basic rapid integration testing

This commit is contained in:
Ross
2023-01-23 12:56:33 +00:00
parent 9b1de19e6f
commit 0e94f780ff
9 changed files with 400 additions and 148 deletions
@@ -0,0 +1,13 @@
# Generated by Django 3.2.13 on 2023-01-16 11:19
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('generic', '0048_alter_userusergroup_archive_alter_userusergroup_name_and_more'),
]
operations = [
]
@@ -37,7 +37,10 @@
This exam has {{question_number}} questions. Time limit: {{exam.time_limit}} seconds.
Exam mode: {{ exam.exam_mode }}<br />
Cid candidates: <a href="{{exam.get_cid_edit_url}}">{{candidate_count.0}}</a>, User candidates: <a href="{{exam.get_user_edit_url}}">{{candidate_count.1}}</a><br />
{% if exam.exam_mode %}
Cid candidates: <a href="{{exam.get_cid_edit_url}}">{{candidate_count.0}}</a>, User candidates: <a href="{{exam.get_user_edit_url}}">{{candidate_count.1}}</a><br />
{% endif %}
Open access: {{ exam.open_access }}<br />
<div class="parent-help" title="Click to enable / disable the exam">
+4 -1
View File
@@ -1371,6 +1371,7 @@ class ExamViews(View, LoginRequiredMixin):
n = 0
for answer in json.loads(request.POST.get("answers")):
print("ANSWER", answer)
eid = int(answer["eid"].split("/")[1])
uid = False
@@ -1454,7 +1455,9 @@ class ExamViews(View, LoginRequiredMixin):
ans = existing_answers[0]
if answer["qidn"] == "1":
ans.normal = normal
ans.answer = ""
# Only wipe the answer text if the new answer is "Normal"
if normal:
ans.answer = ""
elif answer["qidn"] == "2" and not ans.normal:
ans.answer = posted_answer
case "anatomy":