From 403f153d943b4e3c52e22c75e78d3963db67b61e Mon Sep 17 00:00:00 2001 From: Mark Johnson Date: Fri, 17 May 2024 14:00:46 +0100 Subject: [PATCH] fixup! MDL-68806 quiz: Retain backwards compatibility in external function Bump version Fix @since tags --- mod/quiz/classes/external.php | 14 +++++++------- mod/quiz/locallib.php | 7 +++++++ version.php | 2 +- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/mod/quiz/classes/external.php b/mod/quiz/classes/external.php index e84f833cf1d0b..e309325cc0cc8 100644 --- a/mod/quiz/classes/external.php +++ b/mod/quiz/classes/external.php @@ -566,7 +566,7 @@ public static function get_user_attempts_is_deprecated(): bool { * Describes the parameters for get_user_quiz_attempts. * * @return external_function_parameters - * @since Moodle 4.4 + * @since Moodle 4.5 */ public static function get_user_quiz_attempts_parameters(): external_function_parameters { return new external_function_parameters ( @@ -587,7 +587,7 @@ public static function get_user_quiz_attempts_parameters(): external_function_pa * @param string $status quiz status: all, finished or unfinished * @param bool $includepreviews whether to include previews or not * @return array of warnings and the list of attempts - * @since Moodle 4.4 + * @since Moodle 4.5 */ public static function get_user_quiz_attempts( int $quizid, @@ -605,7 +605,7 @@ public static function get_user_quiz_attempts( 'status' => $status, 'includepreviews' => $includepreviews, ]; - $params = self::validate_parameters(self::get_user_attempts_parameters(), $params); + $params = self::validate_parameters(self::get_user_quiz_attempts_parameters(), $params); [$quiz, $course, $cm, $context] = self::validate_quiz($params['quizid']); @@ -661,7 +661,7 @@ public static function get_user_quiz_attempts( * Describes the get_user_attempts return value. * * @return external_single_structure - * @since Moodle 3.1 + * @since Moodle 4.5 */ public static function get_user_quiz_attempts_returns(): external_single_structure { return new external_single_structure( @@ -1791,7 +1791,7 @@ public static function get_attempt_review_is_deprecated(): bool { * Describes the parameters for get_quiz_attempt_review. * * @return external_function_parameters - * @since Moodle 4.4 + * @since Moodle 4.5 */ public static function get_quiz_attempt_review_parameters(): external_function_parameters { return new external_function_parameters ( @@ -1811,7 +1811,7 @@ public static function get_quiz_attempt_review_parameters(): external_function_p * @param int $attemptid attempt id * @param int $page page number, empty for all the questions in all the pages * @return array of warnings and the attempt data, feedback and questions - * @since Moodle 4.4 + * @since Moodle 4.5 */ public static function get_quiz_attempt_review(int $attemptid, int $page = -1): array { $warnings = []; @@ -1888,7 +1888,7 @@ public static function get_quiz_attempt_review(int $attemptid, int $page = -1): * Describes the get_attempt_review return value. * * @return external_single_structure - * @since Moodle 4.4 + * @since Moodle 4.5 */ public static function get_quiz_attempt_review_returns(): external_single_structure { return new external_single_structure( diff --git a/mod/quiz/locallib.php b/mod/quiz/locallib.php index 8141663c66ab7..520f4b8d9223b 100644 --- a/mod/quiz/locallib.php +++ b/mod/quiz/locallib.php @@ -346,6 +346,10 @@ function quiz_start_attempt_built_on_last($quba, $attempt, $lastattempt) { /** * The save started question usage and quiz attempt in db and log the started attempt. * + * If the attempt already exists in the database with the NOT_STARTED state, it will be transitioned + * to IN_PROGRESS and the timestart updated. If it does not already exist, a new record will be created + * already in the IN_PROGRESS state. + * * @param quiz_settings $quizobj * @param question_usage_by_activity $quba * @param stdClass $attempt @@ -416,6 +420,9 @@ function quiz_attempt_save_started( /** * The save started question usage and quiz attempt in db. * + * This saves an attempt in the NOT_STARTED state, and is designed for use when pre-creating attempts + * ahead of the quiz start time to spread out the processing load. + * * @param question_usage_by_activity $quba * @param stdClass $attempt * @return stdClass attempt object with uniqueid and id set. diff --git a/version.php b/version.php index e53c7fe0bcce3..241e40bd26097 100644 --- a/version.php +++ b/version.php @@ -29,7 +29,7 @@ defined('MOODLE_INTERNAL') || die(); -$version = 2024051600.00; // YYYYMMDD = weekly release date of this DEV branch. +$version = 2024051600.01; // YYYYMMDD = weekly release date of this DEV branch. // RR = release increments - 00 in DEV branches. // .XX = incremental changes. $release = '4.5dev (Build: 20240516)'; // Human-friendly version name