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.
This commit is contained in:
Juan Leyva 2019-05-14 17:00:25 +02:00
parent a866c5c238
commit ee766461b4

View File

@ -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');