Skip to content

Commit

Permalink
quiz-data - Fix deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
EJMFarrow committed Nov 26, 2024
1 parent f01b9ee commit 6e6527a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions classes/external/import_quiz_data.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 6e6527a

Please sign in to comment.