error handling & formatting

This commit is contained in:
Audrey Jensen 2023-09-19 21:34:52 +00:00
parent d87c91ee64
commit 3bd543654d

View File

@ -12,23 +12,42 @@
<h1>A Quiz-taker has submitted the J.V. Safety Quiz <h1>
<h2> {{ submitterName }} has completed the quiz, scoring {{answersCorrect}}/{{totalQuestions}} correct.</h2>
<table>
<th>
<td>#</td>
<td>Question</td>
<td>Submitted Answer</td>
<td>Correct Answer</td>
</th>
<thead>
<tr>
<td colspan="1">#</td>
<td colspan="4">Question</td>
<td colspan="2">Submitted Answer</td>
<td colspan="2">Correct Answer</td>
</tr>
</thead>
<tbody>
{% for key,question in submission %}
<tr>
<td>{{key}}</td>
<td>{{question["Text"]}}</td>
{% if question['submittedAnswer'] != null %}
<td>
{% if key != null %}
{{key}}</td>
{% else %}
N/A
{% endif %}
<td>
{% if question["Text"] != null %}
{{question["Text"]}}
{% else %}
N/A
{% endif %}
</td>
<td class="{{ (question['submittedAnswer']==true)? 'correct': 'incorrect' }}">
{{question['submittedAnswer']}}
</td>
<td>
{% if question['answer']['Label'] != null %}
{{question['answer']['Label']}}
{% else %}
N/A
{% endif %}
<td>{{question['answer']['Value']}}</td>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endapply %}