From f45cd217c112aed49688bf4958e200997b4a79fc Mon Sep 17 00:00:00 2001 From: Thomas Carlier Date: Thu, 24 Mar 2022 13:30:15 +0000 Subject: [PATCH] [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 --- addons/website_event_track_quiz/controllers/event_track_quiz.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website_event_track_quiz/controllers/event_track_quiz.py b/addons/website_event_track_quiz/controllers/event_track_quiz.py index b21675d2541..b990805d32e 100644 --- a/addons/website_event_track_quiz/controllers/event_track_quiz.py +++ b/addons/website_event_track_quiz/controllers/event_track_quiz.py @@ -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: