id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
215,000 | moodle/moodle | mod/assign/locallib.php | assign.get_all_submissions | public function get_all_submissions($userid) {
global $DB, $USER;
// If the userid is not null then use userid.
if (!$userid) {
$userid = $USER->id;
}
$params = array();
if ($this->get_instance()->teamsubmission) {
$groupid = 0;
$gro... | php | public function get_all_submissions($userid) {
global $DB, $USER;
// If the userid is not null then use userid.
if (!$userid) {
$userid = $USER->id;
}
$params = array();
if ($this->get_instance()->teamsubmission) {
$groupid = 0;
$gro... | [
"public",
"function",
"get_all_submissions",
"(",
"$",
"userid",
")",
"{",
"global",
"$",
"DB",
",",
"$",
"USER",
";",
"// If the userid is not null then use userid.",
"if",
"(",
"!",
"$",
"userid",
")",
"{",
"$",
"userid",
"=",
"$",
"USER",
"->",
"id",
";... | Get the submissions for all previous attempts.
@param int $userid If not set, $USER->id will be used.
@return array $submissions All submission records for this user (or group). | [
"Get",
"the",
"submissions",
"for",
"all",
"previous",
"attempts",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L5484-L5512 |
215,001 | moodle/moodle | mod/assign/locallib.php | assign.get_assign_grading_summary_renderable | public function get_assign_grading_summary_renderable($activitygroup = null) {
$instance = $this->get_instance();
$cm = $this->get_course_module();
$draft = ASSIGN_SUBMISSION_STATUS_DRAFT;
$submitted = ASSIGN_SUBMISSION_STATUS_SUBMITTED;
$isvisible = $cm->visible;
if (... | php | public function get_assign_grading_summary_renderable($activitygroup = null) {
$instance = $this->get_instance();
$cm = $this->get_course_module();
$draft = ASSIGN_SUBMISSION_STATUS_DRAFT;
$submitted = ASSIGN_SUBMISSION_STATUS_SUBMITTED;
$isvisible = $cm->visible;
if (... | [
"public",
"function",
"get_assign_grading_summary_renderable",
"(",
"$",
"activitygroup",
"=",
"null",
")",
"{",
"$",
"instance",
"=",
"$",
"this",
"->",
"get_instance",
"(",
")",
";",
"$",
"cm",
"=",
"$",
"this",
"->",
"get_course_module",
"(",
")",
";",
... | Creates an assign_grading_summary renderable.
@param mixed $activitygroup int|null the group for calculating the grading summary (if null the function will determine it)
@return assign_grading_summary renderable object | [
"Creates",
"an",
"assign_grading_summary",
"renderable",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L5520-L5569 |
215,002 | moodle/moodle | mod/assign/locallib.php | assign.convert_submission_for_gradebook | protected function convert_submission_for_gradebook(stdClass $submission) {
$gradebookgrade = array();
$gradebookgrade['userid'] = $submission->userid;
$gradebookgrade['usermodified'] = $submission->userid;
$gradebookgrade['datesubmitted'] = $submission->timemodified;
return $g... | php | protected function convert_submission_for_gradebook(stdClass $submission) {
$gradebookgrade = array();
$gradebookgrade['userid'] = $submission->userid;
$gradebookgrade['usermodified'] = $submission->userid;
$gradebookgrade['datesubmitted'] = $submission->timemodified;
return $g... | [
"protected",
"function",
"convert_submission_for_gradebook",
"(",
"stdClass",
"$",
"submission",
")",
"{",
"$",
"gradebookgrade",
"=",
"array",
"(",
")",
";",
"$",
"gradebookgrade",
"[",
"'userid'",
"]",
"=",
"$",
"submission",
"->",
"userid",
";",
"$",
"grade... | Convert submission details for the gradebook.
@param stdClass $submission
@return array | [
"Convert",
"submission",
"details",
"for",
"the",
"gradebook",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L5663-L5671 |
215,003 | moodle/moodle | mod/assign/locallib.php | assign.gradebook_item_update | protected function gradebook_item_update($submission=null, $grade=null) {
global $CFG;
require_once($CFG->dirroot.'/mod/assign/lib.php');
// Do not push grade to gradebook if blind marking is active as
// the gradebook would reveal the students.
if ($this->is_blind_marking()) {
... | php | protected function gradebook_item_update($submission=null, $grade=null) {
global $CFG;
require_once($CFG->dirroot.'/mod/assign/lib.php');
// Do not push grade to gradebook if blind marking is active as
// the gradebook would reveal the students.
if ($this->is_blind_marking()) {
... | [
"protected",
"function",
"gradebook_item_update",
"(",
"$",
"submission",
"=",
"null",
",",
"$",
"grade",
"=",
"null",
")",
"{",
"global",
"$",
"CFG",
";",
"require_once",
"(",
"$",
"CFG",
"->",
"dirroot",
".",
"'/mod/assign/lib.php'",
")",
";",
"// Do not p... | Update grades in the gradebook.
@param mixed $submission stdClass|null
@param mixed $grade stdClass|null
@return bool | [
"Update",
"grades",
"in",
"the",
"gradebook",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L5680-L5727 |
215,004 | moodle/moodle | mod/assign/locallib.php | assign.update_team_submission | protected function update_team_submission(stdClass $submission, $userid, $updatetime) {
global $DB;
if ($updatetime) {
$submission->timemodified = time();
}
// First update the submission for the current user.
$mysubmission = $this->get_user_submission($userid, true... | php | protected function update_team_submission(stdClass $submission, $userid, $updatetime) {
global $DB;
if ($updatetime) {
$submission->timemodified = time();
}
// First update the submission for the current user.
$mysubmission = $this->get_user_submission($userid, true... | [
"protected",
"function",
"update_team_submission",
"(",
"stdClass",
"$",
"submission",
",",
"$",
"userid",
",",
"$",
"updatetime",
")",
"{",
"global",
"$",
"DB",
";",
"if",
"(",
"$",
"updatetime",
")",
"{",
"$",
"submission",
"->",
"timemodified",
"=",
"ti... | Update team submission.
@param stdClass $submission
@param int $userid
@param bool $updatetime
@return bool | [
"Update",
"team",
"submission",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L5737-L5798 |
215,005 | moodle/moodle | mod/assign/locallib.php | assign.update_submission | protected function update_submission(stdClass $submission, $userid, $updatetime, $teamsubmission) {
global $DB;
if ($teamsubmission) {
return $this->update_team_submission($submission, $userid, $updatetime);
}
if ($updatetime) {
$submission->timemodified = time(... | php | protected function update_submission(stdClass $submission, $userid, $updatetime, $teamsubmission) {
global $DB;
if ($teamsubmission) {
return $this->update_team_submission($submission, $userid, $updatetime);
}
if ($updatetime) {
$submission->timemodified = time(... | [
"protected",
"function",
"update_submission",
"(",
"stdClass",
"$",
"submission",
",",
"$",
"userid",
",",
"$",
"updatetime",
",",
"$",
"teamsubmission",
")",
"{",
"global",
"$",
"DB",
";",
"if",
"(",
"$",
"teamsubmission",
")",
"{",
"return",
"$",
"this",... | Update grades in the gradebook based on submission time.
@param stdClass $submission
@param int $userid
@param bool $updatetime
@param bool $teamsubmission
@return bool | [
"Update",
"grades",
"in",
"the",
"gradebook",
"based",
"on",
"submission",
"time",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L5809-L5824 |
215,006 | moodle/moodle | mod/assign/locallib.php | assign.submissions_open | public function submissions_open($userid = 0,
$skipenrolled = false,
$submission = false,
$flags = false,
$gradinginfo = false) {
global $USER;
if (!$useri... | php | public function submissions_open($userid = 0,
$skipenrolled = false,
$submission = false,
$flags = false,
$gradinginfo = false) {
global $USER;
if (!$useri... | [
"public",
"function",
"submissions_open",
"(",
"$",
"userid",
"=",
"0",
",",
"$",
"skipenrolled",
"=",
"false",
",",
"$",
"submission",
"=",
"false",
",",
"$",
"flags",
"=",
"false",
",",
"$",
"gradinginfo",
"=",
"false",
")",
"{",
"global",
"$",
"USER... | Is this assignment open for submissions?
Check the due date,
prevent late submissions,
has this person already submitted,
is the assignment locked?
@param int $userid - Optional userid so we can see if a different user can submit
@param bool $skipenrolled - Skip enrollment checks (because they have been done already)... | [
"Is",
"this",
"assignment",
"open",
"for",
"submissions?"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L5841-L5921 |
215,007 | moodle/moodle | mod/assign/locallib.php | assign.render_area_files | public function render_area_files($component, $area, $submissionid) {
global $USER;
return $this->get_renderer()->assign_files($this->context, $submissionid, $area, $component);
} | php | public function render_area_files($component, $area, $submissionid) {
global $USER;
return $this->get_renderer()->assign_files($this->context, $submissionid, $area, $component);
} | [
"public",
"function",
"render_area_files",
"(",
"$",
"component",
",",
"$",
"area",
",",
"$",
"submissionid",
")",
"{",
"global",
"$",
"USER",
";",
"return",
"$",
"this",
"->",
"get_renderer",
"(",
")",
"->",
"assign_files",
"(",
"$",
"this",
"->",
"cont... | Render the files in file area.
@param string $component
@param string $area
@param int $submissionid
@return string | [
"Render",
"the",
"files",
"in",
"file",
"area",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L5931-L5936 |
215,008 | moodle/moodle | mod/assign/locallib.php | assign.can_edit_submission | public function can_edit_submission($userid, $graderid = 0) {
global $USER;
if (empty($graderid)) {
$graderid = $USER->id;
}
$instance = $this->get_instance();
if ($userid == $graderid &&
$instance->teamsubmission &&
$instance->preventsubmiss... | php | public function can_edit_submission($userid, $graderid = 0) {
global $USER;
if (empty($graderid)) {
$graderid = $USER->id;
}
$instance = $this->get_instance();
if ($userid == $graderid &&
$instance->teamsubmission &&
$instance->preventsubmiss... | [
"public",
"function",
"can_edit_submission",
"(",
"$",
"userid",
",",
"$",
"graderid",
"=",
"0",
")",
"{",
"global",
"$",
"USER",
";",
"if",
"(",
"empty",
"(",
"$",
"graderid",
")",
")",
"{",
"$",
"graderid",
"=",
"$",
"USER",
"->",
"id",
";",
"}",... | Capability check to make sure this grader can edit this submission.
@param int $userid - The user whose submission is to be edited
@param int $graderid (optional) - The user who will do the editing (default to $USER->id).
@return bool | [
"Capability",
"check",
"to",
"make",
"sure",
"this",
"grader",
"can",
"edit",
"this",
"submission",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L5945-L5981 |
215,009 | moodle/moodle | mod/assign/locallib.php | assign.get_shared_group_members | public function get_shared_group_members($cm, $userid) {
if (!isset($this->sharedgroupmembers[$userid])) {
$this->sharedgroupmembers[$userid] = array();
if ($members = groups_get_activity_shared_group_members($cm, $userid)) {
$this->sharedgroupmembers[$userid] = array_key... | php | public function get_shared_group_members($cm, $userid) {
if (!isset($this->sharedgroupmembers[$userid])) {
$this->sharedgroupmembers[$userid] = array();
if ($members = groups_get_activity_shared_group_members($cm, $userid)) {
$this->sharedgroupmembers[$userid] = array_key... | [
"public",
"function",
"get_shared_group_members",
"(",
"$",
"cm",
",",
"$",
"userid",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"sharedgroupmembers",
"[",
"$",
"userid",
"]",
")",
")",
"{",
"$",
"this",
"->",
"sharedgroupmembers",
"[",
... | Returns IDs of the users who share group membership with the specified user.
@param stdClass|cm_info $cm Course-module
@param int $userid User ID
@return array An array of ID of users. | [
"Returns",
"IDs",
"of",
"the",
"users",
"who",
"share",
"group",
"membership",
"with",
"the",
"specified",
"user",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L5990-L5999 |
215,010 | moodle/moodle | mod/assign/locallib.php | assign.get_graders | protected function get_graders($userid) {
// Potential graders should be active users only.
$potentialgraders = get_enrolled_users($this->context, "mod/assign:grade", null, 'u.*', null, null, null, true);
$graders = array();
if (groups_get_activity_groupmode($this->get_course_module()) ... | php | protected function get_graders($userid) {
// Potential graders should be active users only.
$potentialgraders = get_enrolled_users($this->context, "mod/assign:grade", null, 'u.*', null, null, null, true);
$graders = array();
if (groups_get_activity_groupmode($this->get_course_module()) ... | [
"protected",
"function",
"get_graders",
"(",
"$",
"userid",
")",
"{",
"// Potential graders should be active users only.",
"$",
"potentialgraders",
"=",
"get_enrolled_users",
"(",
"$",
"this",
"->",
"context",
",",
"\"mod/assign:grade\"",
",",
"null",
",",
"'u.*'",
",... | Returns a list of teachers that should be grading given submission.
@param int $userid The submission to grade
@return array | [
"Returns",
"a",
"list",
"of",
"teachers",
"that",
"should",
"be",
"grading",
"given",
"submission",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L6007-L6050 |
215,011 | moodle/moodle | mod/assign/locallib.php | assign.get_notifiable_users | protected function get_notifiable_users($userid) {
// Potential users should be active users only.
$potentialusers = get_enrolled_users($this->context, "mod/assign:receivegradernotifications",
null, 'u.*', null, null, null, true);
$notifiableusers = ... | php | protected function get_notifiable_users($userid) {
// Potential users should be active users only.
$potentialusers = get_enrolled_users($this->context, "mod/assign:receivegradernotifications",
null, 'u.*', null, null, null, true);
$notifiableusers = ... | [
"protected",
"function",
"get_notifiable_users",
"(",
"$",
"userid",
")",
"{",
"// Potential users should be active users only.",
"$",
"potentialusers",
"=",
"get_enrolled_users",
"(",
"$",
"this",
"->",
"context",
",",
"\"mod/assign:receivegradernotifications\"",
",",
"nul... | Returns a list of users that should receive notification about given submission.
@param int $userid The submission to grade
@return array | [
"Returns",
"a",
"list",
"of",
"users",
"that",
"should",
"receive",
"notification",
"about",
"given",
"submission",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L6058-L6102 |
215,012 | moodle/moodle | mod/assign/locallib.php | assign.format_notification_message_text | protected static function format_notification_message_text($messagetype,
$info,
$course,
$context,
... | php | protected static function format_notification_message_text($messagetype,
$info,
$course,
$context,
... | [
"protected",
"static",
"function",
"format_notification_message_text",
"(",
"$",
"messagetype",
",",
"$",
"info",
",",
"$",
"course",
",",
"$",
"context",
",",
"$",
"modulename",
",",
"$",
"assignmentname",
")",
"{",
"$",
"formatparams",
"=",
"array",
"(",
"... | Format a notification for plain text.
@param string $messagetype
@param stdClass $info
@param stdClass $course
@param stdClass $context
@param string $modulename
@param string $assignmentname | [
"Format",
"a",
"notification",
"for",
"plain",
"text",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L6114-L6130 |
215,013 | moodle/moodle | mod/assign/locallib.php | assign.format_notification_message_html | protected static function format_notification_message_html($messagetype,
$info,
$course,
$context,
... | php | protected static function format_notification_message_html($messagetype,
$info,
$course,
$context,
... | [
"protected",
"static",
"function",
"format_notification_message_html",
"(",
"$",
"messagetype",
",",
"$",
"info",
",",
"$",
"course",
",",
"$",
"context",
",",
"$",
"modulename",
",",
"$",
"coursemodule",
",",
"$",
"assignmentname",
")",
"{",
"global",
"$",
... | Format a notification for HTML.
@param string $messagetype
@param stdClass $info
@param stdClass $course
@param stdClass $context
@param string $modulename
@param stdClass $coursemodule
@param string $assignmentname | [
"Format",
"a",
"notification",
"for",
"HTML",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L6143-L6166 |
215,014 | moodle/moodle | mod/assign/locallib.php | assign.send_notification | public function send_notification($userfrom, $userto, $messagetype, $eventtype, $updatetime) {
global $USER;
$userid = core_user::is_real_user($userfrom->id) ? $userfrom->id : $USER->id;
$uniqueid = $this->get_uniqueid_for_user($userid);
self::send_assignment_notification($userfrom,
... | php | public function send_notification($userfrom, $userto, $messagetype, $eventtype, $updatetime) {
global $USER;
$userid = core_user::is_real_user($userfrom->id) ? $userfrom->id : $USER->id;
$uniqueid = $this->get_uniqueid_for_user($userid);
self::send_assignment_notification($userfrom,
... | [
"public",
"function",
"send_notification",
"(",
"$",
"userfrom",
",",
"$",
"userto",
",",
"$",
"messagetype",
",",
"$",
"eventtype",
",",
"$",
"updatetime",
")",
"{",
"global",
"$",
"USER",
";",
"$",
"userid",
"=",
"core_user",
"::",
"is_real_user",
"(",
... | Message someone about something.
@param stdClass $userfrom
@param stdClass $userto
@param string $messagetype
@param string $eventtype
@param int $updatetime
@return void | [
"Message",
"someone",
"about",
"something",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L6275-L6291 |
215,015 | moodle/moodle | mod/assign/locallib.php | assign.notify_student_submission_copied | protected function notify_student_submission_copied(stdClass $submission) {
global $DB, $USER;
$adminconfig = $this->get_admin_config();
// Use the same setting for this - no need for another one.
if (empty($adminconfig->submissionreceipts)) {
// No need to do anything.
... | php | protected function notify_student_submission_copied(stdClass $submission) {
global $DB, $USER;
$adminconfig = $this->get_admin_config();
// Use the same setting for this - no need for another one.
if (empty($adminconfig->submissionreceipts)) {
// No need to do anything.
... | [
"protected",
"function",
"notify_student_submission_copied",
"(",
"stdClass",
"$",
"submission",
")",
"{",
"global",
"$",
"DB",
",",
"$",
"USER",
";",
"$",
"adminconfig",
"=",
"$",
"this",
"->",
"get_admin_config",
"(",
")",
";",
"// Use the same setting for this ... | Notify student upon successful submission copy.
@param stdClass $submission
@return void | [
"Notify",
"student",
"upon",
"successful",
"submission",
"copy",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L6299-L6318 |
215,016 | moodle/moodle | mod/assign/locallib.php | assign.notify_student_submission_receipt | protected function notify_student_submission_receipt(stdClass $submission) {
global $DB, $USER;
$adminconfig = $this->get_admin_config();
if (empty($adminconfig->submissionreceipts)) {
// No need to do anything.
return;
}
if ($submission->userid) {
... | php | protected function notify_student_submission_receipt(stdClass $submission) {
global $DB, $USER;
$adminconfig = $this->get_admin_config();
if (empty($adminconfig->submissionreceipts)) {
// No need to do anything.
return;
}
if ($submission->userid) {
... | [
"protected",
"function",
"notify_student_submission_receipt",
"(",
"stdClass",
"$",
"submission",
")",
"{",
"global",
"$",
"DB",
",",
"$",
"USER",
";",
"$",
"adminconfig",
"=",
"$",
"this",
"->",
"get_admin_config",
"(",
")",
";",
"if",
"(",
"empty",
"(",
... | Notify student upon successful submission.
@param stdClass $submission
@return void | [
"Notify",
"student",
"upon",
"successful",
"submission",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L6325-L6351 |
215,017 | moodle/moodle | mod/assign/locallib.php | assign.notify_graders | protected function notify_graders(stdClass $submission) {
global $DB, $USER;
$instance = $this->get_instance();
$late = $instance->duedate && ($instance->duedate < time());
if (!$instance->sendnotifications && !($late && $instance->sendlatenotifications)) {
// No need to d... | php | protected function notify_graders(stdClass $submission) {
global $DB, $USER;
$instance = $this->get_instance();
$late = $instance->duedate && ($instance->duedate < time());
if (!$instance->sendnotifications && !($late && $instance->sendlatenotifications)) {
// No need to d... | [
"protected",
"function",
"notify_graders",
"(",
"stdClass",
"$",
"submission",
")",
"{",
"global",
"$",
"DB",
",",
"$",
"USER",
";",
"$",
"instance",
"=",
"$",
"this",
"->",
"get_instance",
"(",
")",
";",
"$",
"late",
"=",
"$",
"instance",
"->",
"dueda... | Send notifications to graders upon student submissions.
@param stdClass $submission
@return void | [
"Send",
"notifications",
"to",
"graders",
"upon",
"student",
"submissions",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L6359-L6386 |
215,018 | moodle/moodle | mod/assign/locallib.php | assign.submit_for_grading | public function submit_for_grading($data, $notices) {
global $USER;
$userid = $USER->id;
if (!empty($data->userid)) {
$userid = $data->userid;
}
// Need submit permission to submit an assignment.
if ($userid == $USER->id) {
require_capability('mod... | php | public function submit_for_grading($data, $notices) {
global $USER;
$userid = $USER->id;
if (!empty($data->userid)) {
$userid = $data->userid;
}
// Need submit permission to submit an assignment.
if ($userid == $USER->id) {
require_capability('mod... | [
"public",
"function",
"submit_for_grading",
"(",
"$",
"data",
",",
"$",
"notices",
")",
"{",
"global",
"$",
"USER",
";",
"$",
"userid",
"=",
"$",
"USER",
"->",
"id",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"data",
"->",
"userid",
")",
")",
"{",
"... | Submit a submission for grading.
@param stdClass $data - The form data
@param array $notices - List of error messages to display on an error condition.
@return bool Return false if the submission was not submitted. | [
"Submit",
"a",
"submission",
"for",
"grading",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L6395-L6461 |
215,019 | moodle/moodle | mod/assign/locallib.php | assign.process_submit_other_for_grading | protected function process_submit_other_for_grading($mform, $notices) {
global $USER, $CFG;
require_sesskey();
$userid = optional_param('userid', $USER->id, PARAM_INT);
if (!$this->submissions_open($userid)) {
$notices[] = get_string('submissionsclosed', 'assign');
... | php | protected function process_submit_other_for_grading($mform, $notices) {
global $USER, $CFG;
require_sesskey();
$userid = optional_param('userid', $USER->id, PARAM_INT);
if (!$this->submissions_open($userid)) {
$notices[] = get_string('submissionsclosed', 'assign');
... | [
"protected",
"function",
"process_submit_other_for_grading",
"(",
"$",
"mform",
",",
"$",
"notices",
")",
"{",
"global",
"$",
"USER",
",",
"$",
"CFG",
";",
"require_sesskey",
"(",
")",
";",
"$",
"userid",
"=",
"optional_param",
"(",
"'userid'",
",",
"$",
"... | A students submission is submitted for grading by a teacher.
@return bool | [
"A",
"students",
"submission",
"is",
"submitted",
"for",
"grading",
"by",
"a",
"teacher",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L6468-L6482 |
215,020 | moodle/moodle | mod/assign/locallib.php | assign.process_submit_for_grading | protected function process_submit_for_grading($mform, $notices) {
global $CFG;
require_once($CFG->dirroot . '/mod/assign/submissionconfirmform.php');
require_sesskey();
if (!$this->submissions_open()) {
$notices[] = get_string('submissionsclosed', 'assign');
ret... | php | protected function process_submit_for_grading($mform, $notices) {
global $CFG;
require_once($CFG->dirroot . '/mod/assign/submissionconfirmform.php');
require_sesskey();
if (!$this->submissions_open()) {
$notices[] = get_string('submissionsclosed', 'assign');
ret... | [
"protected",
"function",
"process_submit_for_grading",
"(",
"$",
"mform",
",",
"$",
"notices",
")",
"{",
"global",
"$",
"CFG",
";",
"require_once",
"(",
"$",
"CFG",
"->",
"dirroot",
".",
"'/mod/assign/submissionconfirmform.php'",
")",
";",
"require_sesskey",
"(",
... | Assignment submission is processed before grading.
@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. | [
"Assignment",
"submission",
"is",
"processed",
"before",
"grading",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L6491-L6532 |
215,021 | moodle/moodle | mod/assign/locallib.php | assign.save_user_extension | public function save_user_extension($userid, $extensionduedate) {
global $DB;
// Need submit permission to submit an assignment.
require_capability('mod/assign:grantextension', $this->context);
if (!is_enrolled($this->get_course_context(), $userid)) {
return false;
... | php | public function save_user_extension($userid, $extensionduedate) {
global $DB;
// Need submit permission to submit an assignment.
require_capability('mod/assign:grantextension', $this->context);
if (!is_enrolled($this->get_course_context(), $userid)) {
return false;
... | [
"public",
"function",
"save_user_extension",
"(",
"$",
"userid",
",",
"$",
"extensionduedate",
")",
"{",
"global",
"$",
"DB",
";",
"// Need submit permission to submit an assignment.",
"require_capability",
"(",
"'mod/assign:grantextension'",
",",
"$",
"this",
"->",
"co... | Save the extension date for a single user.
@param int $userid The user id
@param mixed $extensionduedate Either an integer date or null
@return boolean | [
"Save",
"the",
"extension",
"date",
"for",
"a",
"single",
"user",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L6541-L6574 |
215,022 | moodle/moodle | mod/assign/locallib.php | assign.process_save_extension | protected function process_save_extension(& $mform) {
global $DB, $CFG;
// Include extension form.
require_once($CFG->dirroot . '/mod/assign/extensionform.php');
require_sesskey();
$users = optional_param('userid', 0, PARAM_INT);
if (!$users) {
$users = requ... | php | protected function process_save_extension(& $mform) {
global $DB, $CFG;
// Include extension form.
require_once($CFG->dirroot . '/mod/assign/extensionform.php');
require_sesskey();
$users = optional_param('userid', 0, PARAM_INT);
if (!$users) {
$users = requ... | [
"protected",
"function",
"process_save_extension",
"(",
"&",
"$",
"mform",
")",
"{",
"global",
"$",
"DB",
",",
"$",
"CFG",
";",
"// Include extension form.",
"require_once",
"(",
"$",
"CFG",
"->",
"dirroot",
".",
"'/mod/assign/extensionform.php'",
")",
";",
"req... | Save extension date.
@param moodleform $mform The submitted form
@return boolean | [
"Save",
"extension",
"date",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L6582-L6645 |
215,023 | moodle/moodle | mod/assign/locallib.php | assign.format_grade_for_log | public function format_grade_for_log(stdClass $grade) {
global $DB;
$user = $DB->get_record('user', array('id' => $grade->userid), '*', MUST_EXIST);
$info = get_string('gradestudent', 'assign', array('id'=>$user->id, 'fullname'=>fullname($user)));
if ($grade->grade != '') {
... | php | public function format_grade_for_log(stdClass $grade) {
global $DB;
$user = $DB->get_record('user', array('id' => $grade->userid), '*', MUST_EXIST);
$info = get_string('gradestudent', 'assign', array('id'=>$user->id, 'fullname'=>fullname($user)));
if ($grade->grade != '') {
... | [
"public",
"function",
"format_grade_for_log",
"(",
"stdClass",
"$",
"grade",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"user",
"=",
"$",
"DB",
"->",
"get_record",
"(",
"'user'",
",",
"array",
"(",
"'id'",
"=>",
"$",
"grade",
"->",
"userid",
")",
",",
... | Take a grade object and print a short summary for the log file.
The size limit for the log file is 255 characters, so be careful not
to include too much information.
@deprecated since 2.7
@param stdClass $grade
@return string | [
"Take",
"a",
"grade",
"object",
"and",
"print",
"a",
"short",
"summary",
"for",
"the",
"log",
"file",
".",
"The",
"size",
"limit",
"for",
"the",
"log",
"file",
"is",
"255",
"characters",
"so",
"be",
"careful",
"not",
"to",
"include",
"too",
"much",
"in... | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L7031-L7043 |
215,024 | moodle/moodle | mod/assign/locallib.php | assign.format_submission_for_log | public function format_submission_for_log(stdClass $submission) {
global $DB;
$info = '';
if ($submission->userid) {
$user = $DB->get_record('user', array('id' => $submission->userid), '*', MUST_EXIST);
$name = fullname($user);
} else {
$group = $this... | php | public function format_submission_for_log(stdClass $submission) {
global $DB;
$info = '';
if ($submission->userid) {
$user = $DB->get_record('user', array('id' => $submission->userid), '*', MUST_EXIST);
$name = fullname($user);
} else {
$group = $this... | [
"public",
"function",
"format_submission_for_log",
"(",
"stdClass",
"$",
"submission",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"info",
"=",
"''",
";",
"if",
"(",
"$",
"submission",
"->",
"userid",
")",
"{",
"$",
"user",
"=",
"$",
"DB",
"->",
"get_reco... | Take a submission object and print a short summary for the log file.
The size limit for the log file is 255 characters, so be careful not
to include too much information.
@deprecated since 2.7
@param stdClass $submission
@return string | [
"Take",
"a",
"submission",
"object",
"and",
"print",
"a",
"short",
"summary",
"for",
"the",
"log",
"file",
".",
"The",
"size",
"limit",
"for",
"the",
"log",
"file",
"is",
"255",
"characters",
"so",
"be",
"careful",
"not",
"to",
"include",
"too",
"much",
... | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L7055-L7081 |
215,025 | moodle/moodle | mod/assign/locallib.php | assign.submission_empty | public function submission_empty($submission) {
$allempty = true;
foreach ($this->submissionplugins as $plugin) {
if ($plugin->is_enabled() && $plugin->is_visible()) {
if (!$allempty || !$plugin->is_empty($submission)) {
$allempty = false;
... | php | public function submission_empty($submission) {
$allempty = true;
foreach ($this->submissionplugins as $plugin) {
if ($plugin->is_enabled() && $plugin->is_visible()) {
if (!$allempty || !$plugin->is_empty($submission)) {
$allempty = false;
... | [
"public",
"function",
"submission_empty",
"(",
"$",
"submission",
")",
"{",
"$",
"allempty",
"=",
"true",
";",
"foreach",
"(",
"$",
"this",
"->",
"submissionplugins",
"as",
"$",
"plugin",
")",
"{",
"if",
"(",
"$",
"plugin",
"->",
"is_enabled",
"(",
")",
... | Determine if the current submission is empty or not.
@param submission $submission the students submission record to check.
@return bool | [
"Determine",
"if",
"the",
"current",
"submission",
"is",
"empty",
"or",
"not",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L7194-L7205 |
215,026 | moodle/moodle | mod/assign/locallib.php | assign.new_submission_empty | public function new_submission_empty($data) {
foreach ($this->submissionplugins as $plugin) {
if ($plugin->is_enabled() && $plugin->is_visible() && $plugin->allow_submissions() &&
!$plugin->submission_is_empty($data)) {
return false;
}
}
... | php | public function new_submission_empty($data) {
foreach ($this->submissionplugins as $plugin) {
if ($plugin->is_enabled() && $plugin->is_visible() && $plugin->allow_submissions() &&
!$plugin->submission_is_empty($data)) {
return false;
}
}
... | [
"public",
"function",
"new_submission_empty",
"(",
"$",
"data",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"submissionplugins",
"as",
"$",
"plugin",
")",
"{",
"if",
"(",
"$",
"plugin",
"->",
"is_enabled",
"(",
")",
"&&",
"$",
"plugin",
"->",
"is_visibl... | Determine if a new submission is empty or not
@param stdClass $data Submission data
@return bool | [
"Determine",
"if",
"a",
"new",
"submission",
"is",
"empty",
"or",
"not"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L7213-L7221 |
215,027 | moodle/moodle | mod/assign/locallib.php | assign.process_save_submission | protected function process_save_submission(&$mform, &$notices) {
global $CFG, $USER;
// Include submission form.
require_once($CFG->dirroot . '/mod/assign/submission_form.php');
$userid = optional_param('userid', $USER->id, PARAM_INT);
// Need submit permission to submit an ass... | php | protected function process_save_submission(&$mform, &$notices) {
global $CFG, $USER;
// Include submission form.
require_once($CFG->dirroot . '/mod/assign/submission_form.php');
$userid = optional_param('userid', $USER->id, PARAM_INT);
// Need submit permission to submit an ass... | [
"protected",
"function",
"process_save_submission",
"(",
"&",
"$",
"mform",
",",
"&",
"$",
"notices",
")",
"{",
"global",
"$",
"CFG",
",",
"$",
"USER",
";",
"// Include submission form.",
"require_once",
"(",
"$",
"CFG",
"->",
"dirroot",
".",
"'/mod/assign/sub... | Save assignment submission.
@param moodleform $mform
@param array $notices Any error messages that should be shown
to the user at the top of the edit submission form.
@return bool | [
"Save",
"assignment",
"submission",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L7346-L7371 |
215,028 | moodle/moodle | mod/assign/locallib.php | assign.grading_disabled | public function grading_disabled($userid, $checkworkflow=true) {
global $CFG;
if ($checkworkflow && $this->get_instance()->markingworkflow) {
$grade = $this->get_user_grade($userid, false);
$validstates = $this->get_marking_workflow_states_for_current_user();
if (!emp... | php | public function grading_disabled($userid, $checkworkflow=true) {
global $CFG;
if ($checkworkflow && $this->get_instance()->markingworkflow) {
$grade = $this->get_user_grade($userid, false);
$validstates = $this->get_marking_workflow_states_for_current_user();
if (!emp... | [
"public",
"function",
"grading_disabled",
"(",
"$",
"userid",
",",
"$",
"checkworkflow",
"=",
"true",
")",
"{",
"global",
"$",
"CFG",
";",
"if",
"(",
"$",
"checkworkflow",
"&&",
"$",
"this",
"->",
"get_instance",
"(",
")",
"->",
"markingworkflow",
")",
"... | Determine if this users grade can be edited.
@param int $userid - The student userid
@param bool $checkworkflow - whether to include a check for the workflow state.
@return bool $gradingdisabled | [
"Determine",
"if",
"this",
"users",
"grade",
"can",
"be",
"edited",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L7381-L7405 |
215,029 | moodle/moodle | mod/assign/locallib.php | assign.get_grading_instance | protected function get_grading_instance($userid, $grade, $gradingdisabled) {
global $CFG, $USER;
$grademenu = make_grades_menu($this->get_instance()->grade);
$allowgradedecimals = $this->get_instance()->grade > 0;
$advancedgradingwarning = false;
$gradingmanager = get_grading_m... | php | protected function get_grading_instance($userid, $grade, $gradingdisabled) {
global $CFG, $USER;
$grademenu = make_grades_menu($this->get_instance()->grade);
$allowgradedecimals = $this->get_instance()->grade > 0;
$advancedgradingwarning = false;
$gradingmanager = get_grading_m... | [
"protected",
"function",
"get_grading_instance",
"(",
"$",
"userid",
",",
"$",
"grade",
",",
"$",
"gradingdisabled",
")",
"{",
"global",
"$",
"CFG",
",",
"$",
"USER",
";",
"$",
"grademenu",
"=",
"make_grades_menu",
"(",
"$",
"this",
"->",
"get_instance",
"... | Get an instance of a grading form if advanced grading is enabled.
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 | [
"Get",
"an",
"instance",
"of",
"a",
"grading",
"form",
"if",
"advanced",
"grading",
"is",
"enabled",
".",
"This",
"is",
"specific",
"to",
"the",
"assignment",
"marker",
"and",
"student",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L7417-L7449 |
215,030 | moodle/moodle | mod/assign/locallib.php | assign.add_plugin_submission_elements | protected function add_plugin_submission_elements($submission,
MoodleQuickForm $mform,
stdClass $data,
$userid) {
foreach ($this->submissionplugins as $plug... | php | protected function add_plugin_submission_elements($submission,
MoodleQuickForm $mform,
stdClass $data,
$userid) {
foreach ($this->submissionplugins as $plug... | [
"protected",
"function",
"add_plugin_submission_elements",
"(",
"$",
"submission",
",",
"MoodleQuickForm",
"$",
"mform",
",",
"stdClass",
"$",
"data",
",",
"$",
"userid",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"submissionplugins",
"as",
"$",
"plugin",
")... | Add elements in submission plugin form.
@param mixed $submission stdClass|null
@param MoodleQuickForm $mform
@param stdClass $data
@param int $userid The current userid (same as $USER->id)
@return void | [
"Add",
"elements",
"in",
"submission",
"plugin",
"form",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L7738-L7747 |
215,031 | moodle/moodle | mod/assign/locallib.php | assign.is_any_feedback_plugin_enabled | public function is_any_feedback_plugin_enabled() {
if (!isset($this->cache['any_feedback_plugin_enabled'])) {
$this->cache['any_feedback_plugin_enabled'] = false;
foreach ($this->feedbackplugins as $plugin) {
if ($plugin->is_enabled() && $plugin->is_visible()) {
... | php | public function is_any_feedback_plugin_enabled() {
if (!isset($this->cache['any_feedback_plugin_enabled'])) {
$this->cache['any_feedback_plugin_enabled'] = false;
foreach ($this->feedbackplugins as $plugin) {
if ($plugin->is_enabled() && $plugin->is_visible()) {
... | [
"public",
"function",
"is_any_feedback_plugin_enabled",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"cache",
"[",
"'any_feedback_plugin_enabled'",
"]",
")",
")",
"{",
"$",
"this",
"->",
"cache",
"[",
"'any_feedback_plugin_enabled'",
"]",
"=... | Check if feedback plugins installed are enabled.
@return bool | [
"Check",
"if",
"feedback",
"plugins",
"installed",
"are",
"enabled",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L7754-L7767 |
215,032 | moodle/moodle | mod/assign/locallib.php | assign.is_any_submission_plugin_enabled | public function is_any_submission_plugin_enabled() {
if (!isset($this->cache['any_submission_plugin_enabled'])) {
$this->cache['any_submission_plugin_enabled'] = false;
foreach ($this->submissionplugins as $plugin) {
if ($plugin->is_enabled() && $plugin->is_visible() && $... | php | public function is_any_submission_plugin_enabled() {
if (!isset($this->cache['any_submission_plugin_enabled'])) {
$this->cache['any_submission_plugin_enabled'] = false;
foreach ($this->submissionplugins as $plugin) {
if ($plugin->is_enabled() && $plugin->is_visible() && $... | [
"public",
"function",
"is_any_submission_plugin_enabled",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"cache",
"[",
"'any_submission_plugin_enabled'",
"]",
")",
")",
"{",
"$",
"this",
"->",
"cache",
"[",
"'any_submission_plugin_enabled'",
"]"... | Check if submission plugins installed are enabled.
@return bool | [
"Check",
"if",
"submission",
"plugins",
"installed",
"are",
"enabled",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L7774-L7787 |
215,033 | moodle/moodle | mod/assign/locallib.php | assign.add_submission_form_elements | public function add_submission_form_elements(MoodleQuickForm $mform, stdClass $data) {
global $USER;
$userid = $data->userid;
// Team submissions.
if ($this->get_instance()->teamsubmission) {
$submission = $this->get_group_submission($userid, 0, false);
} else {
... | php | public function add_submission_form_elements(MoodleQuickForm $mform, stdClass $data) {
global $USER;
$userid = $data->userid;
// Team submissions.
if ($this->get_instance()->teamsubmission) {
$submission = $this->get_group_submission($userid, 0, false);
} else {
... | [
"public",
"function",
"add_submission_form_elements",
"(",
"MoodleQuickForm",
"$",
"mform",
",",
"stdClass",
"$",
"data",
")",
"{",
"global",
"$",
"USER",
";",
"$",
"userid",
"=",
"$",
"data",
"->",
"userid",
";",
"// Team submissions.",
"if",
"(",
"$",
"thi... | Add elements to submission form.
@param MoodleQuickForm $mform
@param stdClass $data
@return void | [
"Add",
"elements",
"to",
"submission",
"form",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L7795-L7840 |
215,034 | moodle/moodle | mod/assign/locallib.php | assign.remove_submission | public function remove_submission($userid) {
global $USER;
if (!$this->can_edit_submission($userid, $USER->id)) {
print_error('nopermission');
}
if ($this->get_instance()->teamsubmission) {
$submission = $this->get_group_submission($userid, 0, false);
} ... | php | public function remove_submission($userid) {
global $USER;
if (!$this->can_edit_submission($userid, $USER->id)) {
print_error('nopermission');
}
if ($this->get_instance()->teamsubmission) {
$submission = $this->get_group_submission($userid, 0, false);
} ... | [
"public",
"function",
"remove_submission",
"(",
"$",
"userid",
")",
"{",
"global",
"$",
"USER",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"can_edit_submission",
"(",
"$",
"userid",
",",
"$",
"USER",
"->",
"id",
")",
")",
"{",
"print_error",
"(",
"'noperm... | Remove any data from the current submission.
@param int $userid
@return boolean | [
"Remove",
"any",
"data",
"from",
"the",
"current",
"submission",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L7848-L7877 |
215,035 | moodle/moodle | mod/assign/locallib.php | assign.revert_to_draft | public function revert_to_draft($userid) {
global $DB, $USER;
// Need grade permission.
require_capability('mod/assign:grade', $this->context);
if ($this->get_instance()->teamsubmission) {
$submission = $this->get_group_submission($userid, 0, false);
} else {
... | php | public function revert_to_draft($userid) {
global $DB, $USER;
// Need grade permission.
require_capability('mod/assign:grade', $this->context);
if ($this->get_instance()->teamsubmission) {
$submission = $this->get_group_submission($userid, 0, false);
} else {
... | [
"public",
"function",
"revert_to_draft",
"(",
"$",
"userid",
")",
"{",
"global",
"$",
"DB",
",",
"$",
"USER",
";",
"// Need grade permission.",
"require_capability",
"(",
"'mod/assign:grade'",
",",
"$",
"this",
"->",
"context",
")",
";",
"if",
"(",
"$",
"thi... | Revert to draft.
@param int $userid
@return boolean | [
"Revert",
"to",
"draft",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L7885-L7922 |
215,036 | moodle/moodle | mod/assign/locallib.php | assign.process_remove_submission | protected function process_remove_submission($userid = 0) {
require_sesskey();
if (!$userid) {
$userid = required_param('userid', PARAM_INT);
}
return $this->remove_submission($userid);
} | php | protected function process_remove_submission($userid = 0) {
require_sesskey();
if (!$userid) {
$userid = required_param('userid', PARAM_INT);
}
return $this->remove_submission($userid);
} | [
"protected",
"function",
"process_remove_submission",
"(",
"$",
"userid",
"=",
"0",
")",
"{",
"require_sesskey",
"(",
")",
";",
"if",
"(",
"!",
"$",
"userid",
")",
"{",
"$",
"userid",
"=",
"required_param",
"(",
"'userid'",
",",
"PARAM_INT",
")",
";",
"}... | Remove the current submission.
@param int $userid
@return boolean | [
"Remove",
"the",
"current",
"submission",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L7930-L7938 |
215,037 | moodle/moodle | mod/assign/locallib.php | assign.process_revert_to_draft | protected function process_revert_to_draft($userid = 0) {
require_sesskey();
if (!$userid) {
$userid = required_param('userid', PARAM_INT);
}
return $this->revert_to_draft($userid);
} | php | protected function process_revert_to_draft($userid = 0) {
require_sesskey();
if (!$userid) {
$userid = required_param('userid', PARAM_INT);
}
return $this->revert_to_draft($userid);
} | [
"protected",
"function",
"process_revert_to_draft",
"(",
"$",
"userid",
"=",
"0",
")",
"{",
"require_sesskey",
"(",
")",
";",
"if",
"(",
"!",
"$",
"userid",
")",
"{",
"$",
"userid",
"=",
"required_param",
"(",
"'userid'",
",",
"PARAM_INT",
")",
";",
"}",... | Revert to draft.
Uses url parameter userid if userid not supplied as a parameter.
@param int $userid
@return boolean | [
"Revert",
"to",
"draft",
".",
"Uses",
"url",
"parameter",
"userid",
"if",
"userid",
"not",
"supplied",
"as",
"a",
"parameter",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L7947-L7955 |
215,038 | moodle/moodle | mod/assign/locallib.php | assign.lock_submission | public function lock_submission($userid) {
global $USER, $DB;
// Need grade permission.
require_capability('mod/assign:grade', $this->context);
// Give each submission plugin a chance to process the locking.
$plugins = $this->get_submission_plugins();
$submission = $this... | php | public function lock_submission($userid) {
global $USER, $DB;
// Need grade permission.
require_capability('mod/assign:grade', $this->context);
// Give each submission plugin a chance to process the locking.
$plugins = $this->get_submission_plugins();
$submission = $this... | [
"public",
"function",
"lock_submission",
"(",
"$",
"userid",
")",
"{",
"global",
"$",
"USER",
",",
"$",
"DB",
";",
"// Need grade permission.",
"require_capability",
"(",
"'mod/assign:grade'",
",",
"$",
"this",
"->",
"context",
")",
";",
"// Give each submission p... | Prevent student updates to this submission
@param int $userid
@return bool | [
"Prevent",
"student",
"updates",
"to",
"this",
"submission"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L7963-L7985 |
215,039 | moodle/moodle | mod/assign/locallib.php | assign.process_set_batch_marking_workflow_state | protected function process_set_batch_marking_workflow_state() {
global $CFG, $DB;
// Include batch marking workflow form.
require_once($CFG->dirroot . '/mod/assign/batchsetmarkingworkflowstateform.php');
$formparams = array(
'userscount' => 0, // This form is never re-disp... | php | protected function process_set_batch_marking_workflow_state() {
global $CFG, $DB;
// Include batch marking workflow form.
require_once($CFG->dirroot . '/mod/assign/batchsetmarkingworkflowstateform.php');
$formparams = array(
'userscount' => 0, // This form is never re-disp... | [
"protected",
"function",
"process_set_batch_marking_workflow_state",
"(",
")",
"{",
"global",
"$",
"CFG",
",",
"$",
"DB",
";",
"// Include batch marking workflow form.",
"require_once",
"(",
"$",
"CFG",
"->",
"dirroot",
".",
"'/mod/assign/batchsetmarkingworkflowstateform.ph... | Set the workflow state for multiple users
@return void | [
"Set",
"the",
"workflow",
"state",
"for",
"multiple",
"users"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L7993-L8048 |
215,040 | moodle/moodle | mod/assign/locallib.php | assign.process_set_batch_marking_allocation | protected function process_set_batch_marking_allocation() {
global $CFG, $DB;
// Include batch marking allocation form.
require_once($CFG->dirroot . '/mod/assign/batchsetallocatedmarkerform.php');
$formparams = array(
'userscount' => 0, // This form is never re-displayed, ... | php | protected function process_set_batch_marking_allocation() {
global $CFG, $DB;
// Include batch marking allocation form.
require_once($CFG->dirroot . '/mod/assign/batchsetallocatedmarkerform.php');
$formparams = array(
'userscount' => 0, // This form is never re-displayed, ... | [
"protected",
"function",
"process_set_batch_marking_allocation",
"(",
")",
"{",
"global",
"$",
"CFG",
",",
"$",
"DB",
";",
"// Include batch marking allocation form.",
"require_once",
"(",
"$",
"CFG",
"->",
"dirroot",
".",
"'/mod/assign/batchsetallocatedmarkerform.php'",
... | Set the marking allocation for multiple users
@return void | [
"Set",
"the",
"marking",
"allocation",
"for",
"multiple",
"users"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L8055-L8104 |
215,041 | moodle/moodle | mod/assign/locallib.php | assign.process_lock_submission | protected function process_lock_submission($userid = 0) {
require_sesskey();
if (!$userid) {
$userid = required_param('userid', PARAM_INT);
}
return $this->lock_submission($userid);
} | php | protected function process_lock_submission($userid = 0) {
require_sesskey();
if (!$userid) {
$userid = required_param('userid', PARAM_INT);
}
return $this->lock_submission($userid);
} | [
"protected",
"function",
"process_lock_submission",
"(",
"$",
"userid",
"=",
"0",
")",
"{",
"require_sesskey",
"(",
")",
";",
"if",
"(",
"!",
"$",
"userid",
")",
"{",
"$",
"userid",
"=",
"required_param",
"(",
"'userid'",
",",
"PARAM_INT",
")",
";",
"}",... | Prevent student updates to this submission.
Uses url parameter userid.
@param int $userid
@return void | [
"Prevent",
"student",
"updates",
"to",
"this",
"submission",
".",
"Uses",
"url",
"parameter",
"userid",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L8114-L8123 |
215,042 | moodle/moodle | mod/assign/locallib.php | assign.process_unlock_submission | protected function process_unlock_submission($userid = 0) {
require_sesskey();
if (!$userid) {
$userid = required_param('userid', PARAM_INT);
}
return $this->unlock_submission($userid);
} | php | protected function process_unlock_submission($userid = 0) {
require_sesskey();
if (!$userid) {
$userid = required_param('userid', PARAM_INT);
}
return $this->unlock_submission($userid);
} | [
"protected",
"function",
"process_unlock_submission",
"(",
"$",
"userid",
"=",
"0",
")",
"{",
"require_sesskey",
"(",
")",
";",
"if",
"(",
"!",
"$",
"userid",
")",
"{",
"$",
"userid",
"=",
"required_param",
"(",
"'userid'",
",",
"PARAM_INT",
")",
";",
"}... | Unlock the student submission.
Uses url parameter userid.
@param int $userid
@return bool | [
"Unlock",
"the",
"student",
"submission",
".",
"Uses",
"url",
"parameter",
"userid",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L8163-L8172 |
215,043 | moodle/moodle | mod/assign/locallib.php | assign.process_outcomes | protected function process_outcomes($userid, $formdata, $sourceuserid = null) {
global $CFG, $USER;
if (empty($CFG->enableoutcomes)) {
return;
}
if ($this->grading_disabled($userid)) {
return;
}
require_once($CFG->libdir.'/gradelib.php');
... | php | protected function process_outcomes($userid, $formdata, $sourceuserid = null) {
global $CFG, $USER;
if (empty($CFG->enableoutcomes)) {
return;
}
if ($this->grading_disabled($userid)) {
return;
}
require_once($CFG->libdir.'/gradelib.php');
... | [
"protected",
"function",
"process_outcomes",
"(",
"$",
"userid",
",",
"$",
"formdata",
",",
"$",
"sourceuserid",
"=",
"null",
")",
"{",
"global",
"$",
"CFG",
",",
"$",
"USER",
";",
"if",
"(",
"empty",
"(",
"$",
"CFG",
"->",
"enableoutcomes",
")",
")",
... | Save outcomes submitted from grading form.
@param int $userid
@param stdClass $formdata
@param int $sourceuserid The user ID under which the outcome data is accessible. This is relevant
for an outcome set to a user but applied to an entire group. | [
"Save",
"outcomes",
"submitted",
"from",
"grading",
"form",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L8271-L8309 |
215,044 | moodle/moodle | mod/assign/locallib.php | assign.reopen_submission_if_required | protected function reopen_submission_if_required($userid, $submission, $addattempt) {
$instance = $this->get_instance();
$maxattemptsreached = !empty($submission) &&
$submission->attemptnumber >= ($instance->maxattempts - 1) &&
$instance->maxat... | php | protected function reopen_submission_if_required($userid, $submission, $addattempt) {
$instance = $this->get_instance();
$maxattemptsreached = !empty($submission) &&
$submission->attemptnumber >= ($instance->maxattempts - 1) &&
$instance->maxat... | [
"protected",
"function",
"reopen_submission_if_required",
"(",
"$",
"userid",
",",
"$",
"submission",
",",
"$",
"addattempt",
")",
"{",
"$",
"instance",
"=",
"$",
"this",
"->",
"get_instance",
"(",
")",
";",
"$",
"maxattemptsreached",
"=",
"!",
"empty",
"(",... | If the requirements are met - reopen the submission for another attempt.
Only call this function when grading the latest attempt.
@param int $userid The userid.
@param stdClass $submission The submission (may be a group submission).
@param bool $addattempt - True if the "allow another attempt" checkbox was checked.
@r... | [
"If",
"the",
"requirements",
"are",
"met",
"-",
"reopen",
"the",
"submission",
"for",
"another",
"attempt",
".",
"Only",
"call",
"this",
"function",
"when",
"grading",
"the",
"latest",
"attempt",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L8320-L8347 |
215,045 | moodle/moodle | mod/assign/locallib.php | assign.save_grade | public function save_grade($userid, $data) {
// Need grade permission.
require_capability('mod/assign:grade', $this->context);
$instance = $this->get_instance();
$submission = null;
if ($instance->teamsubmission) {
// We need to know what the most recent group submi... | php | public function save_grade($userid, $data) {
// Need grade permission.
require_capability('mod/assign:grade', $this->context);
$instance = $this->get_instance();
$submission = null;
if ($instance->teamsubmission) {
// We need to know what the most recent group submi... | [
"public",
"function",
"save_grade",
"(",
"$",
"userid",
",",
"$",
"data",
")",
"{",
"// Need grade permission.",
"require_capability",
"(",
"'mod/assign:grade'",
",",
"$",
"this",
"->",
"context",
")",
";",
"$",
"instance",
"=",
"$",
"this",
"->",
"get_instanc... | Save grade update.
@param int $userid
@param stdClass $data
@return bool - was the grade saved | [
"Save",
"grade",
"update",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L8356-L8397 |
215,046 | moodle/moodle | mod/assign/locallib.php | assign.process_save_grade | protected function process_save_grade(&$mform) {
global $CFG, $SESSION;
// Include grade form.
require_once($CFG->dirroot . '/mod/assign/gradeform.php');
require_sesskey();
$instance = $this->get_instance();
$rownum = required_param('rownum', PARAM_INT);
$attemp... | php | protected function process_save_grade(&$mform) {
global $CFG, $SESSION;
// Include grade form.
require_once($CFG->dirroot . '/mod/assign/gradeform.php');
require_sesskey();
$instance = $this->get_instance();
$rownum = required_param('rownum', PARAM_INT);
$attemp... | [
"protected",
"function",
"process_save_grade",
"(",
"&",
"$",
"mform",
")",
"{",
"global",
"$",
"CFG",
",",
"$",
"SESSION",
";",
"// Include grade form.",
"require_once",
"(",
"$",
"CFG",
"->",
"dirroot",
".",
"'/mod/assign/gradeform.php'",
")",
";",
"require_se... | Save grade.
@param moodleform $mform
@return bool - was the grade saved | [
"Save",
"grade",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L8405-L8454 |
215,047 | moodle/moodle | mod/assign/locallib.php | assign.can_upgrade_assignment | public static function can_upgrade_assignment($type, $version) {
$assignment = new assign(null, null, null);
return $assignment->can_upgrade($type, $version);
} | php | public static function can_upgrade_assignment($type, $version) {
$assignment = new assign(null, null, null);
return $assignment->can_upgrade($type, $version);
} | [
"public",
"static",
"function",
"can_upgrade_assignment",
"(",
"$",
"type",
",",
"$",
"version",
")",
"{",
"$",
"assignment",
"=",
"new",
"assign",
"(",
"null",
",",
"null",
",",
"null",
")",
";",
"return",
"$",
"assignment",
"->",
"can_upgrade",
"(",
"$... | This function is a static wrapper around can_upgrade.
@param string $type The plugin type
@param int $version The plugin version
@return bool | [
"This",
"function",
"is",
"a",
"static",
"wrapper",
"around",
"can_upgrade",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L8463-L8466 |
215,048 | moodle/moodle | mod/assign/locallib.php | assign.can_upgrade | public function can_upgrade($type, $version) {
if ($type == 'offline' && $version >= 2011112900) {
return true;
}
foreach ($this->submissionplugins as $plugin) {
if ($plugin->can_upgrade($type, $version)) {
return true;
}
}
fore... | php | public function can_upgrade($type, $version) {
if ($type == 'offline' && $version >= 2011112900) {
return true;
}
foreach ($this->submissionplugins as $plugin) {
if ($plugin->can_upgrade($type, $version)) {
return true;
}
}
fore... | [
"public",
"function",
"can_upgrade",
"(",
"$",
"type",
",",
"$",
"version",
")",
"{",
"if",
"(",
"$",
"type",
"==",
"'offline'",
"&&",
"$",
"version",
">=",
"2011112900",
")",
"{",
"return",
"true",
";",
"}",
"foreach",
"(",
"$",
"this",
"->",
"submi... | This function returns true if it can upgrade an assignment from the 2.2 module.
@param string $type The plugin type
@param int $version The plugin version
@return bool | [
"This",
"function",
"returns",
"true",
"if",
"it",
"can",
"upgrade",
"an",
"assignment",
"from",
"the",
"2",
".",
"2",
"module",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L8475-L8490 |
215,049 | moodle/moodle | mod/assign/locallib.php | assign.copy_area_files_for_upgrade | public function copy_area_files_for_upgrade($oldcontextid,
$oldcomponent,
$oldfilearea,
$olditemid,
$newcontextid,
... | php | public function copy_area_files_for_upgrade($oldcontextid,
$oldcomponent,
$oldfilearea,
$olditemid,
$newcontextid,
... | [
"public",
"function",
"copy_area_files_for_upgrade",
"(",
"$",
"oldcontextid",
",",
"$",
"oldcomponent",
",",
"$",
"oldfilearea",
",",
"$",
"olditemid",
",",
"$",
"newcontextid",
",",
"$",
"newcomponent",
",",
"$",
"newfilearea",
",",
"$",
"newitemid",
")",
"{... | Copy all the files from the old assignment files area to the new one.
This is used by the plugin upgrade code.
@param int $oldcontextid The old assignment context id
@param int $oldcomponent The old assignment component ('assignment')
@param int $oldfilearea The old assignment filearea ('submissions')
@param int $oldi... | [
"Copy",
"all",
"the",
"files",
"from",
"the",
"old",
"assignment",
"files",
"area",
"to",
"the",
"new",
"one",
".",
"This",
"is",
"used",
"by",
"the",
"plugin",
"upgrade",
"code",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L8506-L8537 |
215,050 | moodle/moodle | mod/assign/locallib.php | assign.process_add_attempt_group | protected function process_add_attempt_group($useridlist) {
$groupsprocessed = array();
$result = true;
foreach ($useridlist as $userid) {
$groupid = 0;
$group = $this->get_submission_group($userid);
if ($group) {
$groupid = $group->id;
... | php | protected function process_add_attempt_group($useridlist) {
$groupsprocessed = array();
$result = true;
foreach ($useridlist as $userid) {
$groupid = 0;
$group = $this->get_submission_group($userid);
if ($group) {
$groupid = $group->id;
... | [
"protected",
"function",
"process_add_attempt_group",
"(",
"$",
"useridlist",
")",
"{",
"$",
"groupsprocessed",
"=",
"array",
"(",
")",
";",
"$",
"result",
"=",
"true",
";",
"foreach",
"(",
"$",
"useridlist",
"as",
"$",
"userid",
")",
"{",
"$",
"groupid",
... | Add a new attempt for each user in the list - but reopen each group assignment
at most 1 time.
@param array $useridlist Array of userids to reopen.
@return bool | [
"Add",
"a",
"new",
"attempt",
"for",
"each",
"user",
"in",
"the",
"list",
"-",
"but",
"reopen",
"each",
"group",
"assignment",
"at",
"most",
"1",
"time",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L8546-L8568 |
215,051 | moodle/moodle | mod/assign/locallib.php | assign.add_attempt | protected function add_attempt($userid) {
require_capability('mod/assign:grade', $this->context);
if ($this->get_instance()->attemptreopenmethod == ASSIGN_ATTEMPT_REOPEN_METHOD_NONE) {
return false;
}
if ($this->get_instance()->teamsubmission) {
$oldsubmission =... | php | protected function add_attempt($userid) {
require_capability('mod/assign:grade', $this->context);
if ($this->get_instance()->attemptreopenmethod == ASSIGN_ATTEMPT_REOPEN_METHOD_NONE) {
return false;
}
if ($this->get_instance()->teamsubmission) {
$oldsubmission =... | [
"protected",
"function",
"add_attempt",
"(",
"$",
"userid",
")",
"{",
"require_capability",
"(",
"'mod/assign:grade'",
",",
"$",
"this",
"->",
"context",
")",
";",
"if",
"(",
"$",
"this",
"->",
"get_instance",
"(",
")",
"->",
"attemptreopenmethod",
"==",
"AS... | Add a new attempt for a user.
@param int $userid int The user to add the attempt for
@return bool - true if successful. | [
"Add",
"a",
"new",
"attempt",
"for",
"a",
"user",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L8588-L8646 |
215,052 | moodle/moodle | mod/assign/locallib.php | assign.get_user_grades_for_gradebook | public function get_user_grades_for_gradebook($userid) {
global $DB, $CFG;
$grades = array();
$assignmentid = $this->get_instance()->id;
$adminconfig = $this->get_admin_config();
$gradebookpluginname = $adminconfig->feedback_plugin_for_gradebook;
$gradebookplugin = null;... | php | public function get_user_grades_for_gradebook($userid) {
global $DB, $CFG;
$grades = array();
$assignmentid = $this->get_instance()->id;
$adminconfig = $this->get_admin_config();
$gradebookpluginname = $adminconfig->feedback_plugin_for_gradebook;
$gradebookplugin = null;... | [
"public",
"function",
"get_user_grades_for_gradebook",
"(",
"$",
"userid",
")",
"{",
"global",
"$",
"DB",
",",
"$",
"CFG",
";",
"$",
"grades",
"=",
"array",
"(",
")",
";",
"$",
"assignmentid",
"=",
"$",
"this",
"->",
"get_instance",
"(",
")",
"->",
"id... | Get an upto date list of user grades and feedback for the gradebook.
@param int $userid int or 0 for all users
@return array of grade data formated for the gradebook api
The data required by the gradebook api is userid,
rawgrade,
feedback,
feedbackformat,
usermodified,
dategraded,
datesubmitted | [
"Get",
"an",
"upto",
"date",
"list",
"of",
"user",
"grades",
"and",
"feedback",
"for",
"the",
"gradebook",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L8661-L8722 |
215,053 | moodle/moodle | mod/assign/locallib.php | assign.allocate_unique_ids | public static function allocate_unique_ids($assignid) {
global $DB;
$cm = get_coursemodule_from_instance('assign', $assignid, 0, false, MUST_EXIST);
$context = context_module::instance($cm->id);
$currentgroup = groups_get_activity_group($cm, true);
$users = get_enrolled_users($... | php | public static function allocate_unique_ids($assignid) {
global $DB;
$cm = get_coursemodule_from_instance('assign', $assignid, 0, false, MUST_EXIST);
$context = context_module::instance($cm->id);
$currentgroup = groups_get_activity_group($cm, true);
$users = get_enrolled_users($... | [
"public",
"static",
"function",
"allocate_unique_ids",
"(",
"$",
"assignid",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"cm",
"=",
"get_coursemodule_from_instance",
"(",
"'assign'",
",",
"$",
"assignid",
",",
"0",
",",
"false",
",",
"MUST_EXIST",
")",
";",
"... | Foreach participant in the course - assign them a random id.
@param int $assignid The assignid to lookup | [
"Foreach",
"participant",
"in",
"the",
"course",
"-",
"assign",
"them",
"a",
"random",
"id",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L8739-L8762 |
215,054 | moodle/moodle | mod/assign/locallib.php | assign.get_uniqueid_for_user_static | public static function get_uniqueid_for_user_static($assignid, $userid) {
global $DB;
// Search for a record.
$params = array('assignment'=>$assignid, 'userid'=>$userid);
if ($record = $DB->get_record('assign_user_mapping', $params, 'id')) {
return $record->id;
}
... | php | public static function get_uniqueid_for_user_static($assignid, $userid) {
global $DB;
// Search for a record.
$params = array('assignment'=>$assignid, 'userid'=>$userid);
if ($record = $DB->get_record('assign_user_mapping', $params, 'id')) {
return $record->id;
}
... | [
"public",
"static",
"function",
"get_uniqueid_for_user_static",
"(",
"$",
"assignid",
",",
"$",
"userid",
")",
"{",
"global",
"$",
"DB",
";",
"// Search for a record.",
"$",
"params",
"=",
"array",
"(",
"'assignment'",
"=>",
"$",
"assignid",
",",
"'userid'",
"... | 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 | [
"Lookup",
"this",
"user",
"id",
"and",
"return",
"the",
"unique",
"id",
"for",
"this",
"assignment",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L8771-L8796 |
215,055 | moodle/moodle | mod/assign/locallib.php | assign.get_user_id_for_uniqueid_static | public static function get_user_id_for_uniqueid_static($assignid, $uniqueid) {
global $DB;
// Search for a record.
if ($record = $DB->get_record('assign_user_mapping',
array('assignment'=>$assignid, 'id'=>$uniqueid),
'u... | php | public static function get_user_id_for_uniqueid_static($assignid, $uniqueid) {
global $DB;
// Search for a record.
if ($record = $DB->get_record('assign_user_mapping',
array('assignment'=>$assignid, 'id'=>$uniqueid),
'u... | [
"public",
"static",
"function",
"get_user_id_for_uniqueid_static",
"(",
"$",
"assignid",
",",
"$",
"uniqueid",
")",
"{",
"global",
"$",
"DB",
";",
"// Search for a record.",
"if",
"(",
"$",
"record",
"=",
"$",
"DB",
"->",
"get_record",
"(",
"'assign_user_mapping... | Lookup this unique id and return the user id for this assignment.
@param int $assignid The id of the assignment this user mapping is in
@param int $uniqueid The uniqueid to lookup
@return int The user id or false if they don't exist | [
"Lookup",
"this",
"unique",
"id",
"and",
"return",
"the",
"user",
"id",
"for",
"this",
"assignment",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L8815-L8827 |
215,056 | moodle/moodle | mod/assign/locallib.php | assign.get_marking_workflow_states_for_current_user | public function get_marking_workflow_states_for_current_user() {
if (!empty($this->markingworkflowstates)) {
return $this->markingworkflowstates;
}
$states = array();
if (has_capability('mod/assign:grade', $this->context)) {
$states[ASSIGN_MARKING_WORKFLOW_STATE_I... | php | public function get_marking_workflow_states_for_current_user() {
if (!empty($this->markingworkflowstates)) {
return $this->markingworkflowstates;
}
$states = array();
if (has_capability('mod/assign:grade', $this->context)) {
$states[ASSIGN_MARKING_WORKFLOW_STATE_I... | [
"public",
"function",
"get_marking_workflow_states_for_current_user",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"markingworkflowstates",
")",
")",
"{",
"return",
"$",
"this",
"->",
"markingworkflowstates",
";",
"}",
"$",
"states",
"=",
"a... | Get the list of marking_workflow states the current user has permission to transition a grade to.
@return array of state => description | [
"Get",
"the",
"list",
"of",
"marking_workflow",
"states",
"the",
"current",
"user",
"has",
"permission",
"to",
"transition",
"a",
"grade",
"to",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L8834-L8854 |
215,057 | moodle/moodle | mod/assign/locallib.php | assign.show_only_active_users | public function show_only_active_users() {
global $CFG;
if (is_null($this->showonlyactiveenrol)) {
$defaultgradeshowactiveenrol = !empty($CFG->grade_report_showonlyactiveenrol);
$this->showonlyactiveenrol = get_user_preferences('grade_report_showonlyactiveenrol', $defaultgradesh... | php | public function show_only_active_users() {
global $CFG;
if (is_null($this->showonlyactiveenrol)) {
$defaultgradeshowactiveenrol = !empty($CFG->grade_report_showonlyactiveenrol);
$this->showonlyactiveenrol = get_user_preferences('grade_report_showonlyactiveenrol', $defaultgradesh... | [
"public",
"function",
"show_only_active_users",
"(",
")",
"{",
"global",
"$",
"CFG",
";",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"showonlyactiveenrol",
")",
")",
"{",
"$",
"defaultgradeshowactiveenrol",
"=",
"!",
"empty",
"(",
"$",
"CFG",
"->",
"gra... | Check is only active users in course should be shown.
@return bool true if only active users should be shown. | [
"Check",
"is",
"only",
"active",
"users",
"in",
"course",
"should",
"be",
"shown",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L8861-L8874 |
215,058 | moodle/moodle | mod/assign/locallib.php | assign.is_gradebook_feedback_enabled | public function is_gradebook_feedback_enabled() {
// Get default grade book feedback plugin.
$adminconfig = $this->get_admin_config();
$gradebookplugin = $adminconfig->feedback_plugin_for_gradebook;
$gradebookplugin = str_replace('assignfeedback_', '', $gradebookplugin);
// Chec... | php | public function is_gradebook_feedback_enabled() {
// Get default grade book feedback plugin.
$adminconfig = $this->get_admin_config();
$gradebookplugin = $adminconfig->feedback_plugin_for_gradebook;
$gradebookplugin = str_replace('assignfeedback_', '', $gradebookplugin);
// Chec... | [
"public",
"function",
"is_gradebook_feedback_enabled",
"(",
")",
"{",
"// Get default grade book feedback plugin.",
"$",
"adminconfig",
"=",
"$",
"this",
"->",
"get_admin_config",
"(",
")",
";",
"$",
"gradebookplugin",
"=",
"$",
"adminconfig",
"->",
"feedback_plugin_for... | Returns true if gradebook feedback plugin is enabled
@return bool true if gradebook feedback plugin is enabled and visible else false. | [
"Returns",
"true",
"if",
"gradebook",
"feedback",
"plugin",
"is",
"enabled"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L8891-L8910 |
215,059 | moodle/moodle | mod/assign/locallib.php | assign.get_grading_status | public function get_grading_status($userid) {
if ($this->get_instance()->markingworkflow) {
$flags = $this->get_user_flags($userid, false);
if (!empty($flags->workflowstate)) {
return $flags->workflowstate;
}
return ASSIGN_MARKING_WORKFLOW_STATE_NO... | php | public function get_grading_status($userid) {
if ($this->get_instance()->markingworkflow) {
$flags = $this->get_user_flags($userid, false);
if (!empty($flags->workflowstate)) {
return $flags->workflowstate;
}
return ASSIGN_MARKING_WORKFLOW_STATE_NO... | [
"public",
"function",
"get_grading_status",
"(",
"$",
"userid",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"get_instance",
"(",
")",
"->",
"markingworkflow",
")",
"{",
"$",
"flags",
"=",
"$",
"this",
"->",
"get_user_flags",
"(",
"$",
"userid",
",",
"false",... | Returns the grading status.
@param int $userid the user id
@return string returns the grading status | [
"Returns",
"the",
"grading",
"status",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L8918-L8935 |
215,060 | moodle/moodle | mod/assign/locallib.php | assign.get_useridlist_key | public function get_useridlist_key($id = null) {
if ($id === null) {
$id = $this->get_useridlist_key_id();
}
return $this->get_course_module()->id . '_' . $id;
} | php | public function get_useridlist_key($id = null) {
if ($id === null) {
$id = $this->get_useridlist_key_id();
}
return $this->get_course_module()->id . '_' . $id;
} | [
"public",
"function",
"get_useridlist_key",
"(",
"$",
"id",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"id",
"===",
"null",
")",
"{",
"$",
"id",
"=",
"$",
"this",
"->",
"get_useridlist_key_id",
"(",
")",
";",
"}",
"return",
"$",
"this",
"->",
"get_course... | Generates the key that should be used for an entry in the useridlist cache.
@param string $id Generate a key for this instance (optional)
@return string The key for the id, or new entry if no $id is passed. | [
"Generates",
"the",
"key",
"that",
"should",
"be",
"used",
"for",
"an",
"entry",
"in",
"the",
"useridlist",
"cache",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L8952-L8957 |
215,061 | moodle/moodle | mod/assign/locallib.php | assign.update_activity_completion_records | protected function update_activity_completion_records($teamsubmission,
$requireallteammemberssubmit,
$submission,
$userid,
... | php | protected function update_activity_completion_records($teamsubmission,
$requireallteammemberssubmit,
$submission,
$userid,
... | [
"protected",
"function",
"update_activity_completion_records",
"(",
"$",
"teamsubmission",
",",
"$",
"requireallteammemberssubmit",
",",
"$",
"submission",
",",
"$",
"userid",
",",
"$",
"complete",
",",
"$",
"completion",
")",
"{",
"if",
"(",
"(",
"$",
"teamsubm... | Updates and creates the completion records in mdl_course_modules_completion.
@param int $teamsubmission value of 0 or 1 to indicate whether this is a group activity
@param int $requireallteammemberssubmit value of 0 or 1 to indicate whether all group members must click Submit
@param obj $submission the submission
@par... | [
"Updates",
"and",
"creates",
"the",
"completion",
"records",
"in",
"mdl_course_modules_completion",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L8971-L8992 |
215,062 | moodle/moodle | mod/assign/locallib.php | assign.add_grade_notices | protected function add_grade_notices() {
if (has_capability('mod/assign:grade', $this->get_context()) && get_config('assign', 'has_rescaled_null_grades_' . $this->get_instance()->id)) {
$link = new \moodle_url('/mod/assign/view.php', array('id' => $this->get_course_module()->id, 'action' => 'fixresc... | php | protected function add_grade_notices() {
if (has_capability('mod/assign:grade', $this->get_context()) && get_config('assign', 'has_rescaled_null_grades_' . $this->get_instance()->id)) {
$link = new \moodle_url('/mod/assign/view.php', array('id' => $this->get_course_module()->id, 'action' => 'fixresc... | [
"protected",
"function",
"add_grade_notices",
"(",
")",
"{",
"if",
"(",
"has_capability",
"(",
"'mod/assign:grade'",
",",
"$",
"this",
"->",
"get_context",
"(",
")",
")",
"&&",
"get_config",
"(",
"'assign'",
",",
"'has_rescaled_null_grades_'",
".",
"$",
"this",
... | Checks for any grade notices, and adds notifications. Will display on assignment main page and grading table.
@return void The notifications API will render the notifications at the appropriate part of the page. | [
"Checks",
"for",
"any",
"grade",
"notices",
"and",
"adds",
"notifications",
".",
"Will",
"display",
"on",
"assignment",
"main",
"page",
"and",
"grading",
"table",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L9024-L9029 |
215,063 | moodle/moodle | mod/assign/locallib.php | assign.get_marking_allocation_filters | public function get_marking_allocation_filters($export = false) {
$markingallocation = $this->get_instance()->markingworkflow &&
$this->get_instance()->markingallocation &&
has_capability('mod/assign:manageallocations', $this->context);
// Get markers to use in drop lists.
... | php | public function get_marking_allocation_filters($export = false) {
$markingallocation = $this->get_instance()->markingworkflow &&
$this->get_instance()->markingallocation &&
has_capability('mod/assign:manageallocations', $this->context);
// Get markers to use in drop lists.
... | [
"public",
"function",
"get_marking_allocation_filters",
"(",
"$",
"export",
"=",
"false",
")",
"{",
"$",
"markingallocation",
"=",
"$",
"this",
"->",
"get_instance",
"(",
")",
"->",
"markingworkflow",
"&&",
"$",
"this",
"->",
"get_instance",
"(",
")",
"->",
... | Return array of valid grading allocation filters for the grading interface.
@param boolean $export Export the list of filters for a template.
@return array | [
"Return",
"array",
"of",
"valid",
"grading",
"allocation",
"filters",
"for",
"the",
"grading",
"interface",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L9123-L9153 |
215,064 | moodle/moodle | mod/assign/locallib.php | assign.get_marking_workflow_filters | public function get_marking_workflow_filters($export = false) {
$markingworkflow = $this->get_instance()->markingworkflow;
// Get marking states to show in form.
$markingworkflowoptions = array();
if ($markingworkflow) {
$notmarked = get_string('markingworkflowstatenotmarked'... | php | public function get_marking_workflow_filters($export = false) {
$markingworkflow = $this->get_instance()->markingworkflow;
// Get marking states to show in form.
$markingworkflowoptions = array();
if ($markingworkflow) {
$notmarked = get_string('markingworkflowstatenotmarked'... | [
"public",
"function",
"get_marking_workflow_filters",
"(",
"$",
"export",
"=",
"false",
")",
"{",
"$",
"markingworkflow",
"=",
"$",
"this",
"->",
"get_instance",
"(",
")",
"->",
"markingworkflow",
";",
"// Get marking states to show in form.",
"$",
"markingworkflowopt... | Return array of valid grading workflow filters for the grading interface.
@param boolean $export Export the list of filters for a template.
@return array | [
"Return",
"array",
"of",
"valid",
"grading",
"workflow",
"filters",
"for",
"the",
"grading",
"interface",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L9161-L9184 |
215,065 | moodle/moodle | mod/assign/locallib.php | assign.get_filters | public function get_filters() {
$filterkeys = [
ASSIGN_FILTER_SUBMITTED,
ASSIGN_FILTER_NOT_SUBMITTED,
ASSIGN_FILTER_REQUIRE_GRADING,
ASSIGN_FILTER_GRANTED_EXTENSION
];
$current = get_user_preferences('assign_filter', '');
$filters = [];
... | php | public function get_filters() {
$filterkeys = [
ASSIGN_FILTER_SUBMITTED,
ASSIGN_FILTER_NOT_SUBMITTED,
ASSIGN_FILTER_REQUIRE_GRADING,
ASSIGN_FILTER_GRANTED_EXTENSION
];
$current = get_user_preferences('assign_filter', '');
$filters = [];
... | [
"public",
"function",
"get_filters",
"(",
")",
"{",
"$",
"filterkeys",
"=",
"[",
"ASSIGN_FILTER_SUBMITTED",
",",
"ASSIGN_FILTER_NOT_SUBMITTED",
",",
"ASSIGN_FILTER_REQUIRE_GRADING",
",",
"ASSIGN_FILTER_GRANTED_EXTENSION",
"]",
";",
"$",
"current",
"=",
"get_user_preferenc... | Return array of valid search filters for the grading interface.
@return array | [
"Return",
"array",
"of",
"valid",
"search",
"filters",
"for",
"the",
"grading",
"interface",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L9191-L9217 |
215,066 | moodle/moodle | mod/assign/locallib.php | assign.get_submissionstatement | protected function get_submissionstatement($adminconfig, $instance, $context) {
$submissionstatement = '';
if (!($context instanceof context)) {
return $submissionstatement;
}
// Single submission.
if (!$instance->teamsubmission) {
// Single submission s... | php | protected function get_submissionstatement($adminconfig, $instance, $context) {
$submissionstatement = '';
if (!($context instanceof context)) {
return $submissionstatement;
}
// Single submission.
if (!$instance->teamsubmission) {
// Single submission s... | [
"protected",
"function",
"get_submissionstatement",
"(",
"$",
"adminconfig",
",",
"$",
"instance",
",",
"$",
"context",
")",
"{",
"$",
"submissionstatement",
"=",
"''",
";",
"if",
"(",
"!",
"(",
"$",
"context",
"instanceof",
"context",
")",
")",
"{",
"retu... | Get the correct submission statement depending on single submisison, team submission or team submission
where all team memebers must submit.
@param array $adminconfig
@param assign $instance
@param context $context
@return string | [
"Get",
"the",
"correct",
"submission",
"statement",
"depending",
"on",
"single",
"submisison",
"team",
"submission",
"or",
"team",
"submission",
"where",
"all",
"team",
"memebers",
"must",
"submit",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L9229-L9274 |
215,067 | moodle/moodle | mod/assign/locallib.php | assign_portfolio_caller.load_data | public function load_data() {
global $DB;
$context = context_module::instance($this->cmid);
if (empty($this->fileid)) {
if (empty($this->sid) || empty($this->area)) {
throw new portfolio_caller_exception('invalidfileandsubmissionid', 'mod_assign');
}
... | php | public function load_data() {
global $DB;
$context = context_module::instance($this->cmid);
if (empty($this->fileid)) {
if (empty($this->sid) || empty($this->area)) {
throw new portfolio_caller_exception('invalidfileandsubmissionid', 'mod_assign');
}
... | [
"public",
"function",
"load_data",
"(",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"context",
"=",
"context_module",
"::",
"instance",
"(",
"$",
"this",
"->",
"cmid",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"fileid",
")",
")",
"{",
"if"... | Load data needed for the portfolio export.
If the assignment type implements portfolio_load_data(), the processing is delegated
to it. Otherwise, the caller must provide either fileid (to export single file) or
submissionid and filearea (to export all data attached to the given submission file area)
via callback argum... | [
"Load",
"data",
"needed",
"for",
"the",
"portfolio",
"export",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L9342-L9382 |
215,068 | moodle/moodle | mod/assign/locallib.php | assign_portfolio_caller.get_submission_plugin | protected function get_submission_plugin() {
global $CFG;
if (!$this->plugin || !$this->cmid) {
return null;
}
require_once($CFG->dirroot . '/mod/assign/locallib.php');
$context = context_module::instance($this->cmid);
$assignment = new assign($context, nul... | php | protected function get_submission_plugin() {
global $CFG;
if (!$this->plugin || !$this->cmid) {
return null;
}
require_once($CFG->dirroot . '/mod/assign/locallib.php');
$context = context_module::instance($this->cmid);
$assignment = new assign($context, nul... | [
"protected",
"function",
"get_submission_plugin",
"(",
")",
"{",
"global",
"$",
"CFG",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"plugin",
"||",
"!",
"$",
"this",
"->",
"cmid",
")",
"{",
"return",
"null",
";",
"}",
"require_once",
"(",
"$",
"CFG",
"->"... | Fetch the plugin by its type.
@return assign_submission_plugin | [
"Fetch",
"the",
"plugin",
"by",
"its",
"type",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L9487-L9499 |
215,069 | moodle/moodle | mod/assign/locallib.php | assign_portfolio_caller.get_sha1 | public function get_sha1() {
if ($this->plugin && $this->editor) {
$plugin = $this->get_submission_plugin();
$options = portfolio_format_text_options();
$options->context = context_module::instance($this->cmid);
$text = format_text($plugin->get_editor_text($this... | php | public function get_sha1() {
if ($this->plugin && $this->editor) {
$plugin = $this->get_submission_plugin();
$options = portfolio_format_text_options();
$options->context = context_module::instance($this->cmid);
$text = format_text($plugin->get_editor_text($this... | [
"public",
"function",
"get_sha1",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"plugin",
"&&",
"$",
"this",
"->",
"editor",
")",
"{",
"$",
"plugin",
"=",
"$",
"this",
"->",
"get_submission_plugin",
"(",
")",
";",
"$",
"options",
"=",
"portfolio_format_... | Calculate a sha1 has of either a single file or a list
of files based on the data set by load_data.
@return string | [
"Calculate",
"a",
"sha1",
"has",
"of",
"either",
"a",
"single",
"file",
"or",
"a",
"list",
"of",
"files",
"based",
"on",
"the",
"data",
"set",
"by",
"load_data",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L9507-L9527 |
215,070 | moodle/moodle | lib/mustache/src/Mustache/Logger/StreamLogger.php | Mustache_Logger_StreamLogger.setLevel | public function setLevel($level)
{
if (!array_key_exists($level, self::$levels)) {
throw new Mustache_Exception_InvalidArgumentException(sprintf('Unexpected logging level: %s', $level));
}
$this->level = $level;
} | php | public function setLevel($level)
{
if (!array_key_exists($level, self::$levels)) {
throw new Mustache_Exception_InvalidArgumentException(sprintf('Unexpected logging level: %s', $level));
}
$this->level = $level;
} | [
"public",
"function",
"setLevel",
"(",
"$",
"level",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"level",
",",
"self",
"::",
"$",
"levels",
")",
")",
"{",
"throw",
"new",
"Mustache_Exception_InvalidArgumentException",
"(",
"sprintf",
"(",
"'Unexp... | Set the minimum logging level.
@throws Mustache_Exception_InvalidArgumentException if the logging level is unknown
@param int $level The minimum logging level which will be written | [
"Set",
"the",
"minimum",
"logging",
"level",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/mustache/src/Mustache/Logger/StreamLogger.php#L72-L79 |
215,071 | moodle/moodle | lib/mustache/src/Mustache/Logger/StreamLogger.php | Mustache_Logger_StreamLogger.writeLog | protected function writeLog($level, $message, array $context = array())
{
if (!is_resource($this->stream)) {
if (!isset($this->url)) {
throw new Mustache_Exception_LogicException('Missing stream url, the stream can not be opened. This may be caused by a premature call to close().... | php | protected function writeLog($level, $message, array $context = array())
{
if (!is_resource($this->stream)) {
if (!isset($this->url)) {
throw new Mustache_Exception_LogicException('Missing stream url, the stream can not be opened. This may be caused by a premature call to close().... | [
"protected",
"function",
"writeLog",
"(",
"$",
"level",
",",
"$",
"message",
",",
"array",
"$",
"context",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"!",
"is_resource",
"(",
"$",
"this",
"->",
"stream",
")",
")",
"{",
"if",
"(",
"!",
"isset",
... | Write a record to the log.
@throws Mustache_Exception_LogicException If neither a stream resource nor url is present
@throws Mustache_Exception_RuntimeException If the stream url cannot be opened
@param int $level The logging level
@param string $message The log message
@param array $context The log context | [
"Write",
"a",
"record",
"to",
"the",
"log",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/mustache/src/Mustache/Logger/StreamLogger.php#L121-L137 |
215,072 | moodle/moodle | lib/mustache/src/Mustache/Logger/StreamLogger.php | Mustache_Logger_StreamLogger.formatLine | protected static function formatLine($level, $message, array $context = array())
{
return sprintf(
"%s: %s\n",
self::getLevelName($level),
self::interpolateMessage($message, $context)
);
} | php | protected static function formatLine($level, $message, array $context = array())
{
return sprintf(
"%s: %s\n",
self::getLevelName($level),
self::interpolateMessage($message, $context)
);
} | [
"protected",
"static",
"function",
"formatLine",
"(",
"$",
"level",
",",
"$",
"message",
",",
"array",
"$",
"context",
"=",
"array",
"(",
")",
")",
"{",
"return",
"sprintf",
"(",
"\"%s: %s\\n\"",
",",
"self",
"::",
"getLevelName",
"(",
"$",
"level",
")",... | Format a log line for output.
@param int $level The logging level
@param string $message The log message
@param array $context The log context
@return string | [
"Format",
"a",
"log",
"line",
"for",
"output",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/mustache/src/Mustache/Logger/StreamLogger.php#L162-L169 |
215,073 | moodle/moodle | lib/mustache/src/Mustache/LambdaHelper.php | Mustache_LambdaHelper.render | public function render($string)
{
return $this->mustache
->loadLambda((string) $string, $this->delims)
->renderInternal($this->context);
} | php | public function render($string)
{
return $this->mustache
->loadLambda((string) $string, $this->delims)
->renderInternal($this->context);
} | [
"public",
"function",
"render",
"(",
"$",
"string",
")",
"{",
"return",
"$",
"this",
"->",
"mustache",
"->",
"loadLambda",
"(",
"(",
"string",
")",
"$",
"string",
",",
"$",
"this",
"->",
"delims",
")",
"->",
"renderInternal",
"(",
"$",
"this",
"->",
... | Render a string as a Mustache template with the current rendering context.
@param string $string
@return string Rendered template | [
"Render",
"a",
"string",
"as",
"a",
"Mustache",
"template",
"with",
"the",
"current",
"rendering",
"context",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/mustache/src/Mustache/LambdaHelper.php#L46-L51 |
215,074 | moodle/moodle | mod/assign/feedback/offline/importgradeslib.php | assignfeedback_offline_grade_importer.init | public function init() {
if ($this->csvreader == null) {
$this->csvreader = new csv_import_reader($this->importid, 'assignfeedback_offline');
}
$this->csvreader->init();
$columns = $this->csvreader->get_columns();
$strgrade = get_string('grade');
$strid = ge... | php | public function init() {
if ($this->csvreader == null) {
$this->csvreader = new csv_import_reader($this->importid, 'assignfeedback_offline');
}
$this->csvreader->init();
$columns = $this->csvreader->get_columns();
$strgrade = get_string('grade');
$strid = ge... | [
"public",
"function",
"init",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"csvreader",
"==",
"null",
")",
"{",
"$",
"this",
"->",
"csvreader",
"=",
"new",
"csv_import_reader",
"(",
"$",
"this",
"->",
"importid",
",",
"'assignfeedback_offline'",
")",
";"... | Initialise the import reader and locate the column indexes.
@return bool false is a failed import | [
"Initialise",
"the",
"import",
"reader",
"and",
"locate",
"the",
"column",
"indexes",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/feedback/offline/importgradeslib.php#L96-L149 |
215,075 | moodle/moodle | question/classes/statistics/responses/analysis_for_subpart.php | analysis_for_subpart.count_response | public function count_response($subpart, $try = 0) {
$responseanalysisforclass = $this->get_response_class($subpart->responseclassid);
$responseanalysisforclass->count_response($subpart->response, $subpart->fraction, $try);
} | php | public function count_response($subpart, $try = 0) {
$responseanalysisforclass = $this->get_response_class($subpart->responseclassid);
$responseanalysisforclass->count_response($subpart->response, $subpart->fraction, $try);
} | [
"public",
"function",
"count_response",
"(",
"$",
"subpart",
",",
"$",
"try",
"=",
"0",
")",
"{",
"$",
"responseanalysisforclass",
"=",
"$",
"this",
"->",
"get_response_class",
"(",
"$",
"subpart",
"->",
"responseclassid",
")",
";",
"$",
"responseanalysisforcl... | Count a part of a response.
@param \question_classified_response $subpart
@param int $try the try number or zero if not keeping track of try number | [
"Count",
"a",
"part",
"of",
"a",
"response",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/classes/statistics/responses/analysis_for_subpart.php#L109-L112 |
215,076 | moodle/moodle | question/classes/statistics/responses/analysis_for_subpart.php | analysis_for_subpart.cache | public function cache($qubaids, $whichtries, $questionid, $variantno, $subpartid) {
foreach ($this->get_response_class_ids() as $responseclassid) {
$analysisforclass = $this->get_response_class($responseclassid);
$analysisforclass->cache($qubaids, $whichtries, $questionid, $variantno, $s... | php | public function cache($qubaids, $whichtries, $questionid, $variantno, $subpartid) {
foreach ($this->get_response_class_ids() as $responseclassid) {
$analysisforclass = $this->get_response_class($responseclassid);
$analysisforclass->cache($qubaids, $whichtries, $questionid, $variantno, $s... | [
"public",
"function",
"cache",
"(",
"$",
"qubaids",
",",
"$",
"whichtries",
",",
"$",
"questionid",
",",
"$",
"variantno",
",",
"$",
"subpartid",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"get_response_class_ids",
"(",
")",
"as",
"$",
"responseclassid",... | Cache analysis for sub part.
@param \qubaid_condition $qubaids which question usages have been analysed.
@param string $whichtries which tries have been analysed?
@param int $questionid which question.
@param int $variantno which variant.
@param string $subpartid ... | [
"Cache",
"analysis",
"for",
"sub",
"part",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/classes/statistics/responses/analysis_for_subpart.php#L123-L128 |
215,077 | moodle/moodle | question/classes/statistics/responses/analysis_for_subpart.php | analysis_for_subpart.has_actual_responses | public function has_actual_responses() {
foreach ($this->get_response_class_ids() as $responseclassid) {
if ($this->get_response_class($responseclassid)->has_actual_responses()) {
return true;
}
}
return false;
} | php | public function has_actual_responses() {
foreach ($this->get_response_class_ids() as $responseclassid) {
if ($this->get_response_class($responseclassid)->has_actual_responses()) {
return true;
}
}
return false;
} | [
"public",
"function",
"has_actual_responses",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"get_response_class_ids",
"(",
")",
"as",
"$",
"responseclassid",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"get_response_class",
"(",
"$",
"responseclassid",
")",
... | Has actual responses different to the model response for this class?
@return bool whether this analysis has a response class with more than one
different actual response, or if the actual response is different from
the model response. | [
"Has",
"actual",
"responses",
"different",
"to",
"the",
"model",
"response",
"for",
"this",
"class?"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/classes/statistics/responses/analysis_for_subpart.php#L137-L144 |
215,078 | moodle/moodle | question/classes/statistics/responses/analysis_for_subpart.php | analysis_for_subpart.get_maximum_tries | public function get_maximum_tries() {
$max = 1;
foreach ($this->get_response_class_ids() as $responseclassid) {
$max = max($max, $this->get_response_class($responseclassid)->get_maximum_tries());
}
return $max;
} | php | public function get_maximum_tries() {
$max = 1;
foreach ($this->get_response_class_ids() as $responseclassid) {
$max = max($max, $this->get_response_class($responseclassid)->get_maximum_tries());
}
return $max;
} | [
"public",
"function",
"get_maximum_tries",
"(",
")",
"{",
"$",
"max",
"=",
"1",
";",
"foreach",
"(",
"$",
"this",
"->",
"get_response_class_ids",
"(",
")",
"as",
"$",
"responseclassid",
")",
"{",
"$",
"max",
"=",
"max",
"(",
"$",
"max",
",",
"$",
"th... | What is the highest try number for this sub part?
@return int max tries | [
"What",
"is",
"the",
"highest",
"try",
"number",
"for",
"this",
"sub",
"part?"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/classes/statistics/responses/analysis_for_subpart.php#L151-L157 |
215,079 | moodle/moodle | mod/quiz/report/overview/report.php | quiz_overview_report.process_actions | protected function process_actions($quiz, $cm, $currentgroup, \core\dml\sql_join $groupstudentsjoins,
\core\dml\sql_join $allowedjoins, $redirecturl) {
parent::process_actions($quiz, $cm, $currentgroup, $groupstudentsjoins, $allowedjoins, $redirecturl);
if (empty($currentgroup) || $this->ha... | php | protected function process_actions($quiz, $cm, $currentgroup, \core\dml\sql_join $groupstudentsjoins,
\core\dml\sql_join $allowedjoins, $redirecturl) {
parent::process_actions($quiz, $cm, $currentgroup, $groupstudentsjoins, $allowedjoins, $redirecturl);
if (empty($currentgroup) || $this->ha... | [
"protected",
"function",
"process_actions",
"(",
"$",
"quiz",
",",
"$",
"cm",
",",
"$",
"currentgroup",
",",
"\\",
"core",
"\\",
"dml",
"\\",
"sql_join",
"$",
"groupstudentsjoins",
",",
"\\",
"core",
"\\",
"dml",
"\\",
"sql_join",
"$",
"allowedjoins",
",",... | Extends parent function processing any submitted actions.
@param object $quiz
@param object $cm
@param int $currentgroup
@param \core\dml\sql_join $groupstudentsjoins (joins, wheres, params)
@param \core\dml\sql_join $allowedjoins (joins, wheres, params)
@param moodle_url $redirecturl | [
"Extends",
"parent",
"function",
"processing",
"any",
"submitted",
"actions",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/report/overview/report.php#L246-L275 |
215,080 | moodle/moodle | mod/quiz/report/overview/report.php | quiz_overview_report.start_regrade | protected function start_regrade($quiz, $cm) {
require_capability('mod/quiz:regrade', $this->context);
$this->print_header_and_tabs($cm, $this->course, $quiz, $this->mode);
} | php | protected function start_regrade($quiz, $cm) {
require_capability('mod/quiz:regrade', $this->context);
$this->print_header_and_tabs($cm, $this->course, $quiz, $this->mode);
} | [
"protected",
"function",
"start_regrade",
"(",
"$",
"quiz",
",",
"$",
"cm",
")",
"{",
"require_capability",
"(",
"'mod/quiz:regrade'",
",",
"$",
"this",
"->",
"context",
")",
";",
"$",
"this",
"->",
"print_header_and_tabs",
"(",
"$",
"cm",
",",
"$",
"this"... | 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. | [
"Check",
"necessary",
"capabilities",
"and",
"start",
"the",
"display",
"of",
"the",
"regrade",
"progress",
"page",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/report/overview/report.php#L282-L285 |
215,081 | moodle/moodle | mod/quiz/report/overview/report.php | quiz_overview_report.finish_regrade | protected function finish_regrade($nexturl) {
global $OUTPUT;
\core\notification::success(get_string('regradecomplete', 'quiz_overview'));
echo $OUTPUT->continue_button($nexturl);
echo $OUTPUT->footer();
die();
} | php | protected function finish_regrade($nexturl) {
global $OUTPUT;
\core\notification::success(get_string('regradecomplete', 'quiz_overview'));
echo $OUTPUT->continue_button($nexturl);
echo $OUTPUT->footer();
die();
} | [
"protected",
"function",
"finish_regrade",
"(",
"$",
"nexturl",
")",
"{",
"global",
"$",
"OUTPUT",
";",
"\\",
"core",
"\\",
"notification",
"::",
"success",
"(",
"get_string",
"(",
"'regradecomplete'",
",",
"'quiz_overview'",
")",
")",
";",
"echo",
"$",
"OUT... | Finish displaying the regrade progress page.
@param moodle_url $nexturl where to send the user after the regrade.
@uses exit. This method never returns. | [
"Finish",
"displaying",
"the",
"regrade",
"progress",
"page",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/report/overview/report.php#L292-L298 |
215,082 | moodle/moodle | mod/quiz/report/overview/report.php | quiz_overview_report.regrade_attempts | protected function regrade_attempts($quiz, $dryrun = false,
\core\dml\sql_join$groupstudentsjoins = null, $attemptids = array()) {
global $DB;
$this->unlock_session();
$sql = "SELECT quiza.*
FROM {quiz_attempts} quiza";
$where = "quiz = :qid AND preview = 0... | php | protected function regrade_attempts($quiz, $dryrun = false,
\core\dml\sql_join$groupstudentsjoins = null, $attemptids = array()) {
global $DB;
$this->unlock_session();
$sql = "SELECT quiza.*
FROM {quiz_attempts} quiza";
$where = "quiz = :qid AND preview = 0... | [
"protected",
"function",
"regrade_attempts",
"(",
"$",
"quiz",
",",
"$",
"dryrun",
"=",
"false",
",",
"\\",
"core",
"\\",
"dml",
"\\",
"sql_join",
"$",
"groupstudentsjoins",
"=",
"null",
",",
"$",
"attemptids",
"=",
"array",
"(",
")",
")",
"{",
"global",... | Regrade attempts for this quiz, exactly which attempts are regraded is
controlled by the parameters.
@param object $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
... | [
"Regrade",
"attempts",
"for",
"this",
"quiz",
"exactly",
"which",
"attempts",
"are",
"regraded",
"is",
"controlled",
"by",
"the",
"parameters",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/report/overview/report.php#L374-L419 |
215,083 | moodle/moodle | mod/quiz/report/overview/report.php | quiz_overview_report.regrade_attempts_needing_it | protected function regrade_attempts_needing_it($quiz, \core\dml\sql_join $groupstudentsjoins) {
global $DB;
$this->unlock_session();
$join = '{quiz_overview_regrades} qqr ON qqr.questionusageid = quiza.uniqueid';
$where = "quiza.quiz = :qid AND quiza.preview = 0 AND qqr.regraded = 0";
... | php | protected function regrade_attempts_needing_it($quiz, \core\dml\sql_join $groupstudentsjoins) {
global $DB;
$this->unlock_session();
$join = '{quiz_overview_regrades} qqr ON qqr.questionusageid = quiza.uniqueid';
$where = "quiza.quiz = :qid AND quiza.preview = 0 AND qqr.regraded = 0";
... | [
"protected",
"function",
"regrade_attempts_needing_it",
"(",
"$",
"quiz",
",",
"\\",
"core",
"\\",
"dml",
"\\",
"sql_join",
"$",
"groupstudentsjoins",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"this",
"->",
"unlock_session",
"(",
")",
";",
"$",
"join",
"=",... | 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 \core\dml\sql_join $groupstudentsjoins empty for all attempts, otherwise regrade attempts
for these users. | [
"Regrade",
"those",
"questions",
"in",
"those",
"attempts",
"that",
"are",
"marked",
"as",
"needing",
"regrading",
"in",
"the",
"quiz_overview_regrades",
"table",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/report/overview/report.php#L428-L478 |
215,084 | moodle/moodle | mod/quiz/report/overview/report.php | quiz_overview_report.count_question_attempts_needing_regrade | protected function count_question_attempts_needing_regrade($quiz, \core\dml\sql_join $groupstudentsjoins) {
global $DB;
$userjoin = '';
$usertest = '';
$params = array();
if ($this->hasgroupstudents) {
$userjoin = "JOIN {user} u ON u.id = quiza.userid
... | php | protected function count_question_attempts_needing_regrade($quiz, \core\dml\sql_join $groupstudentsjoins) {
global $DB;
$userjoin = '';
$usertest = '';
$params = array();
if ($this->hasgroupstudents) {
$userjoin = "JOIN {user} u ON u.id = quiza.userid
... | [
"protected",
"function",
"count_question_attempts_needing_regrade",
"(",
"$",
"quiz",
",",
"\\",
"core",
"\\",
"dml",
"\\",
"sql_join",
"$",
"groupstudentsjoins",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"userjoin",
"=",
"''",
";",
"$",
"usertest",
"=",
"''"... | Count the number of attempts in need of a regrade.
@param object $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. | [
"Count",
"the",
"number",
"of",
"attempts",
"in",
"need",
"of",
"a",
"regrade",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/report/overview/report.php#L486-L510 |
215,085 | moodle/moodle | mod/quiz/report/overview/report.php | quiz_overview_report.get_bands_count_and_width | public static function get_bands_count_and_width($quiz) {
$bands = $quiz->grade;
while ($bands > 20 || $bands <= 10) {
if ($bands > 50) {
$bands /= 5;
} else if ($bands > 20) {
$bands /= 2;
}
if ($bands < 4) {
... | php | public static function get_bands_count_and_width($quiz) {
$bands = $quiz->grade;
while ($bands > 20 || $bands <= 10) {
if ($bands > 50) {
$bands /= 5;
} else if ($bands > 20) {
$bands /= 2;
}
if ($bands < 4) {
... | [
"public",
"static",
"function",
"get_bands_count_and_width",
"(",
"$",
"quiz",
")",
"{",
"$",
"bands",
"=",
"$",
"quiz",
"->",
"grade",
";",
"while",
"(",
"$",
"bands",
">",
"20",
"||",
"$",
"bands",
"<=",
"10",
")",
"{",
"if",
"(",
"$",
"bands",
"... | Get the bands configuration for the quiz.
This returns the configuration for having between 11 and 20 bars in
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.
@return array Contains the number of bands, an... | [
"Get",
"the",
"bands",
"configuration",
"for",
"the",
"quiz",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/report/overview/report.php#L577-L594 |
215,086 | moodle/moodle | mod/quiz/report/overview/report.php | quiz_overview_report.get_bands_labels | public static function get_bands_labels($bands, $bandwidth, $quiz) {
$bandlabels = [];
for ($i = 1; $i <= $bands; $i++) {
$bandlabels[] = quiz_format_grade($quiz, ($i - 1) * $bandwidth) . ' - ' . quiz_format_grade($quiz, $i * $bandwidth);
}
return $bandlabels;
} | php | public static function get_bands_labels($bands, $bandwidth, $quiz) {
$bandlabels = [];
for ($i = 1; $i <= $bands; $i++) {
$bandlabels[] = quiz_format_grade($quiz, ($i - 1) * $bandwidth) . ' - ' . quiz_format_grade($quiz, $i * $bandwidth);
}
return $bandlabels;
} | [
"public",
"static",
"function",
"get_bands_labels",
"(",
"$",
"bands",
",",
"$",
"bandwidth",
",",
"$",
"quiz",
")",
"{",
"$",
"bandlabels",
"=",
"[",
"]",
";",
"for",
"(",
"$",
"i",
"=",
"1",
";",
"$",
"i",
"<=",
"$",
"bands",
";",
"$",
"i",
"... | Get the bands labels.
@param int $bands The number of bands.
@param int $bandwidth The band width.
@param object $quiz The quiz object.
@return string[] The labels. | [
"Get",
"the",
"bands",
"labels",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/report/overview/report.php#L604-L610 |
215,087 | moodle/moodle | mod/quiz/report/overview/report.php | quiz_overview_report.get_chart | protected static function get_chart($labels, $data) {
$chart = new \core\chart_bar();
$chart->set_labels($labels);
$chart->get_xaxis(0, true)->set_label(get_string('grade'));
$yaxis = $chart->get_yaxis(0, true);
$yaxis->set_label(get_string('participants'));
$yaxis->set_... | php | protected static function get_chart($labels, $data) {
$chart = new \core\chart_bar();
$chart->set_labels($labels);
$chart->get_xaxis(0, true)->set_label(get_string('grade'));
$yaxis = $chart->get_yaxis(0, true);
$yaxis->set_label(get_string('participants'));
$yaxis->set_... | [
"protected",
"static",
"function",
"get_chart",
"(",
"$",
"labels",
",",
"$",
"data",
")",
"{",
"$",
"chart",
"=",
"new",
"\\",
"core",
"\\",
"chart_bar",
"(",
")",
";",
"$",
"chart",
"->",
"set_labels",
"(",
"$",
"labels",
")",
";",
"$",
"chart",
... | Get a chart.
@param string[] $labels Chart labels.
@param int[] $data The data.
@return \core\chart_base | [
"Get",
"a",
"chart",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/report/overview/report.php#L619-L631 |
215,088 | moodle/moodle | lib/phpexcel/PHPExcel/Shared/File.php | PHPExcel_Shared_File.file_exists | public static function file_exists($pFilename)
{
// Sick construction, but it seems that
// file_exists returns strange values when
// doing the original file_exists on ZIP archives...
if (strtolower(substr($pFilename, 0, 3)) == 'zip') {
// Open ZIP file and verify if the... | php | public static function file_exists($pFilename)
{
// Sick construction, but it seems that
// file_exists returns strange values when
// doing the original file_exists on ZIP archives...
if (strtolower(substr($pFilename, 0, 3)) == 'zip') {
// Open ZIP file and verify if the... | [
"public",
"static",
"function",
"file_exists",
"(",
"$",
"pFilename",
")",
"{",
"// Sick construction, but it seems that",
"// file_exists returns strange values when",
"// doing the original file_exists on ZIP archives...",
"if",
"(",
"strtolower",
"(",
"substr",
"(",
"$",
"pF... | Verify if a file exists
@param string $pFilename Filename
@return bool | [
"Verify",
"if",
"a",
"file",
"exists"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/phpexcel/PHPExcel/Shared/File.php#L67-L89 |
215,089 | moodle/moodle | admin/tool/log/classes/local/privacy/moodle_database_export_and_delete.php | moodle_database_export_and_delete.delete_data_for_userlist | public static function delete_data_for_userlist(\core_privacy\local\request\approved_userlist $userlist) {
list($db, $table) = static::get_database_and_table();
if (!$db || !$table) {
return;
}
list($insql, $inparams) = $db->get_in_or_equal($userlist->get_userids(), SQL_PARAM... | php | public static function delete_data_for_userlist(\core_privacy\local\request\approved_userlist $userlist) {
list($db, $table) = static::get_database_and_table();
if (!$db || !$table) {
return;
}
list($insql, $inparams) = $db->get_in_or_equal($userlist->get_userids(), SQL_PARAM... | [
"public",
"static",
"function",
"delete_data_for_userlist",
"(",
"\\",
"core_privacy",
"\\",
"local",
"\\",
"request",
"\\",
"approved_userlist",
"$",
"userlist",
")",
"{",
"list",
"(",
"$",
"db",
",",
"$",
"table",
")",
"=",
"static",
"::",
"get_database_and_... | Delete all user data for the specified users, in the specified context.
@param \core_privacy\local\request\approved_userlist $contextlist The approved contexts and user information to delete information for. | [
"Delete",
"all",
"user",
"data",
"for",
"the",
"specified",
"users",
"in",
"the",
"specified",
"context",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/log/classes/local/privacy/moodle_database_export_and_delete.php#L128-L136 |
215,090 | moodle/moodle | admin/tool/xmldb/actions/create_xml_file/create_xml_file.class.php | create_xml_file.get_plugin_type | function get_plugin_type($dirpath) {
global $CFG;
$dirpath = $CFG->dirroot.$dirpath;
// Reverse order so that we get subplugin matches.
$plugintypes = array_reverse(core_component::get_plugin_types());
foreach ($plugintypes as $plugintype => $pluginbasedir) {
if (subs... | php | function get_plugin_type($dirpath) {
global $CFG;
$dirpath = $CFG->dirroot.$dirpath;
// Reverse order so that we get subplugin matches.
$plugintypes = array_reverse(core_component::get_plugin_types());
foreach ($plugintypes as $plugintype => $pluginbasedir) {
if (subs... | [
"function",
"get_plugin_type",
"(",
"$",
"dirpath",
")",
"{",
"global",
"$",
"CFG",
";",
"$",
"dirpath",
"=",
"$",
"CFG",
"->",
"dirroot",
".",
"$",
"dirpath",
";",
"// Reverse order so that we get subplugin matches.",
"$",
"plugintypes",
"=",
"array_reverse",
"... | From a given path, work out what type of plugin
this belongs to
@param string $dirpath Path to the db file for this plugin
@return string the type of the plugin or null if not found | [
"From",
"a",
"given",
"path",
"work",
"out",
"what",
"type",
"of",
"plugin",
"this",
"belongs",
"to"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/xmldb/actions/create_xml_file/create_xml_file.class.php#L118-L129 |
215,091 | moodle/moodle | lib/ddl/database_manager.php | database_manager.dispose | public function dispose() {
if ($this->generator) {
$this->generator->dispose();
$this->generator = null;
}
$this->mdb = null;
} | php | public function dispose() {
if ($this->generator) {
$this->generator->dispose();
$this->generator = null;
}
$this->mdb = null;
} | [
"public",
"function",
"dispose",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"generator",
")",
"{",
"$",
"this",
"->",
"generator",
"->",
"dispose",
"(",
")",
";",
"$",
"this",
"->",
"generator",
"=",
"null",
";",
"}",
"$",
"this",
"->",
"mdb",
... | Releases all resources | [
"Releases",
"all",
"resources"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/ddl/database_manager.php#L61-L67 |
215,092 | moodle/moodle | lib/ddl/database_manager.php | database_manager.find_index_name | public function find_index_name(xmldb_table $xmldb_table, xmldb_index $xmldb_index, $returnall = false) {
// Calculate the name of the table
$tablename = $xmldb_table->getName();
// Check the table exists
if (!$this->table_exists($xmldb_table)) {
throw new ddl_table_missing_... | php | public function find_index_name(xmldb_table $xmldb_table, xmldb_index $xmldb_index, $returnall = false) {
// Calculate the name of the table
$tablename = $xmldb_table->getName();
// Check the table exists
if (!$this->table_exists($xmldb_table)) {
throw new ddl_table_missing_... | [
"public",
"function",
"find_index_name",
"(",
"xmldb_table",
"$",
"xmldb_table",
",",
"xmldb_index",
"$",
"xmldb_index",
",",
"$",
"returnall",
"=",
"false",
")",
"{",
"// Calculate the name of the table",
"$",
"tablename",
"=",
"$",
"xmldb_table",
"->",
"getName",
... | Given one xmldb_index, the function returns the name of the index in DB
of false if it doesn't exist
@param xmldb_table $xmldb_table table to be searched
@param xmldb_index $xmldb_index the index to be searched
@param bool $returnall true means return array of all indexes, false means first index only as string
@retur... | [
"Given",
"one",
"xmldb_index",
"the",
"function",
"returns",
"the",
"name",
"of",
"the",
"index",
"in",
"DB",
"of",
"false",
"if",
"it",
"doesn",
"t",
"exist"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/ddl/database_manager.php#L174-L212 |
215,093 | moodle/moodle | lib/ddl/database_manager.php | database_manager.delete_tables_from_xmldb_file | public function delete_tables_from_xmldb_file($file) {
$xmldb_file = new xmldb_file($file);
if (!$xmldb_file->fileExists()) {
throw new ddl_exception('ddlxmlfileerror', null, 'File does not exist');
}
$loaded = $xmldb_file->loadXMLStructure();
$structure = $xmld... | php | public function delete_tables_from_xmldb_file($file) {
$xmldb_file = new xmldb_file($file);
if (!$xmldb_file->fileExists()) {
throw new ddl_exception('ddlxmlfileerror', null, 'File does not exist');
}
$loaded = $xmldb_file->loadXMLStructure();
$structure = $xmld... | [
"public",
"function",
"delete_tables_from_xmldb_file",
"(",
"$",
"file",
")",
"{",
"$",
"xmldb_file",
"=",
"new",
"xmldb_file",
"(",
"$",
"file",
")",
";",
"if",
"(",
"!",
"$",
"xmldb_file",
"->",
"fileExists",
"(",
")",
")",
"{",
"throw",
"new",
"ddl_ex... | This function will delete all tables found in XMLDB file from db
@param string $file Full path to the XML file to be used.
@return void | [
"This",
"function",
"will",
"delete",
"all",
"tables",
"found",
"in",
"XMLDB",
"file",
"from",
"db"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/ddl/database_manager.php#L283-L313 |
215,094 | moodle/moodle | lib/ddl/database_manager.php | database_manager.load_xmldb_file | private function load_xmldb_file($file) {
$xmldb_file = new xmldb_file($file);
if (!$xmldb_file->fileExists()) {
throw new ddl_exception('ddlxmlfileerror', null, 'File does not exist');
}
$loaded = $xmldb_file->loadXMLStructure();
if (!$loaded || !$xmldb_file->isLoa... | php | private function load_xmldb_file($file) {
$xmldb_file = new xmldb_file($file);
if (!$xmldb_file->fileExists()) {
throw new ddl_exception('ddlxmlfileerror', null, 'File does not exist');
}
$loaded = $xmldb_file->loadXMLStructure();
if (!$loaded || !$xmldb_file->isLoa... | [
"private",
"function",
"load_xmldb_file",
"(",
"$",
"file",
")",
"{",
"$",
"xmldb_file",
"=",
"new",
"xmldb_file",
"(",
"$",
"file",
")",
";",
"if",
"(",
"!",
"$",
"xmldb_file",
"->",
"fileExists",
"(",
")",
")",
"{",
"throw",
"new",
"ddl_exception",
"... | Load an install.xml file, checking that it exists, and that the structure is OK.
@param string $file the full path to the XMLDB file.
@return xmldb_file the loaded file. | [
"Load",
"an",
"install",
".",
"xml",
"file",
"checking",
"that",
"it",
"exists",
"and",
"that",
"the",
"structure",
"is",
"OK",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/ddl/database_manager.php#L340-L359 |
215,095 | moodle/moodle | lib/ddl/database_manager.php | database_manager.install_from_xmldb_structure | public function install_from_xmldb_structure($xmldb_structure) {
if (!$sqlarr = $this->generator->getCreateStructureSQL($xmldb_structure)) {
return; // nothing to do
}
$tablenames = array();
foreach ($xmldb_structure as $xmldb_table) {
if ($xmldb_table instanceo... | php | public function install_from_xmldb_structure($xmldb_structure) {
if (!$sqlarr = $this->generator->getCreateStructureSQL($xmldb_structure)) {
return; // nothing to do
}
$tablenames = array();
foreach ($xmldb_structure as $xmldb_table) {
if ($xmldb_table instanceo... | [
"public",
"function",
"install_from_xmldb_structure",
"(",
"$",
"xmldb_structure",
")",
"{",
"if",
"(",
"!",
"$",
"sqlarr",
"=",
"$",
"this",
"->",
"generator",
"->",
"getCreateStructureSQL",
"(",
"$",
"xmldb_structure",
")",
")",
"{",
"return",
";",
"// nothi... | This function will generate all the needed SQL statements, specific for each
RDBMS type and, finally, it will execute all those statements against the DB.
@param stdClass $xmldb_structure xmldb_structure object.
@return void | [
"This",
"function",
"will",
"generate",
"all",
"the",
"needed",
"SQL",
"statements",
"specific",
"for",
"each",
"RDBMS",
"type",
"and",
"finally",
"it",
"will",
"execute",
"all",
"those",
"statements",
"against",
"the",
"DB",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/ddl/database_manager.php#L413-L426 |
215,096 | moodle/moodle | lib/ddl/database_manager.php | database_manager.rename_table | public function rename_table(xmldb_table $xmldb_table, $newname) {
// Check newname isn't empty
if (!$newname) {
throw new ddl_exception('ddlunknownerror', null, 'newname can not be empty');
}
$check = new xmldb_table($newname);
// Check table already renamed
... | php | public function rename_table(xmldb_table $xmldb_table, $newname) {
// Check newname isn't empty
if (!$newname) {
throw new ddl_exception('ddlunknownerror', null, 'newname can not be empty');
}
$check = new xmldb_table($newname);
// Check table already renamed
... | [
"public",
"function",
"rename_table",
"(",
"xmldb_table",
"$",
"xmldb_table",
",",
"$",
"newname",
")",
"{",
"// Check newname isn't empty",
"if",
"(",
"!",
"$",
"newname",
")",
"{",
"throw",
"new",
"ddl_exception",
"(",
"'ddlunknownerror'",
",",
"null",
",",
... | This function will rename the table passed as argument
Before renaming the index, the function will check it exists
@param xmldb_table $xmldb_table Table object (just the name is mandatory).
@param string $newname New name of the index.
@return void | [
"This",
"function",
"will",
"rename",
"the",
"table",
"passed",
"as",
"argument",
"Before",
"renaming",
"the",
"index",
"the",
"function",
"will",
"check",
"it",
"exists"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/ddl/database_manager.php#L493-L520 |
215,097 | moodle/moodle | lib/ddl/database_manager.php | database_manager.add_field | public function add_field(xmldb_table $xmldb_table, xmldb_field $xmldb_field) {
// Check the field doesn't exist
if ($this->field_exists($xmldb_table, $xmldb_field)) {
throw new ddl_exception('ddlfieldalreadyexists', $xmldb_field->getName());
}
// If NOT NULL and no default... | php | public function add_field(xmldb_table $xmldb_table, xmldb_field $xmldb_field) {
// Check the field doesn't exist
if ($this->field_exists($xmldb_table, $xmldb_field)) {
throw new ddl_exception('ddlfieldalreadyexists', $xmldb_field->getName());
}
// If NOT NULL and no default... | [
"public",
"function",
"add_field",
"(",
"xmldb_table",
"$",
"xmldb_table",
",",
"xmldb_field",
"$",
"xmldb_field",
")",
"{",
"// Check the field doesn't exist",
"if",
"(",
"$",
"this",
"->",
"field_exists",
"(",
"$",
"xmldb_table",
",",
"$",
"xmldb_field",
")",
... | This function will add the field to the table passed as arguments
@param xmldb_table $xmldb_table Table object (just the name is mandatory).
@param xmldb_field $xmldb_field Index object (full specs are required).
@return void | [
"This",
"function",
"will",
"add",
"the",
"field",
"to",
"the",
"table",
"passed",
"as",
"arguments"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/ddl/database_manager.php#L529-L546 |
215,098 | moodle/moodle | lib/ddl/database_manager.php | database_manager.drop_field | public function drop_field(xmldb_table $xmldb_table, xmldb_field $xmldb_field) {
if (!$this->table_exists($xmldb_table)) {
throw new ddl_table_missing_exception($xmldb_table->getName());
}
// Check the field exists
if (!$this->field_exists($xmldb_table, $xmldb_field)) {
... | php | public function drop_field(xmldb_table $xmldb_table, xmldb_field $xmldb_field) {
if (!$this->table_exists($xmldb_table)) {
throw new ddl_table_missing_exception($xmldb_table->getName());
}
// Check the field exists
if (!$this->field_exists($xmldb_table, $xmldb_field)) {
... | [
"public",
"function",
"drop_field",
"(",
"xmldb_table",
"$",
"xmldb_table",
",",
"xmldb_field",
"$",
"xmldb_field",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"table_exists",
"(",
"$",
"xmldb_table",
")",
")",
"{",
"throw",
"new",
"ddl_table_missing_exceptio... | This function will drop the field from the table passed as arguments
@param xmldb_table $xmldb_table Table object (just the name is mandatory).
@param xmldb_field $xmldb_field Index object (full specs are required).
@return void | [
"This",
"function",
"will",
"drop",
"the",
"field",
"from",
"the",
"table",
"passed",
"as",
"arguments"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/ddl/database_manager.php#L555-L571 |
215,099 | moodle/moodle | lib/ddl/database_manager.php | database_manager.change_field_type | public function change_field_type(xmldb_table $xmldb_table, xmldb_field $xmldb_field) {
if (!$this->table_exists($xmldb_table)) {
throw new ddl_table_missing_exception($xmldb_table->getName());
}
// Check the field exists
if (!$this->field_exists($xmldb_table, $xmldb_field)) ... | php | public function change_field_type(xmldb_table $xmldb_table, xmldb_field $xmldb_field) {
if (!$this->table_exists($xmldb_table)) {
throw new ddl_table_missing_exception($xmldb_table->getName());
}
// Check the field exists
if (!$this->field_exists($xmldb_table, $xmldb_field)) ... | [
"public",
"function",
"change_field_type",
"(",
"xmldb_table",
"$",
"xmldb_table",
",",
"xmldb_field",
"$",
"xmldb_field",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"table_exists",
"(",
"$",
"xmldb_table",
")",
")",
"{",
"throw",
"new",
"ddl_table_missing_e... | This function will change the type of the field in the table passed as arguments
@param xmldb_table $xmldb_table Table object (just the name is mandatory).
@param xmldb_field $xmldb_field Index object (full specs are required).
@return void | [
"This",
"function",
"will",
"change",
"the",
"type",
"of",
"the",
"field",
"in",
"the",
"table",
"passed",
"as",
"arguments"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/ddl/database_manager.php#L580-L596 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.