.
This commit is contained in:
+2
-2
@@ -1201,7 +1201,7 @@ class GenericViewBase:
|
|||||||
|
|
||||||
def question_review(self, request, pk):
|
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():
|
if request.is_ajax():
|
||||||
exam = get_object_or_404(self.exam_object, pk=pk)
|
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 = 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(question_json)
|
||||||
return JsonResponse({"status": "error"})
|
return JsonResponse({"status": "error"})
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
<div class="feedback"></div>
|
<div class="feedback"></div>
|
||||||
<div>
|
<div>
|
||||||
<details>
|
<details>
|
||||||
<summary>Answers: <span class="answers"></span></summary>
|
<summary>Answers:</summary><span class="answers"></span>
|
||||||
</details>
|
</details>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -67,7 +67,7 @@
|
|||||||
$(".question-display-block .answers").empty().append(data.answers.toString());
|
$(".question-display-block .answers").empty().append(data.answers.toString());
|
||||||
n = parseInt(question_number) + 1
|
n = parseInt(question_number) + 1
|
||||||
$(".question-display-block .question-number").empty().append(n);
|
$(".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.
|
// show some message according to the response.
|
||||||
// For eg. A message box showing that the status has been changed
|
// For eg. A message box showing that the status has been changed
|
||||||
$(".inner-display-block").show();
|
$(".inner-display-block").show();
|
||||||
|
|||||||
Reference in New Issue
Block a user