Fixes automatic stop of quizzes after all attendees sent a response for questions without timer

parent 612b3d9b
......@@ -369,11 +369,15 @@ export class QuizEntity extends AbstractEntity implements IQuizEntity {
step: MessageProtocol.UpdatedResponse,
payload,
}));
if (this._quizTimer && MemberDAO.getMembersOfQuiz(this.name).every(nick => {
if (MemberDAO.getMembersOfQuiz(this.name).every(nick => {
const val = nick.responses[this.currentQuestionIndex].value;
return typeof val === 'number' ? val > -1 : val.length > 0;
})) {
this._quizTimer = 1;
if (this._quizTimer) {
this._quizTimer = 1;
} else {
DbDAO.updateOne(DbCollection.Quizzes, { _id: this.id }, { currentStartTimestamp: -1 });
}
}
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment