mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
MDL-75914 webservice: Added fake URL to avoid debugging output.
Webservice doesn't need to set the page URL. Hence, any function that requires a page URL will raise debugging output. The patch fixes it by adding a fake URL for the webservice. The patch also removed assertDebuggingCalled because it is no longer needed.
This commit is contained in:
parent
5019abfdd6
commit
e33194755f
@ -1050,6 +1050,7 @@ class mod_quiz_external extends external_api {
|
||||
* @throws moodle_quiz_exceptions
|
||||
*/
|
||||
public static function get_attempt_data($attemptid, $page, $preflightdata = array()) {
|
||||
global $PAGE;
|
||||
|
||||
$warnings = array();
|
||||
|
||||
@ -1068,6 +1069,10 @@ class mod_quiz_external extends external_api {
|
||||
$nextpage = $params['page'] + 1;
|
||||
}
|
||||
|
||||
// TODO: Remove the code once the long-term solution (MDL-76728) has been applied.
|
||||
// Set a default URL to stop the debugging output.
|
||||
$PAGE->set_url('/fake/url');
|
||||
|
||||
$result = array();
|
||||
$result['attempt'] = $attemptobj->get_attempt();
|
||||
$result['messages'] = $messages;
|
||||
|
1
mod/quiz/tests/external/external_test.php
vendored
1
mod/quiz/tests/external/external_test.php
vendored
@ -1321,7 +1321,6 @@ class external_test extends externallib_advanced_testcase {
|
||||
// Now, get the summary.
|
||||
$result = mod_quiz_external::get_attempt_summary($attempt->id);
|
||||
$result = \external_api::clean_returnvalue(mod_quiz_external::get_attempt_summary_returns(), $result);
|
||||
$this->assertDebuggingCalled(); // Expect $PAGE->set_url debugging.
|
||||
|
||||
// Check it's marked as completed only the first one.
|
||||
$this->assertEquals('complete', $result['questions'][0]['state']);
|
||||
|
Loading…
x
Reference in New Issue
Block a user