libfic: simplify git usability of the reset list
This commit is contained in:
parent
476f0f553c
commit
3ad7976e4b
1 changed files with 37 additions and 3 deletions
|
@ -29,15 +29,49 @@ func truncateTable(tables ...string) (error) {
|
||||||
|
|
||||||
// ResetGame resets all tables containing team attempts and solves.
|
// ResetGame resets all tables containing team attempts and solves.
|
||||||
func ResetGame() (error) {
|
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).
|
// ResetExercices wipes out all challenges (both attempts and statements).
|
||||||
func ResetExercices() (error) {
|
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.
|
// ResetTeams wipes out all teams, incluings members and attempts.
|
||||||
func ResetTeams() (error) {
|
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",
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue