This commit is contained in:
Ross
2021-08-19 13:02:25 +01:00
parent 8198effa10
commit 15ca934285
+11 -11
View File
@@ -11,8 +11,8 @@
<h3>Candidate: {{ cid }}</h3>
Answers:
<ul>{% for ans, score, correct_answer in answers_and_marks %}
<li class="user-answer-li">Question {{forloop.counter}} - Correct answer: <span class="correct-answer">{{
correct_answer }}</span></li>
<li class="user-answer-li">Question {{forloop.counter}} - Correct answer: <span
class="correct-answer">{{ correct_answer }}</span></li>
<span class="user-answer-score user-answer-score-{{score}} rapid-ans">
<pre>{{ans}}</pre> ({{score}})
</span>
@@ -32,20 +32,20 @@
console.log("click", e)
question_number = e.currentTarget.dataset.qn;
$.ajax({
url: `{% url 'rapids:question_review' pk=exam.pk %}`,
data: {
csrfmiddlewaretoken: "{{ csrf_token }}",
question_number: question_number
},
type: "POST",
dataType: "json",
})
url: `{% url 'rapids:question_review' pk=exam.pk %}`,
data: {
csrfmiddlewaretoken: "{{ csrf_token }}",
question_number: question_number
},
type: "POST",
dataType: "json",
})
// $.ajax().done(), $.ajax().fail(), $ajax().always() are upto you. Add/change accordingly
.done(function (data) {
console.log(data);
if (data.status == "success") {
toastr.info('Exam state changed.')
toastr.info('Exam state changed.')
}
// show some message according to the response.
// For eg. A message box showing that the status has been changed