summaryrefslogtreecommitdiff
path: root/components/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'components/index.html')
-rw-r--r--components/index.html67
1 files changed, 11 insertions, 56 deletions
diff --git a/components/index.html b/components/index.html
index 9c43a50..3020e05 100644
--- a/components/index.html
+++ b/components/index.html
@@ -10,64 +10,19 @@
</head>
<body>
<div id="ancestor">
- <div class="question-text" data-testid="question">
- {{.Text}}
- </div>
- <div id="feedback" data-testid="feedback">
- {{template "feedback" .}}
- {{if .ShowNext}}
- <button
- hx-get="/next-question?current_id={{.ID}}"
- hx-target="#ancestor"
- hx-swap="outerHTML"
- class="next-button"
- data-testid="next-button">
- Next Question →
- </button>
- {{end}}
- </div>
- {{template "feedback" .}}
- <div id="options">
- <button
- data-testid="option1"
- hx-post="/answer"
- hx-vals='{"selected": "0", "question_id": "{{.ID}}"}'
- hx-target="#feedback"
- hx-swap="innerHTML"
- class="option-button"
- >
- {{.Option1}}
- </button>
- <button
- data-testid="option2"
- hx-post="/answer"
- hx-vals='{"selected": "1", "question_id": "{{.ID}}"}'
- hx-target="#feedback"
- hx-swap="innerHTML"
- class="option-button"
- >
- {{.Option2}}
- </button>
- <button
- data-testid="option3"
- hx-post="/answer"
- hx-vals='{"selected": "2", "question_id": "{{.ID}}"}'
- hx-target="#feedback"
- hx-swap="innerHTML"
- class="option-button"
- >
- {{.Option3}}
- </button>
+ <h1>Mixed Übungen</h1>
+ <div class="ubung-list">
+ {{range .}}
+ <p>
<button
- data-testid="option4"
- hx-post="/answer"
- hx-vals='{"selected": "3", "question_id": "{{.ID}}"}'
- hx-target="#feedback"
- hx-swap="innerHTML"
- class="option-button"
- >
- {{.Option4}}
+ class="ubung-button"
+ hx-get="/mixed?id={{.ID}}"
+ hx-target="#ancestor"
+ hx-swap="outerHTML">
+ {{.Name}} (Level {{.LevelID}})
</button>
+ </p>
+ {{end}}
</div>
</div>
</body>