From d14f8a2056a869710d0dcdd0cc5fc8923a404ec6 Mon Sep 17 00:00:00 2001 From: Grail Finder Date: Sat, 5 Apr 2025 18:12:35 +0300 Subject: feat: Update question status based on answer correctness --- internal/handlers/main.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/handlers/main.go b/internal/handlers/main.go index b485864..af8dbc7 100644 --- a/internal/handlers/main.go +++ b/internal/handlers/main.go @@ -85,6 +85,10 @@ func (h *Handlers) HandleAnswer(w http.ResponseWriter, r *http.Request) { abortWithError(w, err.Error()) return } + question.Status = 2 + if selectedIndex == question.CorrectIndex { + question.Status = 1 + } // Execute template with question data including status w.Header().Set("Content-Type", "text/html") -- cgit v1.2.3