From df6a6ed97e9fdff9fae9e659a267bf13a14225fe Mon Sep 17 00:00:00 2001 From: Juan Leyva Date: Tue, 14 May 2019 17:00:25 +0200 Subject: [PATCH] MDL-65274 mod_quiz: Do not return a translated string We should be returning proper error codes and the translated string can be part of the debug information. --- mod/quiz/classes/external.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mod/quiz/classes/external.php b/mod/quiz/classes/external.php index 9c38f7e69bc..cfdc4a89d33 100644 --- a/mod/quiz/classes/external.php +++ b/mod/quiz/classes/external.php @@ -1299,7 +1299,8 @@ class mod_quiz_external extends external_api { if (!$attemptobj->is_finished()) { throw new moodle_quiz_exception($attemptobj->get_quizobj(), 'attemptclosed'); } else if (!$displayoptions->attempt) { - throw new moodle_exception($attemptobj->cannot_review_message()); + throw new moodle_quiz_exception($attemptobj->get_quizobj(), 'noreview', null, '', + $attemptobj->cannot_review_message()); } } else if (!$attemptobj->is_review_allowed()) { throw new moodle_quiz_exception($attemptobj->get_quizobj(), 'noreviewattempt');