sync: handle new sync format: extends challenge defines
This commit is contained in:
parent
d303ecfa38
commit
af55c5af9f
@ -9,14 +9,61 @@ import (
|
|||||||
// ExerciceHintParams holds EHint definition infomation.
|
// ExerciceHintParams holds EHint definition infomation.
|
||||||
type ExerciceHintParams struct {
|
type ExerciceHintParams struct {
|
||||||
Filename string
|
Filename string
|
||||||
|
Content string
|
||||||
Cost int64
|
Cost int64
|
||||||
Title string
|
Title string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ExerciceDependency holds dependency definitions information.
|
||||||
|
type ExerciceDependency struct {
|
||||||
|
Id int64
|
||||||
|
Theme string `toml:",omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// ExerciceFlag holds informations about a "classic" flag.
|
||||||
|
type ExerciceFlag struct {
|
||||||
|
Label string `toml:",omitempty"`
|
||||||
|
Raw string
|
||||||
|
IgnoreCase bool `toml:",omitempty"`
|
||||||
|
Help string `toml:",omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// ExerciceFlagMCQChoice holds a choice for an MCQ flag.
|
||||||
|
type ExerciceFlagMCQChoice struct {
|
||||||
|
Label string
|
||||||
|
Value bool `toml:",omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// ExerciceFlagMCQ holds information about a MCQ flag.
|
||||||
|
type ExerciceFlagMCQ struct {
|
||||||
|
Label string `toml:",omitempty"`
|
||||||
|
Choice []ExerciceFlagMCQChoice
|
||||||
|
}
|
||||||
|
|
||||||
|
// ExerciceFlagUCQChoice holds a choice for an UCQ flag.
|
||||||
|
type ExerciceFlagUCQChoice struct {
|
||||||
|
Label string `toml:",omitempty"`
|
||||||
|
Value string
|
||||||
|
}
|
||||||
|
|
||||||
|
// ExerciceFlagUCQ holds information about a UCQ flag.
|
||||||
|
type ExerciceFlagUCQ struct {
|
||||||
|
Label string `toml:",omitempty"`
|
||||||
|
Raw string
|
||||||
|
Help string `toml:",omitempty"`
|
||||||
|
DisplayAs string `toml:",omitempty"`
|
||||||
|
Choices_Cost int64 `toml:",omitempty"`
|
||||||
|
Choice []ExerciceFlagUCQChoice
|
||||||
|
}
|
||||||
|
|
||||||
// ExerciceParams contains values parsed from defines.txt.
|
// ExerciceParams contains values parsed from defines.txt.
|
||||||
type ExerciceParams struct {
|
type ExerciceParams struct {
|
||||||
Gain int64
|
Gain int64
|
||||||
Hints []ExerciceHintParams `toml:"hint"`
|
Hints []ExerciceHintParams `toml:"hint"`
|
||||||
|
Dependencies []ExerciceDependency `toml:"depend"`
|
||||||
|
Flags []ExerciceFlag `toml:"flag"`
|
||||||
|
FlagsMCQ []ExerciceFlagMCQ `toml:"flag_mcq"`
|
||||||
|
FlagsUCQ []ExerciceFlagUCQ `toml:"flag_ucq"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// parseExerciceParams reads challenge definitions from defines.txt and extract usefull data to set up the challenge.
|
// parseExerciceParams reads challenge definitions from defines.txt and extract usefull data to set up the challenge.
|
||||||
|
Loading…
Reference in New Issue
Block a user