skip penalties check when already solved

This commit is contained in:
2025-11-06 11:55:08 +01:00
parent c38a33a7aa
commit 2e830b1ea2

View File

@@ -231,6 +231,7 @@ func qrHandler(w http.ResponseWriter, r *http.Request) {
} }
// get penalties for this task and team // get penalties for this task and team
if help != 0 {
err = db.QueryRow("SELECT minutes FROM penalties WHERE team_id = ? AND task_id = ?", teamID, taskID).Scan(&penalty) err = db.QueryRow("SELECT minutes FROM penalties WHERE team_id = ? AND task_id = ?", teamID, taskID).Scan(&penalty)
if err == sql.ErrNoRows { if err == sql.ErrNoRows {
penalty = 0 penalty = 0
@@ -244,6 +245,7 @@ func qrHandler(w http.ResponseWriter, r *http.Request) {
} else if penalty > smallHelpPenalty { } else if penalty > smallHelpPenalty {
help = 2 help = 2
} }
}
// handle answer and help form submission // handle answer and help form submission
if r.Method == http.MethodPost { if r.Method == http.MethodPost {