Skip to content

Commit 3562918

Browse files
committed
Add support for questionnaire option 'hide-correctness'
Part of apluslms/a-plus-rst-tools#182
1 parent 2961cbc commit 3562918

2 files changed

Lines changed: 13 additions & 5 deletions

File tree

access/templates/access/graded_form.html

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,15 @@
5353
{% if not field.field.group_errors %}
5454
{% if result.accepted and not result.form.enrollment_exercise %}
5555
<!-- Points badge -->
56-
{% if not exercise.feedback or field.field.points > 0 %}
56+
{% if exercise.hide_correctness %}
57+
<span class="badge rounded-pill text-bg-secondary">
58+
{% blocktrans trimmed count points=field.field.max_points %}
59+
POINTS_SINGULAR -- {{ points }}
60+
{% plural %}
61+
POINTS_PLURAL -- {{ points }}
62+
{% endblocktrans %}
63+
</span>
64+
{% elif not exercise.feedback or field.field.points > 0 %}
5765
<span class="badge rounded-pill text-bg-{% if field.field.grade_points > 0 and field.field.grade_points < field.field.max_points %}warning{% elif field.field.name in result.error_fields %}danger{% else %}success{% endif %}">
5866
{{ field.field.grade_points }} / {{ field.field.max_points }}
5967
</span>
@@ -101,7 +109,7 @@
101109
<tr>
102110
<td>&nbsp;</td>
103111
{% for choice in field %}
104-
<td>{{ choice.choice_label|safe }}</td>
112+
<td>{{ choice.choice_label|safe }}</td>
105113
{% endfor %}
106114
{% if field.field.more_text %}
107115
<td>{{ field.field.more_text|safe }}</td>
@@ -110,7 +118,7 @@
110118
{% endif %}
111119

112120
{% if field.field.table_more %}
113-
<td>{{ field }}</td>
121+
<td>{{ field }}</td>
114122
</tr>
115123
{% else %}
116124
<tr>

access/templates/access/graded_form_feedback.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
{% endif %}
1010
{% if not result.model_answer %}
1111
<p class="question-feedback">
12-
{% if field.answer_correct %}
12+
{% if field.answer_correct and not exercise.hide_correctness %}
1313
{% if not field.group_errors %}
1414
<i class="quiz1-icon-correct" aria-hidden="true"></i>
1515
<span class="feedback-text">{% trans "FEEDBACK_CORRECT_WITH_PUNCTUATION" %}</span>
1616
{% endif %}
17-
{% else %}
17+
{% elif not exercise.hide_correctness %}
1818
{% if not field.group_errors %}
1919
<i class="quiz1-icon-incorrect" aria-hidden="true"></i>
2020
{% endif %}

0 commit comments

Comments
 (0)