New field for exercice to display a text after exercice validation
This commit is contained in:
parent
87471acf98
commit
21697f01ca
9 changed files with 43 additions and 18 deletions
|
@ -47,6 +47,7 @@ type myTeamExercice struct {
|
|||
ThemeId int64 `json:"theme_id"`
|
||||
Statement string `json:"statement"`
|
||||
Overview string `json:"overview,omitempty"`
|
||||
Finished string `json:"finished,omitempty"`
|
||||
Hints []myTeamHint `json:"hints,omitempty"`
|
||||
Gain int `json:"gain"`
|
||||
Files []myTeamFile `json:"files,omitempty"`
|
||||
|
@ -106,6 +107,7 @@ func MyJSONTeam(t *Team, started bool) (interface{}, error) {
|
|||
|
||||
if t == nil {
|
||||
exercice.Overview = strings.Replace(e.Overview, "$FILES$", FilesDir, -1)
|
||||
exercice.Finished = strings.Replace(e.Finished, "$FILES$", FilesDir, -1)
|
||||
exercice.VideoURI = e.VideoURI
|
||||
exercice.Tries = e.TriedCount()
|
||||
exercice.Gain = int(float64(e.Gain) * e.Coefficient)
|
||||
|
@ -115,6 +117,7 @@ func MyJSONTeam(t *Team, started bool) (interface{}, error) {
|
|||
exercice.SolvedRank, _ = t.GetSolvedRank(e)
|
||||
|
||||
if solved {
|
||||
exercice.Finished = e.Finished
|
||||
exercice.Tries, _ = t.CountTries(e)
|
||||
} else {
|
||||
exercice.Tries, stime = t.CountTries(e)
|
||||
|
|
Reference in a new issue