MDL-76899 quiz: Bulk fix object -> stdClass in PHPdoc

This commit is contained in:
Tim Hunt
2023-01-16 17:12:44 +00:00
parent 450e55e79d
commit 17e11dd9d5
28 changed files with 194 additions and 193 deletions
@@ -59,7 +59,7 @@ class quizaccess_delaybetweenattempts extends access_rule_base {
* Compute the next time a student would be allowed to start an attempt,
* according to this rule.
* @param int $numprevattempts number of previous attempts.
* @param object $lastattempt information about the previous attempt.
* @param stdClass $lastattempt information about the previous attempt.
* @return number the time.
*/
protected function compute_next_start_time($numprevattempts, $lastattempt) {
+2 -2
View File
@@ -151,7 +151,7 @@ class quizaccess_seb extends access_rule_base {
* Save any submitted settings when the quiz settings form is submitted. This
* is called from {@link quiz_after_add_or_update()} in lib.php.
*
* @param object $quiz the data from the quiz form, including $quiz->id
* @param stdClass $quiz the data from the quiz form, including $quiz->id
* which is the id of the quiz being saved.
*/
public static function save_settings($quiz) {
@@ -204,7 +204,7 @@ class quizaccess_seb extends access_rule_base {
* Delete any rule-specific settings when the quiz is deleted. This is called
* from {@link quiz_delete_instance()} in lib.php.
*
* @param object $quiz the data from the database, including $quiz->id
* @param stdClass $quiz the data from the database, including $quiz->id
* which is the id of the quiz being deleted.
*/
public static function delete_settings($quiz) {
+1 -1
View File
@@ -45,7 +45,7 @@ class overrides implements \cache_data_source {
* specified by this interface.
*
* @param cache_definition $definition
* @return object
* @return stdClass
*/
public static function get_instance_for_cache(cache_definition $definition): overrides {
if (is_null(self::$instance)) {
+5 -5
View File
@@ -82,7 +82,7 @@ abstract class access_rule_base {
* Whether a user should be allowed to start a new attempt at this quiz now.
*
* @param int $numprevattempts the number of previous attempts this user has made.
* @param object $lastattempt information about the user's last completed attempt.
* @param stdClass $lastattempt information about the user's last completed attempt.
* @return string false if access should be allowed, a message explaining the
* reason if access should be prevented.
*/
@@ -185,7 +185,7 @@ abstract class access_rule_base {
* active attempt for this user.
*
* @param int $numprevattempts the number of previous attempts this user has made.
* @param object $lastattempt information about the user's last completed attempt.
* @param stdClass $lastattempt information about the user's last completed attempt.
* @return bool true if this rule means that this user will never be allowed another
* attempt at this quiz.
*/
@@ -206,7 +206,7 @@ abstract class access_rule_base {
/**
* If the user should be shown a different amount of time than $timenow - $this->end_time(), then
* override this method. This is useful if the time remaining is large enough to be omitted.
* @param object $attempt the current attempt
* @param stdClass $attempt the current attempt
* @param int $timenow the time now. We don't use $this->timenow, so we can
* give the user a more accurate indication of how much time is left.
* @return mixed the time left in seconds (can be negative) or false if there is no limit.
@@ -301,7 +301,7 @@ abstract class access_rule_base {
/**
* Save any submitted settings when the quiz settings form is submitted. This
* is called from {@see quiz_after_add_or_update()} in lib.php.
* @param object $quiz the data from the quiz form, including $quiz->id
* @param stdClass $quiz the data from the quiz form, including $quiz->id
* which is the id of the quiz being saved.
*/
public static function save_settings($quiz) {
@@ -311,7 +311,7 @@ abstract class access_rule_base {
/**
* Delete any rule-specific settings when the quiz is deleted. This is called
* from {@see quiz_delete_instance()} in lib.php.
* @param object $quiz the data from the database, including $quiz->id
* @param stdClass $quiz the data from the database, including $quiz->id
* which is the id of the quiz being deleted.
* @since Moodle 2.7.1, 2.6.4, 2.5.7
*/
@@ -68,9 +68,9 @@ abstract class attempts_report extends report_base {
*
* @param string $mode
* @param string $formclass
* @param object $quiz
* @param object $cm
* @param object $course
* @param stdClass $quiz
* @param stdClass $cm
* @param stdClass $course
* @return array with four elements:
* 0 => integer the current group id (0 for none).
* 1 => \core\dml\sql_join Contains joins, wheres, params for all the students in this course.
@@ -107,8 +107,8 @@ abstract class attempts_report extends report_base {
* Get sql fragments (joins) which can be used to build queries that
* will select an appropriate set of students to show in the reports.
*
* @param object $cm the course module.
* @param object $course the course settings.
* @param stdClass $cm the course module.
* @param stdClass $course the course settings.
* @return array with four elements:
* 0 => integer the current group id (0 for none).
* 1 => \core\dml\sql_join Contains joins, wheres, params for all the students in this course.
@@ -257,7 +257,7 @@ abstract class attempts_report extends report_base {
/**
* Add all the grade and feedback columns, if applicable, to the $columns
* and $headers arrays.
* @param object $quiz the quiz settings.
* @param stdClass $quiz the quiz settings.
* @param bool $usercanseegrades whether the user is allowed to see grades for this quiz.
* @param array $columns the list of columns. Added to.
* @param array $headers the columns headings. Added to.
@@ -305,8 +305,8 @@ abstract class attempts_report extends report_base {
/**
* Process any submitted actions.
* @param object $quiz the quiz settings.
* @param object $cm the cm object for the quiz.
* @param stdClass $quiz the quiz settings.
* @param stdClass $cm the cm object for the quiz.
* @param int $currentgroup the currently selected group.
* @param \core\dml\sql_join $groupstudentsjoins (joins, wheres, params) the students in the current group.
* @param \core\dml\sql_join $allowedjoins (joins, wheres, params) the users whose attempt this user is allowed to modify.
@@ -327,9 +327,9 @@ abstract class attempts_report extends report_base {
/**
* Delete the quiz attempts
* @param object $quiz the quiz settings. Attempts that don't belong to
* @param stdClass $quiz the quiz settings. Attempts that don't belong to
* this quiz are not deleted.
* @param object $cm the course_module object.
* @param stdClass $cm the course_module object.
* @param array $attemptids the list of attempt ids to delete.
* @param \core\dml\sql_join $allowedjoins (joins, wheres, params) This list of userids that are visible in the report.
* Users can only delete attempts that they are allowed to see in the report.
@@ -90,9 +90,9 @@ class attempts_report_options {
* Constructor.
*
* @param string $mode which report these options are for.
* @param object $quiz the settings for the quiz being reported on.
* @param object $cm the course module objects for the quiz being reported on.
* @param object $course the course settings for the coures this quiz is in.
* @param stdClass $quiz the settings for the quiz being reported on.
* @param stdClass $cm the course module objects for the quiz being reported on.
* @param stdClass $course the course settings for the coures this quiz is in.
*/
public function __construct($mode, $quiz, $cm, $course) {
$this->mode = $mode;
@@ -137,7 +137,7 @@ class attempts_report_options {
* Process the data we get when the settings form is submitted. This includes
* updating the fields of this class, and updating the user preferences
* where appropriate.
* @param object $fromform The data from $mform->get_data() from the settings form.
* @param stdClass $fromform The data from $mform->get_data() from the settings form.
*/
public function process_settings_from_form($fromform) {
$this->setup_from_form_data($fromform);
@@ -175,7 +175,7 @@ class attempts_report_options {
/**
* Set the fields of this object from the form data.
* @param object $fromform The data from $mform->get_data() from the settings form.
* @param stdClass $fromform The data from $mform->get_data() from the settings form.
*/
public function setup_from_form_data($fromform) {
$this->attempts = $fromform->attempts;
@@ -77,8 +77,8 @@ abstract class report_base {
/**
* Get the current group for the user user looking at the report.
*
* @param object $cm the course_module information.
* @param object $course the course settings.
* @param stdClass $cm the course_module information.
* @param stdClass $course the course settings.
* @param context $context the quiz context.
* @return int the current group id, if applicable. 0 for all users,
* NO_GROUPS_ALLOWED if the user cannot see any group.
+1 -1
View File
@@ -485,7 +485,7 @@ class edit_renderer extends \plugin_renderer_base {
/**
* Render an icon to remove a section from the quiz.
*
* @param object $section the section to be removed.
* @param stdClass $section the section to be removed.
* @return string HTML to output.
*/
public function section_remove_icon($section) {
+4 -4
View File
@@ -1026,8 +1026,8 @@ class renderer extends plugin_renderer_base {
/**
* Output the page information
*
* @param object $quiz the quiz settings.
* @param object $cm the course_module object.
* @param stdClass $quiz the quiz settings.
* @param stdClass $cm the course_module object.
* @param context $context the quiz context.
* @param array $messages any access messages that should be described.
* @param bool $quizhasquestions does quiz has questions added.
@@ -1062,8 +1062,8 @@ class renderer extends plugin_renderer_base {
/**
* Output the quiz intro.
*
* @param object $quiz the quiz settings.
* @param object $cm the course_module object.
* @param stdClass $quiz the quiz settings.
* @param stdClass $cm the course_module object.
* @return string HTML to output.
*/
public function quiz_intro($quiz, $cm) {
+1 -1
View File
@@ -72,7 +72,7 @@ class view_page {
public $gradebookfeedback;
/** @var bool $unfinished contains 1 if an attempt is unfinished. */
public $unfinished;
/** @var object $lastfinishedattempt the last attempt from the attempts array. */
/** @var stdClass $lastfinishedattempt the last attempt from the attempts array. */
public $lastfinishedattempt;
/** @var array $preventmessages of messages telling the user why they can't
* attempt the quiz now. */
+6 -6
View File
@@ -68,9 +68,9 @@ class quiz_settings {
/**
* Constructor, assuming we already have the necessary data loaded.
*
* @param object $quiz the row from the quiz table.
* @param object $cm the course_module object for this quiz.
* @param object $course the row from the course table for the course we belong to.
* @param stdClass $quiz the row from the quiz table.
* @param stdClass $cm the course_module object for this quiz.
* @param stdClass $course the row from the course table for the course we belong to.
* @param bool $getcontext intended for testing - stops the constructor getting the context.
*/
public function __construct($quiz, $cm, $course, $getcontext = true) {
@@ -108,7 +108,7 @@ class quiz_settings {
/**
* Create a {@see quiz_attempt} for an attempt at this quiz.
*
* @param object $attemptdata row from the quiz_attempts table.
* @param stdClass $attemptdata row from the quiz_attempts table.
* @return quiz_attempt the new quiz_attempt object.
*/
public function create_attempt_object($attemptdata) {
@@ -176,7 +176,7 @@ class quiz_settings {
/**
* Get the course settings object that this quiz belongs to.
*
* @return object the row of the course table.
* @return stdClass the row of the course table.
*/
public function get_course() {
return $this->course;
@@ -239,7 +239,7 @@ class quiz_settings {
/**
* Get the course-module object for this quiz.
*
* @return object the course_module object.
* @return stdClass the course_module object.
*/
public function get_cm() {
return $this->cm;
+1 -1
View File
@@ -219,7 +219,7 @@ function quiz_retrieve_tags_for_slot_ids($slotids) {
*
* @deprecated in 4.1 use mod_quiz\structure::has_use_capability(...) instead.
*
* @param object $quiz the quiz settings.
* @param stdClass $quiz the quiz settings.
* @param int $slot which question in the quiz to test.
* @return bool whether the user can use this question.
*/
+37 -36
View File
@@ -86,7 +86,7 @@ require_once(__DIR__ . '/deprecatedlib.php');
* will create a new instance and return the id number
* of the new instance.
*
* @param object $quiz the data that came from the form.
* @param stdClass $quiz the data that came from the form.
* @return mixed the id of the new instance on success,
* false or a string error message on failure.
*/
@@ -119,7 +119,7 @@ function quiz_add_instance($quiz) {
* (defined by the form in mod_form.php) this function
* will update an existing instance with new data.
*
* @param object $quiz the data that came from the form.
* @param stdClass $quiz the data that came from the form.
* @return mixed true on success, false or a string error message on failure.
*/
function quiz_update_instance($quiz, $mform) {
@@ -211,7 +211,7 @@ function quiz_delete_instance($id) {
/**
* Deletes a quiz override from the database and clears any corresponding calendar events
*
* @param object $quiz The quiz object.
* @param stdClass $quiz The quiz object.
* @param int $overrideid The id of the override being deleted
* @param bool $log Whether to trigger logs.
* @return bool true on success
@@ -276,7 +276,7 @@ function quiz_delete_override($quiz, $overrideid, $log = true) {
/**
* Deletes all quiz overrides from the database and clears any corresponding calendar events
*
* @param object $quiz The quiz object.
* @param stdClass $quiz The quiz object.
* @param bool $log Whether to trigger logs.
*/
function quiz_delete_all_overrides($quiz, $log = true) {
@@ -299,9 +299,9 @@ function quiz_delete_all_overrides($quiz, $log = true) {
* quiz->extrapasswords will contain an array of strings giving the remaining
* passwords.
*
* @param object $quiz The quiz object.
* @param stdClass $quiz The quiz object.
* @param int $userid The userid.
* @return object $quiz The updated quiz object.
* @return stdClass $quiz The updated quiz object.
*/
function quiz_update_effective_access($quiz, $userid) {
global $DB;
@@ -401,7 +401,7 @@ function quiz_update_effective_access($quiz, $userid) {
/**
* Delete all the attempts belonging to a quiz.
*
* @param object $quiz The quiz object.
* @param stdClass $quiz The quiz object.
*/
function quiz_delete_all_attempts($quiz) {
global $CFG, $DB;
@@ -414,8 +414,8 @@ function quiz_delete_all_attempts($quiz) {
/**
* Delete all the attempts belonging to a user in a particular quiz.
*
* @param object $quiz The quiz object.
* @param object $user The user object.
* @param stdClass $quiz The quiz object.
* @param stdClass $user The user object.
*/
function quiz_delete_user_attempts($quiz, $user) {
global $CFG, $DB;
@@ -433,7 +433,7 @@ function quiz_delete_user_attempts($quiz, $user) {
/**
* Get the best current grade for a particular user in a quiz.
*
* @param object $quiz the quiz settings.
* @param stdClass $quiz the quiz settings.
* @param int $userid the id of the user.
* @return float the user's current grade for this quiz, or null if this user does
* not have a grade on this quiz.
@@ -456,7 +456,7 @@ function quiz_get_best_grade($quiz, $userid) {
* $quiz->grade and $quiz->sumgrades are non-zero (for example, if you want to
* divide by them).
*
* @param object $quiz a row from the quiz table.
* @param stdClass $quiz a row from the quiz table.
* @return bool whether this is a graded quiz.
*/
function quiz_has_grades($quiz) {
@@ -480,11 +480,11 @@ function quiz_allows_multiple_tries($quiz) {
* $return->time = the time they did it
* $return->info = a short text description
*
* @param object $course
* @param object $user
* @param object $mod
* @param object $quiz
* @return object|null
* @param stdClass $course
* @param stdClass $user
* @param stdClass $mod
* @param stdClass $quiz
* @return stdClass|null
*/
function quiz_user_outline($course, $user, $mod, $quiz) {
global $DB, $CFG;
@@ -515,10 +515,10 @@ function quiz_user_outline($course, $user, $mod, $quiz) {
* Print a detailed representation of what a user has done with
* a given particular instance of this module, for user activity reports.
*
* @param object $course
* @param object $user
* @param object $mod
* @param object $quiz
* @param stdClass $course
* @param stdClass $user
* @param stdClass $mod
* @param stdClass $quiz
* @return bool
*/
function quiz_user_complete($course, $user, $mod, $quiz) {
@@ -671,7 +671,8 @@ function quiz_format_grade($quiz, $grade) {
/**
* Determine the correct number of decimal places required to format a grade.
*
* @param object $quiz The quiz table row, only $quiz->decimalpoints is used.
* @param stdClass $quiz The quiz table row, only $quiz->decimalpoints and
* ->questiondecimalpoints are used.
* @return integer
*/
function quiz_get_grade_format($quiz) {
@@ -701,7 +702,7 @@ function quiz_format_question_grade($quiz, $grade) {
* Update grades in central gradebook
*
* @category grade
* @param object $quiz the quiz settings.
* @param stdClass $quiz the quiz settings.
* @param int $userid specific user only, 0 means all users.
* @param bool $nullifnone If a single user is specified and $nullifnone is true a grade item with a null rawgrade will be inserted
*/
@@ -730,7 +731,7 @@ function quiz_update_grades($quiz, $userid = 0, $nullifnone = true) {
* Create or update the grade item for given quiz
*
* @category grade
* @param object $quiz object with extra cmidnumber
* @param stdClass $quiz object with extra cmidnumber
* @param mixed $grades optional array/object of grade(s); 'reset' means reset grades in gradebook
* @return int 0 if ok, error code otherwise
*/
@@ -834,8 +835,8 @@ function quiz_grade_item_update($quiz, $grades = null) {
* Delete grade item for given quiz
*
* @category grade
* @param object $quiz object
* @return object quiz
* @param stdClass $quiz object
* @return int
*/
function quiz_grade_item_delete($quiz) {
global $CFG;
@@ -1031,7 +1032,7 @@ function quiz_print_recent_mod_activity($activity, $courseid, $detail, $modnames
* Pre-process the quiz options form data, making any necessary adjustments.
* Called by add/update instance in this file.
*
* @param object $quiz The variables set on the form.
* @param stdClass $quiz The variables set on the form.
*/
function quiz_process_options($quiz) {
global $CFG;
@@ -1137,7 +1138,7 @@ function quiz_process_options($quiz) {
/**
* Helper function for {@link quiz_process_options()}.
* @param object $fromform the sumbitted form date.
* @param stdClass $fromform the sumbitted form date.
* @param string $field one of the review option field names.
*/
function quiz_review_option_form_to_db($fromform, $field) {
@@ -1204,7 +1205,7 @@ function mod_quiz_inplace_editable(string $itemtype, int $itemid, string $newval
* This function is called at the end of quiz_add_instance
* and quiz_update_instance, to do the common processing.
*
* @param object $quiz the quiz object.
* @param stdClass $quiz the quiz object.
*/
function quiz_after_add_or_update($quiz) {
global $DB;
@@ -1251,8 +1252,8 @@ function quiz_after_add_or_update($quiz) {
* associated with the specified override.
*
* @uses QUIZ_MAX_EVENT_LENGTH
* @param object $quiz the quiz object.
* @param object optional $override limit to a specific override
* @param stdClass $quiz the quiz object.
* @param stdClass optional $override limit to a specific override
*/
function quiz_update_events($quiz, $override = null) {
global $DB;
@@ -1549,7 +1550,7 @@ function quiz_reset_gradebook($courseid, $type='') {
*
* Also, move the quiz open and close dates, if the course start date is changing.
*
* @param object $data the data submitted from the reset course.
* @param stdClass $data the data submitted from the reset course.
* @return array status array
*/
function quiz_reset_userdata($data) {
@@ -1643,8 +1644,8 @@ function quiz_reset_userdata($data) {
* Return a textual summary of the number of attempts that have been made at a particular quiz,
* returns '' if no attempts have been made yet, unless $returnzero is passed as true.
*
* @param object $quiz the quiz object. Only $quiz->id is used at the moment.
* @param object $cm the cm object. Only $cm->course, $cm->groupmode and
* @param stdClass $quiz the quiz object. Only $quiz->id is used at the moment.
* @param stdClass $cm the cm object. Only $cm->course, $cm->groupmode and
* $cm->groupingid fields are used at the moment.
* @param bool $returnzero if false (default), when no attempts have been
* made '' is returned instead of 'Attempts: 0'.
@@ -1686,10 +1687,10 @@ function quiz_num_attempt_summary($quiz, $cm, $returnzero = false, $currentgroup
* Returns the same as {@link quiz_num_attempt_summary()} but wrapped in a link
* to the quiz reports.
*
* @param object $quiz the quiz object. Only $quiz->id is used at the moment.
* @param object $cm the cm object. Only $cm->course, $cm->groupmode and
* @param stdClass $quiz the quiz object. Only $quiz->id is used at the moment.
* @param stdClass $cm the cm object. Only $cm->course, $cm->groupmode and
* $cm->groupingid fields are used at the moment.
* @param object $context the quiz context.
* @param stdClass $context the quiz context.
* @param bool $returnzero if false (default), when no attempts have been made
* '' is returned instead of 'Attempts: 0'.
* @param int $currentgroup if there is a concept of current group where this method is being called
+49 -49
View File
@@ -79,7 +79,7 @@ define('QUIZ_SHOWIMAGE_LARGE', 2);
* user starting at the current time. The ->id field is not set. The object is
* NOT written to the database.
*
* @param object $quizobj the quiz object to create an attempt for.
* @param stdClass $quizobj the quiz object to create an attempt for.
* @param int $attemptnumber the sequence number for the attempt.
* @param stdClass|false $lastattempt the previous attempt by this user, if any. Only needed
* if $attemptnumber > 1 and $quiz->attemptonlast is true.
@@ -87,7 +87,7 @@ define('QUIZ_SHOWIMAGE_LARGE', 2);
* @param bool $ispreview whether this new attempt is a preview.
* @param int $userid the id of the user attempting this quiz.
*
* @return object the newly created attempt object.
* @return stdClass the newly created attempt object.
*/
function quiz_create_attempt(quiz_settings $quizobj, $attemptnumber, $lastattempt, $timenow, $ispreview = false, $userid = null) {
global $USER;
@@ -147,7 +147,7 @@ function quiz_create_attempt(quiz_settings $quizobj, $attemptnumber, $lastattemp
*
* @param quiz_settings $quizobj the quiz object to start an attempt for.
* @param question_usage_by_activity $quba
* @param object $attempt
* @param stdClass $attempt
* @param integer $attemptnumber starting from 1
* @param integer $timenow the attempt start time
* @param array $questionids slot number => question id. Used for random questions, to force the choice
@@ -155,7 +155,7 @@ function quiz_create_attempt(quiz_settings $quizobj, $attemptnumber, $lastattemp
* @param array $forcedvariantsbyslot slot number => variant. Used for questions with variants,
* to force the choice of a particular variant. Intended for testing
* purposes only.
* @return object modified attempt object
* @return stdClass modified attempt object
*/
function quiz_start_new_attempt($quizobj, $quba, $attempt, $attemptnumber, $timenow,
$questionids = array(), $forcedvariantsbyslot = array()) {
@@ -306,9 +306,9 @@ function quiz_start_new_attempt($quizobj, $quba, $attempt, $attemptnumber, $time
* Start a subsequent new attempt, in each attempt builds on last mode.
*
* @param question_usage_by_activity $quba this question usage
* @param object $attempt this attempt
* @param object $lastattempt last attempt
* @return object modified attempt object
* @param stdClass $attempt this attempt
* @param stdClass $lastattempt last attempt
* @return stdClass modified attempt object
*
*/
function quiz_start_attempt_built_on_last($quba, $attempt, $lastattempt) {
@@ -341,8 +341,8 @@ function quiz_start_attempt_built_on_last($quba, $attempt, $lastattempt) {
*
* @param quiz_settings $quizobj
* @param question_usage_by_activity $quba
* @param object $attempt
* @return object attempt object with uniqueid and id set.
* @param stdClass $attempt
* @return stdClass attempt object with uniqueid and id set.
*/
function quiz_attempt_save_started($quizobj, $quba, $attempt) {
global $DB;
@@ -399,7 +399,7 @@ function quiz_get_user_attempt_unfinished($quizid, $userid) {
* Delete a quiz attempt.
* @param mixed $attempt an integer attempt id or an attempt object
* (row of the quiz_attempts table).
* @param object $quiz the quiz object.
* @param stdClass $quiz the quiz object.
*/
function quiz_delete_attempt($attempt, $quiz) {
global $DB;
@@ -454,7 +454,7 @@ function quiz_delete_attempt($attempt, $quiz) {
/**
* Delete all the preview attempts at a quiz, or possibly all the attempts belonging
* to one user.
* @param object $quiz the quiz object.
* @param stdClass $quiz the quiz object.
* @param int $userid (optional) if given, only delete the previews belonging to this user.
*/
function quiz_delete_previews($quiz, $userid = null) {
@@ -536,7 +536,7 @@ function quiz_repaginate_questions($quizid, $slotsperpage) {
* grade for this quiz.
*
* @param float $rawgrade the unadjusted grade, fof example $attempt->sumgrades
* @param object $quiz the quiz object. Only the fields grade, sumgrades and decimalpoints are used.
* @param stdClass $quiz the quiz object. Only the fields grade, sumgrades and decimalpoints are used.
* @param bool|string $format whether to format the results for display
* or 'question' to format a question grade (different number of decimal places.
* @return float|string the rescaled grade, or null/the lang string 'notyetgraded'
@@ -562,7 +562,7 @@ function quiz_rescale_grade($rawgrade, $quiz, $format = true) {
* Get the feedback object for this grade on this quiz.
*
* @param float $grade a grade on this quiz.
* @param object $quiz the quiz settings.
* @param stdClass $quiz the quiz settings.
* @return false|stdClass the record object or false if there is not feedback for the given grade
* @since Moodle 3.1
*/
@@ -611,7 +611,7 @@ function quiz_feedback_for_grade($grade, $quiz, $context) {
}
/**
* @param object $quiz the quiz database row.
* @param stdClass $quiz the quiz database row.
* @return bool Whether this quiz has any non-blank feedback text.
*/
function quiz_has_feedback($quiz) {
@@ -633,7 +633,7 @@ function quiz_has_feedback($quiz) {
*
* You should call {@link quiz_delete_previews()} before you call this function.
*
* @param object $quiz a quiz.
* @param stdClass $quiz a quiz.
*/
function quiz_update_sumgrades($quiz) {
global $DB;
@@ -659,7 +659,7 @@ function quiz_update_sumgrades($quiz) {
/**
* Update the sumgrades field of the attempts at a quiz.
*
* @param object $quiz a quiz.
* @param stdClass $quiz a quiz.
*/
function quiz_update_all_attempt_sumgrades($quiz) {
global $DB;
@@ -685,7 +685,7 @@ function quiz_update_all_attempt_sumgrades($quiz) {
* quiz_update_grades.
*
* @param float $newgrade the new maximum grade for the quiz.
* @param object $quiz the quiz we are updating. Passed by reference so its
* @param stdClass $quiz the quiz we are updating. Passed by reference so its
* grade field can be updated too.
* @return bool indicating success or failure.
*/
@@ -755,7 +755,7 @@ function quiz_set_grade($newgrade, $quiz) {
/**
* Save the overall grade for a user at a quiz in the quiz_grades table
*
* @param object $quiz The quiz for which the best grade is to be calculated and then saved.
* @param stdClass $quiz The quiz for which the best grade is to be calculated and then saved.
* @param int $userid The userid to calculate the grade for. Defaults to the current user.
* @param array $attempts The attempts of this user. Useful if you are
* looping through many users. Attempts can be fetched in one master query to
@@ -803,7 +803,7 @@ function quiz_save_best_grade($quiz, $userid = null, $attempts = array()) {
/**
* Calculate the overall grade for a quiz given a number of attempts by a particular user.
*
* @param object $quiz the quiz settings object.
* @param stdClass $quiz the quiz settings object.
* @param array $attempts an array of all the user's attempts at this quiz in order.
* @return float the overall grade
*/
@@ -851,7 +851,7 @@ function quiz_calculate_best_grade($quiz, $attempts) {
* This function is equivalent to calling quiz_save_best_grade for all
* users, but much more efficient.
*
* @param object $quiz the quiz settings.
* @param stdClass $quiz the quiz settings.
*/
function quiz_update_all_final_grades($quiz) {
global $DB;
@@ -1218,8 +1218,8 @@ function quiz_get_attempt_usertime_sql($redundantwhereclauses = '') {
*
* Which attempt is the best depends on $quiz->grademethod. If the grade
* method is GRADEAVERAGE then this function simply returns the last attempt.
* @return object The attempt with the best grade
* @param object $quiz The quiz for which the best grade is to be calculated
* @return stdClass The attempt with the best grade
* @param stdClass $quiz The quiz for which the best grade is to be calculated
* @param array $attempts An array of all the attempts of the user at the quiz
*/
function quiz_calculate_best_attempt($quiz, $attempts) {
@@ -1303,7 +1303,7 @@ function quiz_get_user_image_options() {
* Return an user's timeclose for all quizzes in a course, hereby taking into account group and user overrides.
*
* @param int $courseid the course id.
* @return object An object with of all quizids and close unixdates in this course, taking into account the most lenient
* @return stdClass An object with of all quizids and close unixdates in this course, taking into account the most lenient
* overrides, if existing and 0 if no close date is set.
*/
function quiz_get_user_timeclose($courseid) {
@@ -1374,9 +1374,9 @@ function quiz_attempt_state_name($state) {
// Other quiz functions ////////////////////////////////////////////////////////
/**
* @param object $quiz the quiz.
* @param stdClass $quiz the quiz.
* @param int $cmid the course_module object for this quiz.
* @param object $question the question.
* @param stdClass $question the question.
* @param string $returnurl url to return to after action is done.
* @param int $variant which question variant to preview (optional).
* @param bool $random if question is random, true.
@@ -1394,7 +1394,7 @@ function quiz_question_action_icons($quiz, $cmid, $question, $returnurl, $varian
/**
* @param int $cmid the course_module.id for this quiz.
* @param object $question the question.
* @param stdClass $question the question.
* @param string $returnurl url to return to after action is done.
* @param string $contentbeforeicon some HTML content to be added inside the link, before the icon.
* @return the HTML for an edit icon, view icon, or nothing for a question
@@ -1442,8 +1442,8 @@ function quiz_question_edit_button($cmid, $question, $returnurl, $contentafteric
}
/**
* @param object $quiz the quiz settings
* @param object $question the question
* @param stdClass $quiz the quiz settings
* @param stdClass $question the question
* @param int $variant which question variant to preview (optional).
* @return moodle_url to preview this question with the options from this quiz.
*/
@@ -1463,8 +1463,8 @@ function quiz_question_preview_url($quiz, $question, $variant = null) {
}
/**
* @param object $quiz the quiz settings
* @param object $question the question
* @param stdClass $quiz the quiz settings
* @param stdClass $question the question
* @param bool $label if true, show the preview question label after the icon
* @param int $variant which question variant to preview (optional).
* @param bool $random if question is random, true.
@@ -1479,8 +1479,8 @@ function quiz_question_preview_button($quiz, $question, $label = false, $variant
}
/**
* @param object $attempt the attempt.
* @param object $context the quiz context.
* @param stdClass $attempt the attempt.
* @param stdClass $context the quiz context.
* @return int whether flags should be shown/editable to the current user for this attempt.
*/
function quiz_get_flag_option($attempt, $context) {
@@ -1497,8 +1497,8 @@ function quiz_get_flag_option($attempt, $context) {
/**
* Work out what state this quiz attempt is in - in the sense used by
* quiz_get_review_options, not in the sense of $attempt->state.
* @param object $quiz the quiz settings
* @param object $attempt the quiz_attempt database row.
* @param stdClass $quiz the quiz settings
* @param stdClass $attempt the quiz_attempt database row.
* @return int one of the display_options::DURING,
* IMMEDIATELY_AFTER, LATER_WHILE_OPEN or AFTER_CLOSE constants.
*/
@@ -1569,7 +1569,7 @@ function quiz_get_review_options($quiz, $attempt, $context) {
* funciton is:
* list($someoptions, $alloptions) = quiz_get_combined_reviewoptions(...)
*
* @param object $quiz the quiz instance.
* @param stdClass $quiz the quiz instance.
* @param array $attempts an array of attempt objects.
*
* @return array of two options objects, one showing which options are true for
@@ -1610,7 +1610,7 @@ function quiz_get_combined_reviewoptions($quiz, $attempts) {
/**
* Sends a confirmation message to the student confirming that the attempt was processed.
*
* @param object $a lots of useful information that can be used in the message
* @param stdClass $a lots of useful information that can be used in the message
* subject and body.
* @param bool $studentisonline is the student currently interacting with Moodle?
*
@@ -1659,8 +1659,8 @@ function quiz_send_confirmation($recipient, $a, $studentisonline) {
/**
* Sends notification messages to the interested parties that assign the role capability
*
* @param object $recipient user object of the intended recipient
* @param object $a associative array of replaceable fields for the templates
* @param stdClass $recipient user object of the intended recipient
* @param stdClass $a associative array of replaceable fields for the templates
*
* @return int|false as for {@link message_send()}.
*/
@@ -1706,11 +1706,11 @@ function quiz_send_notification($recipient, $submitter, $a) {
/**
* Send all the requried messages when a quiz attempt is submitted.
*
* @param object $course the course
* @param object $quiz the quiz
* @param object $attempt this attempt just finished
* @param object $context the quiz context
* @param object $cm the coursemodule for this quiz
* @param stdClass $course the course
* @param stdClass $quiz the quiz
* @param stdClass $attempt this attempt just finished
* @param stdClass $context the quiz context
* @param stdClass $cm the coursemodule for this quiz
* @param bool $studentisonline is the student currently interacting with Moodle?
*
* @return bool true if all necessary messages were sent successfully, else false.
@@ -1885,7 +1885,7 @@ function quiz_send_overdue_message($attemptobj) {
*
* This sends the confirmation and notification messages, if required.
*
* @param object $event the event object.
* @param stdClass $event the event object.
*/
function quiz_attempt_submitted_handler($event) {
global $DB;
@@ -1916,7 +1916,7 @@ function quiz_attempt_submitted_handler($event) {
* Send the notification message when a quiz attempt has been manual graded.
*
* @param quiz_attempt $attemptobj Some data about the quiz attempt.
* @param object $userto
* @param stdClass $userto
* @return int|false As for message_send.
*/
function quiz_send_notify_manual_graded_message(quiz_attempt $attemptobj, object $userto): ?int {
@@ -2015,7 +2015,7 @@ function quiz_get_js_module() {
/**
* Creates a textual representation of a question for display.
*
* @param object $question A question object from the database questions table
* @param stdClass $question A question object from the database questions table
* @param bool $showicon If true, show the question's icon with the question. False by default.
* @param bool $showquestiontext If true (default), show question text after question name.
* If false, show only question name.
@@ -2085,7 +2085,7 @@ function quiz_require_question_use($questionid) {
* Adds a question to a quiz by updating $quiz as well as the
* quiz and quiz_slots tables. It also adds a page break if required.
* @param int $questionid The id of the question to be added
* @param object $quiz The extended quiz object as used by edit.php
* @param stdClass $quiz The extended quiz object as used by edit.php
* This is updated by this function
* @param int $page Which page in quiz to add the question on. If 0 (default),
* add at the end
@@ -2436,14 +2436,14 @@ function quiz_validate_new_attempt(quiz_settings $quizobj, access_manager $acces
*
* @param quiz_settings $quizobj quiz object
* @param int $attemptnumber the attempt number
* @param object $lastattempt last attempt object
* @param stdClass $lastattempt last attempt object
* @param bool $offlineattempt whether is an offline attempt or not
* @param array $forcedrandomquestions slot number => question id. Used for random questions,
* to force the choice of a particular actual question. Intended for testing purposes only.
* @param array $forcedvariants slot number => variant. Used for questions with variants,
* to force the choice of a particular variant. Intended for testing purposes only.
* @param int $userid Specific user id to create an attempt for that user, null for current logged in user
* @return object the new attempt
* @return stdClass the new attempt
* @since Moodle 3.1
*/
function quiz_prepare_and_start_new_attempt(quiz_settings $quizobj, $attemptnumber, $lastattempt,
+7 -7
View File
@@ -35,9 +35,9 @@ class quiz_grading_renderer extends plugin_renderer_base {
/**
* Render no question notification.
*
* @param object $quiz The quiz settings.
* @param object $cm The course-module for this quiz.
* @param object $context The quiz context.
* @param stdClass $quiz The quiz settings.
* @param stdClass $cm The course-module for this quiz.
* @param stdClass $context The quiz context.
* @return string The HTML for the no questions message.
*/
public function render_quiz_no_question_notification($quiz, $cm, $context) {
@@ -99,7 +99,7 @@ class quiz_grading_renderer extends plugin_renderer_base {
/**
* Render grade link for question.
*
* @param object $counts
* @param stdClass $counts
* @param string $type Type of grade.
* @param string $gradestring Lang string.
* @param moodle_url $gradequestionurl Url to grade question.
@@ -120,11 +120,11 @@ class quiz_grading_renderer extends plugin_renderer_base {
/**
* Render grading page.
*
* @param object $questioninfo Information of a question.
* @param stdClass $questioninfo Information of a question.
* @param moodle_url $listquestionsurl Url of the page that list all questions.
* @param quiz_grading_settings_form $filterform Question filter form.
* @param object $paginginfo Pagination information.
* @param object $pagingbar Pagination bar information.
* @param stdClass $paginginfo Pagination information.
* @param stdClass $pagingbar Pagination bar information.
* @param moodle_url $formaction Form submit url.
* @param array $hiddeninputs List of hidden input fields.
* @param string $gradequestioncontent HTML string of question content.
+3 -3
View File
@@ -672,9 +672,9 @@ class quiz_grading_report extends report_base {
/**
* Initialise some parts of $PAGE and start output.
*
* @param object $cm the course_module information.
* @param object $course the course settings.
* @param object $quiz the quiz settings.
* @param stdClass $cm the course_module information.
* @param stdClass $course the course settings.
* @param stdClass $quiz the quiz settings.
* @param string $reportmode the report name.
*/
public function print_header_and_tabs($cm, $course, $quiz, $reportmode = 'overview') {
+3 -3
View File
@@ -29,7 +29,7 @@ class quiz_overview_table extends attempts_report_table {
/**
* Constructor
* @param object $quiz
* @param stdClass $quiz
* @param context $context
* @param string $qmsubselect
* @param quiz_overview_options $options
@@ -176,7 +176,7 @@ class quiz_overview_table extends attempts_report_table {
/**
* Format an entry in an average row.
* @param object $record with fields grade and numaveraged.
* @param stdClass $record with fields grade and numaveraged.
* @param bool $question true if this is a question score, false if it is an overall score.
* @return string HTML fragment for an average score (with number of things included in the average).
*/
@@ -257,7 +257,7 @@ class quiz_overview_table extends attempts_report_table {
/**
* @param string $colname the name of the column.
* @param object $attempt the row of data - see the SQL in display() in
* @param stdClass $attempt the row of data - see the SQL in display() in
* mod/quiz/report/overview/report.php to see what fields are present,
* and what they are called.
* @return string the contents of the cell.
+13 -13
View File
@@ -256,8 +256,8 @@ class quiz_overview_report extends attempts_report {
/**
* Extends parent function processing any submitted actions.
*
* @param object $quiz
* @param object $cm
* @param stdClass $quiz
* @param stdClass $cm
* @param int $currentgroup
* @param \core\dml\sql_join $groupstudentsjoins (joins, wheres, params)
* @param \core\dml\sql_join $allowedjoins (joins, wheres, params)
@@ -296,8 +296,8 @@ class quiz_overview_report extends attempts_report {
/**
* Check necessary capabilities, and start the display of the regrade progress page.
* @param object $quiz the quiz settings.
* @param object $cm the cm object for the quiz.
* @param stdClass $quiz the quiz settings.
* @param stdClass $cm the cm object for the quiz.
*/
protected function start_regrade($quiz, $cm) {
require_capability('mod/quiz:regrade', $this->context);
@@ -333,7 +333,7 @@ class quiz_overview_report extends attempts_report {
* Note, $attempt is not upgraded in the database. The caller needs to do that.
* However, $attempt->sumgrades is updated, if this is not a dry run.
*
* @param object $attempt the quiz attempt to regrade.
* @param stdClass $attempt the quiz attempt to regrade.
* @param bool $dryrun if true, do a pretend regrade, otherwise do it for real.
* @param array $slots if null, regrade all questions, otherwise, just regrade
* the questions with those slots.
@@ -452,7 +452,7 @@ class quiz_overview_report extends attempts_report {
/**
* Regrade attempts for this quiz, exactly which attempts are regraded is
* controlled by the parameters.
* @param object $quiz the quiz settings.
* @param stdClass $quiz the quiz settings.
* @param bool $dryrun if true, do a pretend regrade, otherwise do it for real.
* @param \core\dml\sql_join|array $groupstudentsjoins empty for all attempts, otherwise regrade attempts
* for these users.
@@ -495,7 +495,7 @@ class quiz_overview_report extends attempts_report {
/**
* Regrade those questions in those attempts that are marked as needing regrading
* in the quiz_overview_regrades table.
* @param object $quiz the quiz settings.
* @param stdClass $quiz the quiz settings.
* @param \core\dml\sql_join $groupstudentsjoins empty for all attempts, otherwise regrade attempts
* for these users.
*/
@@ -557,7 +557,7 @@ class quiz_overview_report extends attempts_report {
* In addition, if $attempt->regradeonlyslots is set, then only those slots
* are regraded, otherwise all slots are regraded.
*
* @param object $quiz the quiz settings.
* @param stdClass $quiz the quiz settings.
* @param array $attempts of data from the quiz_attempts table, with extra data as above.
* @param bool $dryrun if true, do a pretend regrade, otherwise do it for real.
* @param \core\dml\sql_join $groupstudentsjoins empty for all attempts, otherwise regrade attempts
@@ -605,7 +605,7 @@ class quiz_overview_report extends attempts_report {
/**
* Count the number of attempts in need of a regrade.
*
* @param object $quiz the quiz settings.
* @param stdClass $quiz the quiz settings.
* @param \core\dml\sql_join $groupstudentsjoins (joins, wheres, params) If this is given, only data relating
* to these users is cleared.
* @return int the number of attempts.
@@ -654,7 +654,7 @@ class quiz_overview_report extends attempts_report {
/**
* Remove all information about pending/complete regrades from the database.
* @param object $quiz the quiz settings.
* @param stdClass $quiz the quiz settings.
* @param \core\dml\sql_join $groupstudentsjoins (joins, wheres, params). If this is given, only data relating
* to these users is cleared.
*/
@@ -681,7 +681,7 @@ class quiz_overview_report extends attempts_report {
/**
* Update the final grades for all attempts. This method is used following
* a regrade.
* @param object $quiz the quiz settings.
* @param stdClass $quiz the quiz settings.
* @param array $userids only update scores for these userids.
* @param array $attemptids attemptids only update scores for these attempt ids.
*/
@@ -698,7 +698,7 @@ class quiz_overview_report extends attempts_report {
* a chart based on the maximum grade to be given on a quiz. The width of
* a band is the number of grade points it encapsulates.
*
* @param object $quiz The quiz object.
* @param stdClass $quiz The quiz object.
* @return array Contains the number of bands, and their width.
*/
public static function get_bands_count_and_width($quiz) {
@@ -725,7 +725,7 @@ class quiz_overview_report extends attempts_report {
*
* @param int $bands The number of bands.
* @param int $bandwidth The band width.
* @param object $quiz The quiz object.
* @param stdClass $quiz The quiz object.
* @return string[] The labels.
*/
public static function get_bands_labels($bands, $bandwidth, $quiz) {
+5 -5
View File
@@ -34,9 +34,9 @@ class testable_quiz_attempts_report extends attempts_report {
/**
* Override this function to displays the report.
* @param object $cm the course-module for this quiz.
* @param object $course the course we are in.
* @param object $quiz this quiz.
* @param stdClass $cm the course-module for this quiz.
* @param stdClass $course the course we are in.
* @param stdClass $quiz this quiz.
*/
public function display($cm, $course, $quiz) {
@@ -45,8 +45,8 @@ class testable_quiz_attempts_report extends attempts_report {
/**
* Testable delete_selected_attempts function.
*
* @param object $quiz
* @param object $cm
* @param stdClass $quiz
* @param stdClass $cm
* @param array $attemptids
* @param \core\dml\sql_join $allowedjoins
*/
+9 -9
View File
@@ -90,7 +90,7 @@ function quiz_has_questions($quizid) {
/**
* Get the slots of real questions (not descriptions) in this quiz, in order.
* @param object $quiz the quiz.
* @param stdClass $quiz the quiz.
* @return array of slot => objects with fields
* ->slot, ->id, ->qtype, ->length, ->number, ->maxmark, ->category (for random questions).
*/
@@ -125,7 +125,7 @@ function quiz_report_get_significant_questions($quiz) {
}
/**
* @param object $quiz the quiz settings.
* @param stdClass $quiz the quiz settings.
* @return bool whether, for this quiz, it is possible to filter attempts to show
* only those that gave the final grade.
*/
@@ -137,7 +137,7 @@ function quiz_report_can_filter_only_graded($quiz) {
* This is a wrapper for {@link quiz_report_grade_method_sql} that takes the whole quiz object instead of just the grading method
* as a param. See definition for {@link quiz_report_grade_method_sql} below.
*
* @param object $quiz
* @param stdClass $quiz
* @param string $quizattemptsalias sql alias for 'quiz_attempts' table
* @return string sql to test if this is an attempt that will contribute towards the grade of the user
*/
@@ -316,7 +316,7 @@ function quiz_report_feedback_for_grade($grade, $quizid, $context) {
/**
* Format a number as a percentage out of $quiz->sumgrades
* @param number $rawgrade the mark to format.
* @param object $quiz the quiz settings
* @param stdClass $quiz the quiz settings
* @param bool $round whether to round the results ot $quiz->decimalpoints.
*/
function quiz_report_scale_summarks_as_percentage($rawmark, $quiz, $round = true) {
@@ -390,7 +390,7 @@ function quiz_report_download_filename($report, $courseshortname, $quizname) {
/**
* Get the default report for the current user.
* @param object $context the quiz context.
* @param stdClass $context the quiz context.
*/
function quiz_report_default_report($context) {
$reports = quiz_report_list($context);
@@ -400,9 +400,9 @@ function quiz_report_default_report($context) {
/**
* Generate a message saying that this quiz has no questions, with a button to
* go to the edit page, if the user has the right capability.
* @param object $quiz the quiz settings.
* @param object $cm the course_module object.
* @param object $context the quiz context.
* @param stdClass $quiz the quiz settings.
* @param stdClass $cm the course_module object.
* @param stdClass $context the quiz context.
* @return string HTML to output.
*/
function quiz_no_questions_message($quiz, $cm, $context) {
@@ -421,7 +421,7 @@ function quiz_no_questions_message($quiz, $cm, $context) {
/**
* Should the grades be displayed in this report. That depends on the quiz
* display options, and whether the quiz is graded.
* @param object $quiz the quiz settings.
* @param stdClass $quiz the quiz settings.
* @param context $context the quiz context.
* @return bool
*/
@@ -114,7 +114,7 @@ class quiz_first_or_all_responses_table extends quiz_last_responses_table {
/**
* Find the state for $slot given after this try.
*
* @param object $tablerow row data
* @param stdClass $tablerow row data
* @param int $slot Slot number.
* @return question_state The question state after the attempt.
*/
@@ -137,7 +137,7 @@ class quiz_first_or_all_responses_table extends quiz_last_responses_table {
/**
* Get the summary of the response after the try.
*
* @param object $tablerow row data
* @param stdClass $tablerow row data
* @param int $slot Slot number.
* @return string summary for the question after this try.
*/
@@ -170,7 +170,7 @@ class quiz_first_or_all_responses_table extends quiz_last_responses_table {
/**
* The grade for this slot after this try.
*
* @param object $tablerow attempt data from db.
* @param stdClass $tablerow attempt data from db.
* @param int $slot Slot number.
* @return float The fraction.
*/
@@ -192,7 +192,7 @@ class quiz_first_or_all_responses_table extends quiz_last_responses_table {
/**
* Is this the last try in the question attempt?
*
* @param object $tablerow attempt data from db.
* @param stdClass $tablerow attempt data from db.
* @param int $slot Slot number
* @param int $tryno try no
* @return bool Is it the last try?
@@ -204,7 +204,7 @@ class quiz_first_or_all_responses_table extends quiz_last_responses_table {
/**
* How many tries were attempted at this question in this slot, during this usage?
*
* @param object $tablerow attempt data from db.
* @param stdClass $tablerow attempt data from db.
* @param int $slot Slot number
* @return int the number of tries in the question attempt for slot $slot.
*/
@@ -237,7 +237,7 @@ class quiz_first_or_all_responses_table extends quiz_last_responses_table {
/**
* Cell value function for email column. This extracts the contents for any cell in the email column from the row data.
*
* @param object $tablerow Row data.
* @param stdClass $tablerow Row data.
* @return string What to put in the cell for this column, for this row data.
*/
public function col_email($tablerow) {
@@ -251,7 +251,7 @@ class quiz_first_or_all_responses_table extends quiz_last_responses_table {
/**
* Cell value function for sumgrades column. This extracts the contents for any cell in the sumgrades column from the row data.
*
* @param object $tablerow Row data.
* @param stdClass $tablerow Row data.
* @return string What to put in the cell for this column, for this row data.
*/
public function col_sumgrades($tablerow) {
@@ -27,7 +27,7 @@ class quiz_last_responses_table extends attempts_report_table {
/**
* Constructor
* @param object $quiz
* @param stdClass $quiz
* @param context $context
* @param string $qmsubselect
* @param quiz_responses_options $options
@@ -94,7 +94,7 @@ class quiz_last_responses_table extends attempts_report_table {
/**
* Column text from the extra data loaded in load_extra_data(), before html formatting etc.
*
* @param object $attempt
* @param stdClass $attempt
* @param int $slot
* @param string $field
* @return string
@@ -265,7 +265,7 @@ class calculator {
* @param $fromqa
* @param $whereqa
* @param $qaparams
* @return object with properties power2, power3, power4
* @return stdClass with properties power2, power3, power4
*/
protected function sum_of_powers_of_difference_to_mean($mean, $fromqa, $whereqa, $qaparams) {
global $DB;
+8 -8
View File
@@ -284,7 +284,7 @@ class quiz_statistics_report extends report_base {
* Display the statistical and introductory information about a question.
* Only called when not downloading.
*
* @param object $quiz the quiz settings.
* @param stdClass $quiz the quiz settings.
* @param \core_question\statistics\questions\calculated $questionstat the question to report on.
*/
protected function output_individual_question_data($quiz, $questionstat) {
@@ -353,7 +353,7 @@ class quiz_statistics_report extends report_base {
/**
* Output question text in a box with urls appropriate for a preview of the question.
*
* @param object $question question data.
* @param stdClass $question question data.
* @return string HTML of question text, ready for display.
*/
protected function render_question_text($question) {
@@ -371,7 +371,7 @@ class quiz_statistics_report extends report_base {
/**
* Display the response analysis for a question.
*
* @param object $question the question to report on.
* @param stdClass $question the question to report on.
* @param int|null $variantno the variant
* @param int $s
* @param moodle_url $reporturl the URL to redisplay this report.
@@ -617,7 +617,7 @@ class quiz_statistics_report extends report_base {
* Get the quiz and question statistics, either by loading the cached results,
* or by recomputing them.
*
* @param object $quiz the quiz settings.
* @param stdClass $quiz the quiz settings.
* @param string $whichattempts which attempts to use, represented internally as one of the constants as used in
* $quiz->grademethod ie.
* QUIZ_GRADEAVERAGE, QUIZ_GRADEHIGHEST, QUIZ_ATTEMPTLAST or QUIZ_ATTEMPTFIRST
@@ -694,8 +694,8 @@ class quiz_statistics_report extends report_base {
/**
* Analyse responses for all questions and sub questions in this quiz.
*
* @param object[] $questions as returned by self::load_and_initialise_questions_for_calculations
* @param object[] $subquestions full question objects.
* @param stdClass[] $questions as returned by self::load_and_initialise_questions_for_calculations
* @param stdClass[] $subquestions full question objects.
* @param qubaid_condition $qubaids the question usages whose responses to analyse.
* @param string $whichtries which tries to analyse \question_attempt::FIRST_TRY, LAST_TRY or ALL_TRIES.
* @param null|\core\progress\base $progress Used to indicate progress of task.
@@ -720,7 +720,7 @@ class quiz_statistics_report extends report_base {
/**
* Analyse responses for an array of questions or sub questions.
*
* @param object[] $questions as returned by self::load_and_initialise_questions_for_calculations.
* @param stdClass[] $questions as returned by self::load_and_initialise_questions_for_calculations.
* @param qubaid_condition $qubaids the question usages whose responses to analyse.
* @param string $whichtries which tries to analyse \question_attempt::FIRST_TRY, LAST_TRY or ALL_TRIES.
* @param null|\core\progress\base $progress Used to indicate progress of task.
@@ -829,7 +829,7 @@ class quiz_statistics_report extends report_base {
/**
* Load the questions in this quiz and add some properties to the objects needed in the reports.
*
* @param object $quiz the quiz.
* @param stdClass $quiz the quiz.
* @return array of questions for this quiz.
*/
public function load_and_initialise_questions_for_calculations($quiz) {
@@ -40,7 +40,7 @@ require_once($CFG->libdir . '/tablelib.php');
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class quiz_statistics_question_table extends flexible_table {
/** @var object full question object for this question. */
/** @var stdClass full question object for this question. */
protected $questiondata;
/** @var int no of attempts. */
@@ -60,7 +60,7 @@ class quiz_statistics_question_table extends flexible_table {
* Set up columns and column names and other table settings.
*
* @param moodle_url $reporturl
* @param object $questiondata
* @param stdClass $questiondata
* @param integer $s number of attempts on this question.
* @param \core_question\statistics\responses\analysis_for_question $responseanalysis
*/
@@ -138,7 +138,7 @@ class quiz_statistics_question_table extends flexible_table {
/**
* The mark fraction that this response earns.
* @param object $response containst the data to display.
* @param stdClass $response containst the data to display.
* @return string contents of this table cell.
*/
protected function col_fraction($response) {
@@ -151,7 +151,7 @@ class quiz_statistics_question_table extends flexible_table {
/**
* The frequency with which this response was given.
* @param object $response contains the data to display.
* @param stdClass $response contains the data to display.
* @return string contents of this table cell.
*/
protected function col_frequency($response) {
@@ -167,7 +167,7 @@ class quiz_statistics_question_table extends flexible_table {
* then this is the output for this cell of the table.
*
* @param string $colname The name of this column.
* @param object $response The raw data for this row.
* @param stdClass $response The raw data for this row.
* @return string|null The value for this cell of the table or null means use raw data.
*/
public function other_cols($colname, $response) {
@@ -38,7 +38,7 @@ use \core_question\statistics\questions\calculated_question_summary;
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class quiz_statistics_table extends flexible_table {
/** @var object the quiz settings. */
/** @var stdClass the quiz settings. */
protected $quiz;
/** @var integer the quiz course_module id. */
@@ -55,7 +55,7 @@ class quiz_statistics_table extends flexible_table {
* Set up the columns and headers and other properties of the table and then
* call flexible_table::setup() method.
*
* @param object $quiz the quiz settings
* @param stdClass $quiz the quiz settings
* @param int $cmid the quiz course_module id
* @param moodle_url $reporturl the URL to redisplay this report.
* @param int $s number of attempts included in the statistics.
@@ -53,7 +53,7 @@ class testable_all_calculated_for_qubaid_condition extends \core_question\statis
class testable_question_statistics extends \core_question\statistics\questions\calculator {
/**
* @var object[]
* @var stdClass[]
*/
protected $lateststeps;
+3 -3
View File
@@ -462,9 +462,9 @@ class custom_completion_test extends advanced_testcase {
/**
* Set up moduleinfo object sample data for quiz instance.
*
* @param object $cm course-module instance
* @param object $quiz quiz instance data.
* @param object $course Course related data.
* @param stdClass $cm course-module instance
* @param stdClass $quiz quiz instance data.
* @param stdClass $course Course related data.
* @param int $gradepass Grade to pass and completed completion.
* @param string $grademethod grade attempt method.
* @return \stdClass