[FIX] event_track_quiz : fix quiz validation error

Steps to reproduce the bug:

- Config/Settings > "Event Gamification" needs to be enabled >
- Go to an event E > Tracks, select one with a quiz > View on website > Do quiz
- On website > Go to E > click Take the Quizz > Fill the answers
- Check the answers

Bug:

 Error was raised saying need to answer all questions instead of showing correct vs incorrect answers

opw:2733275

closes odoo/odoo#90873

X-original-commit: 5f15f76e6a9467c245af1d4804d773cce59d902b
Signed-off-by: Simon Goffin <sig@odoo.com>
This commit is contained in:
Thomas Carlier
2022-05-09 15:01:11 +02:00
committed by Goffin Simon
parent 81c8a0564d
commit f45cd217c1
@@ -66,7 +66,7 @@ class WebsiteEventTrackQuiz(EventTrackController):
})
def _get_quiz_answers_details(self, track, answer_ids):
questions_count = len(track.quiz_ids)
questions_count = track.quiz_questions_count
user_answers = request.env['event.quiz.answer'].sudo().search([('id', 'in', answer_ids)])
if len(user_answers.mapped('question_id')) != questions_count: