diff --git a/mod/assign/externallib.php b/mod/assign/externallib.php index 18531bdba5e..4a679d9f1a4 100644 --- a/mod/assign/externallib.php +++ b/mod/assign/externallib.php @@ -29,6 +29,8 @@ require_once("$CFG->libdir/externallib.php"); /** * Assign functions + * @copyright 2012 Paul Charsley + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class mod_assign_external extends external_api { @@ -36,7 +38,7 @@ class mod_assign_external extends external_api { * Generate a warning in a standard structure for a known failure. * * @param int $assignmentid - The assignment - * @param string $warningcode - The key for the warning message (@see $warningmessages) + * @param string $warningcode - The key for the warning message * @param string $detail - A description of the error * @return array - Warning structure containing item, itemid, warningcode, message */ @@ -85,7 +87,7 @@ class mod_assign_external extends external_api { /** * Returns grade information from assign_grades for the requested assignment ids - * @param array of ints $assignmentids + * @param int[] $assignmentids * @param int $since only return records with timemodified >= since * @return array of grade records for each requested assignment * @since Moodle 2.4 @@ -507,7 +509,7 @@ class mod_assign_external extends external_api { /** * Returns submissions for the requested assignment ids * - * @param array of ints $assignmentids + * @param int[] $assignmentids * @param string $status only return submissions with this status * @param int $since only return submissions with timemodified >= since * @param int $before only return submissions with timemodified <= before @@ -752,7 +754,7 @@ class mod_assign_external extends external_api { /** * Returns user flag information from assign_user_flags for the requested assignment ids - * @param array of ints $assignmentids + * @param int[] $assignmentids * @return array of user flag records for each requested assignment * @since Moodle 2.6 */ @@ -906,7 +908,7 @@ class mod_assign_external extends external_api { /** * Returns user mapping information from assign_user_mapping for the requested assignment ids - * @param array of ints $assignmentids + * @param int[] $assignmentids * @return array of user mapping records for each requested assignment * @since Moodle 2.6 */ @@ -1438,10 +1440,11 @@ class mod_assign_external extends external_api { } /** - * Save a student submission for a single assignment. + * Save a student submission for a single assignment * * @param int $assignmentid The id of the assignment - * @return array of warnings to indicate any errors. + * @param array $plugindata - The submitted data for plugins + * @return array of warnings to indicate any errors * @since Moodle 2.6 */ public static function save_submission($assignmentid, $plugindata) { @@ -1525,6 +1528,13 @@ class mod_assign_external extends external_api { * Save a student grade for a single assignment. * * @param int $assignmentid The id of the assignment + * @param int $userid The id of the user + * @param float $grade The grade + * @param int $attemptnumber The attempt number + * @param bool $addattempt Allow another attempt + * @param string $workflowstate New workflow state + * @param bool $applytoall Apply the grade to all members of the group + * @param array $plugindata Custom data used by plugins * @return null * @since Moodle 2.6 */ @@ -1593,6 +1603,7 @@ class mod_assign_external extends external_api { /** * Copy a students previous attempt to a new attempt. * + * @param int $assignmentid * @return array of warnings to indicate any errors. * @since Moodle 2.6 */ diff --git a/mod/assign/feedback/comments/backup/moodle2/restore_assignfeedback_comments_subplugin.class.php b/mod/assign/feedback/comments/backup/moodle2/restore_assignfeedback_comments_subplugin.class.php index 1efd24e79a8..9b95aed42d6 100644 --- a/mod/assign/feedback/comments/backup/moodle2/restore_assignfeedback_comments_subplugin.class.php +++ b/mod/assign/feedback/comments/backup/moodle2/restore_assignfeedback_comments_subplugin.class.php @@ -15,7 +15,9 @@ // along with Moodle. If not, see . /** - * Restore subplugin class that provides the necessary information needed to restore + * Restore subplugin class. + * + * Provides the necessary information needed to restore * one assign_submission subplugin. * * @package assignfeedback_comments @@ -26,7 +28,9 @@ defined('MOODLE_INTERNAL') || die(); /** - * Restore subplugin class that provides the necessary information needed to restore + * Restore subplugin class. + * + * Provides the necessary information needed to restore * one assignfeedback subplugin. * * @package assignfeedback_comments diff --git a/mod/assign/feedback/comments/settings.php b/mod/assign/feedback/comments/settings.php index f85cd5ad42e..f8d45ae927b 100644 --- a/mod/assign/feedback/comments/settings.php +++ b/mod/assign/feedback/comments/settings.php @@ -17,7 +17,7 @@ /** * This file defines the admin settings for this plugin * - * @package assignsubmission_comments + * @package assignfeedback_comments * @copyright 2012 NetSpot {@link http://www.netspot.com.au} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/mod/assign/feedback/file/backup/moodle2/restore_assignfeedback_file_subplugin.class.php b/mod/assign/feedback/file/backup/moodle2/restore_assignfeedback_file_subplugin.class.php index df258d3cccb..a408afd548a 100644 --- a/mod/assign/feedback/file/backup/moodle2/restore_assignfeedback_file_subplugin.class.php +++ b/mod/assign/feedback/file/backup/moodle2/restore_assignfeedback_file_subplugin.class.php @@ -24,7 +24,9 @@ defined('MOODLE_INTERNAL') || die(); /** - * Restore subplugin class that provides the necessary information needed + * Restore subplugin class. + * + * Provides the necessary information needed * to restore one assign_feedback subplugin. * * @package assignfeedback_file diff --git a/mod/assign/feedback/file/locallib.php b/mod/assign/feedback/file/locallib.php index b4db0ae1c28..7b64583ac8e 100644 --- a/mod/assign/feedback/file/locallib.php +++ b/mod/assign/feedback/file/locallib.php @@ -36,7 +36,7 @@ define('ASSIGNFEEDBACK_FILE_MAXFILEUNZIPTIME', 120); /** * Library class for file feedback plugin extending feedback plugin base class. * - * @package asignfeedback_file + * @package assignfeedback_file * @copyright 2012 NetSpot {@link http://www.netspot.com.au} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/mod/assign/feedback/file/settings.php b/mod/assign/feedback/file/settings.php index 0719b0bbe70..ead9c885c87 100644 --- a/mod/assign/feedback/file/settings.php +++ b/mod/assign/feedback/file/settings.php @@ -17,7 +17,7 @@ /** * This file defines the admin settings for this plugin * - * @package assignsubmission_onlinetext + * @package assignfeedback_file * @copyright 2012 NetSpot {@link http://www.netspot.com.au} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/mod/assign/gradingtable.php b/mod/assign/gradingtable.php index 4b795fe20e7..d7c7e276cb8 100644 --- a/mod/assign/gradingtable.php +++ b/mod/assign/gradingtable.php @@ -71,6 +71,7 @@ class assign_grading_table extends table_sql implements renderable { * @param string $filter The current filter * @param int $rowoffset For showing a subsequent page of results * @param bool $quickgrading Is this table wrapped in a quickgrading form? + * @param string $downloadfilename */ public function __construct(assign $assignment, $perpage, @@ -435,6 +436,7 @@ class assign_grading_table extends table_sql implements renderable { /** * Add a column with an ID that uniquely identifies this user in this assignment. * + * @param stdClass $row * @return string */ public function col_recordid(stdClass $row) { @@ -621,8 +623,8 @@ class assign_grading_table extends table_sql implements renderable { * Use a static cache to try and reduce DB calls. * * @param int $userid The user id for this submission - * @param int $groupid The groupid (returned) - * @param mixed $submission The stdClass submission or false (returned) + * @param int $group The groupid (returned) + * @param stdClass|false $submission The stdClass submission or false (returned) * @param int $attemptnumber Return a specific attempt number (-1 for latest) */ protected function get_group_and_submission($userid, &$group, &$submission, $attemptnumber) { diff --git a/mod/assign/lib.php b/mod/assign/lib.php index 65e5cc254a4..99bd42569a8 100644 --- a/mod/assign/lib.php +++ b/mod/assign/lib.php @@ -16,6 +16,7 @@ /** * This file contains the moodle hooks for the assign module. + * * It delegates most functions to the assignment class. * * @package mod_assign @@ -59,8 +60,9 @@ function assign_delete_instance($id) { * This function is used by the reset_course_userdata function in moodlelib. * This function will remove all assignment submissions and feedbacks in the database * and clean up any related data. - * @param $data the data submitted from the reset course. - * @return array status array + * + * @param stdClass $data the data submitted from the reset course. + * @return array */ function assign_reset_userdata($data) { global $CFG, $DB; @@ -109,7 +111,7 @@ function assign_reset_gradebook($courseid, $type='') { /** * Implementation of the function for printing the form elements that control * whether the course reset functionality affects the assignment. - * @param $mform form passed by reference + * @param moodleform $mform form passed by reference */ function assign_reset_course_form_definition(&$mform) { $mform->addElement('header', 'assignheader', get_string('modulenameplural', 'assign')); @@ -131,7 +133,7 @@ function assign_reset_course_form_defaults($course) { * * This is done by calling the update_instance() method of the assignment type class * @param stdClass $data - * @param $form + * @param stdClass $form - unused * @return object */ function assign_update_instance(stdClass $data, $form) { diff --git a/mod/assign/locallib.php b/mod/assign/locallib.php index 30bd6dcf043..5ef2ccdea0c 100644 --- a/mod/assign/locallib.php +++ b/mod/assign/locallib.php @@ -674,7 +674,7 @@ class assign { * Actual implementation of the reset course functionality, delete all the * assignment submissions for course $data->courseid. * - * @param $data the data submitted from the reset course. + * @param stdClass $data the data submitted from the reset course. * @return array status array */ public function reset_userdata($data) { @@ -2142,6 +2142,7 @@ class assign { /** * Rewrite plugin file urls so they resolve correctly in an exported zip. * + * @param string $text - The replacement text * @param stdClass $user - The user record * @param assign_plugin $plugin - The assignment plugin */ @@ -2231,6 +2232,7 @@ class assign { /** * Display a continue page. * + * @param string $message - The message to display * @return string */ protected function view_savegrading_result($message) { @@ -3237,6 +3239,7 @@ class assign { /** * Allows the plugin to show a batch grading operation page. * + * @param moodleform $mform * @return none */ protected function view_plugin_grading_batch_operation($mform) { @@ -3453,7 +3456,7 @@ class assign { /** * Ask the user to confirm they want to submit their work for grading. * - * @param $mform moodleform - null unless form validation has failed + * @param moodleform $mform - null unless form validation has failed * @return string */ protected function check_submit_for_grading($mform) { @@ -4242,7 +4245,6 @@ class assign { * @param string $modulename * @param stdClass $coursemodule * @param string $assignmentname - * @param stdClass $info */ protected static function format_notification_message_html($messagetype, $info, @@ -4282,6 +4284,8 @@ class assign { * @param stdClass $course * @param string $modulename * @param string $assignmentname + * @param bool $blindmarking + * @param int $uniqueidforuser * @return void */ public static function send_assignment_notification($userfrom, @@ -4531,7 +4535,7 @@ class assign { /** * Assignment submission is processed before grading. * - * @param $mform If validation failed when submitting this form - this is the moodleform. + * @param moodleform|null $mform If validation failed when submitting this form - this is the moodleform. * It can be null. * @return bool Return false if the validation fails. This affects which page is displayed next. */ @@ -5364,6 +5368,7 @@ class assign { * This is specific to the assignment, marker and student. * * @param int $userid - The student userid + * @param stdClass|false $grade - The grade record * @param bool $gradingdisabled * @return mixed gradingform_instance|null $gradinginstance */ @@ -6064,7 +6069,7 @@ class assign { * * @param stdClass $formdata - the data from the form * @param int $userid - the user to apply the grade to - * @param int attemptnumber - The attempt number to apply the grade to. + * @param int $attemptnumber - The attempt number to apply the grade to. * @return void */ protected function apply_grade_to_user($formdata, $userid, $attemptnumber) { @@ -6175,7 +6180,6 @@ class assign { * * @param int $userid * @param stdClass $data - * @param int $attemptnumber - -1 means latest attempt * @return bool - was the grade saved */ public function save_grade($userid, $data) { @@ -6602,6 +6606,7 @@ class assign { /** * Lookup this user id and return the unique id for this assignment. * + * @param int $assignid The assignment id * @param int $userid The userid to lookup * @return int The unique id */ diff --git a/mod/assign/mod_form.php b/mod/assign/mod_form.php index edfe6ebe1e7..1cd183ca0a0 100644 --- a/mod/assign/mod_form.php +++ b/mod/assign/mod_form.php @@ -265,6 +265,11 @@ class mod_assign_mod_form extends moodleform_mod { $assignment->plugin_data_preprocessing($defaultvalues); } + /** + * Add any custom completion rules to the form. + * + * @return array Contains the names of the added form elements + */ public function add_completion_rules() { $mform =& $this->_form; @@ -272,6 +277,12 @@ class mod_assign_mod_form extends moodleform_mod { return array('completionsubmit'); } + /** + * Determines if completion is enabled for this module. + * + * @param array $data + * @return bool + */ public function completion_rule_enabled($data) { return !empty($data['completionsubmit']); } diff --git a/mod/assign/renderable.php b/mod/assign/renderable.php index 5e40398be74..6b033237676 100644 --- a/mod/assign/renderable.php +++ b/mod/assign/renderable.php @@ -42,6 +42,7 @@ class assign_submit_for_grading_page implements renderable { * Constructor * @param string $notifications - Any mesages to display * @param int $coursemoduleid + * @param moodleform $confirmform */ public function __construct($notifications, $coursemoduleid, $confirmform) { $this->notifications = $notifications; @@ -69,6 +70,7 @@ class assign_gradingmessage implements renderable { * Constructor * @param string $heading This is the heading to display * @param string $message This is the message to display + * @param int $coursemoduleid */ public function __construct($heading, $message, $coursemoduleid) { $this->heading = $heading; @@ -404,6 +406,7 @@ class assign_submission_status implements renderable { * @param int $extensionduedate - Any extension to the due date granted for this user * @param context $context - Any extension to the due date granted for this user * @param bool $blindmarking - Should we hide student identities from graders? + * @param string $gradingcontrollerpreview * @param string $attemptreopenmethod - The method of reopening student attempts. * @param int $maxattempts - How many attempts can a student make? */ @@ -493,14 +496,14 @@ class assign_attempt_history implements renderable { /** * Constructor * - * @param $submissions - * @param $grades - * @param $submissionplugins - * @param $feedbackplugins - * @param $coursemoduleid - * @param $returnaction - * @param $returnparams - * @param $cangrade + * @param array $submissions + * @param array $grades + * @param array $submissionplugins + * @param array $feedbackplugins + * @param int $coursemoduleid + * @param string $returnaction + * @param array $returnparams + * @param bool $cangrade */ public function __construct($submissions, $grades, @@ -648,8 +651,8 @@ class assign_course_index_summary implements renderable { /** * constructor * - * @param $usesections boolean - True if this course format uses sections - * @param $courseformatname string - The id of this course format + * @param boolean $usesections - True if this course format uses sections + * @param string $courseformatname - The id of this course format */ public function __construct($usesections, $courseformatname) { $this->usesections = $usesections; diff --git a/mod/assign/submission/file/backup/moodle2/restore_assignsubmission_file_subplugin.class.php b/mod/assign/submission/file/backup/moodle2/restore_assignsubmission_file_subplugin.class.php index 8f575e538a3..2447270a7c5 100644 --- a/mod/assign/submission/file/backup/moodle2/restore_assignsubmission_file_subplugin.class.php +++ b/mod/assign/submission/file/backup/moodle2/restore_assignsubmission_file_subplugin.class.php @@ -23,7 +23,9 @@ */ /** - * restore subplugin class that provides the necessary information + * Restore subplugin class. + * + * Provides the necessary information * needed to restore one assign_submission subplugin. * * @package assignsubmission_file diff --git a/mod/assign/submission/file/locallib.php b/mod/assign/submission/file/locallib.php index 7b8facb37e2..a2c2c8be819 100644 --- a/mod/assign/submission/file/locallib.php +++ b/mod/assign/submission/file/locallib.php @@ -249,6 +249,7 @@ class assign_submission_file extends assign_submission_plugin { * Produce a list of files suitable for export that represent this feedback or submission * * @param stdClass $submission The submission + * @param stdClass $user The user record - unused * @return array - return an array of files indexed by filename */ public function get_files(stdClass $submission, stdClass $user) { diff --git a/mod/assign/submission/onlinetext/backup/moodle2/restore_assignsubmission_onlinetext_subplugin.class.php b/mod/assign/submission/onlinetext/backup/moodle2/restore_assignsubmission_onlinetext_subplugin.class.php index bfa234289c6..ac975860f55 100644 --- a/mod/assign/submission/onlinetext/backup/moodle2/restore_assignsubmission_onlinetext_subplugin.class.php +++ b/mod/assign/submission/onlinetext/backup/moodle2/restore_assignsubmission_onlinetext_subplugin.class.php @@ -23,7 +23,9 @@ */ /** - * restore subplugin class that provides the necessary information needed to restore + * Restore subplugin class. + * + * Provides the necessary information needed to restore * one assign_submission subplugin. * * @package assignsubmission_onlinetext diff --git a/mod/assign/submissionplugin.php b/mod/assign/submissionplugin.php index 120f9b73f63..70388cb40f9 100644 --- a/mod/assign/submissionplugin.php +++ b/mod/assign/submissionplugin.php @@ -79,13 +79,15 @@ abstract class assign_submission_plugin extends assign_plugin { /** * Copy the plugin specific submission data to a new submission record. * + * @param stdClass $oldsubmission - Old submission record + * @param stdClass $submission - New submission record * @return bool */ public function copy_submission( stdClass $oldsubmission, stdClass $submission) { return true; } - /* + /** * Carry out any extra processing required when the work is locked. * * @param stdClass|false $submission - assign_submission data if any @@ -98,7 +100,7 @@ abstract class assign_submission_plugin extends assign_plugin { /** * Carry out any extra processing required when the work is unlocked. * - * @param stdClass $submission|false - assign_submission data if any + * @param stdClass|false $submission - assign_submission data if any * @param stdClass $flags - User flags record * @return void */