Added cross-reference to question viewer

Changed question number countint to be consistent with viewer
This commit is contained in:
Vivek Santayana 2022-08-17 16:36:16 +01:00
parent 3a0abaac6a
commit 2da8eb7712
2 changed files with 10 additions and 5 deletions

View File

@ -242,6 +242,10 @@ $('.adjustment-delete').click(function(event){
event.preventDefault() event.preventDefault()
}) })
event.preventDefault(); // Detailed Results view questions
}); $('.view-full-questions').click(function(event) {
var dataset = $(this).data('dataset')
window.open(`/admin/view/${dataset}`, '_blank')
event.preventDefault()
})

View File

@ -114,7 +114,7 @@
{{ scores.scored }} {{ scores.scored }}
</td> </td>
<td> <td>
{{scores.max}} {{ scores.max }}
</td> </td>
</tr> </tr>
{% endfor %} {% endfor %}
@ -131,6 +131,7 @@
</h2> </h2>
<div id="by-question-breakdown" class="accordion-collapse collapse" aria-labelledby="by-question" data-bs-parent="#results-breakdown"> <div id="by-question-breakdown" class="accordion-collapse collapse" aria-labelledby="by-question" data-bs-parent="#results-breakdown">
<div class="accordion-body"> <div class="accordion-body">
<a class="view-full-questions" data-dataset="{{ entry.test.dataset.id }}">View Questions</a>
<table class="table table-striped"> <table class="table table-striped">
<thead> <thead>
<tr> <tr>
@ -146,7 +147,7 @@
{% for question, answer in entry.answers.items() %} {% for question, answer in entry.answers.items() %}
<tr> <tr>
<td> <td>
{{ question }} {{ question|int + 1 }}
</td> </td>
<td> <td>
{{ answers[question|int][answer|int] }} {{ answers[question|int][answer|int] }}