diff options
author | Grail Finder <wohilas@gmail.com> | 2025-04-05 18:12:35 +0300 |
---|---|---|
committer | Grail Finder (aider) <wohilas@gmail.com> | 2025-04-05 18:12:35 +0300 |
commit | d14f8a2056a869710d0dcdd0cc5fc8923a404ec6 (patch) | |
tree | 03e610ba44d5fa0af6722275a1389d7024895954 /internal | |
parent | d5d503e1ec81bd4e21cfb53566b015df61a99db5 (diff) |
feat: Update question status based on answer correctness
Diffstat (limited to 'internal')
-rw-r--r-- | internal/handlers/main.go | 4 |
1 files changed, 4 insertions, 0 deletions
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") |