admin: Check all theme/exercice attribute are in sync with repo
This commit is contained in:
parent
5e262b75a3
commit
74f388a2b9
18 changed files with 813 additions and 137 deletions
|
|
@ -46,6 +46,10 @@ func GetHint(id int64) (*EHint, error) {
|
|||
return h, nil
|
||||
}
|
||||
|
||||
func (h *EHint) TreatHintContent() {
|
||||
treatHintContent(h)
|
||||
}
|
||||
|
||||
// GetHint retrieves the hint with the given id.
|
||||
func (e *Exercice) GetHint(id int64) (*EHint, error) {
|
||||
h := &EHint{}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,14 @@ package fic
|
|||
|
||||
import ()
|
||||
|
||||
const StandaloneExercicesDirectory = "exercices"
|
||||
|
||||
var StandaloneExercicesTheme = Theme{
|
||||
Name: "Défis indépendants",
|
||||
URLId: "_",
|
||||
Path: StandaloneExercicesDirectory,
|
||||
}
|
||||
|
||||
// Theme represents a group of challenges, to display to players
|
||||
type Theme struct {
|
||||
Id int64 `json:"id"`
|
||||
|
|
@ -62,11 +70,7 @@ func GetThemesExtended() ([]*Theme, error) {
|
|||
return nil, err
|
||||
} else {
|
||||
// Append standalone exercices fake-themes
|
||||
stdthm := &Theme{
|
||||
Name: "Défis indépendants",
|
||||
URLId: "_",
|
||||
Path: "exercices",
|
||||
}
|
||||
stdthm := &StandaloneExercicesTheme
|
||||
|
||||
if exercices, err := stdthm.GetExercices(); err == nil && len(exercices) > 0 {
|
||||
themes = append(themes, stdthm)
|
||||
|
|
|
|||
Reference in a new issue