.
This commit is contained in:
@@ -27,8 +27,8 @@
|
||||
<div class="parent-help" title="Click to enable / disable the exam results">
|
||||
Publish results: <input type="checkbox" id="exam-publish-results-switch" {% if exam.publish_results %}checked{% endif %}> <span class="help-text">[When checked the exam results will be available to users on this site]</span>
|
||||
</div>
|
||||
<p><a href="{% url 'anatomy:mark_overview' pk=exam.pk %}"><button>Mark exam</button></a></p>
|
||||
{% endif %}
|
||||
<p><a href="{% url 'anatomy:mark_overview' pk=exam.pk %}"><button>Mark exam</button></a></p>
|
||||
|
||||
<ol id="full-question-list" class="sortable">
|
||||
{% for question in questions.all %}
|
||||
@@ -41,7 +41,10 @@
|
||||
<br />
|
||||
{{ question.question_type }}: {{ question.get_primary_answer }}
|
||||
<br />
|
||||
Modality: {{ question.modality }}, <a href="{% url 'anatomy:mark' pk=exam.pk sk=forloop.counter0 %}">Mark</a>
|
||||
Modality: {{ question.modality }},
|
||||
{% if exam.exam_mode %}
|
||||
<a href="{% url 'anatomy:mark' pk=exam.pk sk=forloop.counter0 %}">Mark</a>
|
||||
{% endif %}
|
||||
<span class="id"><a href="{% url 'anatomy:question_detail' pk=question.pk %}">[id: {{question.pk}}]</a></span>
|
||||
</li>
|
||||
{% endfor %}
|
||||
|
||||
+5
-3
@@ -118,15 +118,17 @@ def generic_exam_json_edit(request):
|
||||
|
||||
if "add_exam_questions" in request.POST:
|
||||
question_ids = json.loads(request.POST.get("add_exam_questions"))
|
||||
question_objects = Question.objects.filter(pk__in=question_ids)
|
||||
#question_objects = Question.objects.filter(pk__in=question_ids)
|
||||
|
||||
add_count = 0
|
||||
for i in question_ids:
|
||||
# We get an integrity error if we try to add an object that already exists
|
||||
if not exam.exam_questions.filter(pk=i).exists():
|
||||
add_count += 1
|
||||
exam.exam_questions.add(i)
|
||||
#exam.exam_questions.add(question_objects)
|
||||
|
||||
exam.save()
|
||||
data = {"status": "success"}
|
||||
data = {"status": "success", "questions added" : add_count}
|
||||
return JsonResponse(data, status=200)
|
||||
|
||||
if "set_exam_order" in request.POST:
|
||||
|
||||
Reference in New Issue
Block a user