22 lines
469 B
HTML
Raw Permalink Normal View History

{{define "answers"}}
{{range .Question.Answers}}
<div>
<input type="radio" name="answer" id="answer-{{.ID}}" value="{{.ID}}" />
<label for="answer-{{.ID}}">{{.Text}}</label>
</div>
{{end}}
{{end}}
2023-10-10 18:43:48 +02:00
{{define "content"}}
<h2>Frage {{.QuestionID}}</h2>
<p>{{.Question.Text}}</p>
2023-10-10 18:43:48 +02:00
<form>
{{template "answers" .}}
<button hx-post="/submit-answer/{{.SessionID}}/{{.Login}}/{{.QuestionID}}/" hx-target="#content" type="submit">
Weiter
</button>
</form>
{{end}}