admin: Check all theme/exercice attribute are in sync with repo

This commit is contained in:
nemunaire 2025-03-28 13:09:13 +01:00
commit 74f388a2b9
18 changed files with 813 additions and 137 deletions

View file

@ -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{}

View file

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