diff --git a/admin/api/settings.go b/admin/api/settings.go
index ae561157..7bb907ee 100644
--- a/admin/api/settings.go
+++ b/admin/api/settings.go
@@ -373,6 +373,8 @@ func reset(c *gin.Context) {
err = fic.ResetExercices()
case "game":
err = fic.ResetGame()
+ case "annexes":
+ err = fic.ResetAnnexes()
case "settings":
err = ResetSettings()
case "challengeInfo":
diff --git a/admin/static/views/settings.html b/admin/static/views/settings.html
index f288ee1e..060a8ca3 100644
--- a/admin/static/views/settings.html
+++ b/admin/static/views/settings.html
@@ -367,6 +367,7 @@
+
diff --git a/libfic/reset.go b/libfic/reset.go
index 0b7b2d6f..74e3f996 100644
--- a/libfic/reset.go
+++ b/libfic/reset.go
@@ -5,7 +5,7 @@ import (
)
// truncateTable performs an insecure wipe on the given tables.
-func truncateTable(tables ...string) (error) {
+func truncateTable(tables ...string) error {
if tx, err := db.BeginTx(context.TODO(), nil); err != nil {
return err
} else {
@@ -27,8 +27,20 @@ func truncateTable(tables ...string) (error) {
return nil
}
+// ResetAnnexes resets all tables containing annexe info like events, claims and qa.
+func ResetAnnexes() error {
+ return truncateTable(
+ "claim_descriptions",
+ "claims",
+ "events",
+ "qa_comments",
+ "teams_qa_todo",
+ "teams_qa_view",
+ )
+}
+
// ResetGame resets all tables containing team attempts and solves.
-func ResetGame() (error) {
+func ResetGame() error {
return truncateTable(
"team_wchoices",
"team_hints",
@@ -40,7 +52,7 @@ func ResetGame() (error) {
}
// ResetExercices wipes out all challenges (both attempts and statements).
-func ResetExercices() (error) {
+func ResetExercices() error {
return truncateTable(
"team_wchoices",
"team_hints",
@@ -55,6 +67,10 @@ func ResetExercices() (error) {
"exercice_hints_okey_deps",
"exercice_hints_omcq_deps",
"flag_choices",
+ "exercice_flag_deps",
+ "exercice_flag_labels_omcq_deps",
+ "exercice_flag_labels_deps",
+ "exercice_flag_labels",
"exercice_flags",
"exercice_solved",
"exercice_tries",
@@ -69,7 +85,7 @@ func ResetExercices() (error) {
}
// ResetTeams wipes out all teams, incluings members and attempts.
-func ResetTeams() (error) {
+func ResetTeams() error {
return truncateTable(
"team_wchoices",
"team_hints",