This commit is contained in:
Ross
2021-03-02 20:49:08 +00:00
parent c0eeb17482
commit c661a5c9c5
2 changed files with 17 additions and 1 deletions
+15
View File
@@ -352,6 +352,21 @@ class Exam(ExamBase):
help_text="Exam time limit (in seconds). Default is 2100 secondse (35 minutes)", default=2100 help_text="Exam time limit (in seconds). Default is 2100 secondse (35 minutes)", default=2100
) )
def get_normal_abnormal_breakdown(self):
# Inefficient but more extendible
questions = self.exam_questions.all()
normal = []
abnormal = []
for q in question:
if q.normal:
normal.append(q)
else:
abnormal.append(q)
return len(normal)
def get_exam_json(self): def get_exam_json(self):
questions = self.exam_questions.all() questions = self.exam_questions.all()
+2 -1
View File
@@ -6,7 +6,8 @@
<div class="rapids"> <div class="rapids">
<a href="{% url 'admin:rapids_exam_change' exam.id %}" title="Edit the Exam using the admin interface">Admin Edit</a> <a href="{% url 'admin:rapids_exam_change' exam.id %}" title="Edit the Exam using the admin interface">Admin Edit</a>
<h1>Exam: {{ exam.name }}</h1> <h1>Exam: {{ exam.name }}</h1>
This exam has {{question_number}} questions. Time limit: {{exam.time_limit}} seconds. This exam has {{question_number}} questions. Time limit: {{exam.time_limit}} seconds.<br/>
Normal {{ exam.get_normal_abnormal_breakdown }}
<div class="parent-help" title="Click to enable / disable the exam"> <div class="parent-help" title="Click to enable / disable the exam">
Exam active: <input type="checkbox" id="exam-active-switch" {% if exam.active %}checked{% endif %}> <span class="help-text">[When checked the exam will be available to take in the test system]</span> Exam active: <input type="checkbox" id="exam-active-switch" {% if exam.active %}checked{% endif %}> <span class="help-text">[When checked the exam will be available to take in the test system]</span>