Write docs!
This commit is contained in:
parent
c460bb7bf5
commit
bcc598ebd5
37 changed files with 478 additions and 188 deletions
|
@ -9,6 +9,8 @@ import (
|
|||
"srs.epita.fr/fic-server/libfic"
|
||||
)
|
||||
|
||||
// isFullGraphic detects if some rune are not graphic one.
|
||||
// This function is usefull to display warning when importing key ending with \r.
|
||||
func isFullGraphic(s string) bool {
|
||||
for _, c := range s {
|
||||
if !unicode.IsGraphic(c) {
|
||||
|
@ -18,6 +20,7 @@ func isFullGraphic(s string) bool {
|
|||
return true
|
||||
}
|
||||
|
||||
// SyncExerciceKeys reads the content of flags.txt and import them as Key for the given challenge.
|
||||
func SyncExerciceKeys(i Importer, exercice fic.Exercice) []string {
|
||||
var errs []string
|
||||
|
||||
|
@ -60,6 +63,7 @@ func SyncExerciceKeys(i Importer, exercice fic.Exercice) []string {
|
|||
return errs
|
||||
}
|
||||
|
||||
// SyncExerciceMCQ reads the content of flags-ucq.txt and flags-mcq.txt, and import them as MCQs for the given challenge.
|
||||
func SyncExerciceMCQ(i Importer, exercice fic.Exercice) (errs []string) {
|
||||
if _, err := exercice.WipeMCQs(); err != nil {
|
||||
errs = append(errs, err.Error())
|
||||
|
|
Reference in a new issue