diff --git a/generic/views.py b/generic/views.py index abddc0aa..c193ad87 100644 --- a/generic/views.py +++ b/generic/views.py @@ -2296,7 +2296,7 @@ class ExamViews(View, LoginRequiredMixin): ans = user_answer.get_answer() answer_score = user_answer.get_answer_score() - if self.app_name == "longs": + if self.app_name in ("longs", "shorts"): feedback = user_answer.candidate_feedback match self.app_name: @@ -2336,7 +2336,7 @@ class ExamViews(View, LoginRequiredMixin): answers.append(ans) answers_marks.append(answer_score) - if self.app_name == "longs": + if self.app_name in ("longs", "shorts"): answers_and_marks.append( (ans, answer_score, correct_answer, feedback) ) diff --git a/shorts/models.py b/shorts/models.py index ce61c720..d3475ce9 100644 --- a/shorts/models.py +++ b/shorts/models.py @@ -234,7 +234,7 @@ class Question(QuestionBase): based: bool = True, feedback: bool = False, answers: bool = True, - history: bool = False, + history: bool = True, annotations: bool = False, ) -> QuestionData: """Returns a json representation of the question""" diff --git a/shorts/templates/shorts/exam_scores_user.html b/shorts/templates/shorts/exam_scores_user.html index feafc2f6..3afd3f79 100644 --- a/shorts/templates/shorts/exam_scores_user.html +++ b/shorts/templates/shorts/exam_scores_user.html @@ -7,7 +7,7 @@ Question 1
-
+
Sample Answers: @@ -20,7 +20,7 @@
{% include 'user_score_header.html' %}
    - {% for ans, score, correct_answer in answers_and_marks %} + {% for ans, score, correct_answer, feedback in answers_and_marks %}
  • Question {{forloop.counter}} - Correct answer: {% if exam.publish_results %}{{correct_answer}}{% endif %} View
    @@ -28,8 +28,11 @@ - {% if exam.publish_results or view_all_results%} + {% if exam.publish_results or view_all_results %} Score: {{score}} + {% if feedback %} + Feedback: {{ feedback }} + {% endif %} {% endif %}
  • @@ -73,7 +76,15 @@ "detail": { "images": images, "annotations": data.annotations } }); - window.dispatchEvent(event); + if (!images || images.length === 0) { + $("#single-dicom-viewer").html("

    No images for this question

    "); + } else{ + window.dispatchEvent(event); + } + + if (data.history) { + $(".question-display-block .history").empty().append(`History:
    ${data.history}
    `); + } console.log(data) if (data.answers && data.answers.length > 0) { // Format: [[answer, score], ...] @@ -86,7 +97,6 @@ } n = parseInt(question_number) + 1 $(".question-display-block .question-number").empty().append(n); - $(".question-display-block .feedback").empty().append(`Feedback: ${data.feedback}
    `); // show some message according to the response. // For eg. A message box showing that the status has been changed $(".inner-display-block").show();