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