admin: Obtain full current gains from a solved exercice

This commit is contained in:
nemunaire 2025-03-30 13:46:10 +02:00
parent 9f25bc54d3
commit 38e3a4efdf

View file

@ -68,7 +68,7 @@ func (e *Exercice) AppendHistoryItem(tId int64, kind string, secondary *int64) e
if kind == "tries" {
bid := make([]byte, 5)
binary.LittleEndian.PutUint32(bid, rand.Uint32())
_, err = (&Exercice{Id: e.Id}).NewTry(team, bid)
_, err = e.NewTry(team, bid)
return err
} else if kind == "hint" && secondary != nil {
return team.OpenHint(&EHint{Id: *secondary})
@ -79,7 +79,7 @@ func (e *Exercice) AppendHistoryItem(tId int64, kind string, secondary *int64) e
} else if kind == "mcq_found" && secondary != nil {
return (&MCQ{Id: int(*secondary)}).FoundBy(team)
} else if kind == "solved" {
return (&Exercice{Id: e.Id}).Solved(team)
return e.Solved(team)
} else {
return nil
}