qa: Add a new field to retrieve passed time on exercice
This commit is contained in:
parent
3a38a75e25
commit
31bccddc49
3 changed files with 52 additions and 11 deletions
|
@ -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
|
||||
|
|
Reference in a new issue