Im Grunde nach MVC umstrukturiert und Funktionen in Handlers, die eine Session als Parameter erhalten haben zu Sessionmethoden umgewandelt

This commit is contained in:
2023-10-28 08:49:28 +02:00
parent 5049db064c
commit c7bb630043
7 changed files with 185 additions and 196 deletions

18
templates/result.html Normal file
View File

@ -0,0 +1,18 @@
{{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}}