qa: Add a new field to retrieve passed time on exercice

This commit is contained in:
nemunaire 2023-06-06 15:44:09 +02:00
parent 3a38a75e25
commit 31bccddc49
3 changed files with 52 additions and 11 deletions

View file

@ -109,6 +109,10 @@ func createExerciceQA(c *gin.Context) {
tmp := time.Now()
uq.Subject = "RAS"
uq.Solved = &tmp
} else if uq.State == "timer" {
tmp := time.Now()
uq.Subject = fmt.Sprintf("Temps passé équipe #%d (%s)", teamid, ficteam)
uq.Solved = &tmp
} else {
c.AbortWithStatusJSON(http.StatusBadRequest, gin.H{"errmsg": "Subject not filled"})
return