mirror of
https://github.com/MarijnDoeve/TijdVoorDeTest.git
synced 2026-07-11 20:38:21 +02:00
feat: add reset progress action for a candidate's quiz attempt
Admins previously had no way to let a candidate retake a quiz once started. Adds a backoffice action that clears a candidate's given answers and start timestamp for a quiz, closes #20.
This commit is contained in:
@@ -37,7 +37,7 @@
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<form action="{{ path('tvdt_backoffice_toggle_candidate', {quiz: quiz.id, candidate: candidate.id}) }}" method="POST">
|
||||
<form action="{{ path('tvdt_backoffice_toggle_candidate', {quiz: quiz.id, candidate: candidate.id}) }}" method="POST" class="d-inline">
|
||||
<input type="hidden" name="_token" value="{{ csrf_token('toggle_candidate') }}">
|
||||
<button type="submit" class="btn btn-sm btn-outline-secondary">
|
||||
{% if quizCandidate == null or quizCandidate.active %}
|
||||
@@ -47,6 +47,12 @@
|
||||
{% endif %}
|
||||
</button>
|
||||
</form>
|
||||
{% if quizCandidate and quizCandidate.started %}
|
||||
<form action="{{ path('tvdt_backoffice_reset_candidate_progress', {quiz: quiz.id, candidate: candidate.id}) }}" method="POST" class="d-inline" onsubmit="return confirm('{{ 'Are you sure you want to reset progress for this candidate? Their given answers for this quiz will be deleted.'|trans|e('js') }}');">
|
||||
<input type="hidden" name="_token" value="{{ csrf_token('reset_candidate_progress') }}">
|
||||
<button type="submit" class="btn btn-sm btn-outline-danger">{{ 'Reset progress'|trans }}</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
||||
Reference in New Issue
Block a user