From 6265f85149439781b037a6ae1c277bc169e6e922 Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Mercier Date: Fri, 6 Sep 2019 23:08:59 +0200 Subject: [PATCH] sync: Implement vector flags --- admin/sync/exercice_keys.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/admin/sync/exercice_keys.go b/admin/sync/exercice_keys.go index 66c0c435..a3459ba6 100644 --- a/admin/sync/exercice_keys.go +++ b/admin/sync/exercice_keys.go @@ -193,16 +193,18 @@ func buildExerciceFlags(i Importer, exercice fic.Exercice) (flags map[int64]impo flag.Type = "key" case "key": flag.Type = "key" + case "vector": + flag.Type = "vector" case "ucq": flag.Type = "ucq" case "mcq": flag.Type = "mcq" default: - errs = append(errs, fmt.Sprintf("%q: flag #%d: invalid type of flag: should be 'key', 'mcq' or 'ucq'.", path.Base(exercice.Path), nline+1)) + errs = append(errs, fmt.Sprintf("%q: flag #%d: invalid type of flag: should be 'key', 'mcq', 'ucq' or 'vector'.", path.Base(exercice.Path), nline+1)) continue } - if flag.Type == "key" || flag.Type == "ucq" { + if flag.Type == "key" || flag.Type == "ucq" || flag.Type == "vector" { addedFlag, choices, berrs := buildKeyFlag(exercice, flag, nline+1, "Flag") if len(berrs) > 0 { errs = append(errs, berrs...)