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
{{ans}}
- {% if exam.publish_results or view_all_results%}
+ {% if exam.publish_results or view_all_results %}
Score: {{score}}
+ {% if feedback %}
+ Feedback: {{ feedback }}
+ {% endif %}
{% endif %}
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}