2023-10-18 13:40:21 +02:00
|
|
|
package models
|
|
|
|
|
2023-10-28 20:50:06 +02:00
|
|
|
import (
|
2023-11-28 16:19:49 +01:00
|
|
|
"encoding/json"
|
|
|
|
"fmt"
|
2023-10-28 20:50:06 +02:00
|
|
|
)
|
2023-10-18 13:40:21 +02:00
|
|
|
|
|
|
|
type Exam struct {
|
2023-11-28 16:19:49 +01:00
|
|
|
Meta
|
|
|
|
Participant *Participant
|
|
|
|
Quizzes []*Quiz
|
|
|
|
}
|
|
|
|
|
|
|
|
func (e *Exam) String() string {
|
|
|
|
return fmt.Sprintf("Exam ID %v with %v quizzes.", e.ID, len(e.Quizzes))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (e *Exam) GetHash() string {
|
2023-12-12 09:21:55 +01:00
|
|
|
return ""
|
2023-11-28 16:19:49 +01:00
|
|
|
}
|
2023-10-18 13:40:21 +02:00
|
|
|
|
2023-11-28 16:19:49 +01:00
|
|
|
func (e *Exam) Marshal() ([]byte, error) {
|
|
|
|
return json.Marshal(e)
|
|
|
|
|
|
|
|
}
|
2023-10-18 13:40:21 +02:00
|
|
|
|
2023-11-28 16:19:49 +01:00
|
|
|
func (e *Exam) Unmarshal(data []byte) error {
|
|
|
|
return json.Unmarshal(data, e)
|
2023-10-18 13:40:21 +02:00
|
|
|
}
|