From 5515c456d5cf69e83bccb91b015056478633b285 Mon Sep 17 00:00:00 2001 From: Grail Finder Date: Sat, 5 Apr 2025 18:24:35 +0300 Subject: Chore: index.html update --- components/index.html | 16 ++++++++++++---- internal/handlers/main.go | 2 ++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/components/index.html b/components/index.html index d3811b1..7d4552f 100644 --- a/components/index.html +++ b/components/index.html @@ -16,6 +16,14 @@
{{.Text}}
+
+ {{if eq .Status 1}} + Correct! + {{end}} + {{if eq .Status 2}} + Wrong. + {{end}} +
{{if ne .Status 0}}
@@ -36,7 +44,7 @@ data-testid="option1" hx-post="/answer" hx-vals='{"selected": "0", "question_id": "{{.ID}}"}' - hx-target="#feedback" + hx-target="#ancestor" hx-swap="innerHTML" class="option-button" > @@ -46,7 +54,7 @@ data-testid="option2" hx-post="/answer" hx-vals='{"selected": "1", "question_id": "{{.ID}}"}' - hx-target="#feedback" + hx-target="#ancestor" hx-swap="innerHTML" class="option-button" > @@ -56,7 +64,7 @@ data-testid="option3" hx-post="/answer" hx-vals='{"selected": "2", "question_id": "{{.ID}}"}' - hx-target="#feedback" + hx-target="#ancestor" hx-swap="innerHTML" class="option-button" > @@ -66,7 +74,7 @@ data-testid="option4" hx-post="/answer" hx-vals='{"selected": "3", "question_id": "{{.ID}}"}' - hx-target="#feedback" + hx-target="#ancestor" hx-swap="innerHTML" class="option-button" > diff --git a/internal/handlers/main.go b/internal/handlers/main.go index b3b1810..41ff85f 100644 --- a/internal/handlers/main.go +++ b/internal/handlers/main.go @@ -129,6 +129,8 @@ func (h *Handlers) HandleNextQuestion(w http.ResponseWriter, r *http.Request) { return } + h.log.Debug("returning new question", "q", question) + h.renderQuestion(w, question) } -- cgit v1.2.3