From 6e6527a0b74409123c9c1dfae126e416f8f04657 Mon Sep 17 00:00:00 2001 From: Edmund Farrow Date: Tue, 26 Nov 2024 17:16:48 +0000 Subject: [PATCH] quiz-data - Fix deprecation --- classes/external/import_quiz_data.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/classes/external/import_quiz_data.php b/classes/external/import_quiz_data.php index a06bd5d..016d0df 100644 --- a/classes/external/import_quiz_data.php +++ b/classes/external/import_quiz_data.php @@ -39,7 +39,8 @@ use external_multiple_structure; use external_single_structure; use external_value; -use quiz; +use mod_quiz\grade_calculator; +use mod_quiz\quiz_settings; /** * A webservice function to export details of a quiz content and structure. @@ -181,8 +182,8 @@ public static function execute(array $quiz, array $sections, array $questions, a $DB->set_field('quiz_slots', 'requireprevious', 1, ['id' => $itemid]); } } - if (class_exists('\grade_calculator::recompute_quiz_sumgrades')) { - \grade_calculator::recompute_quiz_sumgrades($module); + if (class_exists('mod_quiz\grade_calculator')) { + quiz_settings::create($moduleinfo->instance)->get_grade_calculator()->recompute_quiz_sumgrades(); } else { quiz_update_sumgrades($module); }