Add feedback display for questions based on user answers
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
Question {{forloop.counter}}
|
||||
</a>
|
||||
{% endif %}
|
||||
|
||||
|
||||
- {{ question.stem|safe }}</span>
|
||||
<ol type="a">
|
||||
{% for q, a, score, correct_answer in ans %}
|
||||
@@ -23,11 +23,24 @@
|
||||
<span class="question-text">{{q|safe}}:</span> {% if exam.publish_results %}<span class="correct-answer">Correct answer: {{correct_answer|safe}}</span>{% endif %}
|
||||
<br />
|
||||
<span class="submitted-user-answer">{{a}}</span>
|
||||
{% if exam.publish_results or view_all_results%}
|
||||
<span class="answer-{{score}}">
|
||||
(Score: {{score}})
|
||||
</span>
|
||||
{% if exam.publish_results or view_all_results%}
|
||||
<span class="answer-{{score}}">
|
||||
(Score: {{score}})
|
||||
</span>
|
||||
{% endif %}
|
||||
{% if exam.publish_results %}
|
||||
{% if forloop.counter0 == 0 and question.a_feedback %}
|
||||
<div class="small text-muted mt-1">Feedback: {{ question.a_feedback|safe }}</div>
|
||||
{% elif forloop.counter0 == 1 and question.b_feedback %}
|
||||
<div class="small text-muted mt-1">Feedback: {{ question.b_feedback|safe }}</div>
|
||||
{% elif forloop.counter0 == 2 and question.c_feedback %}
|
||||
<div class="small text-muted mt-1">Feedback: {{ question.c_feedback|safe }}</div>
|
||||
{% elif forloop.counter0 == 3 and question.d_feedback %}
|
||||
<div class="small text-muted mt-1">Feedback: {{ question.d_feedback|safe }}</div>
|
||||
{% elif forloop.counter0 == 4 and question.e_feedback %}
|
||||
<div class="small text-muted mt-1">Feedback: {{ question.e_feedback|safe }}</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
|
||||
Reference in New Issue
Block a user