summaryrefslogtreecommitdiff
path: root/internal/handlers
diff options
context:
space:
mode:
Diffstat (limited to 'internal/handlers')
-rw-r--r--internal/handlers/main.go17
1 files changed, 8 insertions, 9 deletions
diff --git a/internal/handlers/main.go b/internal/handlers/main.go
index ce894c2..3b44d49 100644
--- a/internal/handlers/main.go
+++ b/internal/handlers/main.go
@@ -1,15 +1,14 @@
package handlers
import (
- "fmt"
- "strconv"
"demoon/config"
- "demoon/internal/database/repos"
+ "demoon/internal/database/repos"
"demoon/internal/models"
"html/template"
"log/slog"
"net/http"
"os"
+ "strconv"
)
// Handlers structure
@@ -54,8 +53,8 @@ func (h *Handlers) HandleAnswer(w http.ResponseWriter, r *http.Request) {
return
}
- h.log.Info("answer received",
- "selected", selectedIndex,
+ h.log.Info("answer received",
+ "selected", selectedIndex,
"question_id", questionID)
question, err := h.repo.DBGetQuestion(questionID)
@@ -121,10 +120,10 @@ func (h *Handlers) MainPage(w http.ResponseWriter, r *http.Request) {
Option4: "Habt",
CorrectIndex: 1,
Requirement: "Choose the correct verb form",
- Explanation: "Use 'Hast' for 2nd person singular",
- Status: 0,
- ExamID: 1,
- MixedID: 101,
+ Explanation: "Use 'Hast' for 2nd person singular",
+ Status: 0,
+ ExamID: 1,
+ MixedID: 101,
}
err = tmpl.ExecuteTemplate(w, "main", testQuestion)
if err != nil {