Detect theme and exercice language at runtime (not stored)

This commit is contained in:
nemunaire 2023-01-17 18:26:04 +01:00
commit aa0e7406c1
17 changed files with 99 additions and 42 deletions

View file

@ -20,9 +20,10 @@ var ExerciceCurrentCoefficient = 1.0
// Exercice represents a challenge inside a Theme.
type Exercice struct {
Id int64 `json:"id"`
IdTheme int64 `json:"id_theme"`
Title string `json:"title"`
Id int64 `json:"id"`
IdTheme int64 `json:"id_theme"`
Language string `json:"lang,omitempty"`
Title string `json:"title"`
// WIP indicates if the exercice is in development or not
WIP bool `json:"wip"`
// URLid is used to reference the challenge from the URL path

View file

@ -5,6 +5,7 @@ import ()
// Theme represents a group of challenges, to display to players
type Theme struct {
Id int64 `json:"id"`
Language string `json:"lang,omitempty"`
Name string `json:"name"`
URLId string `json:"urlid"`
Path string `json:"path"`