a few fixes for exam marking

This commit is contained in:
Ross
2024-07-15 11:24:02 +01:00
parent 7ef68c035b
commit 35e4b81e34
3 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -927,7 +927,7 @@ class ExamBase(ExamOrCollectionGenericBase):
return f"{settings.REMOTE_URL}/rts"
def get_exam_name(self):
return self.name
return str(self)
def get_json_url(self, cid=None, passcode=None):
if cid is None:
+3 -3
View File
@@ -579,7 +579,7 @@ class ExamViews(View, LoginRequiredMixin):
data = {
"status": "success",
"publish_results": exam.publish_results,
"name": exam,
"name": str(exam),
"id": exam.id,
}
return JsonResponse(data, status=200)
@@ -601,7 +601,7 @@ class ExamViews(View, LoginRequiredMixin):
data = {
"status": "success",
"active": exam.active,
"name": exam,
"name": str(exam),
"id": exam.id,
}
return JsonResponse(data, status=200)
@@ -1520,7 +1520,7 @@ class ExamViews(View, LoginRequiredMixin):
obj["multi_question_json"] = h
active_exams["exams"].append(obj)
if json == False:
if json is False:
return active_exams["exams"]
return JsonResponse(active_exams)
+3 -3
View File
@@ -34,9 +34,9 @@
{% if not exam.active %}
<li class="exam-item">
<a href="{% url app_name|add:':exam_overview' pk=exam.pk %}" class="flex-col-2 exam-name">{{exam}}</a>
{% if marking %}<a href="{% url app_name|add:':mark_overview' pk=exam.pk %}" class="flex-col-half">Mark</a>{% endif %}
{% if marking %}<a href="{% url app_name|add:':mark_overview' pk=exam.pk %}" class="flex-col-half" title="Click to mark exam">Mark</a>{% endif %}
<span class="flex-col">
<a href="{% url app_name|add:':exam_cids' exam_id=exam.pk %}">Candidates</a>
<a href="{% url app_name|add:':exam_cids' exam_id=exam.pk %}" title="Click to manage candidates">Candidates</a>
<span class="candidate-counts">
[<span title="Number of active CID users">{{exam.valid_cid_users.count}}</span>
/
@@ -50,7 +50,7 @@
<label for="active-{{exam.pk}}" class="flex-col icon-container active-icon" title="Click to toggle active state">Exam Active</label>
<input type="checkbox" id="{{exam.pk}}-pub" class="exam-publish-results-switch" data-posturl="{% url app_name|add:':exam_toggle_results_published' pk=exam.pk %}" {% if exam.publish_results %}checked{% endif %}>
<label for="{{exam.pk}}-pub" class="flex-col icon-container published-icon">Results Published</label>
<a href="{% url app_name|add:':exam_update' pk=exam.pk %}" class="flex-shrink exam-list-edit-button"><i class="bi bi-pencil-square"></i></a>
<a href="{% url app_name|add:':exam_update' pk=exam.pk %}" class="flex-shrink exam-list-edit-button" title="Click to edit exam"><i class="bi bi-pencil-square"></i></a>
<input type="checkbox" id="archived-{{exam.pk}}" class="exam-archived-switch" data-posturl="{% url app_name|add:':exam_toggle_archived' pk=exam.pk %}" {% if exam.archive %}checked{% endif %}>
<label for="archived-{{exam.pk}}" class="flex-shrink icon-archive archived-icon" title="Click to toggle archived state"><i class="bi bi-archive"></i></label>
</li>