From 3ad7976e4b8f63ced7f2a1c70a89b16d654f7586 Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Mercier Date: Tue, 4 Dec 2018 01:20:25 +0100 Subject: [PATCH] libfic: simplify git usability of the reset list --- libfic/reset.go | 40 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/libfic/reset.go b/libfic/reset.go index b8dae956..aae70ecf 100644 --- a/libfic/reset.go +++ b/libfic/reset.go @@ -29,15 +29,49 @@ func truncateTable(tables ...string) (error) { // ResetGame resets all tables containing team attempts and solves. func ResetGame() (error) { - return truncateTable("team_wchoices", "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_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") + 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_wchoices", "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", + ) }