19 lines
447 B
HTML

{{define "answers"}}
{{range .Answers}}
<p class="{{if and .Chosen .Correct}} correct {{else if and .Chosen (not .Correct)}} incorrect {{end}}">
{{.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}}