.
This commit is contained in:
@@ -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()
|
||||||
|
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
Reference in New Issue
Block a user