implement choices_cost

This commit is contained in:
nemunaire 2018-12-02 23:18:32 +01:00
commit 476f0f553c
18 changed files with 180 additions and 24 deletions

View file

@ -29,15 +29,15 @@ func truncateTable(tables ...string) (error) {
// ResetGame resets all tables containing team attempts and solves.
func ResetGame() (error) {
return truncateTable("team_hints", "flag_found", "mcq_found", "exercice_solved", "exercice_tries")
return truncateTable("team_wchoices", "team_hints", "flag_found", "mcq_found", "exercice_solved", "exercice_tries")
}
// ResetExercices wipes out all challenges (both attempts and statements).
func ResetExercices() (error) {
return truncateTable("team_hints", "exercice_files_deps", "exercice_files", "flag_found", "exercice_flags_deps", "flag_choices", "exercice_flags", "exercice_solved", "exercice_tries", "exercice_hints", "mcq_found", "mcq_entries", "exercice_mcq", "exercice_tags", "exercices", "themes")
return truncateTable("team_wchoices", "team_hints", "exercice_files_deps", "exercice_files", "flag_found", "exercice_flags_deps", "flag_choices", "exercice_flags", "exercice_solved", "exercice_tries", "exercice_hints", "mcq_found", "mcq_entries", "exercice_mcq", "exercice_tags", "exercices", "themes")
}
// ResetTeams wipes out all teams, incluings members and attempts.
func ResetTeams() (error) {
return truncateTable("team_hints", "flag_found", "mcq_found", "exercice_solved", "exercice_tries", "team_members", "teams")
return truncateTable("team_wchoices", "team_hints", "flag_found", "mcq_found", "exercice_solved", "exercice_tries", "team_members", "teams")
}