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
218,100
moodle/moodle
mod/assign/externallib.php
mod_assign_external.generate_warning
private static function generate_warning($assignmentid, $warningcode, $detail) { $warningmessages = array( 'couldnotlock'=>'Could not lock the submission for this user.', 'couldnotunlock'=>'Could not unlock the submission for this user.', 'couldnotsubmitforgrading'=>'Could no...
php
private static function generate_warning($assignmentid, $warningcode, $detail) { $warningmessages = array( 'couldnotlock'=>'Could not lock the submission for this user.', 'couldnotunlock'=>'Could not unlock the submission for this user.', 'couldnotsubmitforgrading'=>'Could no...
[ "private", "static", "function", "generate_warning", "(", "$", "assignmentid", ",", "$", "warningcode", ",", "$", "detail", ")", "{", "$", "warningmessages", "=", "array", "(", "'couldnotlock'", "=>", "'Could not lock the submission for this user.'", ",", "'couldnotun...
Generate a warning in a standard structure for a known failure. @param int $assignmentid - The assignment @param string $warningcode - The key for the warning message @param string $detail - A description of the error @return array - Warning structure containing item, itemid, warningcode, message
[ "Generate", "a", "warning", "in", "a", "standard", "structure", "for", "a", "known", "failure", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/externallib.php#L47-L69
218,101
moodle/moodle
mod/assign/externallib.php
mod_assign_external.get_grade_structure
private static function get_grade_structure($required = VALUE_REQUIRED) { return new external_single_structure( array( 'id' => new external_value(PARAM_INT, 'grade id'), 'assignment' => new external_value(PARAM_INT, 'assignment id', VALUE_OPTIONA...
php
private static function get_grade_structure($required = VALUE_REQUIRED) { return new external_single_structure( array( 'id' => new external_value(PARAM_INT, 'grade id'), 'assignment' => new external_value(PARAM_INT, 'assignment id', VALUE_OPTIONA...
[ "private", "static", "function", "get_grade_structure", "(", "$", "required", "=", "VALUE_REQUIRED", ")", "{", "return", "new", "external_single_structure", "(", "array", "(", "'id'", "=>", "new", "external_value", "(", "PARAM_INT", ",", "'grade id'", ")", ",", ...
Creates a grade single structure. @return external_single_structure a grade single structure. @since Moodle 3.1
[ "Creates", "a", "grade", "single", "structure", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/externallib.php#L206-L221
218,102
moodle/moodle
mod/assign/externallib.php
mod_assign_external.get_assignments_assignment_structure
private static function get_assignments_assignment_structure() { return new external_single_structure( array( 'id' => new external_value(PARAM_INT, 'assignment id'), 'cmid' => new external_value(PARAM_INT, 'course module id'), 'course' => new external_...
php
private static function get_assignments_assignment_structure() { return new external_single_structure( array( 'id' => new external_value(PARAM_INT, 'assignment id'), 'cmid' => new external_value(PARAM_INT, 'course module id'), 'course' => new external_...
[ "private", "static", "function", "get_assignments_assignment_structure", "(", ")", "{", "return", "new", "external_single_structure", "(", "array", "(", "'id'", "=>", "new", "external_value", "(", "PARAM_INT", ",", "'assignment id'", ")", ",", "'cmid'", "=>", "new",...
Creates an assignment external_single_structure @return external_single_structure @since Moodle 2.4
[ "Creates", "an", "assignment", "external_single_structure" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/externallib.php#L524-L564
218,103
moodle/moodle
mod/assign/externallib.php
mod_assign_external.get_assignments_config_structure
private static function get_assignments_config_structure() { return new external_single_structure( array( 'id' => new external_value(PARAM_INT, 'assign_plugin_config id', VALUE_OPTIONAL), 'assignment' => new external_value(PARAM_INT, 'assignment id', VALUE_OPTIONAL), ...
php
private static function get_assignments_config_structure() { return new external_single_structure( array( 'id' => new external_value(PARAM_INT, 'assign_plugin_config id', VALUE_OPTIONAL), 'assignment' => new external_value(PARAM_INT, 'assignment id', VALUE_OPTIONAL), ...
[ "private", "static", "function", "get_assignments_config_structure", "(", ")", "{", "return", "new", "external_single_structure", "(", "array", "(", "'id'", "=>", "new", "external_value", "(", "PARAM_INT", ",", "'assign_plugin_config id'", ",", "VALUE_OPTIONAL", ")", ...
Creates an assign_plugin_config external_single_structure @return external_single_structure @since Moodle 2.4
[ "Creates", "an", "assign_plugin_config", "external_single_structure" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/externallib.php#L572-L583
218,104
moodle/moodle
mod/assign/externallib.php
mod_assign_external.get_assignments_course_structure
private static function get_assignments_course_structure() { return new external_single_structure( array( 'id' => new external_value(PARAM_INT, 'course id'), 'fullname' => new external_value(PARAM_TEXT, 'course full name'), 'shortname' => new external_...
php
private static function get_assignments_course_structure() { return new external_single_structure( array( 'id' => new external_value(PARAM_INT, 'course id'), 'fullname' => new external_value(PARAM_TEXT, 'course full name'), 'shortname' => new external_...
[ "private", "static", "function", "get_assignments_course_structure", "(", ")", "{", "return", "new", "external_single_structure", "(", "array", "(", "'id'", "=>", "new", "external_value", "(", "PARAM_INT", ",", "'course id'", ")", ",", "'fullname'", "=>", "new", "...
Creates a course external_single_structure @return external_single_structure @since Moodle 2.4
[ "Creates", "a", "course", "external_single_structure" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/externallib.php#L591-L601
218,105
moodle/moodle
mod/assign/externallib.php
mod_assign_external.get_submissions_parameters
public static function get_submissions_parameters() { return new external_function_parameters( array( 'assignmentids' => new external_multiple_structure( new external_value(PARAM_INT, 'assignment id'), '1 or more assignment ids', ...
php
public static function get_submissions_parameters() { return new external_function_parameters( array( 'assignmentids' => new external_multiple_structure( new external_value(PARAM_INT, 'assignment id'), '1 or more assignment ids', ...
[ "public", "static", "function", "get_submissions_parameters", "(", ")", "{", "return", "new", "external_function_parameters", "(", "array", "(", "'assignmentids'", "=>", "new", "external_multiple_structure", "(", "new", "external_value", "(", "PARAM_INT", ",", "'assignm...
Describes the parameters for get_submissions @return external_function_parameters @since Moodle 2.5
[ "Describes", "the", "parameters", "for", "get_submissions" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/externallib.php#L690-L702
218,106
moodle/moodle
mod/assign/externallib.php
mod_assign_external.get_plugin_structure
private static function get_plugin_structure() { return new external_single_structure( array( 'type' => new external_value(PARAM_TEXT, 'submission plugin type'), 'name' => new external_value(PARAM_TEXT, 'submission plugin name'), 'fileareas' => new ext...
php
private static function get_plugin_structure() { return new external_single_structure( array( 'type' => new external_value(PARAM_TEXT, 'submission plugin type'), 'name' => new external_value(PARAM_TEXT, 'submission plugin name'), 'fileareas' => new ext...
[ "private", "static", "function", "get_plugin_structure", "(", ")", "{", "return", "new", "external_single_structure", "(", "array", "(", "'type'", "=>", "new", "external_value", "(", "PARAM_TEXT", ",", "'submission plugin type'", ")", ",", "'name'", "=>", "new", "...
Creates an assignment plugin structure. @return external_single_structure the plugin structure
[ "Creates", "an", "assignment", "plugin", "structure", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/externallib.php#L828-L854
218,107
moodle/moodle
mod/assign/externallib.php
mod_assign_external.get_submission_structure
private static function get_submission_structure($required = VALUE_REQUIRED) { return new external_single_structure( array( 'id' => new external_value(PARAM_INT, 'submission id'), 'userid' => new external_value(PARAM_INT, 'student id'), 'attemptnumber'...
php
private static function get_submission_structure($required = VALUE_REQUIRED) { return new external_single_structure( array( 'id' => new external_value(PARAM_INT, 'submission id'), 'userid' => new external_value(PARAM_INT, 'student id'), 'attemptnumber'...
[ "private", "static", "function", "get_submission_structure", "(", "$", "required", "=", "VALUE_REQUIRED", ")", "{", "return", "new", "external_single_structure", "(", "array", "(", "'id'", "=>", "new", "external_value", "(", "PARAM_INT", ",", "'submission id'", ")",...
Creates a submission structure. @return external_single_structure the submission structure
[ "Creates", "a", "submission", "structure", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/externallib.php#L861-L877
218,108
moodle/moodle
mod/assign/externallib.php
mod_assign_external.set_user_flags_parameters
public static function set_user_flags_parameters() { return new external_function_parameters( array( 'assignmentid' => new external_value(PARAM_INT, 'assignment id'), 'userflags' => new external_multiple_structure( new external_single_structure(...
php
public static function set_user_flags_parameters() { return new external_function_parameters( array( 'assignmentid' => new external_value(PARAM_INT, 'assignment id'), 'userflags' => new external_multiple_structure( new external_single_structure(...
[ "public", "static", "function", "set_user_flags_parameters", "(", ")", "{", "return", "new", "external_function_parameters", "(", "array", "(", "'assignmentid'", "=>", "new", "external_value", "(", "PARAM_INT", ",", "'assignment id'", ")", ",", "'userflags'", "=>", ...
Describes the parameters for set_user_flags @return external_function_parameters @since Moodle 2.6
[ "Describes", "the", "parameters", "for", "set_user_flags" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/externallib.php#L914-L932
218,109
moodle/moodle
mod/assign/externallib.php
mod_assign_external.set_user_flags_returns
public static function set_user_flags_returns() { return new external_multiple_structure( new external_single_structure( array( 'id' => new external_value(PARAM_INT, 'id of record if successful, -1 for failure'), 'userid' => new external_value(...
php
public static function set_user_flags_returns() { return new external_multiple_structure( new external_single_structure( array( 'id' => new external_value(PARAM_INT, 'id of record if successful, -1 for failure'), 'userid' => new external_value(...
[ "public", "static", "function", "set_user_flags_returns", "(", ")", "{", "return", "new", "external_multiple_structure", "(", "new", "external_single_structure", "(", "array", "(", "'id'", "=>", "new", "external_value", "(", "PARAM_INT", ",", "'id of record if successfu...
Describes the set_user_flags return value @return external_multiple_structure @since Moodle 2.6
[ "Describes", "the", "set_user_flags", "return", "value" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/externallib.php#L1036-L1046
218,110
moodle/moodle
mod/assign/externallib.php
mod_assign_external.assign_user_flags
private static function assign_user_flags() { return new external_single_structure( array ( 'assignmentid' => new external_value(PARAM_INT, 'assignment id'), 'userflags' => new external_multiple_structure(new external_single_structure( arr...
php
private static function assign_user_flags() { return new external_single_structure( array ( 'assignmentid' => new external_value(PARAM_INT, 'assignment id'), 'userflags' => new external_multiple_structure(new external_single_structure( arr...
[ "private", "static", "function", "assign_user_flags", "(", ")", "{", "return", "new", "external_single_structure", "(", "array", "(", "'assignmentid'", "=>", "new", "external_value", "(", "PARAM_INT", ",", "'assignment id'", ")", ",", "'userflags'", "=>", "new", "...
Creates an assign_user_flags external_single_structure @return external_single_structure @since Moodle 2.6
[ "Creates", "an", "assign_user_flags", "external_single_structure" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/externallib.php#L1166-L1184
218,111
moodle/moodle
mod/assign/externallib.php
mod_assign_external.assign_user_mappings
private static function assign_user_mappings() { return new external_single_structure( array ( 'assignmentid' => new external_value(PARAM_INT, 'assignment id'), 'mappings' => new external_multiple_structure(new external_single_structure( a...
php
private static function assign_user_mappings() { return new external_single_structure( array ( 'assignmentid' => new external_value(PARAM_INT, 'assignment id'), 'mappings' => new external_multiple_structure(new external_single_structure( a...
[ "private", "static", "function", "assign_user_mappings", "(", ")", "{", "return", "new", "external_single_structure", "(", "array", "(", "'assignmentid'", "=>", "new", "external_value", "(", "PARAM_INT", ",", "'assignment id'", ")", ",", "'mappings'", "=>", "new", ...
Creates an assign_user_mappings external_single_structure @return external_single_structure @since Moodle 2.6
[ "Creates", "an", "assign_user_mappings", "external_single_structure" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/externallib.php#L1314-L1327
218,112
moodle/moodle
mod/assign/externallib.php
mod_assign_external.revert_submissions_to_draft
public static function revert_submissions_to_draft($assignmentid, $userids) { global $CFG; $params = self::validate_parameters(self::revert_submissions_to_draft_parameters(), array('assignmentid' => $assignmentid, 'userids' => $userids)); l...
php
public static function revert_submissions_to_draft($assignmentid, $userids) { global $CFG; $params = self::validate_parameters(self::revert_submissions_to_draft_parameters(), array('assignmentid' => $assignmentid, 'userids' => $userids)); l...
[ "public", "static", "function", "revert_submissions_to_draft", "(", "$", "assignmentid", ",", "$", "userids", ")", "{", "global", "$", "CFG", ";", "$", "params", "=", "self", "::", "validate_parameters", "(", "self", "::", "revert_submissions_to_draft_parameters", ...
Reverts a list of user submissions to draft for a single assignment. @param int $assignmentid The id of the assignment @param array $userids Array of user ids to revert @return array of warnings for each submission that could not be reverted. @since Moodle 2.6
[ "Reverts", "a", "list", "of", "user", "submissions", "to", "draft", "for", "a", "single", "assignment", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/externallib.php#L1427-L1447
218,113
moodle/moodle
mod/assign/externallib.php
mod_assign_external.save_user_extensions_parameters
public static function save_user_extensions_parameters() { return new external_function_parameters( array( 'assignmentid' => new external_value(PARAM_INT, 'The assignment id to operate on'), 'userids' => new external_multiple_structure( new externa...
php
public static function save_user_extensions_parameters() { return new external_function_parameters( array( 'assignmentid' => new external_value(PARAM_INT, 'The assignment id to operate on'), 'userids' => new external_multiple_structure( new externa...
[ "public", "static", "function", "save_user_extensions_parameters", "(", ")", "{", "return", "new", "external_function_parameters", "(", "array", "(", "'assignmentid'", "=>", "new", "external_value", "(", "PARAM_INT", ",", "'The assignment id to operate on'", ")", ",", "...
Describes the parameters for save_user_extensions @return external_function_parameters @since Moodle 2.6
[ "Describes", "the", "parameters", "for", "save_user_extensions" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/externallib.php#L1663-L1677
218,114
moodle/moodle
mod/assign/externallib.php
mod_assign_external.save_user_extensions
public static function save_user_extensions($assignmentid, $userids, $dates) { global $CFG; $params = self::validate_parameters(self::save_user_extensions_parameters(), array('assignmentid' => $assignmentid, 'userids' => $userids, ...
php
public static function save_user_extensions($assignmentid, $userids, $dates) { global $CFG; $params = self::validate_parameters(self::save_user_extensions_parameters(), array('assignmentid' => $assignmentid, 'userids' => $userids, ...
[ "public", "static", "function", "save_user_extensions", "(", "$", "assignmentid", ",", "$", "userids", ",", "$", "dates", ")", "{", "global", "$", "CFG", ";", "$", "params", "=", "self", "::", "validate_parameters", "(", "self", "::", "save_user_extensions_par...
Grant extension dates to students for an assignment. @param int $assignmentid The id of the assignment @param array $userids Array of user ids to grant extensions to @param array $dates Array of extension dates @return array of warnings for each extension date that could not be granted @since Moodle 2.6
[ "Grant", "extension", "dates", "to", "students", "for", "an", "assignment", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/externallib.php#L1688-L1719
218,115
moodle/moodle
mod/assign/externallib.php
mod_assign_external.reveal_identities
public static function reveal_identities($assignmentid) { global $CFG, $USER; $params = self::validate_parameters(self::reveal_identities_parameters(), array('assignmentid' => $assignmentid)); list($assignment, $course, $cm, $context) = self::validat...
php
public static function reveal_identities($assignmentid) { global $CFG, $USER; $params = self::validate_parameters(self::reveal_identities_parameters(), array('assignmentid' => $assignmentid)); list($assignment, $course, $cm, $context) = self::validat...
[ "public", "static", "function", "reveal_identities", "(", "$", "assignmentid", ")", "{", "global", "$", "CFG", ",", "$", "USER", ";", "$", "params", "=", "self", "::", "validate_parameters", "(", "self", "::", "reveal_identities_parameters", "(", ")", ",", "...
Reveal the identities of anonymous students to markers for a single assignment. @param int $assignmentid The id of the assignment @return array of warnings to indicate any errors. @since Moodle 2.6
[ "Reveal", "the", "identities", "of", "anonymous", "students", "to", "markers", "for", "a", "single", "assignment", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/externallib.php#L1751-L1768
218,116
moodle/moodle
mod/assign/externallib.php
mod_assign_external.save_submission_parameters
public static function save_submission_parameters() { global $CFG; $instance = new assign(null, null, null); $pluginsubmissionparams = array(); foreach ($instance->get_submission_plugins() as $plugin) { if ($plugin->is_visible()) { $pluginparams = $plugin->ge...
php
public static function save_submission_parameters() { global $CFG; $instance = new assign(null, null, null); $pluginsubmissionparams = array(); foreach ($instance->get_submission_plugins() as $plugin) { if ($plugin->is_visible()) { $pluginparams = $plugin->ge...
[ "public", "static", "function", "save_submission_parameters", "(", ")", "{", "global", "$", "CFG", ";", "$", "instance", "=", "new", "assign", "(", "null", ",", "null", ",", "null", ")", ";", "$", "pluginsubmissionparams", "=", "array", "(", ")", ";", "f...
Describes the parameters for save_submission @return external_function_parameters @since Moodle 2.6
[ "Describes", "the", "parameters", "for", "save_submission" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/externallib.php#L1785-L1807
218,117
moodle/moodle
mod/assign/externallib.php
mod_assign_external.save_submission
public static function save_submission($assignmentid, $plugindata) { global $CFG, $USER; $params = self::validate_parameters(self::save_submission_parameters(), array('assignmentid' => $assignmentid, 'pluginda...
php
public static function save_submission($assignmentid, $plugindata) { global $CFG, $USER; $params = self::validate_parameters(self::save_submission_parameters(), array('assignmentid' => $assignmentid, 'pluginda...
[ "public", "static", "function", "save_submission", "(", "$", "assignmentid", ",", "$", "plugindata", ")", "{", "global", "$", "CFG", ",", "$", "USER", ";", "$", "params", "=", "self", "::", "validate_parameters", "(", "self", "::", "save_submission_parameters"...
Save a student submission for a single assignment @param int $assignmentid The id of the assignment @param array $plugindata - The submitted data for plugins @return array of warnings to indicate any errors @since Moodle 2.6
[ "Save", "a", "student", "submission", "for", "a", "single", "assignment" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/externallib.php#L1817-L1844
218,118
moodle/moodle
mod/assign/externallib.php
mod_assign_external.save_grade_parameters
public static function save_grade_parameters() { global $CFG; require_once("$CFG->dirroot/grade/grading/lib.php"); $instance = new assign(null, null, null); $pluginfeedbackparams = array(); foreach ($instance->get_feedback_plugins() as $plugin) { if ($plugin->is_visi...
php
public static function save_grade_parameters() { global $CFG; require_once("$CFG->dirroot/grade/grading/lib.php"); $instance = new assign(null, null, null); $pluginfeedbackparams = array(); foreach ($instance->get_feedback_plugins() as $plugin) { if ($plugin->is_visi...
[ "public", "static", "function", "save_grade_parameters", "(", ")", "{", "global", "$", "CFG", ";", "require_once", "(", "\"$CFG->dirroot/grade/grading/lib.php\"", ")", ";", "$", "instance", "=", "new", "assign", "(", "null", ",", "null", ",", "null", ")", ";",...
Describes the parameters for save_grade @return external_function_parameters @since Moodle 2.6
[ "Describes", "the", "parameters", "for", "save_grade" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/externallib.php#L1861-L1913
218,119
moodle/moodle
mod/assign/externallib.php
mod_assign_external.save_grade
public static function save_grade($assignmentid, $userid, $grade, $attemptnumber, $addattempt, $workflowstate, ...
php
public static function save_grade($assignmentid, $userid, $grade, $attemptnumber, $addattempt, $workflowstate, ...
[ "public", "static", "function", "save_grade", "(", "$", "assignmentid", ",", "$", "userid", ",", "$", "grade", ",", "$", "attemptnumber", ",", "$", "addattempt", ",", "$", "workflowstate", ",", "$", "applytoall", ",", "$", "plugindata", "=", "array", "(", ...
Save a student grade for a single assignment. @param int $assignmentid The id of the assignment @param int $userid The id of the user @param float $grade The grade (ignored if the assignment uses advanced grading) @param int $attemptnumber The attempt number @param bool $addattempt Allow another attempt @param string ...
[ "Save", "a", "student", "grade", "for", "a", "single", "assignment", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/externallib.php#L1930-L1980
218,120
moodle/moodle
mod/assign/externallib.php
mod_assign_external.save_grades
public static function save_grades($assignmentid, $applytoall = false, $grades) { global $CFG, $USER; $params = self::validate_parameters(self::save_grades_parameters(), array('assignmentid' => $assignmentid, ...
php
public static function save_grades($assignmentid, $applytoall = false, $grades) { global $CFG, $USER; $params = self::validate_parameters(self::save_grades_parameters(), array('assignmentid' => $assignmentid, ...
[ "public", "static", "function", "save_grades", "(", "$", "assignmentid", ",", "$", "applytoall", "=", "false", ",", "$", "grades", ")", "{", "global", "$", "CFG", ",", "$", "USER", ";", "$", "params", "=", "self", "::", "validate_parameters", "(", "self"...
Save multiple student grades for a single assignment. @param int $assignmentid The id of the assignment @param boolean $applytoall If set to true and this is a team assignment, apply the grade to all members of the group @param array $grades grade data for one or more students that includes userid - The id of the stud...
[ "Save", "multiple", "student", "grades", "for", "a", "single", "assignment", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/externallib.php#L2078-L2128
218,121
moodle/moodle
mod/assign/externallib.php
mod_assign_external.copy_previous_attempt
public static function copy_previous_attempt($assignmentid) { $params = self::validate_parameters(self::copy_previous_attempt_parameters(), array('assignmentid' => $assignmentid)); list($assignment, $course, $cm, $context) = self::validate_assign($params['as...
php
public static function copy_previous_attempt($assignmentid) { $params = self::validate_parameters(self::copy_previous_attempt_parameters(), array('assignmentid' => $assignmentid)); list($assignment, $course, $cm, $context) = self::validate_assign($params['as...
[ "public", "static", "function", "copy_previous_attempt", "(", "$", "assignmentid", ")", "{", "$", "params", "=", "self", "::", "validate_parameters", "(", "self", "::", "copy_previous_attempt_parameters", "(", ")", ",", "array", "(", "'assignmentid'", "=>", "$", ...
Copy a students previous attempt to a new attempt. @param int $assignmentid @return array of warnings to indicate any errors. @since Moodle 2.6
[ "Copy", "a", "students", "previous", "attempt", "to", "a", "new", "attempt", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/externallib.php#L2160-L2179
218,122
moodle/moodle
mod/assign/externallib.php
mod_assign_external.view_grading_table
public static function view_grading_table($assignid) { $params = self::validate_parameters(self::view_grading_table_parameters(), array( 'assignid' => $assignid )); $w...
php
public static function view_grading_table($assignid) { $params = self::validate_parameters(self::view_grading_table_parameters(), array( 'assignid' => $assignid )); $w...
[ "public", "static", "function", "view_grading_table", "(", "$", "assignid", ")", "{", "$", "params", "=", "self", "::", "validate_parameters", "(", "self", "::", "view_grading_table_parameters", "(", ")", ",", "array", "(", "'assignid'", "=>", "$", "assignid", ...
Trigger the grading_table_viewed event. @param int $assignid the assign instance id @return array of warnings and status result @since Moodle 3.0 @throws moodle_exception
[ "Trigger", "the", "grading_table_viewed", "event", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/externallib.php#L2213-L2230
218,123
moodle/moodle
mod/assign/externallib.php
mod_assign_external.view_submission_status
public static function view_submission_status($assignid) { $warnings = array(); $params = array( 'assignid' => $assignid, ); $params = self::validate_parameters(self::view_submission_status_parameters(), $params); list($assign, $course, $cm, $context) = self::valida...
php
public static function view_submission_status($assignid) { $warnings = array(); $params = array( 'assignid' => $assignid, ); $params = self::validate_parameters(self::view_submission_status_parameters(), $params); list($assign, $course, $cm, $context) = self::valida...
[ "public", "static", "function", "view_submission_status", "(", "$", "assignid", ")", "{", "$", "warnings", "=", "array", "(", ")", ";", "$", "params", "=", "array", "(", "'assignid'", "=>", "$", "assignid", ",", ")", ";", "$", "params", "=", "self", ":...
Trigger the submission status viewed event. @param int $assignid assign instance id @return array of warnings and status result @since Moodle 3.1
[ "Trigger", "the", "submission", "status", "viewed", "event", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/externallib.php#L2268-L2284
218,124
moodle/moodle
mod/assign/externallib.php
mod_assign_external.get_submission_status_parameters
public static function get_submission_status_parameters() { return new external_function_parameters ( array( 'assignid' => new external_value(PARAM_INT, 'assignment instance id'), 'userid' => new external_value(PARAM_INT, 'user id (empty for current user)', VALUE_DEFA...
php
public static function get_submission_status_parameters() { return new external_function_parameters ( array( 'assignid' => new external_value(PARAM_INT, 'assignment instance id'), 'userid' => new external_value(PARAM_INT, 'user id (empty for current user)', VALUE_DEFA...
[ "public", "static", "function", "get_submission_status_parameters", "(", ")", "{", "return", "new", "external_function_parameters", "(", "array", "(", "'assignid'", "=>", "new", "external_value", "(", "PARAM_INT", ",", "'assignment instance id'", ")", ",", "'userid'", ...
Describes the parameters for get_submission_status. @return external_function_parameters @since Moodle 3.1
[ "Describes", "the", "parameters", "for", "get_submission_status", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/externallib.php#L2307-L2316
218,125
moodle/moodle
mod/assign/externallib.php
mod_assign_external.get_participant
public static function get_participant($assignid, $userid, $embeduser) { global $DB, $CFG; require_once($CFG->dirroot . "/mod/assign/locallib.php"); require_once($CFG->dirroot . "/user/lib.php"); $params = self::validate_parameters(self::get_participant_parameters(), array( ...
php
public static function get_participant($assignid, $userid, $embeduser) { global $DB, $CFG; require_once($CFG->dirroot . "/mod/assign/locallib.php"); require_once($CFG->dirroot . "/user/lib.php"); $params = self::validate_parameters(self::get_participant_parameters(), array( ...
[ "public", "static", "function", "get_participant", "(", "$", "assignid", ",", "$", "userid", ",", "$", "embeduser", ")", "{", "global", "$", "DB", ",", "$", "CFG", ";", "require_once", "(", "$", "CFG", "->", "dirroot", ".", "\"/mod/assign/locallib.php\"", ...
Get the user participating in the given assignment. An error with code 'usernotincourse' is thrown is the user isn't a participant of the given assignment. @param int $assignid the assign instance id @param int $userid the user id @param bool $embeduser return user details (only applicable if not blind marking) @retur...
[ "Get", "the", "user", "participating", "in", "the", "given", "assignment", ".", "An", "error", "with", "code", "usernotincourse", "is", "thrown", "is", "the", "user", "isn", "t", "a", "participant", "of", "the", "given", "assignment", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/externallib.php#L2791-L2844
218,126
moodle/moodle
mod/assign/externallib.php
mod_assign_external.validate_assign
protected static function validate_assign($assignid) { global $DB; // Request and permission validation. $assign = $DB->get_record('assign', array('id' => $assignid), 'id', MUST_EXIST); list($course, $cm) = get_course_and_cm_from_instance($assign, 'assign'); $context = context_...
php
protected static function validate_assign($assignid) { global $DB; // Request and permission validation. $assign = $DB->get_record('assign', array('id' => $assignid), 'id', MUST_EXIST); list($course, $cm) = get_course_and_cm_from_instance($assign, 'assign'); $context = context_...
[ "protected", "static", "function", "validate_assign", "(", "$", "assignid", ")", "{", "global", "$", "DB", ";", "// Request and permission validation.", "$", "assign", "=", "$", "DB", "->", "get_record", "(", "'assign'", ",", "array", "(", "'id'", "=>", "$", ...
Utility function for validating an assign. @param int $assignid assign instance id @return array array containing the assign, course, context and course module objects @since Moodle 3.2
[ "Utility", "function", "for", "validating", "an", "assign", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/externallib.php#L2881-L2894
218,127
moodle/moodle
mod/assign/externallib.php
mod_assign_external.view_assign
public static function view_assign($assignid) { $warnings = array(); $params = array( 'assignid' => $assignid, ); $params = self::validate_parameters(self::view_assign_parameters(), $params); list($assign, $course, $cm, $context) = self::validate_assign($params['assi...
php
public static function view_assign($assignid) { $warnings = array(); $params = array( 'assignid' => $assignid, ); $params = self::validate_parameters(self::view_assign_parameters(), $params); list($assign, $course, $cm, $context) = self::validate_assign($params['assi...
[ "public", "static", "function", "view_assign", "(", "$", "assignid", ")", "{", "$", "warnings", "=", "array", "(", ")", ";", "$", "params", "=", "array", "(", "'assignid'", "=>", "$", "assignid", ",", ")", ";", "$", "params", "=", "self", "::", "vali...
Update the module completion status. @param int $assignid assign instance id @return array of warnings and status result @since Moodle 3.2
[ "Update", "the", "module", "completion", "status", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/externallib.php#L2917-L2932
218,128
moodle/moodle
lib/ddl/mssql_sql_generator.php
mssql_sql_generator.getDefaultConstraintName
protected function getDefaultConstraintName($xmldb_table, $xmldb_field) { // Get the quoted name of the table and field $tablename = $this->getTableName($xmldb_table); $fieldname = $xmldb_field->getName(); // Look for any default constraint in this field and drop it if ($defaul...
php
protected function getDefaultConstraintName($xmldb_table, $xmldb_field) { // Get the quoted name of the table and field $tablename = $this->getTableName($xmldb_table); $fieldname = $xmldb_field->getName(); // Look for any default constraint in this field and drop it if ($defaul...
[ "protected", "function", "getDefaultConstraintName", "(", "$", "xmldb_table", ",", "$", "xmldb_field", ")", "{", "// Get the quoted name of the table and field", "$", "tablename", "=", "$", "this", "->", "getTableName", "(", "$", "xmldb_table", ")", ";", "$", "field...
Given one xmldb_table and one xmldb_field, returns the name of its default constraint in DB or false if not found This function should be considered internal and never used outside from generator @param xmldb_table $xmldb_table The xmldb_table object instance. @param xmldb_field $xmldb_field The xmldb_field object ins...
[ "Given", "one", "xmldb_table", "and", "one", "xmldb_field", "returns", "the", "name", "of", "its", "default", "constraint", "in", "DB", "or", "false", "if", "not", "found", "This", "function", "should", "be", "considered", "internal", "and", "never", "used", ...
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/ddl/mssql_sql_generator.php#L578-L593
218,129
moodle/moodle
lib/tcpdf/tcpdf_parser.php
TCPDF_PARSER.setConfig
protected function setConfig($cfg) { if (isset($cfg['die_for_errors'])) { $this->cfg['die_for_errors'] = !!$cfg['die_for_errors']; } if (isset($cfg['ignore_filter_decoding_errors'])) { $this->cfg['ignore_filter_decoding_errors'] = !!$cfg['ignore_filter_decoding_errors']; } if (isset($cfg['ignore_missing...
php
protected function setConfig($cfg) { if (isset($cfg['die_for_errors'])) { $this->cfg['die_for_errors'] = !!$cfg['die_for_errors']; } if (isset($cfg['ignore_filter_decoding_errors'])) { $this->cfg['ignore_filter_decoding_errors'] = !!$cfg['ignore_filter_decoding_errors']; } if (isset($cfg['ignore_missing...
[ "protected", "function", "setConfig", "(", "$", "cfg", ")", "{", "if", "(", "isset", "(", "$", "cfg", "[", "'die_for_errors'", "]", ")", ")", "{", "$", "this", "->", "cfg", "[", "'die_for_errors'", "]", "=", "!", "!", "$", "cfg", "[", "'die_for_error...
Set the configuration parameters. @param $cfg (array) Array of configuration parameters: 'die_for_errors' : if true termitate the program execution in case of error, otherwise thows an exception; 'ignore_filter_decoding_errors' : if true ignore filter decoding errors; 'ignore_missing_filter_decoders' : if true ignore m...
[ "Set", "the", "configuration", "parameters", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/tcpdf/tcpdf_parser.php#L139-L149
218,130
moodle/moodle
admin/tool/monitor/classes/rule.php
rule.duplicate_rule
public function duplicate_rule($finalcourseid) { $rule = fullclone($this->rule); unset($rule->id); $rule->courseid = $finalcourseid; $time = time(); $rule->timecreated = $time; $rule->timemodified = $time; rule_manager::add_rule($rule); }
php
public function duplicate_rule($finalcourseid) { $rule = fullclone($this->rule); unset($rule->id); $rule->courseid = $finalcourseid; $time = time(); $rule->timecreated = $time; $rule->timemodified = $time; rule_manager::add_rule($rule); }
[ "public", "function", "duplicate_rule", "(", "$", "finalcourseid", ")", "{", "$", "rule", "=", "fullclone", "(", "$", "this", "->", "rule", ")", ";", "unset", "(", "$", "rule", "->", "id", ")", ";", "$", "rule", "->", "courseid", "=", "$", "finalcour...
Api to duplicate a rule in a given courseid. @param int $finalcourseid Final course id.
[ "Api", "to", "duplicate", "a", "rule", "in", "a", "given", "courseid", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/monitor/classes/rule.php#L70-L78
218,131
moodle/moodle
admin/tool/monitor/classes/rule.php
rule.get_subscribe_options
public function get_subscribe_options($courseid) { global $CFG; $url = new \moodle_url($CFG->wwwroot. '/admin/tool/monitor/index.php', array( 'courseid' => $courseid, 'ruleid' => $this->id, 'action' => 'subscribe', 'sesskey' => sesskey() )); ...
php
public function get_subscribe_options($courseid) { global $CFG; $url = new \moodle_url($CFG->wwwroot. '/admin/tool/monitor/index.php', array( 'courseid' => $courseid, 'ruleid' => $this->id, 'action' => 'subscribe', 'sesskey' => sesskey() )); ...
[ "public", "function", "get_subscribe_options", "(", "$", "courseid", ")", "{", "global", "$", "CFG", ";", "$", "url", "=", "new", "\\", "moodle_url", "(", "$", "CFG", "->", "wwwroot", ".", "'/admin/tool/monitor/index.php'", ",", "array", "(", "'courseid'", "...
Gets the rule subscribe options for a given course and rule. Could be a select drop down with a list of possible module instances or a single link to subscribe if the rule plugin is not a module. @param int $courseid course id @return \single_select|\moodle_url|string @throws \coding_exception
[ "Gets", "the", "rule", "subscribe", "options", "for", "a", "given", "course", "and", "rule", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/monitor/classes/rule.php#L101-L136
218,132
moodle/moodle
admin/tool/monitor/classes/rule.php
rule.subscribe_user
public function subscribe_user($courseid, $cmid, $userid = 0) { global $USER; if ($this->courseid != $courseid && $this->courseid != 0) { // Trying to subscribe to a rule that belongs to a different course. Should never happen. throw new \coding_exception('Can not subscribe to r...
php
public function subscribe_user($courseid, $cmid, $userid = 0) { global $USER; if ($this->courseid != $courseid && $this->courseid != 0) { // Trying to subscribe to a rule that belongs to a different course. Should never happen. throw new \coding_exception('Can not subscribe to r...
[ "public", "function", "subscribe_user", "(", "$", "courseid", ",", "$", "cmid", ",", "$", "userid", "=", "0", ")", "{", "global", "$", "USER", ";", "if", "(", "$", "this", "->", "courseid", "!=", "$", "courseid", "&&", "$", "this", "->", "courseid", ...
Subscribe an user to this rule. @param int $courseid Course id. @param int $cmid Course module id. @param int $userid User id. @throws \coding_exception
[ "Subscribe", "an", "user", "to", "this", "rule", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/monitor/classes/rule.php#L147-L165
218,133
moodle/moodle
admin/tool/monitor/classes/rule.php
rule.get_mform_set_data
public function get_mform_set_data() { if (!empty($this->rule)) { $rule = fullclone($this->rule); $rule->description = array('text' => $rule->description, 'format' => $rule->descriptionformat); $rule->template = array('text' => $rule->template, 'format' => $rule->templateform...
php
public function get_mform_set_data() { if (!empty($this->rule)) { $rule = fullclone($this->rule); $rule->description = array('text' => $rule->description, 'format' => $rule->descriptionformat); $rule->template = array('text' => $rule->template, 'format' => $rule->templateform...
[ "public", "function", "get_mform_set_data", "(", ")", "{", "if", "(", "!", "empty", "(", "$", "this", "->", "rule", ")", ")", "{", "$", "rule", "=", "fullclone", "(", "$", "this", "->", "rule", ")", ";", "$", "rule", "->", "description", "=", "arra...
Return the rule data to be used while setting mform. @throws \coding_exception
[ "Return", "the", "rule", "data", "to", "be", "used", "while", "setting", "mform", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/monitor/classes/rule.php#L187-L195
218,134
moodle/moodle
admin/tool/customlang/locallib.php
tool_customlang_utils.list_components
public static function list_components() { $list['moodle'] = 'core'; $coresubsystems = core_component::get_core_subsystems(); ksort($coresubsystems); // should be but just in case foreach ($coresubsystems as $name => $location) { $list[$name] = 'core_'.$name; } ...
php
public static function list_components() { $list['moodle'] = 'core'; $coresubsystems = core_component::get_core_subsystems(); ksort($coresubsystems); // should be but just in case foreach ($coresubsystems as $name => $location) { $list[$name] = 'core_'.$name; } ...
[ "public", "static", "function", "list_components", "(", ")", "{", "$", "list", "[", "'moodle'", "]", "=", "'core'", ";", "$", "coresubsystems", "=", "core_component", "::", "get_core_subsystems", "(", ")", ";", "ksort", "(", "$", "coresubsystems", ")", ";", ...
Returns a list of all components installed on the server @return array (string)legacyname => (string)frankenstylename
[ "Returns", "a", "list", "of", "all", "components", "installed", "on", "the", "server" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/customlang/locallib.php#L55-L79
218,135
moodle/moodle
admin/tool/customlang/locallib.php
tool_customlang_utils.checkin
public static function checkin($lang) { global $DB, $USER, $CFG; require_once($CFG->libdir.'/filelib.php'); if ($lang !== clean_param($lang, PARAM_LANG)) { return false; } // get all customized strings from updated components $sql = "SELECT s.*, c.name AS co...
php
public static function checkin($lang) { global $DB, $USER, $CFG; require_once($CFG->libdir.'/filelib.php'); if ($lang !== clean_param($lang, PARAM_LANG)) { return false; } // get all customized strings from updated components $sql = "SELECT s.*, c.name AS co...
[ "public", "static", "function", "checkin", "(", "$", "lang", ")", "{", "global", "$", "DB", ",", "$", "USER", ",", "$", "CFG", ";", "require_once", "(", "$", "CFG", "->", "libdir", ".", "'/filelib.php'", ")", ";", "if", "(", "$", "lang", "!==", "cl...
Exports the translator database into disk files @param mixed $lang language code
[ "Exports", "the", "translator", "database", "into", "disk", "files" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/customlang/locallib.php#L206-L238
218,136
moodle/moodle
admin/tool/customlang/locallib.php
tool_customlang_utils.dump_strings
protected static function dump_strings($lang, $component, $strings) { global $CFG; if ($lang !== clean_param($lang, PARAM_LANG)) { debugging('Unable to dump local strings for non-installed language pack .'.s($lang)); return false; } if ($component !== clean_param...
php
protected static function dump_strings($lang, $component, $strings) { global $CFG; if ($lang !== clean_param($lang, PARAM_LANG)) { debugging('Unable to dump local strings for non-installed language pack .'.s($lang)); return false; } if ($component !== clean_param...
[ "protected", "static", "function", "dump_strings", "(", "$", "lang", ",", "$", "component", ",", "$", "strings", ")", "{", "global", "$", "CFG", ";", "if", "(", "$", "lang", "!==", "clean_param", "(", "$", "lang", ",", "PARAM_LANG", ")", ")", "{", "d...
Writes strings into a local language pack file @param string $component the name of the component @param array $strings
[ "Writes", "strings", "into", "a", "local", "language", "pack", "file" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/customlang/locallib.php#L258-L332
218,137
moodle/moodle
admin/tool/customlang/locallib.php
tool_customlang_utils.get_component_filename
protected static function get_component_filename($component) { if (is_null(self::$components)) { self::$components = self::list_components(); } $return = false; foreach (self::$components as $legacy => $normalized) { if ($component === $normalized) { ...
php
protected static function get_component_filename($component) { if (is_null(self::$components)) { self::$components = self::list_components(); } $return = false; foreach (self::$components as $legacy => $normalized) { if ($component === $normalized) { ...
[ "protected", "static", "function", "get_component_filename", "(", "$", "component", ")", "{", "if", "(", "is_null", "(", "self", "::", "$", "components", ")", ")", "{", "self", "::", "$", "components", "=", "self", "::", "list_components", "(", ")", ";", ...
Returns the name of the file where the component's local strings should be exported into @param string $component normalized name of the component, eg 'core' or 'mod_workshop' @return string|boolean filename eg 'moodle.php' or 'workshop.php', false if not found
[ "Returns", "the", "name", "of", "the", "file", "where", "the", "component", "s", "local", "strings", "should", "be", "exported", "into" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/customlang/locallib.php#L340-L352
218,138
moodle/moodle
admin/tool/customlang/locallib.php
tool_customlang_utils.save_filter
public static function save_filter(stdclass $data, stdclass $persistant) { if (!isset($persistant->tool_customlang_filter)) { $persistant->tool_customlang_filter = array(); } foreach ($data as $key => $value) { if ($key !== 'submit') { $persistant->tool_cu...
php
public static function save_filter(stdclass $data, stdclass $persistant) { if (!isset($persistant->tool_customlang_filter)) { $persistant->tool_customlang_filter = array(); } foreach ($data as $key => $value) { if ($key !== 'submit') { $persistant->tool_cu...
[ "public", "static", "function", "save_filter", "(", "stdclass", "$", "data", ",", "stdclass", "$", "persistant", ")", "{", "if", "(", "!", "isset", "(", "$", "persistant", "->", "tool_customlang_filter", ")", ")", "{", "$", "persistant", "->", "tool_customla...
Saves filter data into a persistant storage such as user session @see self::load_filter() @param stdclass $data filter values @param stdclass $persistant storage object
[ "Saves", "filter", "data", "into", "a", "persistant", "storage", "such", "as", "user", "session" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/customlang/locallib.php#L373-L382
218,139
moodle/moodle
admin/tool/customlang/locallib.php
tool_customlang_utils.load_filter
public static function load_filter(stdclass $persistant) { $data = new stdclass(); if (isset($persistant->tool_customlang_filter)) { foreach ($persistant->tool_customlang_filter as $key => $value) { $data->{$key} = unserialize($value); } } return $...
php
public static function load_filter(stdclass $persistant) { $data = new stdclass(); if (isset($persistant->tool_customlang_filter)) { foreach ($persistant->tool_customlang_filter as $key => $value) { $data->{$key} = unserialize($value); } } return $...
[ "public", "static", "function", "load_filter", "(", "stdclass", "$", "persistant", ")", "{", "$", "data", "=", "new", "stdclass", "(", ")", ";", "if", "(", "isset", "(", "$", "persistant", "->", "tool_customlang_filter", ")", ")", "{", "foreach", "(", "$...
Loads the previously saved filter settings from a persistent storage @see self::save_filter() @param stdclass $persistant storage object @return stdclass filter data
[ "Loads", "the", "previously", "saved", "filter", "settings", "from", "a", "persistent", "storage" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/customlang/locallib.php#L391-L399
218,140
moodle/moodle
admin/tool/customlang/locallib.php
tool_customlang_menu.add_item
public function add_item($key, $title, moodle_url $url, $method) { if (isset($this->items[$key])) { throw new coding_exception('Menu item already exists'); } if (empty($title) or empty($key)) { throw new coding_exception('Empty title or item key not allowed'); } ...
php
public function add_item($key, $title, moodle_url $url, $method) { if (isset($this->items[$key])) { throw new coding_exception('Menu item already exists'); } if (empty($title) or empty($key)) { throw new coding_exception('Empty title or item key not allowed'); } ...
[ "public", "function", "add_item", "(", "$", "key", ",", "$", "title", ",", "moodle_url", "$", "url", ",", "$", "method", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "items", "[", "$", "key", "]", ")", ")", "{", "throw", "new", "coding_e...
Adds item into the menu @param string $key item identifier @param string $title localized action title @param moodle_url $url action handler @param string $method form method
[ "Adds", "item", "into", "the", "menu" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/customlang/locallib.php#L435-L447
218,141
moodle/moodle
mod/assign/feedback/editpdf/classes/document_services.php
document_services.get_assignment_from_param
private static function get_assignment_from_param($assignment) { global $CFG; require_once($CFG->dirroot . '/mod/assign/locallib.php'); if (!is_object($assignment)) { $cm = get_coursemodule_from_instance('assign', $assignment, 0, false, MUST_EXIST); $context = \context_...
php
private static function get_assignment_from_param($assignment) { global $CFG; require_once($CFG->dirroot . '/mod/assign/locallib.php'); if (!is_object($assignment)) { $cm = get_coursemodule_from_instance('assign', $assignment, 0, false, MUST_EXIST); $context = \context_...
[ "private", "static", "function", "get_assignment_from_param", "(", "$", "assignment", ")", "{", "global", "$", "CFG", ";", "require_once", "(", "$", "CFG", "->", "dirroot", ".", "'/mod/assign/locallib.php'", ")", ";", "if", "(", "!", "is_object", "(", "$", "...
This function will take an int or an assignment instance and return an assignment instance. It is just for convenience. @param int|\assign $assignment @return assign
[ "This", "function", "will", "take", "an", "int", "or", "an", "assignment", "instance", "and", "return", "an", "assignment", "instance", ".", "It", "is", "just", "for", "convenience", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/feedback/editpdf/classes/document_services.php#L92-L104
218,142
moodle/moodle
mod/assign/feedback/editpdf/classes/document_services.php
document_services.hash
private static function hash($assignment, $userid, $attemptnumber) { if (is_object($assignment)) { $assignmentid = $assignment->get_instance()->id; } else { $assignmentid = $assignment; } return sha1($assignmentid . '_' . $userid . '_' . $attemptnumber); }
php
private static function hash($assignment, $userid, $attemptnumber) { if (is_object($assignment)) { $assignmentid = $assignment->get_instance()->id; } else { $assignmentid = $assignment; } return sha1($assignmentid . '_' . $userid . '_' . $attemptnumber); }
[ "private", "static", "function", "hash", "(", "$", "assignment", ",", "$", "userid", ",", "$", "attemptnumber", ")", "{", "if", "(", "is_object", "(", "$", "assignment", ")", ")", "{", "$", "assignmentid", "=", "$", "assignment", "->", "get_instance", "(...
Get a hash that will be unique and can be used in a path name. @param int|\assign $assignment @param int $userid @param int $attemptnumber (-1 means latest attempt)
[ "Get", "a", "hash", "that", "will", "be", "unique", "and", "can", "be", "used", "in", "a", "path", "name", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/feedback/editpdf/classes/document_services.php#L112-L119
218,143
moodle/moodle
mod/assign/feedback/editpdf/classes/document_services.php
document_services.strip_images
protected static function strip_images($html) { // Load HTML and suppress any parsing errors (DOMDocument->loadHTML() does not current support HTML5 tags). $dom = new DOMDocument(); libxml_use_internal_errors(true); $dom->loadHTML('<?xml version="1.0" encoding="UTF-8" ?>' . $html); ...
php
protected static function strip_images($html) { // Load HTML and suppress any parsing errors (DOMDocument->loadHTML() does not current support HTML5 tags). $dom = new DOMDocument(); libxml_use_internal_errors(true); $dom->loadHTML('<?xml version="1.0" encoding="UTF-8" ?>' . $html); ...
[ "protected", "static", "function", "strip_images", "(", "$", "html", ")", "{", "// Load HTML and suppress any parsing errors (DOMDocument->loadHTML() does not current support HTML5 tags).", "$", "dom", "=", "new", "DOMDocument", "(", ")", ";", "libxml_use_internal_errors", "(",...
Use a DOM parser to accurately replace images with their alt text. @param string $html @return string New html with no image tags.
[ "Use", "a", "DOM", "parser", "to", "accurately", "replace", "images", "with", "their", "alt", "text", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/feedback/editpdf/classes/document_services.php#L126-L146
218,144
moodle/moodle
mod/assign/feedback/editpdf/classes/document_services.php
document_services.get_combined_document_for_attempt
public static function get_combined_document_for_attempt($assignment, $userid, $attemptnumber) { global $USER, $DB; $assignment = self::get_assignment_from_param($assignment); // Capability checks. if (!$assignment->can_view_submission($userid)) { print_error('nopermission'...
php
public static function get_combined_document_for_attempt($assignment, $userid, $attemptnumber) { global $USER, $DB; $assignment = self::get_assignment_from_param($assignment); // Capability checks. if (!$assignment->can_view_submission($userid)) { print_error('nopermission'...
[ "public", "static", "function", "get_combined_document_for_attempt", "(", "$", "assignment", ",", "$", "userid", ",", "$", "attemptnumber", ")", "{", "global", "$", "USER", ",", "$", "DB", ";", "$", "assignment", "=", "self", "::", "get_assignment_from_param", ...
Fetch the current combined document ready for state checking. @param int|\assign $assignment @param int $userid @param int $attemptnumber (-1 means latest attempt) @return combined_document
[ "Fetch", "the", "current", "combined", "document", "ready", "for", "state", "checking", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/feedback/editpdf/classes/document_services.php#L251-L302
218,145
moodle/moodle
mod/assign/feedback/editpdf/classes/document_services.php
document_services.get_combined_pdf_for_attempt
public static function get_combined_pdf_for_attempt($assignment, $userid, $attemptnumber) { $document = self::get_combined_document_for_attempt($assignment, $userid, $attemptnumber); if ($document->get_status() === combined_document::STATUS_COMPLETE) { // The combined document is already re...
php
public static function get_combined_pdf_for_attempt($assignment, $userid, $attemptnumber) { $document = self::get_combined_document_for_attempt($assignment, $userid, $attemptnumber); if ($document->get_status() === combined_document::STATUS_COMPLETE) { // The combined document is already re...
[ "public", "static", "function", "get_combined_pdf_for_attempt", "(", "$", "assignment", ",", "$", "userid", ",", "$", "attemptnumber", ")", "{", "$", "document", "=", "self", "::", "get_combined_document_for_attempt", "(", "$", "assignment", ",", "$", "userid", ...
This function return the combined pdf for all valid submission files. @param int|\assign $assignment @param int $userid @param int $attemptnumber (-1 means latest attempt) @return combined_document
[ "This", "function", "return", "the", "combined", "pdf", "for", "all", "valid", "submission", "files", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/feedback/editpdf/classes/document_services.php#L312-L324
218,146
moodle/moodle
mod/assign/feedback/editpdf/classes/document_services.php
document_services.page_number_for_attempt
public static function page_number_for_attempt($assignment, $userid, $attemptnumber, $readonly = false) { global $CFG; require_once($CFG->libdir . '/pdflib.php'); $assignment = self::get_assignment_from_param($assignment); if (!$assignment->can_view_submission($userid)) { ...
php
public static function page_number_for_attempt($assignment, $userid, $attemptnumber, $readonly = false) { global $CFG; require_once($CFG->libdir . '/pdflib.php'); $assignment = self::get_assignment_from_param($assignment); if (!$assignment->can_view_submission($userid)) { ...
[ "public", "static", "function", "page_number_for_attempt", "(", "$", "assignment", ",", "$", "userid", ",", "$", "attemptnumber", ",", "$", "readonly", "=", "false", ")", "{", "global", "$", "CFG", ";", "require_once", "(", "$", "CFG", "->", "libdir", ".",...
This function will return the number of pages of a pdf. @param int|\assign $assignment @param int $userid @param int $attemptnumber (-1 means latest attempt) @param bool $readonly When true we get the number of pages for the readonly version. @return int number of pages
[ "This", "function", "will", "return", "the", "number", "of", "pages", "of", "a", "pdf", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/feedback/editpdf/classes/document_services.php#L335-L362
218,147
moodle/moodle
mod/assign/feedback/editpdf/classes/document_services.php
document_services.get_downloadable_feedback_filename
protected static function get_downloadable_feedback_filename($assignment, $userid, $attemptnumber) { global $DB; $assignment = self::get_assignment_from_param($assignment); $groupmode = groups_get_activity_groupmode($assignment->get_course_module()); $groupname = ''; if ($group...
php
protected static function get_downloadable_feedback_filename($assignment, $userid, $attemptnumber) { global $DB; $assignment = self::get_assignment_from_param($assignment); $groupmode = groups_get_activity_groupmode($assignment->get_course_module()); $groupname = ''; if ($group...
[ "protected", "static", "function", "get_downloadable_feedback_filename", "(", "$", "assignment", ",", "$", "userid", ",", "$", "attemptnumber", ")", "{", "global", "$", "DB", ";", "$", "assignment", "=", "self", "::", "get_assignment_from_param", "(", "$", "assi...
This function returns sensible filename for a feedback file. @param int|\assign $assignment @param int $userid @param int $attemptnumber (-1 means latest attempt) @return string
[ "This", "function", "returns", "sensible", "filename", "for", "a", "feedback", "file", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/feedback/editpdf/classes/document_services.php#L575-L604
218,148
moodle/moodle
mod/assign/feedback/editpdf/classes/document_services.php
document_services.copy_pages_to_readonly_area
public static function copy_pages_to_readonly_area($assignment, $grade) { $fs = get_file_storage(); $assignment = self::get_assignment_from_param($assignment); $contextid = $assignment->get_context()->id; $component = 'assignfeedback_editpdf'; $itemid = $grade->id; // Ge...
php
public static function copy_pages_to_readonly_area($assignment, $grade) { $fs = get_file_storage(); $assignment = self::get_assignment_from_param($assignment); $contextid = $assignment->get_context()->id; $component = 'assignfeedback_editpdf'; $itemid = $grade->id; // Ge...
[ "public", "static", "function", "copy_pages_to_readonly_area", "(", "$", "assignment", ",", "$", "grade", ")", "{", "$", "fs", "=", "get_file_storage", "(", ")", ";", "$", "assignment", "=", "self", "::", "get_assignment_from_param", "(", "$", "assignment", ")...
Copy the pages image to the readonly area. @param int|\assign $assignment The assignment. @param \stdClass $grade The grade record. @return void
[ "Copy", "the", "pages", "image", "to", "the", "readonly", "area", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/feedback/editpdf/classes/document_services.php#L757-L778
218,149
moodle/moodle
mod/assign/feedback/editpdf/classes/document_services.php
document_services.delete_feedback_document
public static function delete_feedback_document($assignment, $userid, $attemptnumber) { $assignment = self::get_assignment_from_param($assignment); if (!$assignment->can_view_submission($userid)) { print_error('nopermission'); } if (!$assignment->can_grade()) { ...
php
public static function delete_feedback_document($assignment, $userid, $attemptnumber) { $assignment = self::get_assignment_from_param($assignment); if (!$assignment->can_view_submission($userid)) { print_error('nopermission'); } if (!$assignment->can_grade()) { ...
[ "public", "static", "function", "delete_feedback_document", "(", "$", "assignment", ",", "$", "userid", ",", "$", "attemptnumber", ")", "{", "$", "assignment", "=", "self", "::", "get_assignment_from_param", "(", "$", "assignment", ")", ";", "if", "(", "!", ...
This function deletes the generated pdf for a student. @param int|\assign $assignment @param int $userid @param int $attemptnumber (-1 means latest attempt) @return bool
[ "This", "function", "deletes", "the", "generated", "pdf", "for", "a", "student", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/feedback/editpdf/classes/document_services.php#L823-L843
218,150
moodle/moodle
mod/assign/feedback/editpdf/classes/document_services.php
document_services.get_files
private static function get_files($assignment, $userid, $attemptnumber, $filearea, $filepath = '/') { $grade = $assignment->get_user_grade($userid, true, $attemptnumber); $itemid = $grade->id; $contextid = $assignment->get_context()->id; $component = self::COMPONENT; $fs = get_fi...
php
private static function get_files($assignment, $userid, $attemptnumber, $filearea, $filepath = '/') { $grade = $assignment->get_user_grade($userid, true, $attemptnumber); $itemid = $grade->id; $contextid = $assignment->get_context()->id; $component = self::COMPONENT; $fs = get_fi...
[ "private", "static", "function", "get_files", "(", "$", "assignment", ",", "$", "userid", ",", "$", "attemptnumber", ",", "$", "filearea", ",", "$", "filepath", "=", "'/'", ")", "{", "$", "grade", "=", "$", "assignment", "->", "get_user_grade", "(", "$",...
Get All files in a File area @param int|\assign $assignment Assignment @param int $userid User ID @param int $attemptnumber Attempt Number @param string $filearea File Area @param string $filepath File Path @return array
[ "Get", "All", "files", "in", "a", "File", "area" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/feedback/editpdf/classes/document_services.php#L854-L862
218,151
moodle/moodle
mod/assign/feedback/editpdf/classes/document_services.php
document_services.rotate_page
public static function rotate_page($assignment, $userid, $attemptnumber, $index, $rotateleft) { $assignment = self::get_assignment_from_param($assignment); $grade = $assignment->get_user_grade($userid, true, $attemptnumber); // Check permission. if (!$assignment->can_view_submission($use...
php
public static function rotate_page($assignment, $userid, $attemptnumber, $index, $rotateleft) { $assignment = self::get_assignment_from_param($assignment); $grade = $assignment->get_user_grade($userid, true, $attemptnumber); // Check permission. if (!$assignment->can_view_submission($use...
[ "public", "static", "function", "rotate_page", "(", "$", "assignment", ",", "$", "userid", ",", "$", "attemptnumber", ",", "$", "index", ",", "$", "rotateleft", ")", "{", "$", "assignment", "=", "self", "::", "get_assignment_from_param", "(", "$", "assignmen...
This function rotate a page, and mark the page as rotated. @param int|\assign $assignment Assignment @param int $userid User ID @param int $attemptnumber Attempt Number @param int $index Index of Current Page @param bool $rotateleft To determine whether the page is rotated left or right. @return null|\stored_file retur...
[ "This", "function", "rotate", "a", "page", "and", "mark", "the", "page", "as", "rotated", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/feedback/editpdf/classes/document_services.php#L917-L969
218,152
moodle/moodle
mod/chat/mod_form.php
mod_chat_mod_form.definition
public function definition() { global $CFG; $mform = $this->_form; $mform->addElement('header', 'general', get_string('general', 'form')); $mform->addElement('text', 'name', get_string('chatname', 'chat'), array('size' => '64')); if (!empty($CFG->formatstringstriptags)) { ...
php
public function definition() { global $CFG; $mform = $this->_form; $mform->addElement('header', 'general', get_string('general', 'form')); $mform->addElement('text', 'name', get_string('chatname', 'chat'), array('size' => '64')); if (!empty($CFG->formatstringstriptags)) { ...
[ "public", "function", "definition", "(", ")", "{", "global", "$", "CFG", ";", "$", "mform", "=", "$", "this", "->", "_form", ";", "$", "mform", "->", "addElement", "(", "'header'", ",", "'general'", ",", "get_string", "(", "'general'", ",", "'form'", "...
Define the chat activity settings form
[ "Define", "the", "chat", "activity", "settings", "form" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/chat/mod_form.php#L28-L79
218,153
moodle/moodle
mod/workshop/eval/best/lib.php
workshop_best_evaluation.update_grading_grades
public function update_grading_grades(stdclass $settings, $restrict=null) { global $DB; // Remember the recently used settings for this workshop. if (empty($this->settings)) { $record = new stdclass(); $record->workshopid = $this->workshop->id; $record->compa...
php
public function update_grading_grades(stdclass $settings, $restrict=null) { global $DB; // Remember the recently used settings for this workshop. if (empty($this->settings)) { $record = new stdclass(); $record->workshopid = $this->workshop->id; $record->compa...
[ "public", "function", "update_grading_grades", "(", "stdclass", "$", "settings", ",", "$", "restrict", "=", "null", ")", "{", "global", "$", "DB", ";", "// Remember the recently used settings for this workshop.", "if", "(", "empty", "(", "$", "this", "->", "settin...
Calculates the grades for assessment and updates 'gradinggrade' fields in 'workshop_assessments' table This function relies on the grading strategy subplugin providing get_assessments_recordset() method. {@see self::process_assessments()} for the required structure of the recordset. @param stdClass $settings Th...
[ "Calculates", "the", "grades", "for", "assessment", "and", "updates", "gradinggrade", "fields", "in", "workshop_assessments", "table" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/eval/best/lib.php#L67-L109
218,154
moodle/moodle
mod/workshop/eval/best/lib.php
workshop_best_evaluation.process_assessments
protected function process_assessments(array $assessments, array $diminfo, stdclass $settings) { global $DB; if (empty($assessments)) { return; } // reindex the passed flat structure to be indexed by assessmentid $assessments = $this->prepare_data_from_recordset($as...
php
protected function process_assessments(array $assessments, array $diminfo, stdclass $settings) { global $DB; if (empty($assessments)) { return; } // reindex the passed flat structure to be indexed by assessmentid $assessments = $this->prepare_data_from_recordset($as...
[ "protected", "function", "process_assessments", "(", "array", "$", "assessments", ",", "array", "$", "diminfo", ",", "stdclass", "$", "settings", ")", "{", "global", "$", "DB", ";", "if", "(", "empty", "(", "$", "assessments", ")", ")", "{", "return", ";...
Given a list of all assessments of a single submission, updates the grading grades in database @param array $assessments of stdclass (->assessmentid ->assessmentweight ->reviewerid ->gradinggrade ->submissionid ->dimensionid ->grade) @param array $diminfo of stdclass (->id ->weight ->max ->min) @param stdClass grading...
[ "Given", "a", "list", "of", "all", "assessments", "of", "a", "single", "submission", "updates", "the", "grading", "grades", "in", "database" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/eval/best/lib.php#L150-L230
218,155
moodle/moodle
mod/workshop/eval/best/lib.php
workshop_best_evaluation.prepare_data_from_recordset
protected function prepare_data_from_recordset($assessments) { $data = array(); // to be returned foreach ($assessments as $a) { $id = $a->assessmentid; // just an abbreviation if (!isset($data[$id])) { $data[$id] = new stdclass(); $data[$id]->a...
php
protected function prepare_data_from_recordset($assessments) { $data = array(); // to be returned foreach ($assessments as $a) { $id = $a->assessmentid; // just an abbreviation if (!isset($data[$id])) { $data[$id] = new stdclass(); $data[$id]->a...
[ "protected", "function", "prepare_data_from_recordset", "(", "$", "assessments", ")", "{", "$", "data", "=", "array", "(", ")", ";", "// to be returned", "foreach", "(", "$", "assessments", "as", "$", "a", ")", "{", "$", "id", "=", "$", "a", "->", "asses...
Prepares a structure of assessments and given grades @param array $assessments batch of recordset items as returned by the grading strategy @return array
[ "Prepares", "a", "structure", "of", "assessments", "and", "given", "grades" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/eval/best/lib.php#L238-L254
218,156
moodle/moodle
mod/workshop/eval/best/lib.php
workshop_best_evaluation.normalize_grades
protected function normalize_grades(array $assessments, array $diminfo) { foreach ($assessments as $asid => $assessment) { foreach ($assessment->dimgrades as $dimid => $dimgrade) { $dimmin = $diminfo[$dimid]->min; $dimmax = $diminfo[$dimid]->max; if ($...
php
protected function normalize_grades(array $assessments, array $diminfo) { foreach ($assessments as $asid => $assessment) { foreach ($assessment->dimgrades as $dimid => $dimgrade) { $dimmin = $diminfo[$dimid]->min; $dimmax = $diminfo[$dimid]->max; if ($...
[ "protected", "function", "normalize_grades", "(", "array", "$", "assessments", ",", "array", "$", "diminfo", ")", "{", "foreach", "(", "$", "assessments", "as", "$", "asid", "=>", "$", "assessment", ")", "{", "foreach", "(", "$", "assessment", "->", "dimgr...
Normalizes the dimension grades to the interval 0.00000 - 100.00000 Note: this heavily relies on PHP5 way of handling references in array of stdclasses. Hopefully it will not change again soon. @param array $assessments of stdclass as returned by {@see self::prepare_data_from_recordset()} @param array $diminfo of std...
[ "Normalizes", "the", "dimension", "grades", "to", "the", "interval", "0", ".", "00000", "-", "100", ".", "00000" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/eval/best/lib.php#L266-L279
218,157
moodle/moodle
mod/workshop/eval/best/lib.php
workshop_best_evaluation.average_assessment
protected function average_assessment(array $assessments) { $sumdimgrades = array(); foreach ($assessments as $a) { foreach ($a->dimgrades as $dimid => $dimgrade) { if (!isset($sumdimgrades[$dimid])) { $sumdimgrades[$dimid] = 0; } ...
php
protected function average_assessment(array $assessments) { $sumdimgrades = array(); foreach ($assessments as $a) { foreach ($a->dimgrades as $dimid => $dimgrade) { if (!isset($sumdimgrades[$dimid])) { $sumdimgrades[$dimid] = 0; } ...
[ "protected", "function", "average_assessment", "(", "array", "$", "assessments", ")", "{", "$", "sumdimgrades", "=", "array", "(", ")", ";", "foreach", "(", "$", "assessments", "as", "$", "a", ")", "{", "foreach", "(", "$", "a", "->", "dimgrades", "as", ...
Given a set of a submission's assessments, returns a hypothetical average assessment The passed structure must be array of assessments objects with ->weight and ->dimgrades properties. Returns null if all passed assessments have zero weight as there is nothing to choose from then. @param array $assessments as prepare...
[ "Given", "a", "set", "of", "a", "submission", "s", "assessments", "returns", "a", "hypothetical", "average", "assessment" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/eval/best/lib.php#L291-L317
218,158
moodle/moodle
mod/workshop/eval/best/lib.php
workshop_best_evaluation.weighted_variance
protected function weighted_variance(array $assessments) { $first = reset($assessments); if (empty($first)) { return null; } $dimids = array_keys($first->dimgrades); $asids = array_keys($assessments); $vars = array(); // to be returned foreach ($di...
php
protected function weighted_variance(array $assessments) { $first = reset($assessments); if (empty($first)) { return null; } $dimids = array_keys($first->dimgrades); $asids = array_keys($assessments); $vars = array(); // to be returned foreach ($di...
[ "protected", "function", "weighted_variance", "(", "array", "$", "assessments", ")", "{", "$", "first", "=", "reset", "(", "$", "assessments", ")", ";", "if", "(", "empty", "(", "$", "first", ")", ")", "{", "return", "null", ";", "}", "$", "dimids", ...
Given a set of a submission's assessments, returns standard deviations of all their dimensions The passed structure must be array of assessments objects with at least ->weight and ->dimgrades properties. This implementation uses weighted incremental algorithm as suggested in "D. H. D. West (1979). Communications of th...
[ "Given", "a", "set", "of", "a", "submission", "s", "assessments", "returns", "standard", "deviations", "of", "all", "their", "dimensions" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/eval/best/lib.php#L331-L373
218,159
moodle/moodle
mod/workshop/eval/best/lib.php
workshop_best_evaluation.assessments_distance
protected function assessments_distance(stdclass $assessment, stdclass $referential, array $diminfo, stdclass $settings) { $distance = 0; $n = 0; foreach (array_keys($assessment->dimgrades) as $dimid) { $agrade = $assessment->dimgrades[$dimid]; $rgrade = $referential->dim...
php
protected function assessments_distance(stdclass $assessment, stdclass $referential, array $diminfo, stdclass $settings) { $distance = 0; $n = 0; foreach (array_keys($assessment->dimgrades) as $dimid) { $agrade = $assessment->dimgrades[$dimid]; $rgrade = $referential->dim...
[ "protected", "function", "assessments_distance", "(", "stdclass", "$", "assessment", ",", "stdclass", "$", "referential", ",", "array", "$", "diminfo", ",", "stdclass", "$", "settings", ")", "{", "$", "distance", "=", "0", ";", "$", "n", "=", "0", ";", "...
Measures the distance of the assessment from a referential one The passed data structures must contain ->dimgrades property. The referential assessment is supposed to be close to the average assessment. All dimension grades are supposed to be normalized to the interval 0 - 100. Returned value is rounded to 4 valid dec...
[ "Measures", "the", "distance", "of", "the", "assessment", "from", "a", "referential", "one" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/eval/best/lib.php#L390-L415
218,160
moodle/moodle
mod/workshop/eval/best/lib.php
workshop_best_evaluation_settings_form.definition_sub
protected function definition_sub() { $mform = $this->_form; $plugindefaults = get_config('workshopeval_best'); $current = $this->_customdata['current']; $options = array(); for ($i = 9; $i >= 1; $i = $i-2) { $options[$i] = get_string('comparisonlevel' . $i, 'worksh...
php
protected function definition_sub() { $mform = $this->_form; $plugindefaults = get_config('workshopeval_best'); $current = $this->_customdata['current']; $options = array(); for ($i = 9; $i >= 1; $i = $i-2) { $options[$i] = get_string('comparisonlevel' . $i, 'worksh...
[ "protected", "function", "definition_sub", "(", ")", "{", "$", "mform", "=", "$", "this", "->", "_form", ";", "$", "plugindefaults", "=", "get_config", "(", "'workshopeval_best'", ")", ";", "$", "current", "=", "$", "this", "->", "_customdata", "[", "'curr...
Defines specific fields for this evaluation method.
[ "Defines", "specific", "fields", "for", "this", "evaluation", "method", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/eval/best/lib.php#L427-L442
218,161
moodle/moodle
mod/workshop/classes/task/cron_task.php
cron_task.execute
public function execute() { global $CFG, $DB; $now = time(); mtrace(' processing workshop subplugins ...'); // Now when the scheduled allocator had a chance to do its job. // Check if there are some workshops to switch into the assessment phase. $workshops = $DB->get_r...
php
public function execute() { global $CFG, $DB; $now = time(); mtrace(' processing workshop subplugins ...'); // Now when the scheduled allocator had a chance to do its job. // Check if there are some workshops to switch into the assessment phase. $workshops = $DB->get_r...
[ "public", "function", "execute", "(", ")", "{", "global", "$", "CFG", ",", "$", "DB", ";", "$", "now", "=", "time", "(", ")", ";", "mtrace", "(", "' processing workshop subplugins ...'", ")", ";", "// Now when the scheduled allocator had a chance to do its job.", ...
Run workshop cron.
[ "Run", "workshop", "cron", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/classes/task/cron_task.php#L49-L87
218,162
moodle/moodle
mod/assignment/backup/moodle1/lib.php
moodle1_mod_assignment_handler.get_subplugin_handler
protected function get_subplugin_handler($subplugin) { global $CFG; // we include other files here if (is_null($this->subpluginhandlers)) { $this->subpluginhandlers = array(); $subplugins = core_component::get_plugin_list('assignment'); foreach ($subplugins as $name ...
php
protected function get_subplugin_handler($subplugin) { global $CFG; // we include other files here if (is_null($this->subpluginhandlers)) { $this->subpluginhandlers = array(); $subplugins = core_component::get_plugin_list('assignment'); foreach ($subplugins as $name ...
[ "protected", "function", "get_subplugin_handler", "(", "$", "subplugin", ")", "{", "global", "$", "CFG", ";", "// we include other files here", "if", "(", "is_null", "(", "$", "this", "->", "subpluginhandlers", ")", ")", "{", "$", "this", "->", "subpluginhandler...
Factory method returning the handler of the given assignment subplugin @param string $subplugin the name of the subplugin @throws moodle1_convert_exception @return moodle1_assignment_subplugin_handler the instance of the handler
[ "Factory", "method", "returning", "the", "handler", "of", "the", "given", "assignment", "subplugin" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assignment/backup/moodle1/lib.php#L178-L209
218,163
moodle/moodle
admin/roles/classes/preset_form.php
core_role_preset_form.definition
protected function definition() { $mform = $this->_form; $data = $this->_customdata; $options = array(); $group = get_string('other'); $options[$group] = array(); $options[$group][0] = get_string('norole', 'core_role'); $group = get_string('role', 'core'); ...
php
protected function definition() { $mform = $this->_form; $data = $this->_customdata; $options = array(); $group = get_string('other'); $options[$group] = array(); $options[$group][0] = get_string('norole', 'core_role'); $group = get_string('role', 'core'); ...
[ "protected", "function", "definition", "(", ")", "{", "$", "mform", "=", "$", "this", "->", "_form", ";", "$", "data", "=", "$", "this", "->", "_customdata", ";", "$", "options", "=", "array", "(", ")", ";", "$", "group", "=", "get_string", "(", "'...
Definition of this form.
[ "Definition", "of", "this", "form", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/roles/classes/preset_form.php#L42-L98
218,164
moodle/moodle
admin/roles/classes/preset_form.php
core_role_preset_form.validation
public function validation($data, $files) { $errors = parent::validation($data, $files); if ($files = $this->get_draft_files('rolepreset')) { /** @var stored_file $file */ $file = reset($files); $xml = $file->get_content(); if (!core_role_preset::is_valid...
php
public function validation($data, $files) { $errors = parent::validation($data, $files); if ($files = $this->get_draft_files('rolepreset')) { /** @var stored_file $file */ $file = reset($files); $xml = $file->get_content(); if (!core_role_preset::is_valid...
[ "public", "function", "validation", "(", "$", "data", ",", "$", "files", ")", "{", "$", "errors", "=", "parent", "::", "validation", "(", "$", "data", ",", "$", "files", ")", ";", "if", "(", "$", "files", "=", "$", "this", "->", "get_draft_files", ...
Validate this form. @param array $data submitted data @param array $files not used @return array errors
[ "Validate", "this", "form", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/roles/classes/preset_form.php#L107-L120
218,165
moodle/moodle
files/renderer.php
core_files_renderer.render_form_filemanager
public function render_form_filemanager($fm) { $html = $this->fm_print_generallayout($fm); $module = array( 'name'=>'form_filemanager', 'fullpath'=>'/lib/form/filemanager.js', 'requires' => array('moodle-core-notification-dialogue', 'core_filepicker', 'base', 'io-base...
php
public function render_form_filemanager($fm) { $html = $this->fm_print_generallayout($fm); $module = array( 'name'=>'form_filemanager', 'fullpath'=>'/lib/form/filemanager.js', 'requires' => array('moodle-core-notification-dialogue', 'core_filepicker', 'base', 'io-base...
[ "public", "function", "render_form_filemanager", "(", "$", "fm", ")", "{", "$", "html", "=", "$", "this", "->", "fm_print_generallayout", "(", "$", "fm", ")", ";", "$", "module", "=", "array", "(", "'name'", "=>", "'form_filemanager'", ",", "'fullpath'", "...
Prints the file manager and initializes all necessary libraries <pre> $fm = new form_filemanager($options); $output = get_renderer('core', 'files'); echo $output->render($fm); </pre> @param form_filemanager $fm File manager to render @return string HTML fragment
[ "Prints", "the", "file", "manager", "and", "initializes", "all", "necessary", "libraries" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/files/renderer.php#L104-L132
218,166
moodle/moodle
files/renderer.php
core_files_renderer.fm_print_generallayout
protected function fm_print_generallayout($fm) { $context = [ 'client_id' => $fm->options->client_id, 'helpicon' => $this->help_icon('setmainfile', 'repository'), 'restrictions' => $this->fm_print_restrictions($fm) ]; return $this->render_from_temp...
php
protected function fm_print_generallayout($fm) { $context = [ 'client_id' => $fm->options->client_id, 'helpicon' => $this->help_icon('setmainfile', 'repository'), 'restrictions' => $this->fm_print_restrictions($fm) ]; return $this->render_from_temp...
[ "protected", "function", "fm_print_generallayout", "(", "$", "fm", ")", "{", "$", "context", "=", "[", "'client_id'", "=>", "$", "fm", "->", "options", "->", "client_id", ",", "'helpicon'", "=>", "$", "this", "->", "help_icon", "(", "'setmainfile'", ",", "...
Returns html for displaying one file manager @param form_filemanager $fm @return string
[ "Returns", "html", "for", "displaying", "one", "file", "manager" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/files/renderer.php#L140-L147
218,167
moodle/moodle
files/renderer.php
core_files_renderer.filemanager_js_templates
public function filemanager_js_templates() { $class_methods = get_class_methods($this); $templates = array(); foreach ($class_methods as $method_name) { if (preg_match('/^fm_js_template_(.*)$/', $method_name, $matches)) $templates[$matches[1]] = $this->$method_name(); ...
php
public function filemanager_js_templates() { $class_methods = get_class_methods($this); $templates = array(); foreach ($class_methods as $method_name) { if (preg_match('/^fm_js_template_(.*)$/', $method_name, $matches)) $templates[$matches[1]] = $this->$method_name(); ...
[ "public", "function", "filemanager_js_templates", "(", ")", "{", "$", "class_methods", "=", "get_class_methods", "(", "$", "this", ")", ";", "$", "templates", "=", "array", "(", ")", ";", "foreach", "(", "$", "class_methods", "as", "$", "method_name", ")", ...
Returns all FileManager JavaScript templates as an array. @return array
[ "Returns", "all", "FileManager", "JavaScript", "templates", "as", "an", "array", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/files/renderer.php#L267-L275
218,168
moodle/moodle
files/renderer.php
core_files_renderer.fm_print_restrictions
protected function fm_print_restrictions($fm) { $maxbytes = display_size($fm->options->maxbytes); $strparam = (object) array('size' => $maxbytes, 'attachments' => $fm->options->maxfiles, 'areasize' => display_size($fm->options->areamaxbytes)); $hasmaxfiles = !empty($fm->options->maxf...
php
protected function fm_print_restrictions($fm) { $maxbytes = display_size($fm->options->maxbytes); $strparam = (object) array('size' => $maxbytes, 'attachments' => $fm->options->maxfiles, 'areasize' => display_size($fm->options->areamaxbytes)); $hasmaxfiles = !empty($fm->options->maxf...
[ "protected", "function", "fm_print_restrictions", "(", "$", "fm", ")", "{", "$", "maxbytes", "=", "display_size", "(", "$", "fm", "->", "options", "->", "maxbytes", ")", ";", "$", "strparam", "=", "(", "object", ")", "array", "(", "'size'", "=>", "$", ...
Displays restrictions for the file manager @param form_filemanager $fm @return string
[ "Displays", "restrictions", "for", "the", "file", "manager" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/files/renderer.php#L283-L300
218,169
moodle/moodle
dataformat/pdf/classes/writer.php
writer.print_heading
private function print_heading() { $fontfamily = $this->pdf->getFontFamily(); $fontstyle = $this->pdf->getFontStyle(); $this->pdf->SetFont($fontfamily, 'B'); $rowheight = 0; foreach ($this->columns as $columns) { $rowheight = max($rowheight, $this->pdf->getStringHeigh...
php
private function print_heading() { $fontfamily = $this->pdf->getFontFamily(); $fontstyle = $this->pdf->getFontStyle(); $this->pdf->SetFont($fontfamily, 'B'); $rowheight = 0; foreach ($this->columns as $columns) { $rowheight = max($rowheight, $this->pdf->getStringHeigh...
[ "private", "function", "print_heading", "(", ")", "{", "$", "fontfamily", "=", "$", "this", "->", "pdf", "->", "getFontFamily", "(", ")", ";", "$", "fontstyle", "=", "$", "this", "->", "pdf", "->", "getFontStyle", "(", ")", ";", "$", "this", "->", "p...
Prints the heading row.
[ "Prints", "the", "heading", "row", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/dataformat/pdf/classes/writer.php#L120-L138
218,170
moodle/moodle
badges/criteria/award_criteria_manual.php
award_criteria_manual.get_role_name
private function get_role_name($rid) { global $DB, $PAGE; $rec = $DB->get_record('role', array('id' => $rid)); if ($rec) { return role_get_name($rec, $PAGE->context, ROLENAME_ALIAS); } else { return null; } }
php
private function get_role_name($rid) { global $DB, $PAGE; $rec = $DB->get_record('role', array('id' => $rid)); if ($rec) { return role_get_name($rec, $PAGE->context, ROLENAME_ALIAS); } else { return null; } }
[ "private", "function", "get_role_name", "(", "$", "rid", ")", "{", "global", "$", "DB", ",", "$", "PAGE", ";", "$", "rec", "=", "$", "DB", "->", "get_record", "(", "'role'", ",", "array", "(", "'id'", "=>", "$", "rid", ")", ")", ";", "if", "(", ...
Gets role name. If no such role exists this function returns null. @return string|null
[ "Gets", "role", "name", ".", "If", "no", "such", "role", "exists", "this", "function", "returns", "null", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/badges/criteria/award_criteria_manual.php#L47-L56
218,171
moodle/moodle
question/type/ddmarker/backup/moodle2/restore_qtype_ddmarker_plugin.class.php
restore_qtype_ddmarker_plugin.define_decode_contents
public static function define_decode_contents() { $prefix = 'qtype_'.self::qtype_name(); $contents = array(); $fields = array('correctfeedback', 'partiallycorrectfeedback', 'incorrectfeedback'); $contents[] = new restore_decode_content($prefix, $fields, $prefix); ...
php
public static function define_decode_contents() { $prefix = 'qtype_'.self::qtype_name(); $contents = array(); $fields = array('correctfeedback', 'partiallycorrectfeedback', 'incorrectfeedback'); $contents[] = new restore_decode_content($prefix, $fields, $prefix); ...
[ "public", "static", "function", "define_decode_contents", "(", ")", "{", "$", "prefix", "=", "'qtype_'", ".", "self", "::", "qtype_name", "(", ")", ";", "$", "contents", "=", "array", "(", ")", ";", "$", "fields", "=", "array", "(", "'correctfeedback'", ...
Return the contents of this qtype to be processed by the links decoder @return array
[ "Return", "the", "contents", "of", "this", "qtype", "to", "be", "processed", "by", "the", "links", "decoder" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/type/ddmarker/backup/moodle2/restore_qtype_ddmarker_plugin.class.php#L159-L170
218,172
moodle/moodle
competency/classes/user_competency.php
user_competency.get_status_list
public static function get_status_list() { static $list = null; if ($list === null) { $list = array( self::STATUS_IDLE => self::get_status_name(self::STATUS_IDLE), self::STATUS_WAITING_FOR_REVIEW => self::get_status_name(self::STATUS_WAITING_FOR_REVIEW), ...
php
public static function get_status_list() { static $list = null; if ($list === null) { $list = array( self::STATUS_IDLE => self::get_status_name(self::STATUS_IDLE), self::STATUS_WAITING_FOR_REVIEW => self::get_status_name(self::STATUS_WAITING_FOR_REVIEW), ...
[ "public", "static", "function", "get_status_list", "(", ")", "{", "static", "$", "list", "=", "null", ";", "if", "(", "$", "list", "===", "null", ")", "{", "$", "list", "=", "array", "(", "self", "::", "STATUS_IDLE", "=>", "self", "::", "get_status_nam...
Get list of competency status. @return array
[ "Get", "list", "of", "competency", "status", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/user_competency.php#L169-L181
218,173
moodle/moodle
competency/classes/user_competency.php
user_competency.validate_reviewerid
protected function validate_reviewerid($value) { global $DB; if ($value !== null && !$DB->record_exists('user', array('id' => $value))) { return new lang_string('invaliduserid', 'error'); } return true; }
php
protected function validate_reviewerid($value) { global $DB; if ($value !== null && !$DB->record_exists('user', array('id' => $value))) { return new lang_string('invaliduserid', 'error'); } return true; }
[ "protected", "function", "validate_reviewerid", "(", "$", "value", ")", "{", "global", "$", "DB", ";", "if", "(", "$", "value", "!==", "null", "&&", "!", "$", "DB", "->", "record_exists", "(", "'user'", ",", "array", "(", "'id'", "=>", "$", "value", ...
Validate the reviewer ID. @param int $value The value. @return true|lang_string
[ "Validate", "the", "reviewer", "ID", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/user_competency.php#L296-L304
218,174
moodle/moodle
competency/classes/user_competency.php
user_competency.can_comment_user
public static function can_comment_user($userid) { global $USER; $capabilities = array('moodle/competency:usercompetencycomment'); if ($USER->id == $userid) { $capabilities[] = 'moodle/competency:usercompetencycommentown'; } if (has_any_capability($capabilities, con...
php
public static function can_comment_user($userid) { global $USER; $capabilities = array('moodle/competency:usercompetencycomment'); if ($USER->id == $userid) { $capabilities[] = 'moodle/competency:usercompetencycommentown'; } if (has_any_capability($capabilities, con...
[ "public", "static", "function", "can_comment_user", "(", "$", "userid", ")", "{", "global", "$", "USER", ";", "$", "capabilities", "=", "array", "(", "'moodle/competency:usercompetencycomment'", ")", ";", "if", "(", "$", "USER", "->", "id", "==", "$", "useri...
Can the current user comment on a user's competency? @param int $userid The user ID the competency belongs to. @return bool
[ "Can", "the", "current", "user", "comment", "on", "a", "user", "s", "competency?" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/user_competency.php#L335-L348
218,175
moodle/moodle
competency/classes/user_competency.php
user_competency.can_grade_user_in_course
public static function can_grade_user_in_course($userid, $courseid) { $ratecap = 'moodle/competency:competencygrade'; return has_capability($ratecap, context_course::instance($courseid)) || static::can_grade_user($userid); }
php
public static function can_grade_user_in_course($userid, $courseid) { $ratecap = 'moodle/competency:competencygrade'; return has_capability($ratecap, context_course::instance($courseid)) || static::can_grade_user($userid); }
[ "public", "static", "function", "can_grade_user_in_course", "(", "$", "userid", ",", "$", "courseid", ")", "{", "$", "ratecap", "=", "'moodle/competency:competencygrade'", ";", "return", "has_capability", "(", "$", "ratecap", ",", "context_course", "::", "instance",...
Can the current user grade a user's user competency in a course? @param int $userid The user ID the competency belongs to. @param int $courseid The course ID. @return bool
[ "Can", "the", "current", "user", "grade", "a", "user", "s", "user", "competency", "in", "a", "course?" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/user_competency.php#L368-L372
218,176
moodle/moodle
competency/classes/user_competency.php
user_competency.can_read_user_in_course
public static function can_read_user_in_course($userid, $courseid) { $capability = 'moodle/competency:usercompetencyview'; return has_capability($capability, context_course::instance($courseid)) || static::can_read_user($userid); }
php
public static function can_read_user_in_course($userid, $courseid) { $capability = 'moodle/competency:usercompetencyview'; return has_capability($capability, context_course::instance($courseid)) || static::can_read_user($userid); }
[ "public", "static", "function", "can_read_user_in_course", "(", "$", "userid", ",", "$", "courseid", ")", "{", "$", "capability", "=", "'moodle/competency:usercompetencyview'", ";", "return", "has_capability", "(", "$", "capability", ",", "context_course", "::", "in...
Can the current user read the user competencies of a user in a course? @param int $userid The user ID the competency belongs to. @param int $courseid The course ID. @return bool
[ "Can", "the", "current", "user", "read", "the", "user", "competencies", "of", "a", "user", "in", "a", "course?" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/user_competency.php#L392-L396
218,177
moodle/moodle
competency/classes/user_competency.php
user_competency.can_read_user
public static function can_read_user($userid) { $capability = 'moodle/competency:usercompetencyview'; return has_capability($capability, context_user::instance($userid)) || plan::can_read_user($userid); }
php
public static function can_read_user($userid) { $capability = 'moodle/competency:usercompetencyview'; return has_capability($capability, context_user::instance($userid)) || plan::can_read_user($userid); }
[ "public", "static", "function", "can_read_user", "(", "$", "userid", ")", "{", "$", "capability", "=", "'moodle/competency:usercompetencyview'", ";", "return", "has_capability", "(", "$", "capability", ",", "context_user", "::", "instance", "(", "$", "userid", ")"...
Can the current user read a user's competency? @param int $userid The user ID the competency belongs to. @return bool
[ "Can", "the", "current", "user", "read", "a", "user", "s", "competency?" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/user_competency.php#L404-L408
218,178
moodle/moodle
competency/classes/user_competency.php
user_competency.get_competency_by_usercompetencyid
public static function get_competency_by_usercompetencyid($id) { global $DB; $sql = "SELECT c.* FROM {" . self::TABLE . "} uc JOIN {" . competency::TABLE . "} c ON c.id = uc.competencyid WHERE uc.id = ?"; $record = $DB->get...
php
public static function get_competency_by_usercompetencyid($id) { global $DB; $sql = "SELECT c.* FROM {" . self::TABLE . "} uc JOIN {" . competency::TABLE . "} c ON c.id = uc.competencyid WHERE uc.id = ?"; $record = $DB->get...
[ "public", "static", "function", "get_competency_by_usercompetencyid", "(", "$", "id", ")", "{", "global", "$", "DB", ";", "$", "sql", "=", "\"SELECT c.*\n FROM {\"", ".", "self", "::", "TABLE", ".", "\"} uc\n JOIN {\"", ".", "competen...
Fetch a competency by user competency ID. This is a convenience method to attempt to efficiently fetch a competency when the only information we have is the user_competency ID, in evidence for instance. @param int $id The user competency ID. @return competency
[ "Fetch", "a", "competency", "by", "user", "competency", "ID", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/user_competency.php#L470-L479
218,179
moodle/moodle
competency/classes/user_competency.php
user_competency.get_multiple
public static function get_multiple($userid, array $competenciesorids = null) { global $DB; $params = array(); $params['userid'] = $userid; $sql = '1 = 1'; if (!empty($competenciesorids)) { $test = reset($competenciesorids); if (is_number($test)) { ...
php
public static function get_multiple($userid, array $competenciesorids = null) { global $DB; $params = array(); $params['userid'] = $userid; $sql = '1 = 1'; if (!empty($competenciesorids)) { $test = reset($competenciesorids); if (is_number($test)) { ...
[ "public", "static", "function", "get_multiple", "(", "$", "userid", ",", "array", "$", "competenciesorids", "=", "null", ")", "{", "global", "$", "DB", ";", "$", "params", "=", "array", "(", ")", ";", "$", "params", "[", "'userid'", "]", "=", "$", "u...
Get multiple user_competency for a user. @param int $userid @param array $competenciesorids Limit search to those competencies, or competency IDs. @return \core_competency\user_competency[]
[ "Get", "multiple", "user_competency", "for", "a", "user", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/user_competency.php#L488-L513
218,180
moodle/moodle
competency/classes/user_competency.php
user_competency.has_records_for_framework
public static function has_records_for_framework($frameworkid) { global $DB; $sql = "SELECT 'x' FROM {" . self::TABLE . "} uc JOIN {" . competency::TABLE . "} c ON uc.competencyid = c.id WHERE c.competencyframeworkid = ?"; ...
php
public static function has_records_for_framework($frameworkid) { global $DB; $sql = "SELECT 'x' FROM {" . self::TABLE . "} uc JOIN {" . competency::TABLE . "} c ON uc.competencyid = c.id WHERE c.competencyframeworkid = ?"; ...
[ "public", "static", "function", "has_records_for_framework", "(", "$", "frameworkid", ")", "{", "global", "$", "DB", ";", "$", "sql", "=", "\"SELECT 'x'\n FROM {\"", ".", "self", "::", "TABLE", ".", "\"} uc\n JOIN {\"", ".", "competen...
Checks if any of the competencies of a framework has a user competency record. @param int $frameworkid The competency framework ID. @return boolean
[ "Checks", "if", "any", "of", "the", "competencies", "of", "a", "framework", "has", "a", "user", "competency", "record", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/user_competency.php#L531-L542
218,181
moodle/moodle
competency/classes/user_evidence.php
user_evidence.get_files
public function get_files() { $fs = get_file_storage(); $files = $fs->get_area_files($this->get_context()->id, 'core_competency', 'userevidence', $this->get('id'), 'filename', false); return $files; }
php
public function get_files() { $fs = get_file_storage(); $files = $fs->get_area_files($this->get_context()->id, 'core_competency', 'userevidence', $this->get('id'), 'filename', false); return $files; }
[ "public", "function", "get_files", "(", ")", "{", "$", "fs", "=", "get_file_storage", "(", ")", ";", "$", "files", "=", "$", "fs", "->", "get_area_files", "(", "$", "this", "->", "get_context", "(", ")", "->", "id", ",", "'core_competency'", ",", "'use...
Return the files associated with this evidence. @return object[]
[ "Return", "the", "files", "associated", "with", "this", "evidence", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/user_evidence.php#L127-L132
218,182
moodle/moodle
competency/classes/user_evidence.php
user_evidence.can_read_user
public static function can_read_user($evidenceuserid) { $context = context_user::instance($evidenceuserid); $capabilities = array('moodle/competency:userevidenceview'); return has_any_capability($capabilities, $context) || self::can_manage_user($evidenceuserid); }
php
public static function can_read_user($evidenceuserid) { $context = context_user::instance($evidenceuserid); $capabilities = array('moodle/competency:userevidenceview'); return has_any_capability($capabilities, $context) || self::can_manage_user($evidenceuserid); }
[ "public", "static", "function", "can_read_user", "(", "$", "evidenceuserid", ")", "{", "$", "context", "=", "context_user", "::", "instance", "(", "$", "evidenceuserid", ")", ";", "$", "capabilities", "=", "array", "(", "'moodle/competency:userevidenceview'", ")",...
Can the current user view a user's evidence? @param int $evidenceuserid The user to whom the evidence would belong. @return bool
[ "Can", "the", "current", "user", "view", "a", "user", "s", "evidence?" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/competency/classes/user_evidence.php#L197-L203
218,183
moodle/moodle
mod/choice/renderer.php
mod_choice_renderer.display_publish_anonymous
public function display_publish_anonymous($choices, $displaylayout) { global $OUTPUT; $count = 0; $data = []; $numberofuser = 0; $percentageamount = 0; foreach ($choices->options as $optionid => $option) { if (!empty($option->user)) { $numberof...
php
public function display_publish_anonymous($choices, $displaylayout) { global $OUTPUT; $count = 0; $data = []; $numberofuser = 0; $percentageamount = 0; foreach ($choices->options as $optionid => $option) { if (!empty($option->user)) { $numberof...
[ "public", "function", "display_publish_anonymous", "(", "$", "choices", ",", "$", "displaylayout", ")", "{", "global", "$", "OUTPUT", ";", "$", "count", "=", "0", ";", "$", "data", "=", "[", "]", ";", "$", "numberofuser", "=", "0", ";", "$", "percentag...
Generate the choice result chart. Can be displayed either in the vertical or horizontal position. @param stdClass $choices Choices responses object. @param int $displaylayout The constants DISPLAY_HORIZONTAL_LAYOUT or DISPLAY_VERTICAL_LAYOUT. @return string the rendered chart.
[ "Generate", "the", "choice", "result", "chart", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/choice/renderer.php#L334-L365
218,184
moodle/moodle
lib/editor/tinymce/lib.php
tinymce_texteditor.use_editor
public function use_editor($elementid, array $options=null, $fpoptions=null) { global $PAGE, $CFG; // Note: use full moodle_url instance to prevent standard JS loader, make sure we are using https on profile page if required. if ($CFG->debugdeveloper) { $PAGE->requires->js(new moodle...
php
public function use_editor($elementid, array $options=null, $fpoptions=null) { global $PAGE, $CFG; // Note: use full moodle_url instance to prevent standard JS loader, make sure we are using https on profile page if required. if ($CFG->debugdeveloper) { $PAGE->requires->js(new moodle...
[ "public", "function", "use_editor", "(", "$", "elementid", ",", "array", "$", "options", "=", "null", ",", "$", "fpoptions", "=", "null", ")", "{", "global", "$", "PAGE", ",", "$", "CFG", ";", "// Note: use full moodle_url instance to prevent standard JS loader, m...
Use this editor for give element. @param string $elementid @param array $options @param null $fpoptions
[ "Use", "this", "editor", "for", "give", "element", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/editor/tinymce/lib.php#L79-L91
218,185
moodle/moodle
lib/editor/tinymce/lib.php
tinymce_texteditor.parse_toolbar_setting
public static function parse_toolbar_setting($customtoolbar) { $result = array(); $customtoolbar = trim($customtoolbar); if ($customtoolbar === '') { return $result; } $customtoolbar = str_replace("\r", "\n", $customtoolbar); $customtoolbar = strtolower($custo...
php
public static function parse_toolbar_setting($customtoolbar) { $result = array(); $customtoolbar = trim($customtoolbar); if ($customtoolbar === '') { return $result; } $customtoolbar = str_replace("\r", "\n", $customtoolbar); $customtoolbar = strtolower($custo...
[ "public", "static", "function", "parse_toolbar_setting", "(", "$", "customtoolbar", ")", "{", "$", "result", "=", "array", "(", ")", ";", "$", "customtoolbar", "=", "trim", "(", "$", "customtoolbar", ")", ";", "if", "(", "$", "customtoolbar", "===", "''", ...
Parse the custom toolbar setting. @param string $customtoolbar @return array csv toolbar lines
[ "Parse", "the", "custom", "toolbar", "setting", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/editor/tinymce/lib.php#L212-L238
218,186
moodle/moodle
lib/classes/chart_base.php
chart_base.get_axis
private function get_axis($type, $index, $createifnotexists) { $isx = $type === 'x'; if ($isx) { $axis = isset($this->xaxes[$index]) ? $this->xaxes[$index] : null; } else { $axis = isset($this->yaxes[$index]) ? $this->yaxes[$index] : null; } if ($axis ===...
php
private function get_axis($type, $index, $createifnotexists) { $isx = $type === 'x'; if ($isx) { $axis = isset($this->xaxes[$index]) ? $this->xaxes[$index] : null; } else { $axis = isset($this->yaxes[$index]) ? $this->yaxes[$index] : null; } if ($axis ===...
[ "private", "function", "get_axis", "(", "$", "type", ",", "$", "index", ",", "$", "createifnotexists", ")", "{", "$", "isx", "=", "$", "type", "===", "'x'", ";", "if", "(", "$", "isx", ")", "{", "$", "axis", "=", "isset", "(", "$", "this", "->", ...
Get an axis. @param string $type Accepts values 'x' or 'y'. @param int $index The index of this axis. @param bool $createifnotexists Whether to create the axis if not found. @return chart_axis
[ "Get", "an", "axis", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/chart_base.php#L101-L123
218,187
moodle/moodle
lib/classes/chart_base.php
chart_base.set_xaxis
public function set_xaxis(chart_axis $axis, $index = 0) { $this->validate_axis('x', $axis, $index); return $this->xaxes[$index] = $axis; }
php
public function set_xaxis(chart_axis $axis, $index = 0) { $this->validate_axis('x', $axis, $index); return $this->xaxes[$index] = $axis; }
[ "public", "function", "set_xaxis", "(", "chart_axis", "$", "axis", ",", "$", "index", "=", "0", ")", "{", "$", "this", "->", "validate_axis", "(", "'x'", ",", "$", "axis", ",", "$", "index", ")", ";", "return", "$", "this", "->", "xaxes", "[", "$",...
Set an X axis. Note that this will override any predefined axis without warning. @param chart_axis $axis The axis. @param int $index The index of the axis.
[ "Set", "an", "X", "axis", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/chart_base.php#L241-L244
218,188
moodle/moodle
lib/classes/chart_base.php
chart_base.set_yaxis
public function set_yaxis(chart_axis $axis, $index = 0) { $this->validate_axis('y', $axis, $index); return $this->yaxes[$index] = $axis; }
php
public function set_yaxis(chart_axis $axis, $index = 0) { $this->validate_axis('y', $axis, $index); return $this->yaxes[$index] = $axis; }
[ "public", "function", "set_yaxis", "(", "chart_axis", "$", "axis", ",", "$", "index", "=", "0", ")", "{", "$", "this", "->", "validate_axis", "(", "'y'", ",", "$", "axis", ",", "$", "index", ")", ";", "return", "$", "this", "->", "yaxes", "[", "$",...
Set an Y axis. Note that this will override any predefined axis without warning. @param chart_axis $axis The axis. @param int $index The index of the axis.
[ "Set", "an", "Y", "axis", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/chart_base.php#L254-L257
218,189
moodle/moodle
lib/classes/chart_base.php
chart_base.validate_axis
protected function validate_axis($xy, chart_axis $axis, $index = 0) { if ($index > 0) { $axes = $xy == 'x' ? $this->xaxes : $this->yaxes; if (!isset($axes[$index - 1])) { throw new coding_exception('Missing ' . $xy . ' axis at index lower than ' . $index); } ...
php
protected function validate_axis($xy, chart_axis $axis, $index = 0) { if ($index > 0) { $axes = $xy == 'x' ? $this->xaxes : $this->yaxes; if (!isset($axes[$index - 1])) { throw new coding_exception('Missing ' . $xy . ' axis at index lower than ' . $index); } ...
[ "protected", "function", "validate_axis", "(", "$", "xy", ",", "chart_axis", "$", "axis", ",", "$", "index", "=", "0", ")", "{", "if", "(", "$", "index", ">", "0", ")", "{", "$", "axes", "=", "$", "xy", "==", "'x'", "?", "$", "this", "->", "xax...
Validate an axis. We validate this from PHP because not doing it here could result in errors being hard to trace down. For instance, if we were to add axis at keys without another axis preceding, we would effectively contain the axes in an associative array rather than a simple array, and that would have consequences ...
[ "Validate", "an", "axis", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/chart_base.php#L271-L278
218,190
moodle/moodle
calendar/classes/local/event/forms/update.php
update.add_event_repeat_elements
protected function add_event_repeat_elements($mform) { $event = $this->_customdata['event']; $mform->addElement('hidden', 'repeatid'); $mform->setType('repeatid', PARAM_INT); if (!empty($event->repeatid)) { $group = []; $group[] = $mform->createElement('radio', ...
php
protected function add_event_repeat_elements($mform) { $event = $this->_customdata['event']; $mform->addElement('hidden', 'repeatid'); $mform->setType('repeatid', PARAM_INT); if (!empty($event->repeatid)) { $group = []; $group[] = $mform->createElement('radio', ...
[ "protected", "function", "add_event_repeat_elements", "(", "$", "mform", ")", "{", "$", "event", "=", "$", "this", "->", "_customdata", "[", "'event'", "]", ";", "$", "mform", "->", "addElement", "(", "'hidden'", ",", "'repeatid'", ")", ";", "$", "mform", ...
Add the repeat elements for the form when editing an existing event. @param MoodleQuickForm $mform
[ "Add", "the", "repeat", "elements", "for", "the", "form", "when", "editing", "an", "existing", "event", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/calendar/classes/local/event/forms/update.php#L42-L58
218,191
moodle/moodle
cache/stores/mongodb/MongoDB/Operation/Aggregate.php
Aggregate.createCommand
private function createCommand(Server $server) { $cmd = [ 'aggregate' => isset($this->collectionName) ? $this->collectionName : 1, 'pipeline' => $this->pipeline, ]; $cmdOptions = []; $cmd['allowDiskUse'] = $this->options['allowDiskUse']; if (isset($t...
php
private function createCommand(Server $server) { $cmd = [ 'aggregate' => isset($this->collectionName) ? $this->collectionName : 1, 'pipeline' => $this->pipeline, ]; $cmdOptions = []; $cmd['allowDiskUse'] = $this->options['allowDiskUse']; if (isset($t...
[ "private", "function", "createCommand", "(", "Server", "$", "server", ")", "{", "$", "cmd", "=", "[", "'aggregate'", "=>", "isset", "(", "$", "this", "->", "collectionName", ")", "?", "$", "this", "->", "collectionName", ":", "1", ",", "'pipeline'", "=>"...
Create the aggregate command. @param Server $server @return Command
[ "Create", "the", "aggregate", "command", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/stores/mongodb/MongoDB/Operation/Aggregate.php#L292-L331
218,192
moodle/moodle
course/classes/analytics/indicator/completion_enabled.php
completion_enabled.calculate_sample
public function calculate_sample($sampleid, $sampleorigin, $notusedstarttime = false, $notusedendtime = false) { $course = $this->retrieve('course', $sampleid); // It may not be available, but if it is the indicator checks if completion is enabled for the cm. $cm = $this->retrieve('course_modu...
php
public function calculate_sample($sampleid, $sampleorigin, $notusedstarttime = false, $notusedendtime = false) { $course = $this->retrieve('course', $sampleid); // It may not be available, but if it is the indicator checks if completion is enabled for the cm. $cm = $this->retrieve('course_modu...
[ "public", "function", "calculate_sample", "(", "$", "sampleid", ",", "$", "sampleorigin", ",", "$", "notusedstarttime", "=", "false", ",", "$", "notusedendtime", "=", "false", ")", "{", "$", "course", "=", "$", "this", "->", "retrieve", "(", "'course'", ",...
Is completion enabled? Work both with courses and activities. @param int $sampleid @param string $sampleorigin @param int|false $notusedstarttime @param int|false $notusedendtime @return float
[ "Is", "completion", "enabled?", "Work", "both", "with", "courses", "and", "activities", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/course/classes/analytics/indicator/completion_enabled.php#L68-L86
218,193
moodle/moodle
backup/util/structure/backup_optigroup_element.class.php
backup_optigroup_element.set_condition
public function set_condition($conditionparam, $conditionvalue) { // We only resolve the condition if the parent of the element (optigroup) already has parent // else, we'll resolve it once the optigroup parent is defined if ($this->get_parent() && $this->get_parent()->get_parent() && $condition...
php
public function set_condition($conditionparam, $conditionvalue) { // We only resolve the condition if the parent of the element (optigroup) already has parent // else, we'll resolve it once the optigroup parent is defined if ($this->get_parent() && $this->get_parent()->get_parent() && $condition...
[ "public", "function", "set_condition", "(", "$", "conditionparam", ",", "$", "conditionvalue", ")", "{", "// We only resolve the condition if the parent of the element (optigroup) already has parent", "// else, we'll resolve it once the optigroup parent is defined", "if", "(", "$", "...
Sets the condition for this optigroup
[ "Sets", "the", "condition", "for", "this", "optigroup" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/util/structure/backup_optigroup_element.class.php#L69-L77
218,194
moodle/moodle
backup/util/structure/backup_optigroup_element.class.php
backup_optigroup_element.process
public function process($processor) { if (!$processor instanceof base_processor) { // No correct processor, throw exception throw new base_element_struct_exception('incorrect_processor'); } $iterator = $this->get_iterator($processor); // Get the iterator over backup-able data ...
php
public function process($processor) { if (!$processor instanceof base_processor) { // No correct processor, throw exception throw new base_element_struct_exception('incorrect_processor'); } $iterator = $this->get_iterator($processor); // Get the iterator over backup-able data ...
[ "public", "function", "process", "(", "$", "processor", ")", "{", "if", "(", "!", "$", "processor", "instanceof", "base_processor", ")", "{", "// No correct processor, throw exception", "throw", "new", "base_element_struct_exception", "(", "'incorrect_processor'", ")", ...
process one optigroup_element Note that this ONLY processes the final elements in order to get all them before processing any nested element. Pending nested elements are processed by the optigroup caller.
[ "process", "one", "optigroup_element" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/util/structure/backup_optigroup_element.class.php#L117-L149
218,195
moodle/moodle
backup/util/structure/backup_optigroup_element.class.php
backup_optigroup_element.set_parent
protected function set_parent($element) { parent::set_parent($element); // Force condition param calculation $this->set_condition($this->conditionparam, $this->conditionvalue); }
php
protected function set_parent($element) { parent::set_parent($element); // Force condition param calculation $this->set_condition($this->conditionparam, $this->conditionvalue); }
[ "protected", "function", "set_parent", "(", "$", "element", ")", "{", "parent", "::", "set_parent", "(", "$", "element", ")", ";", "// Force condition param calculation", "$", "this", "->", "set_condition", "(", "$", "this", "->", "conditionparam", ",", "$", "...
Set the parent of the optigroup_element and, at the same time, process the condition param
[ "Set", "the", "parent", "of", "the", "optigroup_element", "and", "at", "the", "same", "time", "process", "the", "condition", "param" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/util/structure/backup_optigroup_element.class.php#L188-L192
218,196
moodle/moodle
admin/tool/generator/classes/backend.php
tool_generator_backend.size_for_name
public static function size_for_name($sizename) { for ($size = self::MIN_SIZE; $size <= self::MAX_SIZE; $size++) { if ($sizename == get_string('shortsize_' . $size, 'tool_generator')) { return $size; } } throw new coding_exception("Unknown size name '$size...
php
public static function size_for_name($sizename) { for ($size = self::MIN_SIZE; $size <= self::MAX_SIZE; $size++) { if ($sizename == get_string('shortsize_' . $size, 'tool_generator')) { return $size; } } throw new coding_exception("Unknown size name '$size...
[ "public", "static", "function", "size_for_name", "(", "$", "sizename", ")", "{", "for", "(", "$", "size", "=", "self", "::", "MIN_SIZE", ";", "$", "size", "<=", "self", "::", "MAX_SIZE", ";", "$", "size", "++", ")", "{", "if", "(", "$", "sizename", ...
Converts a size name into the numeric constant. @param string $sizename Size name e.g. 'L' @return int Numeric version @throws coding_exception If the size name is not known
[ "Converts", "a", "size", "name", "into", "the", "numeric", "constant", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/generator/classes/backend.php#L114-L121
218,197
moodle/moodle
admin/tool/generator/classes/backend.php
tool_generator_backend.log
protected function log($langstring, $a = null, $leaveopen = false) { if (!$this->progress) { return; } if (CLI_SCRIPT) { echo '* '; } else { echo html_writer::start_tag('li'); } echo get_string('progress_' . $langstring, 'tool_generator...
php
protected function log($langstring, $a = null, $leaveopen = false) { if (!$this->progress) { return; } if (CLI_SCRIPT) { echo '* '; } else { echo html_writer::start_tag('li'); } echo get_string('progress_' . $langstring, 'tool_generator...
[ "protected", "function", "log", "(", "$", "langstring", ",", "$", "a", "=", "null", ",", "$", "leaveopen", "=", "false", ")", "{", "if", "(", "!", "$", "this", "->", "progress", ")", "{", "return", ";", "}", "if", "(", "CLI_SCRIPT", ")", "{", "ec...
Displays information as part of progress. @param string $langstring Part of langstring (after progress_) @param mixed $a Optional lang string parameters @param bool $leaveopen If true, doesn't close LI tag (ready for dots)
[ "Displays", "information", "as", "part", "of", "progress", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/generator/classes/backend.php#L129-L151
218,198
moodle/moodle
admin/tool/generator/classes/backend.php
tool_generator_backend.dot
protected function dot($number, $total) { if (!$this->progress) { return; } $now = time(); if ($now == $this->lastdot) { return; } $this->lastdot = $now; if (CLI_SCRIPT) { echo '.'; } else { echo ' . '; ...
php
protected function dot($number, $total) { if (!$this->progress) { return; } $now = time(); if ($now == $this->lastdot) { return; } $this->lastdot = $now; if (CLI_SCRIPT) { echo '.'; } else { echo ' . '; ...
[ "protected", "function", "dot", "(", "$", "number", ",", "$", "total", ")", "{", "if", "(", "!", "$", "this", "->", "progress", ")", "{", "return", ";", "}", "$", "now", "=", "time", "(", ")", ";", "if", "(", "$", "now", "==", "$", "this", "-...
Outputs dots. There is up to one dot per second. Once a minute, it displays a percentage. @param int $number Number of completed items @param int $total Total number of items to complete
[ "Outputs", "dots", ".", "There", "is", "up", "to", "one", "dot", "per", "second", ".", "Once", "a", "minute", "it", "displays", "a", "percentage", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/generator/classes/backend.php#L159-L182
218,199
moodle/moodle
lib/adodb/adodb-active-record.inc.php
ADODB_Active_Record.Replace
function Replace() { global $ADODB_ASSOC_CASE; $db = $this->DB(); if (!$db) { return false; } $table = $this->TableInfo(); $pkey = $table->keys; foreach($table->flds as $name=>$fld) { $val = $this->$name; /* if (is_null($val)) { if (isset($fld->not_null) && $fld->not_null) { if (is...
php
function Replace() { global $ADODB_ASSOC_CASE; $db = $this->DB(); if (!$db) { return false; } $table = $this->TableInfo(); $pkey = $table->keys; foreach($table->flds as $name=>$fld) { $val = $this->$name; /* if (is_null($val)) { if (isset($fld->not_null) && $fld->not_null) { if (is...
[ "function", "Replace", "(", ")", "{", "global", "$", "ADODB_ASSOC_CASE", ";", "$", "db", "=", "$", "this", "->", "DB", "(", ")", ";", "if", "(", "!", "$", "db", ")", "{", "return", "false", ";", "}", "$", "table", "=", "$", "this", "->", "Table...
returns 0 on error, 1 on update, 2 on insert
[ "returns", "0", "on", "error", "1", "on", "update", "2", "on", "insert" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/adodb/adodb-active-record.inc.php#L928-L1001