Add seed field to models.Session
All checks were successful
Build and push Probo image on the registry / login (push) Successful in 2m59s
All checks were successful
Build and push Probo image on the registry / login (push) Successful in 2m59s
This commit is contained in:
parent
98db4d21a4
commit
4decf37b3d
2 changed files with 4 additions and 0 deletions
|
|
@ -28,6 +28,8 @@ type Session struct {
|
|||
|
||||
IsAlwaysActive bool `json:"always_active"` // Indicates if the session is always active.
|
||||
|
||||
Seed uint64 `json:"seed"` // Seed for the random number generator
|
||||
|
||||
Participants map[string]*Participant `json:"participants"` // Participants in the session, identified by a string key.
|
||||
Quizzes map[string]*Quiz `json:"quizzes"` // Quizzes associated with the session, identified by a string key.
|
||||
Answers map[string]*Answer `json:"answers"` // Answers related to the session, identified by a string key.
|
||||
|
|
|
|||
|
|
@ -76,6 +76,8 @@ func (s *Store) Create(session *models.Session) (*models.Session, error) {
|
|||
if hash := session.GetHash(); hash != "" {
|
||||
session, ok := s.GetByHash(hash)
|
||||
if ok {
|
||||
// q.SetDuplicate(quiz.GetMeta())
|
||||
// return q, nil //&ErrQuizAlreadyPresent{hash}
|
||||
return session, &ErrAlreadyPresent{hash}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue