admin/sync: includes mcq and ucq in full synchronization
This commit is contained in:
parent
935b1666ac
commit
24f527ab8a
1 changed files with 14 additions and 1 deletions
|
@ -5,6 +5,7 @@ import (
|
|||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"path"
|
||||
"time"
|
||||
"sync"
|
||||
|
||||
|
@ -31,7 +32,19 @@ func SyncDeep(i Importer) map[string][]string {
|
|||
for _, exercice := range exercices {
|
||||
errs[theme.Name] = append(errs[theme.Name], SyncExerciceFiles(i, exercice)...)
|
||||
errs[theme.Name] = append(errs[theme.Name], SyncExerciceHints(i, exercice)...)
|
||||
errs[theme.Name] = append(errs[theme.Name], SyncExerciceKeys(i, exercice)...)
|
||||
|
||||
hasFlags := false
|
||||
if i.exists(path.Join(exercice.Path, "flags.txt")) {
|
||||
errs[theme.Name] = append(errs[theme.Name], SyncExerciceKeys(i, exercice)...)
|
||||
hasFlags = true
|
||||
}
|
||||
if i.exists(path.Join(exercice.Path, "flags-mcq.txt")) || i.exists(path.Join(exercice.Path, "flags-ucq.txt")) {
|
||||
errs[theme.Name] = append(errs[theme.Name], SyncExerciceMCQ(i, exercice)...)
|
||||
hasFlags = true
|
||||
}
|
||||
if !hasFlags {
|
||||
errs[theme.Name] = append(errs[theme.Name], fmt.Sprintf("%q: has no flags!", path.Base(exercice.Path)))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue