Im Grunde nach MVC umstrukturiert und Funktionen in Handlers, die eine Session als Parameter erhalten haben zu Sessionmethoden umgewandelt
This commit is contained in:
18
templates/result.html
Normal file
18
templates/result.html
Normal 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}}
|
Reference in New Issue
Block a user