.
This commit is contained in:
+2
-2
@@ -1201,7 +1201,7 @@ class GenericViewBase:
|
||||
|
||||
def question_review(self, request, pk):
|
||||
"""
|
||||
Return a json representation of the question when the exam is active
|
||||
Return a json representation of the question when the exam is published
|
||||
"""
|
||||
if request.is_ajax():
|
||||
exam = get_object_or_404(self.exam_object, pk=pk)
|
||||
@@ -1214,7 +1214,7 @@ class GenericViewBase:
|
||||
|
||||
question = exam.exam_questions.all()[int(request.POST["question_number"])]
|
||||
|
||||
question_json = question.get_question_json(based=False)
|
||||
question_json = question.get_question_json(based=False, feedback=True)
|
||||
return JsonResponse(question_json)
|
||||
return JsonResponse({"status": "error"})
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<div class="feedback"></div>
|
||||
<div>
|
||||
<details>
|
||||
<summary>Answers: <span class="answers"></span></summary>
|
||||
<summary>Answers:</summary><span class="answers"></span>
|
||||
</details>
|
||||
</div>
|
||||
</div>
|
||||
@@ -67,7 +67,7 @@
|
||||
$(".question-display-block .answers").empty().append(data.answers.toString());
|
||||
n = parseInt(question_number) + 1
|
||||
$(".question-display-block .question-number").empty().append(n);
|
||||
$(".question-display-block .feedback").empty().append(data.feedback);
|
||||
$(".question-display-block .feedback").empty().append($(`Feedback: ${data.feedback}<br />`));
|
||||
// show some message according to the response.
|
||||
// For eg. A message box showing that the status has been changed
|
||||
$(".inner-display-block").show();
|
||||
|
||||
Reference in New Issue
Block a user