Der Umstieg auf Sessions ist weitgehend geglückt

This commit is contained in:
2023-10-28 08:01:34 +02:00
parent aded71394d
commit 5049db064c
11 changed files with 396 additions and 225 deletions

View File

@ -1,11 +1,18 @@
{{ define "passed" }}
{{ end }}
{{define "answers"}}
{{range .Answers}}
<p class="{{if and .Chosen .Correct}} correct {{else if and .Chosen (not .Correct)}} incorrect {{end}}">
{{.Text}}
</p>
{{end}}
{{end}}
{{ define "failed" }}
{{ end }}
{{ define "content" }}
{{ q := range .Participant.Questions }}
<p>{{ . }}{{ q.Text }}</p>
{{ end }}
{{ end }}
{{define "content"}}
<p>{{.Incorrect}} Fehler</p>
{{range .Questions}}
<p>{{.Text}}</p>
{{template "answers" .}}
{{end}}
{{if gt .Incorrect 0}}
<button hx-post="/retry/{{.SessionID}}/{{.Login}}/" hx-target="#content" type="submit">Wiederholen</button>
{{end}}
{{end}}