Working on live surveys
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
1e17c7bb40
commit
0e5961c406
19 changed files with 1014 additions and 48 deletions
|
@ -25,10 +25,16 @@ func init() {
|
|||
}
|
||||
|
||||
for _, response := range responses {
|
||||
if len(response.Answer) > 0 {
|
||||
if !s.Shown && (s.Direct == nil || *s.Direct != response.IdQuestion) {
|
||||
return APIErrorResponse{err: fmt.Errorf("Cette question n'est pas disponible")}
|
||||
} else if len(response.Answer) > 0 {
|
||||
if _, err := s.NewResponse(response.IdQuestion, u.Id, response.Answer); err != nil {
|
||||
return APIErrorResponse{err: err}
|
||||
}
|
||||
|
||||
if s.Direct != nil {
|
||||
s.WSAdminWriteAll(WSMessage{Action: "new_response", UserId: &u.Id, QuestionId: &response.IdQuestion, Response: response.Answer})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue