Write docs!

This commit is contained in:
nemunaire 2018-03-09 19:07:08 +01:00
parent c460bb7bf5
commit bcc598ebd5
37 changed files with 478 additions and 188 deletions

View file

@ -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())