-
Notifications
You must be signed in to change notification settings - Fork 0
/
models.go
48 lines (39 loc) · 1.2 KB
/
models.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package ceintures
import (
"github.com/benoitkugler/maths-online/server/src/maths/questions"
tc "github.com/benoitkugler/maths-online/server/src/sql/teacher"
)
type IdBeltquestion int64
// Beltevolution is the evolution of one student in a belt scheme.
//
// gomacro:SQL ADD UNIQUE(IdStudent)
type Beltevolution struct {
IdStudent tc.IdStudent
Level Level
Advance Advance
Stats Stats
}
// Beltquestion is one question, contained in
// a domain and color.
//
// gomacro:SQL _SELECT KEY(Domain, Rank)
// gomacro:SQL ADD CHECK(Repeat > 0)
type Beltquestion struct {
Id IdBeltquestion
Domain Domain // Location
Rank Rank // Location
Parameters questions.Parameters
Enonce questions.Enonce
// Correction an optional content describing the expected solution,
// to be instantiated with the same parameters as [Enonce]
Correction questions.Enonce
// Repeat is the number of times the question is proposed,
// defaulting to 1
Repeat int
// Title is a description of the question, only displayed
// to the teacher
Title string
}
func (qu Beltquestion) Page() questions.QuestionPage {
return questions.QuestionPage{Enonce: qu.Enonce, Correction: qu.Correction, Parameters: qu.Parameters}
}