Skip to content
Snippets Groups Projects
Commit 6d224059 authored by Thibault Delavallée's avatar Thibault Delavallée
Browse files

[FIX] website_slides: do not crash if there is any issue loading quiz data

Template displaying quiz should not crash if call to server did not answer
correctly. Minimal fix is to have void data to display. Real issue is that
unreadable quiz should not be displayed. This will be fixed in an upcoming
fix.

Task 2058595 (eLearning v13 testing)
Task 2064863 (quiz bug report)
parent 1aeba9b9
No related branches found
No related tags found
No related merge requests found
......@@ -92,8 +92,9 @@ odoo.define('website_slides.quiz', function (require) {
}
else if (alert_code === 'slide_quiz_done') {
message = _t('This quiz is already done. Retaking it is not possible.');
} else if (alert_code === 'public_user') {
message = _t("You must be logged to submit the quiz.");
}
else if (alert_code === 'public_user') {
message = _t('You must be logged to submit the quiz.');
}
this.$('.o_wslides_js_lesson_quiz_error span:first').html(message);
this.$('.o_wslides_js_lesson_quiz_error').removeClass('d-none');
......@@ -112,10 +113,10 @@ odoo.define('website_slides.quiz', function (require) {
}
}).then(function (quiz_data) {
self.quiz = {
questions: quiz_data.slide_questions,
quizAttemptsCount: quiz_data.quiz_attempts_count,
quizKarmaGain: quiz_data.quiz_karma_gain,
quizKarmaWon: quiz_data.quiz_karma_won
questions: quiz_data.slide_questions || [],
quizAttemptsCount: quiz_data.quiz_attempts_count || 0,
quizKarmaGain: quiz_data.quiz_karma_gain || 0,
quizKarmaWon: quiz_data.quiz_karma_won || 0,
};
});
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment