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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
216,200 | moodle/moodle | message/externallib.php | core_message_external.mark_all_messages_as_read | public static function mark_all_messages_as_read($useridto, $useridfrom) {
global $USER, $CFG;
// Check if messaging is enabled.
if (empty($CFG->messaging)) {
throw new moodle_exception('disabled', 'message');
}
$params = self::validate_parameters(
self:... | php | public static function mark_all_messages_as_read($useridto, $useridfrom) {
global $USER, $CFG;
// Check if messaging is enabled.
if (empty($CFG->messaging)) {
throw new moodle_exception('disabled', 'message');
}
$params = self::validate_parameters(
self:... | [
"public",
"static",
"function",
"mark_all_messages_as_read",
"(",
"$",
"useridto",
",",
"$",
"useridfrom",
")",
"{",
"global",
"$",
"USER",
",",
"$",
"CFG",
";",
"// Check if messaging is enabled.",
"if",
"(",
"empty",
"(",
"$",
"CFG",
"->",
"messaging",
")",
... | Mark all messages as read function.
@deprecated since 3.6
@throws invalid_parameter_exception
@throws moodle_exception
@param int $useridto the user id who received the message
@param int $useridfrom the user id who send the message. -10 or -20 for no-reply or support user
@return external_descri... | [
"Mark",
"all",
"messages",
"as",
"read",
"function",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/externallib.php#L3688-L3739 |
216,201 | moodle/moodle | message/externallib.php | core_message_external.mark_all_conversation_messages_as_read | public static function mark_all_conversation_messages_as_read(int $userid, int $conversationid) {
global $CFG;
// Check if messaging is enabled.
if (empty($CFG->messaging)) {
throw new moodle_exception('disabled', 'message');
}
$params = array(
'userid' ... | php | public static function mark_all_conversation_messages_as_read(int $userid, int $conversationid) {
global $CFG;
// Check if messaging is enabled.
if (empty($CFG->messaging)) {
throw new moodle_exception('disabled', 'message');
}
$params = array(
'userid' ... | [
"public",
"static",
"function",
"mark_all_conversation_messages_as_read",
"(",
"int",
"$",
"userid",
",",
"int",
"$",
"conversationid",
")",
"{",
"global",
"$",
"CFG",
";",
"// Check if messaging is enabled.",
"if",
"(",
"empty",
"(",
"$",
"CFG",
"->",
"messaging"... | Mark all conversation messages as read function.
@param int $userid The user id of who we want to delete the conversation for
@param int $conversationid The id of the conversations
@since 3.6 | [
"Mark",
"all",
"conversation",
"messages",
"as",
"read",
"function",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/externallib.php#L3784-L3809 |
216,202 | moodle/moodle | message/externallib.php | core_message_external.delete_message | public static function delete_message($messageid, $userid, $read = true) {
global $CFG;
// Check if private messaging between users is allowed.
if (empty($CFG->messaging)) {
throw new moodle_exception('disabled', 'message');
}
// Warnings array, it can be empty at t... | php | public static function delete_message($messageid, $userid, $read = true) {
global $CFG;
// Check if private messaging between users is allowed.
if (empty($CFG->messaging)) {
throw new moodle_exception('disabled', 'message');
}
// Warnings array, it can be empty at t... | [
"public",
"static",
"function",
"delete_message",
"(",
"$",
"messageid",
",",
"$",
"userid",
",",
"$",
"read",
"=",
"true",
")",
"{",
"global",
"$",
"CFG",
";",
"// Check if private messaging between users is allowed.",
"if",
"(",
"empty",
"(",
"$",
"CFG",
"->... | Deletes a message
@param int $messageid the message id
@param int $userid the user id of who we want to delete the message for
@param bool $read if is a message read (default to true)
@return external_description
@throws moodle_exception
@since 3.1 | [
"Deletes",
"a",
"message"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/externallib.php#L4012-L4049 |
216,203 | moodle/moodle | message/externallib.php | core_message_external.message_processor_config_form | public static function message_processor_config_form($userid, $name, $formvalues) {
global $USER, $CFG;
// Check if messaging is enabled.
if (empty($CFG->messaging)) {
throw new moodle_exception('disabled', 'message');
}
$params = self::validate_parameters(
... | php | public static function message_processor_config_form($userid, $name, $formvalues) {
global $USER, $CFG;
// Check if messaging is enabled.
if (empty($CFG->messaging)) {
throw new moodle_exception('disabled', 'message');
}
$params = self::validate_parameters(
... | [
"public",
"static",
"function",
"message_processor_config_form",
"(",
"$",
"userid",
",",
"$",
"name",
",",
"$",
"formvalues",
")",
"{",
"global",
"$",
"USER",
",",
"$",
"CFG",
";",
"// Check if messaging is enabled.",
"if",
"(",
"empty",
"(",
"$",
"CFG",
"-... | Processes a message processor config form.
@param int $userid the user id
@param string $name the name of the processor
@param array $formvalues the form values
@return external_description
@throws moodle_exception
@since 3.2 | [
"Processes",
"a",
"message",
"processor",
"config",
"form",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/externallib.php#L4101-L4135 |
216,204 | moodle/moodle | message/externallib.php | core_message_external.get_message_processor | public static function get_message_processor($userid = 0, $name) {
global $USER, $PAGE, $CFG;
// Check if messaging is enabled.
if (empty($CFG->messaging)) {
throw new moodle_exception('disabled', 'message');
}
$params = self::validate_parameters(
self::... | php | public static function get_message_processor($userid = 0, $name) {
global $USER, $PAGE, $CFG;
// Check if messaging is enabled.
if (empty($CFG->messaging)) {
throw new moodle_exception('disabled', 'message');
}
$params = self::validate_parameters(
self::... | [
"public",
"static",
"function",
"get_message_processor",
"(",
"$",
"userid",
"=",
"0",
",",
"$",
"name",
")",
"{",
"global",
"$",
"USER",
",",
"$",
"PAGE",
",",
"$",
"CFG",
";",
"// Check if messaging is enabled.",
"if",
"(",
"empty",
"(",
"$",
"CFG",
"-... | Get a message processor.
@param int $userid
@param string $name the name of the processor
@return external_description
@throws moodle_exception
@since 3.2 | [
"Get",
"a",
"message",
"processor",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/externallib.php#L4171-L4201 |
216,205 | moodle/moodle | message/externallib.php | core_message_external.validate_preferences_permissions | protected static function validate_preferences_permissions($userid) {
global $USER;
if (empty($userid)) {
$user = $USER;
} else {
$user = core_user::get_user($userid, '*', MUST_EXIST);
core_user::require_active_user($user);
}
$systemcontext =... | php | protected static function validate_preferences_permissions($userid) {
global $USER;
if (empty($userid)) {
$user = $USER;
} else {
$user = core_user::get_user($userid, '*', MUST_EXIST);
core_user::require_active_user($user);
}
$systemcontext =... | [
"protected",
"static",
"function",
"validate_preferences_permissions",
"(",
"$",
"userid",
")",
"{",
"global",
"$",
"USER",
";",
"if",
"(",
"empty",
"(",
"$",
"userid",
")",
")",
"{",
"$",
"user",
"=",
"$",
"USER",
";",
"}",
"else",
"{",
"$",
"user",
... | Check that the user has enough permission to retrieve message or notifications preferences.
@param int $userid the user id requesting the preferences
@return stdClass full user object
@throws moodle_exception
@since Moodle 3.2 | [
"Check",
"that",
"the",
"user",
"has",
"enough",
"permission",
"to",
"retrieve",
"message",
"or",
"notifications",
"preferences",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/externallib.php#L4226-L4249 |
216,206 | moodle/moodle | message/externallib.php | core_message_external.get_preferences_structure | protected static function get_preferences_structure() {
return new external_single_structure(
array(
'userid' => new external_value(PARAM_INT, 'User id'),
'disableall' => new external_value(PARAM_INT, 'Whether all the preferences are disabled'),
'proce... | php | protected static function get_preferences_structure() {
return new external_single_structure(
array(
'userid' => new external_value(PARAM_INT, 'User id'),
'disableall' => new external_value(PARAM_INT, 'Whether all the preferences are disabled'),
'proce... | [
"protected",
"static",
"function",
"get_preferences_structure",
"(",
")",
"{",
"return",
"new",
"external_single_structure",
"(",
"array",
"(",
"'userid'",
"=>",
"new",
"external_value",
"(",
"PARAM_INT",
",",
"'User id'",
")",
",",
"'disableall'",
"=>",
"new",
"e... | Returns a notification or message preference structure.
@return external_single_structure the structure
@since Moodle 3.2 | [
"Returns",
"a",
"notification",
"or",
"message",
"preference",
"structure",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/externallib.php#L4257-L4320 |
216,207 | moodle/moodle | message/externallib.php | core_message_external.set_favourite_conversations | public static function set_favourite_conversations(int $userid, array $conversationids) {
global $CFG, $USER;
// All the business logic checks that really shouldn't be in here.
if (empty($CFG->messaging)) {
throw new moodle_exception('disabled', 'message');
}
$params... | php | public static function set_favourite_conversations(int $userid, array $conversationids) {
global $CFG, $USER;
// All the business logic checks that really shouldn't be in here.
if (empty($CFG->messaging)) {
throw new moodle_exception('disabled', 'message');
}
$params... | [
"public",
"static",
"function",
"set_favourite_conversations",
"(",
"int",
"$",
"userid",
",",
"array",
"$",
"conversationids",
")",
"{",
"global",
"$",
"CFG",
",",
"$",
"USER",
";",
"// All the business logic checks that really shouldn't be in here.",
"if",
"(",
"emp... | Favourite a conversation, or list of conversations for a user.
@param int $userid the id of the user, or 0 for the current user.
@param array $conversationids the list of conversations ids to favourite.
@return array
@throws moodle_exception if messaging is disabled or if the user cannot perform the action. | [
"Favourite",
"a",
"conversation",
"or",
"list",
"of",
"conversations",
"for",
"a",
"user",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/externallib.php#L4488-L4512 |
216,208 | moodle/moodle | message/externallib.php | core_message_external.unset_favourite_conversations | public static function unset_favourite_conversations(int $userid, array $conversationids) {
global $CFG, $USER;
// All the business logic checks that really shouldn't be in here.
if (empty($CFG->messaging)) {
throw new moodle_exception('disabled', 'message');
}
$para... | php | public static function unset_favourite_conversations(int $userid, array $conversationids) {
global $CFG, $USER;
// All the business logic checks that really shouldn't be in here.
if (empty($CFG->messaging)) {
throw new moodle_exception('disabled', 'message');
}
$para... | [
"public",
"static",
"function",
"unset_favourite_conversations",
"(",
"int",
"$",
"userid",
",",
"array",
"$",
"conversationids",
")",
"{",
"global",
"$",
"CFG",
",",
"$",
"USER",
";",
"// All the business logic checks that really shouldn't be in here.",
"if",
"(",
"e... | Unfavourite a conversation, or list of conversations for a user.
@param int $userid the id of the user, or 0 for the current user.
@param array $conversationids the list of conversations ids unset as favourites.
@return array
@throws moodle_exception if messaging is disabled or if the user cannot perform the action. | [
"Unfavourite",
"a",
"conversation",
"or",
"list",
"of",
"conversations",
"for",
"a",
"user",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/externallib.php#L4547-L4571 |
216,209 | moodle/moodle | message/externallib.php | core_message_external.get_conversation_counts | public static function get_conversation_counts(int $userid) {
global $CFG, $USER;
// All the business logic checks that really shouldn't be in here.
if (empty($CFG->messaging)) {
throw new moodle_exception('disabled', 'message');
}
if (empty($userid)) {
... | php | public static function get_conversation_counts(int $userid) {
global $CFG, $USER;
// All the business logic checks that really shouldn't be in here.
if (empty($CFG->messaging)) {
throw new moodle_exception('disabled', 'message');
}
if (empty($userid)) {
... | [
"public",
"static",
"function",
"get_conversation_counts",
"(",
"int",
"$",
"userid",
")",
"{",
"global",
"$",
"CFG",
",",
"$",
"USER",
";",
"// All the business logic checks that really shouldn't be in here.",
"if",
"(",
"empty",
"(",
"$",
"CFG",
"->",
"messaging",... | Returns an array of conversation counts for the various types of conversations, including favourites.
Return format:
[
'favourites' => 0,
'types' => [
\core_message\api::MESSAGE_CONVERSATION_TYPE_INDIVIDUAL => 0,
\core_message\api::MESSAGE_CONVERSATION_TYPE_GROUP => 0
]
]
@param int $userid the id of the user whose c... | [
"Returns",
"an",
"array",
"of",
"conversation",
"counts",
"for",
"the",
"various",
"types",
"of",
"conversations",
"including",
"favourites",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/externallib.php#L4685-L4708 |
216,210 | moodle/moodle | message/externallib.php | core_message_external.get_conversation_counts_returns | public static function get_conversation_counts_returns() {
return new external_single_structure(
[
'favourites' => new external_value(PARAM_INT, 'Total number of favourite conversations'),
'types' => new external_single_structure(
[
... | php | public static function get_conversation_counts_returns() {
return new external_single_structure(
[
'favourites' => new external_value(PARAM_INT, 'Total number of favourite conversations'),
'types' => new external_single_structure(
[
... | [
"public",
"static",
"function",
"get_conversation_counts_returns",
"(",
")",
"{",
"return",
"new",
"external_single_structure",
"(",
"[",
"'favourites'",
"=>",
"new",
"external_value",
"(",
"PARAM_INT",
",",
"'Total number of favourite conversations'",
")",
",",
"'types'"... | Get conversation counts return description.
@return external_description | [
"Get",
"conversation",
"counts",
"return",
"description",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/externallib.php#L4715-L4731 |
216,211 | moodle/moodle | mod/forum/classes/local/entities/sorter.php | sorter.flatten_children | public function flatten_children(array $items) : array {
$result = [];
foreach ($items as [$item, $children]) {
$result[] = $item;
$result = array_merge($result, $this->flatten_children($children));
}
return $result;
} | php | public function flatten_children(array $items) : array {
$result = [];
foreach ($items as [$item, $children]) {
$result[] = $item;
$result = array_merge($result, $this->flatten_children($children));
}
return $result;
} | [
"public",
"function",
"flatten_children",
"(",
"array",
"$",
"items",
")",
":",
"array",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"items",
"as",
"[",
"$",
"item",
",",
"$",
"children",
"]",
")",
"{",
"$",
"result",
"[",
"]",
"... | Take the data structure returned from "sort_into_children" and flatten it back
into an array. It does a depth first flatten which maintains the reply ordering.
@param array $items Items in the data structure returned by "sort_into_children"
@return array A flat array. | [
"Take",
"the",
"data",
"structure",
"returned",
"from",
"sort_into_children",
"and",
"flatten",
"it",
"back",
"into",
"an",
"array",
".",
"It",
"does",
"a",
"depth",
"first",
"flatten",
"which",
"maintains",
"the",
"reply",
"ordering",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/local/entities/sorter.php#L142-L151 |
216,212 | moodle/moodle | mod/assign/feedback/file/importziplib.php | assignfeedback_file_zip_importer.is_file_modified | public function is_file_modified($assignment, $user, $plugin, $filename, $fileinfo) {
$sg = null;
if ($plugin->get_subtype() == 'assignsubmission') {
$sg = $assignment->get_user_submission($user->id, false);
} else if ($plugin->get_subtype() == 'assignfeedback') {
$sg = ... | php | public function is_file_modified($assignment, $user, $plugin, $filename, $fileinfo) {
$sg = null;
if ($plugin->get_subtype() == 'assignsubmission') {
$sg = $assignment->get_user_submission($user->id, false);
} else if ($plugin->get_subtype() == 'assignfeedback') {
$sg = ... | [
"public",
"function",
"is_file_modified",
"(",
"$",
"assignment",
",",
"$",
"user",
",",
"$",
"plugin",
",",
"$",
"filename",
",",
"$",
"fileinfo",
")",
"{",
"$",
"sg",
"=",
"null",
";",
"if",
"(",
"$",
"plugin",
"->",
"get_subtype",
"(",
")",
"==",
... | Does this file exist in any of the current files supported by this plugin for this user?
@param assign $assignment - The assignment instance
@param stdClass $user The user matching this uploaded file
@param assign_plugin $plugin The matching plugin from the filename
@param string $filename The parsed filename from the... | [
"Does",
"this",
"file",
"exist",
"in",
"any",
"of",
"the",
"current",
"files",
"supported",
"by",
"this",
"plugin",
"for",
"this",
"user?"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/feedback/file/importziplib.php#L101-L133 |
216,213 | moodle/moodle | mod/assign/feedback/file/importziplib.php | assignfeedback_file_zip_importer.delete_import_files | public function delete_import_files($contextid) {
global $USER;
$fs = get_file_storage();
return $fs->delete_area_files($contextid,
'assignfeedback_file',
ASSIGNFEEDBACK_FILE_IMPORT_FILEAREA,
... | php | public function delete_import_files($contextid) {
global $USER;
$fs = get_file_storage();
return $fs->delete_area_files($contextid,
'assignfeedback_file',
ASSIGNFEEDBACK_FILE_IMPORT_FILEAREA,
... | [
"public",
"function",
"delete_import_files",
"(",
"$",
"contextid",
")",
"{",
"global",
"$",
"USER",
";",
"$",
"fs",
"=",
"get_file_storage",
"(",
")",
";",
"return",
"$",
"fs",
"->",
"delete_area_files",
"(",
"$",
"contextid",
",",
"'assignfeedback_file'",
... | Delete all temp files used when importing a zip
@param int $contextid - The context id of this assignment instance
@return bool true if all files were deleted | [
"Delete",
"all",
"temp",
"files",
"used",
"when",
"importing",
"a",
"zip"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/feedback/file/importziplib.php#L141-L150 |
216,214 | moodle/moodle | mod/assign/feedback/file/importziplib.php | assignfeedback_file_zip_importer.extract_files_from_zip | public function extract_files_from_zip($zipfile, $contextid) {
global $USER;
$feedbackfilesupdated = 0;
$feedbackfilesadded = 0;
$userswithnewfeedback = array();
// Unzipping a large zip file is memory intensive.
raise_memory_limit(MEMORY_EXTRA);
$packer = get_... | php | public function extract_files_from_zip($zipfile, $contextid) {
global $USER;
$feedbackfilesupdated = 0;
$feedbackfilesadded = 0;
$userswithnewfeedback = array();
// Unzipping a large zip file is memory intensive.
raise_memory_limit(MEMORY_EXTRA);
$packer = get_... | [
"public",
"function",
"extract_files_from_zip",
"(",
"$",
"zipfile",
",",
"$",
"contextid",
")",
"{",
"global",
"$",
"USER",
";",
"$",
"feedbackfilesupdated",
"=",
"0",
";",
"$",
"feedbackfilesadded",
"=",
"0",
";",
"$",
"userswithnewfeedback",
"=",
"array",
... | Extract the uploaded zip to a temporary import area for this user
@param stored_file $zipfile The uploaded file
@param int $contextid The context for this assignment
@return bool - True if the files were unpacked | [
"Extract",
"the",
"uploaded",
"zip",
"to",
"a",
"temporary",
"import",
"area",
"for",
"this",
"user"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/feedback/file/importziplib.php#L159-L179 |
216,215 | moodle/moodle | mod/assign/feedback/file/importziplib.php | assignfeedback_file_zip_importer.get_import_files | public function get_import_files($contextid) {
global $USER;
$fs = get_file_storage();
$files = $fs->get_directory_files($contextid,
'assignfeedback_file',
ASSIGNFEEDBACK_FILE_IMPORT_FILEAREA,
... | php | public function get_import_files($contextid) {
global $USER;
$fs = get_file_storage();
$files = $fs->get_directory_files($contextid,
'assignfeedback_file',
ASSIGNFEEDBACK_FILE_IMPORT_FILEAREA,
... | [
"public",
"function",
"get_import_files",
"(",
"$",
"contextid",
")",
"{",
"global",
"$",
"USER",
";",
"$",
"fs",
"=",
"get_file_storage",
"(",
")",
";",
"$",
"files",
"=",
"$",
"fs",
"->",
"get_directory_files",
"(",
"$",
"contextid",
",",
"'assignfeedbac... | Get the list of files extracted from the uploaded zip
@param int $contextid
@return array of stored_files | [
"Get",
"the",
"list",
"of",
"files",
"extracted",
"from",
"the",
"uploaded",
"zip"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/feedback/file/importziplib.php#L187-L200 |
216,216 | moodle/moodle | media/classes/player_native.php | core_media_player_native.get_attribute | public static function get_attribute($tag, $attrname, $type = PARAM_RAW) {
if (preg_match('/^<[^>]*\b' . $attrname . '="(.*?)"/is', $tag, $matches)) {
return clean_param(htmlspecialchars_decode($matches[1]), $type);
} else if (preg_match('~^<[^>]*\b' . $attrname . '[ />]"~is', $tag, $matches... | php | public static function get_attribute($tag, $attrname, $type = PARAM_RAW) {
if (preg_match('/^<[^>]*\b' . $attrname . '="(.*?)"/is', $tag, $matches)) {
return clean_param(htmlspecialchars_decode($matches[1]), $type);
} else if (preg_match('~^<[^>]*\b' . $attrname . '[ />]"~is', $tag, $matches... | [
"public",
"static",
"function",
"get_attribute",
"(",
"$",
"tag",
",",
"$",
"attrname",
",",
"$",
"type",
"=",
"PARAM_RAW",
")",
"{",
"if",
"(",
"preg_match",
"(",
"'/^<[^>]*\\b'",
".",
"$",
"attrname",
".",
"'=\"(.*?)\"/is'",
",",
"$",
"tag",
",",
"$",
... | Extracts a value for an attribute
@param string $tag html tag which properties are extracted, for example "<video ...>....</video>"
@param string $attrname name of the attribute we are looking for
@param string $type one of PARAM_* constants to clean the attribute value
@return string|null | [
"Extracts",
"a",
"value",
"for",
"an",
"attribute"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/media/classes/player_native.php#L43-L51 |
216,217 | moodle/moodle | media/classes/player_native.php | core_media_player_native.remove_attributes | public static function remove_attributes($tag, $attrname) {
if (is_array($attrname)) {
$attrname = join('|', $attrname);
}
while (preg_match('/^(<[^>]*\b)(' . $attrname . ')=".*?"(.*)$/is', $tag, $matches)) {
$tag = $matches[1] . $matches[3];
}
while (preg... | php | public static function remove_attributes($tag, $attrname) {
if (is_array($attrname)) {
$attrname = join('|', $attrname);
}
while (preg_match('/^(<[^>]*\b)(' . $attrname . ')=".*?"(.*)$/is', $tag, $matches)) {
$tag = $matches[1] . $matches[3];
}
while (preg... | [
"public",
"static",
"function",
"remove_attributes",
"(",
"$",
"tag",
",",
"$",
"attrname",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"attrname",
")",
")",
"{",
"$",
"attrname",
"=",
"join",
"(",
"'|'",
",",
"$",
"attrname",
")",
";",
"}",
"while",
... | Removes an attribute from the media tags
@param string $tag html tag which properties are extracted, for example "<video ...>....</video>"
@param string|array $attrname
@return string | [
"Removes",
"an",
"attribute",
"from",
"the",
"media",
"tags"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/media/classes/player_native.php#L60-L72 |
216,218 | moodle/moodle | media/classes/player_native.php | core_media_player_native.add_attributes | public static function add_attributes($tag, $attributes) {
$tag = self::remove_attributes($tag, array_keys($attributes));
if (!preg_match('/^(<.*?)(>.*)$/s', $tag, $matches)) {
return $tag;
}
$rv = $matches[1];
foreach ($attributes as $name => $value) {
$r... | php | public static function add_attributes($tag, $attributes) {
$tag = self::remove_attributes($tag, array_keys($attributes));
if (!preg_match('/^(<.*?)(>.*)$/s', $tag, $matches)) {
return $tag;
}
$rv = $matches[1];
foreach ($attributes as $name => $value) {
$r... | [
"public",
"static",
"function",
"add_attributes",
"(",
"$",
"tag",
",",
"$",
"attributes",
")",
"{",
"$",
"tag",
"=",
"self",
"::",
"remove_attributes",
"(",
"$",
"tag",
",",
"array_keys",
"(",
"$",
"attributes",
")",
")",
";",
"if",
"(",
"!",
"preg_ma... | Adds attributes to the media tags
@param string $tag html tag which properties are extracted, for example "<video ...>....</video>"
@param array $attributes key-value pairs of attributes to be added
@return string | [
"Adds",
"attributes",
"to",
"the",
"media",
"tags"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/media/classes/player_native.php#L81-L92 |
216,219 | moodle/moodle | admin/tool/usertours/classes/cache.php | cache.get_enabled_tourdata | public static function get_enabled_tourdata() {
global $DB;
$cache = \cache::make('tool_usertours', self::CACHENAME_TOUR);
$data = $cache->get(self::CACHEKEY_TOUR);
if ($data === false) {
$sql = <<<EOF
SELECT t.*
FROM {tool_usertours_tours}... | php | public static function get_enabled_tourdata() {
global $DB;
$cache = \cache::make('tool_usertours', self::CACHENAME_TOUR);
$data = $cache->get(self::CACHEKEY_TOUR);
if ($data === false) {
$sql = <<<EOF
SELECT t.*
FROM {tool_usertours_tours}... | [
"public",
"static",
"function",
"get_enabled_tourdata",
"(",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"cache",
"=",
"\\",
"cache",
"::",
"make",
"(",
"'tool_usertours'",
",",
"self",
"::",
"CACHENAME_TOUR",
")",
";",
"$",
"data",
"=",
"$",
"cache",
"->",... | Fetch all enabled tours. | [
"Fetch",
"all",
"enabled",
"tours",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/usertours/classes/cache.php#L54-L74 |
216,220 | moodle/moodle | admin/tool/usertours/classes/cache.php | cache.get_matching_tourdata | public static function get_matching_tourdata(\moodle_url $targetmatch) {
$tours = self::get_enabled_tourdata();
// Attempt to determine whether this is the front page.
// This is a special case because the frontpage uses a shortened page path making it difficult to detect exactly.
$isfr... | php | public static function get_matching_tourdata(\moodle_url $targetmatch) {
$tours = self::get_enabled_tourdata();
// Attempt to determine whether this is the front page.
// This is a special case because the frontpage uses a shortened page path making it difficult to detect exactly.
$isfr... | [
"public",
"static",
"function",
"get_matching_tourdata",
"(",
"\\",
"moodle_url",
"$",
"targetmatch",
")",
"{",
"$",
"tours",
"=",
"self",
"::",
"get_enabled_tourdata",
"(",
")",
";",
"// Attempt to determine whether this is the front page.",
"// This is a special case beca... | Fetch all enabled tours matching the specified target.
@param moodle_url $targetmatch The URL to match. | [
"Fetch",
"all",
"enabled",
"tours",
"matching",
"the",
"specified",
"target",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/usertours/classes/cache.php#L81-L96 |
216,221 | moodle/moodle | admin/tool/usertours/classes/cache.php | cache.notify_tour_change | public static function notify_tour_change() {
$cache = \cache::make('tool_usertours', self::CACHENAME_TOUR);
$cache->delete(self::CACHEKEY_TOUR);
} | php | public static function notify_tour_change() {
$cache = \cache::make('tool_usertours', self::CACHENAME_TOUR);
$cache->delete(self::CACHEKEY_TOUR);
} | [
"public",
"static",
"function",
"notify_tour_change",
"(",
")",
"{",
"$",
"cache",
"=",
"\\",
"cache",
"::",
"make",
"(",
"'tool_usertours'",
",",
"self",
"::",
"CACHENAME_TOUR",
")",
";",
"$",
"cache",
"->",
"delete",
"(",
"self",
"::",
"CACHEKEY_TOUR",
"... | Notify of changes to any tour to clear the tour cache. | [
"Notify",
"of",
"changes",
"to",
"any",
"tour",
"to",
"clear",
"the",
"tour",
"cache",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/usertours/classes/cache.php#L101-L104 |
216,222 | moodle/moodle | admin/tool/usertours/classes/cache.php | cache.get_stepdata | public static function get_stepdata($tourid) {
global $DB;
$cache = \cache::make('tool_usertours', self::CACHENAME_STEP);
$data = $cache->get($tourid);
if ($data === false) {
$sql = <<<EOF
SELECT s.*
FROM {tool_usertours_steps} s
... | php | public static function get_stepdata($tourid) {
global $DB;
$cache = \cache::make('tool_usertours', self::CACHENAME_STEP);
$data = $cache->get($tourid);
if ($data === false) {
$sql = <<<EOF
SELECT s.*
FROM {tool_usertours_steps} s
... | [
"public",
"static",
"function",
"get_stepdata",
"(",
"$",
"tourid",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"cache",
"=",
"\\",
"cache",
"::",
"make",
"(",
"'tool_usertours'",
",",
"self",
"::",
"CACHENAME_STEP",
")",
";",
"$",
"data",
"=",
"$",
"cach... | Fetch the tour data for the specified tour.
@param int $tourid The ID of the tour to fetch steps for | [
"Fetch",
"the",
"tour",
"data",
"for",
"the",
"specified",
"tour",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/usertours/classes/cache.php#L111-L130 |
216,223 | moodle/moodle | admin/tool/usertours/classes/cache.php | cache.notify_step_change | public static function notify_step_change($tourid) {
$cache = \cache::make('tool_usertours', self::CACHENAME_STEP);
$cache->delete($tourid);
} | php | public static function notify_step_change($tourid) {
$cache = \cache::make('tool_usertours', self::CACHENAME_STEP);
$cache->delete($tourid);
} | [
"public",
"static",
"function",
"notify_step_change",
"(",
"$",
"tourid",
")",
"{",
"$",
"cache",
"=",
"\\",
"cache",
"::",
"make",
"(",
"'tool_usertours'",
",",
"self",
"::",
"CACHENAME_STEP",
")",
";",
"$",
"cache",
"->",
"delete",
"(",
"$",
"tourid",
... | Notify of changes to any step to clear the step cache for that tour.
@param int $tourid The ID of the tour to clear the step cache for | [
"Notify",
"of",
"changes",
"to",
"any",
"step",
"to",
"clear",
"the",
"step",
"cache",
"for",
"that",
"tour",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/usertours/classes/cache.php#L136-L139 |
216,224 | moodle/moodle | lib/classes/event/course_completed.php | course_completed.create_from_completion | public static function create_from_completion(\stdClass $completion) {
$event = self::create(
array(
'objectid' => $completion->id,
'relateduserid' => $completion->userid,
'context' => \context_course::instance($completion->course),
'co... | php | public static function create_from_completion(\stdClass $completion) {
$event = self::create(
array(
'objectid' => $completion->id,
'relateduserid' => $completion->userid,
'context' => \context_course::instance($completion->course),
'co... | [
"public",
"static",
"function",
"create_from_completion",
"(",
"\\",
"stdClass",
"$",
"completion",
")",
"{",
"$",
"event",
"=",
"self",
"::",
"create",
"(",
"array",
"(",
"'objectid'",
"=>",
"$",
"completion",
"->",
"id",
",",
"'relateduserid'",
"=>",
"$",
... | Create event from course_completion record.
@param \stdClass $completion
@return course_completed | [
"Create",
"event",
"from",
"course_completion",
"record",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/event/course_completed.php#L50-L62 |
216,225 | moodle/moodle | lib/phpexcel/PHPExcel/Shared/Date.php | PHPExcel_Shared_Date.dayStringToNumber | public static function dayStringToNumber($day)
{
$strippedDayValue = (str_replace(self::$numberSuffixes, '', $day));
if (is_numeric($strippedDayValue)) {
return (integer) $strippedDayValue;
}
return $day;
} | php | public static function dayStringToNumber($day)
{
$strippedDayValue = (str_replace(self::$numberSuffixes, '', $day));
if (is_numeric($strippedDayValue)) {
return (integer) $strippedDayValue;
}
return $day;
} | [
"public",
"static",
"function",
"dayStringToNumber",
"(",
"$",
"day",
")",
"{",
"$",
"strippedDayValue",
"=",
"(",
"str_replace",
"(",
"self",
"::",
"$",
"numberSuffixes",
",",
"''",
",",
"$",
"day",
")",
")",
";",
"if",
"(",
"is_numeric",
"(",
"$",
"s... | Strips an ordinal froma numeric value
@param string $day Day number with an ordinal
@return integer|string The integer value with any ordinal stripped, or the original string argument if it isn't a valid numeric | [
"Strips",
"an",
"ordinal",
"froma",
"numeric",
"value"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/phpexcel/PHPExcel/Shared/Date.php#L401-L408 |
216,226 | moodle/moodle | question/engine/questionattempt.php | question_attempt.get_step | public function get_step($i) {
if ($i < 0 || $i >= count($this->steps)) {
throw new coding_exception('Index out of bounds in question_attempt::get_step.');
}
return $this->steps[$i];
} | php | public function get_step($i) {
if ($i < 0 || $i >= count($this->steps)) {
throw new coding_exception('Index out of bounds in question_attempt::get_step.');
}
return $this->steps[$i];
} | [
"public",
"function",
"get_step",
"(",
"$",
"i",
")",
"{",
"if",
"(",
"$",
"i",
"<",
"0",
"||",
"$",
"i",
">=",
"count",
"(",
"$",
"this",
"->",
"steps",
")",
")",
"{",
"throw",
"new",
"coding_exception",
"(",
"'Index out of bounds in question_attempt::g... | Get one of the steps in this attempt.
@param int $i the step number, which counts from 0.
@return question_attempt_step | [
"Get",
"one",
"of",
"the",
"steps",
"in",
"this",
"attempt",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/engine/questionattempt.php#L383-L388 |
216,227 | moodle/moodle | question/engine/questionattempt.php | question_attempt.get_last_step_with_qt_var | public function get_last_step_with_qt_var($name) {
foreach ($this->get_reverse_step_iterator() as $step) {
if ($step->has_qt_var($name)) {
return $step;
}
}
return new question_attempt_step_read_only();
} | php | public function get_last_step_with_qt_var($name) {
foreach ($this->get_reverse_step_iterator() as $step) {
if ($step->has_qt_var($name)) {
return $step;
}
}
return new question_attempt_step_read_only();
} | [
"public",
"function",
"get_last_step_with_qt_var",
"(",
"$",
"name",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"get_reverse_step_iterator",
"(",
")",
"as",
"$",
"step",
")",
"{",
"if",
"(",
"$",
"step",
"->",
"has_qt_var",
"(",
"$",
"name",
")",
")",
... | Get the last step with a particular question type varialbe set.
@param string $name the name of the variable to get.
@return question_attempt_step the last step, or a step with no variables
if there was not a real step. | [
"Get",
"the",
"last",
"step",
"with",
"a",
"particular",
"question",
"type",
"varialbe",
"set",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/engine/questionattempt.php#L486-L493 |
216,228 | moodle/moodle | question/engine/questionattempt.php | question_attempt.get_last_step_with_behaviour_var | public function get_last_step_with_behaviour_var($name) {
foreach ($this->get_reverse_step_iterator() as $step) {
if ($step->has_behaviour_var($name)) {
return $step;
}
}
return new question_attempt_step_read_only();
} | php | public function get_last_step_with_behaviour_var($name) {
foreach ($this->get_reverse_step_iterator() as $step) {
if ($step->has_behaviour_var($name)) {
return $step;
}
}
return new question_attempt_step_read_only();
} | [
"public",
"function",
"get_last_step_with_behaviour_var",
"(",
"$",
"name",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"get_reverse_step_iterator",
"(",
")",
"as",
"$",
"step",
")",
"{",
"if",
"(",
"$",
"step",
"->",
"has_behaviour_var",
"(",
"$",
"name",
... | Get the last step with a particular behaviour variable set.
@param string $name the name of the variable to get.
@return question_attempt_step the last step, or a step with no variables
if there was not a real step. | [
"Get",
"the",
"last",
"step",
"with",
"a",
"particular",
"behaviour",
"variable",
"set",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/engine/questionattempt.php#L501-L508 |
216,229 | moodle/moodle | question/engine/questionattempt.php | question_attempt.get_last_qt_var | public function get_last_qt_var($name, $default = null) {
$step = $this->get_last_step_with_qt_var($name);
if ($step->has_qt_var($name)) {
return $step->get_qt_var($name);
} else {
return $default;
}
} | php | public function get_last_qt_var($name, $default = null) {
$step = $this->get_last_step_with_qt_var($name);
if ($step->has_qt_var($name)) {
return $step->get_qt_var($name);
} else {
return $default;
}
} | [
"public",
"function",
"get_last_qt_var",
"(",
"$",
"name",
",",
"$",
"default",
"=",
"null",
")",
"{",
"$",
"step",
"=",
"$",
"this",
"->",
"get_last_step_with_qt_var",
"(",
"$",
"name",
")",
";",
"if",
"(",
"$",
"step",
"->",
"has_qt_var",
"(",
"$",
... | Get the latest value of a particular question type variable. That is, get
the value from the latest step that has it set. Return null if it is not
set in any step.
@param string $name the name of the variable to get.
@param mixed default the value to return in the variable has never been set.
(Optional, defaults to nu... | [
"Get",
"the",
"latest",
"value",
"of",
"a",
"particular",
"question",
"type",
"variable",
".",
"That",
"is",
"get",
"the",
"value",
"from",
"the",
"latest",
"step",
"that",
"has",
"it",
"set",
".",
"Return",
"null",
"if",
"it",
"is",
"not",
"set",
"in"... | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/engine/questionattempt.php#L520-L527 |
216,230 | moodle/moodle | question/engine/questionattempt.php | question_attempt.get_response_file_url | public function get_response_file_url(stored_file $file) {
return file_encode_url(new moodle_url('/pluginfile.php'), '/' . implode('/', array(
$file->get_contextid(),
$file->get_component(),
$file->get_filearea(),
$this->usageid,
$t... | php | public function get_response_file_url(stored_file $file) {
return file_encode_url(new moodle_url('/pluginfile.php'), '/' . implode('/', array(
$file->get_contextid(),
$file->get_component(),
$file->get_filearea(),
$this->usageid,
$t... | [
"public",
"function",
"get_response_file_url",
"(",
"stored_file",
"$",
"file",
")",
"{",
"return",
"file_encode_url",
"(",
"new",
"moodle_url",
"(",
"'/pluginfile.php'",
")",
",",
"'/'",
".",
"implode",
"(",
"'/'",
",",
"array",
"(",
"$",
"file",
"->",
"get... | Get the URL of a file that belongs to a response variable of this
question_attempt.
@param stored_file $file the file to link to.
@return string the URL of that file. | [
"Get",
"the",
"URL",
"of",
"a",
"file",
"that",
"belongs",
"to",
"a",
"response",
"variable",
"of",
"this",
"question_attempt",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/engine/questionattempt.php#L552-L561 |
216,231 | moodle/moodle | question/engine/questionattempt.php | question_attempt.prepare_response_files_draft_itemid | public function prepare_response_files_draft_itemid($name, $contextid) {
foreach ($this->get_reverse_step_iterator() as $step) {
if ($step->has_qt_var($name)) {
return $step->prepare_response_files_draft_itemid($name, $contextid);
}
}
// No files yet.
... | php | public function prepare_response_files_draft_itemid($name, $contextid) {
foreach ($this->get_reverse_step_iterator() as $step) {
if ($step->has_qt_var($name)) {
return $step->prepare_response_files_draft_itemid($name, $contextid);
}
}
// No files yet.
... | [
"public",
"function",
"prepare_response_files_draft_itemid",
"(",
"$",
"name",
",",
"$",
"contextid",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"get_reverse_step_iterator",
"(",
")",
"as",
"$",
"step",
")",
"{",
"if",
"(",
"$",
"step",
"->",
"has_qt_var",... | Prepare a draft file are for the files belonging the a response variable
of this question attempt. The draft area is populated with the files from
the most recent step having files.
@param string $name the variable name the files belong to.
@param int $contextid the id of the context the quba belongs to.
@return int t... | [
"Prepare",
"a",
"draft",
"file",
"are",
"for",
"the",
"files",
"belonging",
"the",
"a",
"response",
"variable",
"of",
"this",
"question",
"attempt",
".",
"The",
"draft",
"area",
"is",
"populated",
"with",
"the",
"files",
"from",
"the",
"most",
"recent",
"s... | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/engine/questionattempt.php#L572-L583 |
216,232 | moodle/moodle | question/engine/questionattempt.php | question_attempt.get_last_behaviour_var | public function get_last_behaviour_var($name, $default = null) {
foreach ($this->get_reverse_step_iterator() as $step) {
if ($step->has_behaviour_var($name)) {
return $step->get_behaviour_var($name);
}
}
return $default;
} | php | public function get_last_behaviour_var($name, $default = null) {
foreach ($this->get_reverse_step_iterator() as $step) {
if ($step->has_behaviour_var($name)) {
return $step->get_behaviour_var($name);
}
}
return $default;
} | [
"public",
"function",
"get_last_behaviour_var",
"(",
"$",
"name",
",",
"$",
"default",
"=",
"null",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"get_reverse_step_iterator",
"(",
")",
"as",
"$",
"step",
")",
"{",
"if",
"(",
"$",
"step",
"->",
"has_behavi... | Get the latest value of a particular behaviour variable. That is,
get the value from the latest step that has it set. Return null if it is
not set in any step.
@param string $name the name of the variable to get.
@param mixed default the value to return in the variable has never been set.
(Optional, defaults to null.)... | [
"Get",
"the",
"latest",
"value",
"of",
"a",
"particular",
"behaviour",
"variable",
".",
"That",
"is",
"get",
"the",
"value",
"from",
"the",
"latest",
"step",
"that",
"has",
"it",
"set",
".",
"Return",
"null",
"if",
"it",
"is",
"not",
"set",
"in",
"any"... | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/engine/questionattempt.php#L595-L602 |
216,233 | moodle/moodle | question/engine/questionattempt.php | question_attempt.get_current_manual_mark | public function get_current_manual_mark() {
// Is there a current value in the current POST data? If so, use that.
$mark = $this->get_submitted_var($this->get_behaviour_field_name('mark'), PARAM_RAW_TRIMMED);
if ($mark !== null) {
return $mark;
}
// Otherwise, use th... | php | public function get_current_manual_mark() {
// Is there a current value in the current POST data? If so, use that.
$mark = $this->get_submitted_var($this->get_behaviour_field_name('mark'), PARAM_RAW_TRIMMED);
if ($mark !== null) {
return $mark;
}
// Otherwise, use th... | [
"public",
"function",
"get_current_manual_mark",
"(",
")",
"{",
"// Is there a current value in the current POST data? If so, use that.",
"$",
"mark",
"=",
"$",
"this",
"->",
"get_submitted_var",
"(",
"$",
"this",
"->",
"get_behaviour_field_name",
"(",
"'mark'",
")",
",",... | This is used by the manual grading code, particularly in association with
validation. It gets the current manual mark for a question, in exactly the string
form that the teacher entered it, if possible. This may come from the current
POST request, if there is one, otherwise from the database.
@return string the curren... | [
"This",
"is",
"used",
"by",
"the",
"manual",
"grading",
"code",
"particularly",
"in",
"association",
"with",
"validation",
".",
"It",
"gets",
"the",
"current",
"manual",
"mark",
"for",
"a",
"question",
"in",
"exactly",
"the",
"string",
"form",
"that",
"the",... | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/engine/questionattempt.php#L674-L690 |
216,234 | moodle/moodle | question/engine/questionattempt.php | question_attempt.set_metadata | public function set_metadata($name, $value) {
$firststep = $this->get_step(0);
if (!$firststep->has_metadata_var($name)) {
$this->observer->notify_metadata_added($this, $name);
} else if ($value !== $firststep->get_metadata_var($name)) {
$this->observer->notify_metadata_m... | php | public function set_metadata($name, $value) {
$firststep = $this->get_step(0);
if (!$firststep->has_metadata_var($name)) {
$this->observer->notify_metadata_added($this, $name);
} else if ($value !== $firststep->get_metadata_var($name)) {
$this->observer->notify_metadata_m... | [
"public",
"function",
"set_metadata",
"(",
"$",
"name",
",",
"$",
"value",
")",
"{",
"$",
"firststep",
"=",
"$",
"this",
"->",
"get_step",
"(",
"0",
")",
";",
"if",
"(",
"!",
"$",
"firststep",
"->",
"has_metadata_var",
"(",
"$",
"name",
")",
")",
"... | Set some metadata for this question attempt.
@param string $name the name of the metadata variable to return.
@param string $value the value to set that metadata variable to. | [
"Set",
"some",
"metadata",
"for",
"this",
"question",
"attempt",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/engine/questionattempt.php#L793-L801 |
216,235 | moodle/moodle | question/engine/questionattempt.php | question_attempt.add_step | protected function add_step(question_attempt_step $step) {
$this->steps[] = $step;
end($this->steps);
$this->observer->notify_step_added($step, $this, key($this->steps));
} | php | protected function add_step(question_attempt_step $step) {
$this->steps[] = $step;
end($this->steps);
$this->observer->notify_step_added($step, $this, key($this->steps));
} | [
"protected",
"function",
"add_step",
"(",
"question_attempt_step",
"$",
"step",
")",
"{",
"$",
"this",
"->",
"steps",
"[",
"]",
"=",
"$",
"step",
";",
"end",
"(",
"$",
"this",
"->",
"steps",
")",
";",
"$",
"this",
"->",
"observer",
"->",
"notify_step_a... | Add a step to this question attempt.
@param question_attempt_step $step the new step. | [
"Add",
"a",
"step",
"to",
"this",
"question",
"attempt",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/engine/questionattempt.php#L913-L917 |
216,236 | moodle/moodle | question/engine/questionattempt.php | question_attempt.add_autosaved_step | protected function add_autosaved_step(question_attempt_step $step) {
$this->steps[] = $step;
$this->autosavedstep = $step;
end($this->steps);
$this->observer->notify_step_added($step, $this, -key($this->steps));
} | php | protected function add_autosaved_step(question_attempt_step $step) {
$this->steps[] = $step;
$this->autosavedstep = $step;
end($this->steps);
$this->observer->notify_step_added($step, $this, -key($this->steps));
} | [
"protected",
"function",
"add_autosaved_step",
"(",
"question_attempt_step",
"$",
"step",
")",
"{",
"$",
"this",
"->",
"steps",
"[",
"]",
"=",
"$",
"step",
";",
"$",
"this",
"->",
"autosavedstep",
"=",
"$",
"step",
";",
"end",
"(",
"$",
"this",
"->",
"... | Add an auto-saved step to this question attempt. We mark auto-saved steps by
changing saving the step number with a - sign.
@param question_attempt_step $step the new step. | [
"Add",
"an",
"auto",
"-",
"saved",
"step",
"to",
"this",
"question",
"attempt",
".",
"We",
"mark",
"auto",
"-",
"saved",
"steps",
"by",
"changing",
"saving",
"the",
"step",
"number",
"with",
"a",
"-",
"sign",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/engine/questionattempt.php#L924-L929 |
216,237 | moodle/moodle | question/engine/questionattempt.php | question_attempt.discard_autosaved_step | public function discard_autosaved_step() {
if (!$this->has_autosaved_step()) {
return;
}
$autosaved = array_pop($this->steps);
$this->autosavedstep = null;
$this->observer->notify_step_deleted($autosaved, $this);
} | php | public function discard_autosaved_step() {
if (!$this->has_autosaved_step()) {
return;
}
$autosaved = array_pop($this->steps);
$this->autosavedstep = null;
$this->observer->notify_step_deleted($autosaved, $this);
} | [
"public",
"function",
"discard_autosaved_step",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"has_autosaved_step",
"(",
")",
")",
"{",
"return",
";",
"}",
"$",
"autosaved",
"=",
"array_pop",
"(",
"$",
"this",
"->",
"steps",
")",
";",
"$",
"this",
... | Discard any auto-saved data belonging to this question attempt. | [
"Discard",
"any",
"auto",
"-",
"saved",
"data",
"belonging",
"to",
"this",
"question",
"attempt",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/engine/questionattempt.php#L934-L942 |
216,238 | moodle/moodle | question/engine/questionattempt.php | question_attempt.convert_autosaved_step_to_real_step | protected function convert_autosaved_step_to_real_step() {
if ($this->autosavedstep === null) {
return;
}
$laststep = end($this->steps);
if ($laststep !== $this->autosavedstep) {
throw new coding_exception('Cannot convert autosaved step to real step, since other ... | php | protected function convert_autosaved_step_to_real_step() {
if ($this->autosavedstep === null) {
return;
}
$laststep = end($this->steps);
if ($laststep !== $this->autosavedstep) {
throw new coding_exception('Cannot convert autosaved step to real step, since other ... | [
"protected",
"function",
"convert_autosaved_step_to_real_step",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"autosavedstep",
"===",
"null",
")",
"{",
"return",
";",
"}",
"$",
"laststep",
"=",
"end",
"(",
"$",
"this",
"->",
"steps",
")",
";",
"if",
"(",
... | If there is an autosaved step, convert it into a real save, so that it
is preserved. | [
"If",
"there",
"is",
"an",
"autosaved",
"step",
"convert",
"it",
"into",
"a",
"real",
"save",
"so",
"that",
"it",
"is",
"preserved",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/engine/questionattempt.php#L948-L960 |
216,239 | moodle/moodle | question/engine/questionattempt.php | question_attempt.select_variant | public function select_variant(question_variant_selection_strategy $variantstrategy) {
return $variantstrategy->choose_variant($this->get_question()->get_num_variants(),
$this->get_question()->get_variants_selection_seed());
} | php | public function select_variant(question_variant_selection_strategy $variantstrategy) {
return $variantstrategy->choose_variant($this->get_question()->get_num_variants(),
$this->get_question()->get_variants_selection_seed());
} | [
"public",
"function",
"select_variant",
"(",
"question_variant_selection_strategy",
"$",
"variantstrategy",
")",
"{",
"return",
"$",
"variantstrategy",
"->",
"choose_variant",
"(",
"$",
"this",
"->",
"get_question",
"(",
")",
"->",
"get_num_variants",
"(",
")",
",",... | Use a strategy to pick a variant.
@param question_variant_selection_strategy $variantstrategy a strategy.
@return int the selected variant. | [
"Use",
"a",
"strategy",
"to",
"pick",
"a",
"variant",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/engine/questionattempt.php#L967-L970 |
216,240 | moodle/moodle | question/engine/questionattempt.php | question_attempt.start | public function start($preferredbehaviour, $variant, $submitteddata = array(),
$timestamp = null, $userid = null, $existingstepid = null) {
if ($this->get_num_steps() > 0) {
throw new coding_exception('Cannot start a question that is already started.');
}
// Initialise ... | php | public function start($preferredbehaviour, $variant, $submitteddata = array(),
$timestamp = null, $userid = null, $existingstepid = null) {
if ($this->get_num_steps() > 0) {
throw new coding_exception('Cannot start a question that is already started.');
}
// Initialise ... | [
"public",
"function",
"start",
"(",
"$",
"preferredbehaviour",
",",
"$",
"variant",
",",
"$",
"submitteddata",
"=",
"array",
"(",
")",
",",
"$",
"timestamp",
"=",
"null",
",",
"$",
"userid",
"=",
"null",
",",
"$",
"existingstepid",
"=",
"null",
")",
"{... | Start this question attempt.
You should not call this method directly. Call
{@link question_usage_by_activity::start_question()} instead.
@param string|question_behaviour $preferredbehaviour the name of the
desired archetypal behaviour, or an actual model instance.
@param int $variant the variant of the question to s... | [
"Start",
"this",
"question",
"attempt",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/engine/questionattempt.php#L988-L1022 |
216,241 | moodle/moodle | question/engine/questionattempt.php | question_attempt.validate_manual_mark | public function validate_manual_mark($currentmark) {
if ($currentmark === null || $currentmark === '') {
return '';
}
$mark = question_utils::clean_param_mark($currentmark);
if ($mark === null) {
return get_string('manualgradeinvalidformat', 'question');
... | php | public function validate_manual_mark($currentmark) {
if ($currentmark === null || $currentmark === '') {
return '';
}
$mark = question_utils::clean_param_mark($currentmark);
if ($mark === null) {
return get_string('manualgradeinvalidformat', 'question');
... | [
"public",
"function",
"validate_manual_mark",
"(",
"$",
"currentmark",
")",
"{",
"if",
"(",
"$",
"currentmark",
"===",
"null",
"||",
"$",
"currentmark",
"===",
"''",
")",
"{",
"return",
"''",
";",
"}",
"$",
"mark",
"=",
"question_utils",
"::",
"clean_param... | Validate the manual mark for a question.
@param string $currentmark the user input (e.g. '1,0', '1,0' or 'invalid'.
@return string any errors with the value, or '' if it is OK. | [
"Validate",
"the",
"manual",
"mark",
"for",
"a",
"question",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/engine/questionattempt.php#L1099-L1115 |
216,242 | moodle/moodle | question/engine/questionattempt.php | question_attempt.process_response_files | protected function process_response_files($name, $draftidname, $postdata = null, $text = null) {
if ($postdata) {
// For simulated posts, get the draft itemid from there.
$draftitemid = $this->get_submitted_var($draftidname, PARAM_INT, $postdata);
} else {
$draftitemi... | php | protected function process_response_files($name, $draftidname, $postdata = null, $text = null) {
if ($postdata) {
// For simulated posts, get the draft itemid from there.
$draftitemid = $this->get_submitted_var($draftidname, PARAM_INT, $postdata);
} else {
$draftitemi... | [
"protected",
"function",
"process_response_files",
"(",
"$",
"name",
",",
"$",
"draftidname",
",",
"$",
"postdata",
"=",
"null",
",",
"$",
"text",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"postdata",
")",
"{",
"// For simulated posts, get the draft itemid from the... | Handle a submitted variable representing uploaded files.
@param string $name the field name.
@param string $draftidname the field name holding the draft file area id.
@param array $postdata (optional, only inteded for testing use) take the
data from this array, instead of from $_POST. At the moment, this
behaves as if ... | [
"Handle",
"a",
"submitted",
"variable",
"representing",
"uploaded",
"files",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/engine/questionattempt.php#L1127-L1143 |
216,243 | moodle/moodle | question/engine/questionattempt.php | question_attempt.get_expected_data | protected function get_expected_data($expected, $postdata, $extraprefix) {
$submitteddata = array();
foreach ($expected as $name => $type) {
$value = $this->get_submitted_var(
$this->get_field_prefix() . $extraprefix . $name, $type, $postdata);
if (!is_null($v... | php | protected function get_expected_data($expected, $postdata, $extraprefix) {
$submitteddata = array();
foreach ($expected as $name => $type) {
$value = $this->get_submitted_var(
$this->get_field_prefix() . $extraprefix . $name, $type, $postdata);
if (!is_null($v... | [
"protected",
"function",
"get_expected_data",
"(",
"$",
"expected",
",",
"$",
"postdata",
",",
"$",
"extraprefix",
")",
"{",
"$",
"submitteddata",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"expected",
"as",
"$",
"name",
"=>",
"$",
"type",
")",
... | Get any data from the request that matches the list of expected params.
@param array $expected variable name => PARAM_... constant.
@param null|array $postdata null to use real post data, otherwise an array of data to use.
@param string $extraprefix '-' or ''.
@return array name => value. | [
"Get",
"any",
"data",
"from",
"the",
"request",
"that",
"matches",
"the",
"list",
"of",
"expected",
"params",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/engine/questionattempt.php#L1153-L1163 |
216,244 | moodle/moodle | question/engine/questionattempt.php | question_attempt.get_all_submitted_qt_vars | public function get_all_submitted_qt_vars($postdata) {
if (is_null($postdata)) {
$postdata = $_POST;
}
$pattern = '/^' . preg_quote($this->get_field_prefix(), '/') . '[^-:]/';
$prefixlen = strlen($this->get_field_prefix());
$submitteddata = array();
foreach ... | php | public function get_all_submitted_qt_vars($postdata) {
if (is_null($postdata)) {
$postdata = $_POST;
}
$pattern = '/^' . preg_quote($this->get_field_prefix(), '/') . '[^-:]/';
$prefixlen = strlen($this->get_field_prefix());
$submitteddata = array();
foreach ... | [
"public",
"function",
"get_all_submitted_qt_vars",
"(",
"$",
"postdata",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"postdata",
")",
")",
"{",
"$",
"postdata",
"=",
"$",
"_POST",
";",
"}",
"$",
"pattern",
"=",
"'/^'",
".",
"preg_quote",
"(",
"$",
"this"... | Get all the submitted question type data for this question, whithout checking
that it is valid or cleaning it in any way.
@param null|array $postdata null to use real post data, otherwise an array of data to use.
@return array name => value. | [
"Get",
"all",
"the",
"submitted",
"question",
"type",
"data",
"for",
"this",
"question",
"whithout",
"checking",
"that",
"it",
"is",
"valid",
"or",
"cleaning",
"it",
"in",
"any",
"way",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/engine/questionattempt.php#L1172-L1188 |
216,245 | moodle/moodle | question/engine/questionattempt.php | question_attempt.get_submitted_data | public function get_submitted_data($postdata = null) {
$submitteddata = $this->get_expected_data(
$this->behaviour->get_expected_data(), $postdata, '-');
$expected = $this->behaviour->get_expected_qt_data();
$this->check_qt_var_name_restrictions($expected);
if ($expecte... | php | public function get_submitted_data($postdata = null) {
$submitteddata = $this->get_expected_data(
$this->behaviour->get_expected_data(), $postdata, '-');
$expected = $this->behaviour->get_expected_qt_data();
$this->check_qt_var_name_restrictions($expected);
if ($expecte... | [
"public",
"function",
"get_submitted_data",
"(",
"$",
"postdata",
"=",
"null",
")",
"{",
"$",
"submitteddata",
"=",
"$",
"this",
"->",
"get_expected_data",
"(",
"$",
"this",
"->",
"behaviour",
"->",
"get_expected_data",
"(",
")",
",",
"$",
"postdata",
",",
... | Get all the sumbitted data belonging to this question attempt from the
current request.
@param array $postdata (optional, only inteded for testing use) take the
data from this array, instead of from $_POST.
@return array name => value pairs that could be passed to {@link process_action()}. | [
"Get",
"all",
"the",
"sumbitted",
"data",
"belonging",
"to",
"this",
"question",
"attempt",
"from",
"the",
"current",
"request",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/engine/questionattempt.php#L1197-L1210 |
216,246 | moodle/moodle | question/engine/questionattempt.php | question_attempt.check_qt_var_name_restrictions | protected function check_qt_var_name_restrictions($expected) {
global $CFG;
if ($CFG->debugdeveloper && $expected !== self::USE_RAW_DATA) {
foreach ($expected as $key => $value) {
if (strpos($key, 'bf_') !== false) {
debugging('The bf_ prefix is reserved ... | php | protected function check_qt_var_name_restrictions($expected) {
global $CFG;
if ($CFG->debugdeveloper && $expected !== self::USE_RAW_DATA) {
foreach ($expected as $key => $value) {
if (strpos($key, 'bf_') !== false) {
debugging('The bf_ prefix is reserved ... | [
"protected",
"function",
"check_qt_var_name_restrictions",
"(",
"$",
"expected",
")",
"{",
"global",
"$",
"CFG",
";",
"if",
"(",
"$",
"CFG",
"->",
"debugdeveloper",
"&&",
"$",
"expected",
"!==",
"self",
"::",
"USE_RAW_DATA",
")",
"{",
"foreach",
"(",
"$",
... | Ensure that no reserved prefixes are being used by installed
question types.
@param array $expected An array of question type variables | [
"Ensure",
"that",
"no",
"reserved",
"prefixes",
"are",
"being",
"used",
"by",
"installed",
"question",
"types",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/engine/questionattempt.php#L1217-L1227 |
216,247 | moodle/moodle | question/engine/questionattempt.php | question_attempt.get_correct_response | public function get_correct_response() {
$response = $this->question->get_correct_response();
if (is_null($response)) {
return null;
}
$imvars = $this->behaviour->get_correct_response();
foreach ($imvars as $name => $value) {
$response['-' . $name] = $valu... | php | public function get_correct_response() {
$response = $this->question->get_correct_response();
if (is_null($response)) {
return null;
}
$imvars = $this->behaviour->get_correct_response();
foreach ($imvars as $name => $value) {
$response['-' . $name] = $valu... | [
"public",
"function",
"get_correct_response",
"(",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"question",
"->",
"get_correct_response",
"(",
")",
";",
"if",
"(",
"is_null",
"(",
"$",
"response",
")",
")",
"{",
"return",
"null",
";",
"}",
"$",
"... | Get a set of response data for this question attempt that would get the
best possible mark. If it is not possible to compute a correct
response, this method should return null.
@return array|null name => value pairs that could be passed to {@link process_action()}. | [
"Get",
"a",
"set",
"of",
"response",
"data",
"for",
"this",
"question",
"attempt",
"that",
"would",
"get",
"the",
"best",
"possible",
"mark",
".",
"If",
"it",
"is",
"not",
"possible",
"to",
"compute",
"a",
"correct",
"response",
"this",
"method",
"should",... | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/engine/questionattempt.php#L1235-L1245 |
216,248 | moodle/moodle | question/engine/questionattempt.php | question_attempt.process_autosave | public function process_autosave($submitteddata, $timestamp = null, $userid = null) {
$pendingstep = new question_attempt_pending_step($submitteddata, $timestamp, $userid);
if ($this->behaviour->process_autosave($pendingstep) == self::KEEP) {
$this->add_autosaved_step($pendingstep);
... | php | public function process_autosave($submitteddata, $timestamp = null, $userid = null) {
$pendingstep = new question_attempt_pending_step($submitteddata, $timestamp, $userid);
if ($this->behaviour->process_autosave($pendingstep) == self::KEEP) {
$this->add_autosaved_step($pendingstep);
... | [
"public",
"function",
"process_autosave",
"(",
"$",
"submitteddata",
",",
"$",
"timestamp",
"=",
"null",
",",
"$",
"userid",
"=",
"null",
")",
"{",
"$",
"pendingstep",
"=",
"new",
"question_attempt_pending_step",
"(",
"$",
"submitteddata",
",",
"$",
"timestamp... | Process an autosave.
@param array $submitteddata the submitted data the determines the action.
@param int $timestamp the time to record for the action. (If not given, use now.)
@param int $userid the user to attribute the action to. (If not given, use the current user.)
@return bool whether anything was saved. | [
"Process",
"an",
"autosave",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/engine/questionattempt.php#L1317-L1324 |
216,249 | moodle/moodle | question/engine/questionattempt.php | question_attempt.finish | public function finish($timestamp = null, $userid = null) {
$this->convert_autosaved_step_to_real_step();
$this->process_action(array('-finish' => 1), $timestamp, $userid);
} | php | public function finish($timestamp = null, $userid = null) {
$this->convert_autosaved_step_to_real_step();
$this->process_action(array('-finish' => 1), $timestamp, $userid);
} | [
"public",
"function",
"finish",
"(",
"$",
"timestamp",
"=",
"null",
",",
"$",
"userid",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"convert_autosaved_step_to_real_step",
"(",
")",
";",
"$",
"this",
"->",
"process_action",
"(",
"array",
"(",
"'-finish'",
"=>... | Perform a finish action on this question attempt. This corresponds to an
external finish action, for example the user pressing Submit all and finish
in the quiz, rather than using one of the controls that is part of the
question.
@param int $timestamp the time to record for the action. (If not given, use now.)
@param ... | [
"Perform",
"a",
"finish",
"action",
"on",
"this",
"question",
"attempt",
".",
"This",
"corresponds",
"to",
"an",
"external",
"finish",
"action",
"for",
"example",
"the",
"user",
"pressing",
"Submit",
"all",
"and",
"finish",
"in",
"the",
"quiz",
"rather",
"th... | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/engine/questionattempt.php#L1335-L1338 |
216,250 | moodle/moodle | question/engine/questionattempt.php | question_attempt.manual_grade | public function manual_grade($comment, $mark, $commentformat = null, $timestamp = null, $userid = null) {
$submitteddata = array('-comment' => $comment);
if (is_null($commentformat)) {
debugging('You should pass $commentformat to manual_grade.', DEBUG_DEVELOPER);
$commentformat =... | php | public function manual_grade($comment, $mark, $commentformat = null, $timestamp = null, $userid = null) {
$submitteddata = array('-comment' => $comment);
if (is_null($commentformat)) {
debugging('You should pass $commentformat to manual_grade.', DEBUG_DEVELOPER);
$commentformat =... | [
"public",
"function",
"manual_grade",
"(",
"$",
"comment",
",",
"$",
"mark",
",",
"$",
"commentformat",
"=",
"null",
",",
"$",
"timestamp",
"=",
"null",
",",
"$",
"userid",
"=",
"null",
")",
"{",
"$",
"submitteddata",
"=",
"array",
"(",
"'-comment'",
"... | Perform a manual grading action on this attempt.
@param string $comment the comment being added.
@param float $mark the new mark. If null, then only a comment is added.
@param int $commentformat the FORMAT_... for $comment. Must be given.
@param int $timestamp the time to record for the action. (If not given, use now.)... | [
"Perform",
"a",
"manual",
"grading",
"action",
"on",
"this",
"attempt",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/engine/questionattempt.php#L1401-L1413 |
216,251 | moodle/moodle | question/engine/questionattempt.php | question_attempt.get_current_manual_comment | public function get_current_manual_comment() {
$comment = $this->get_submitted_var($this->get_behaviour_field_name('comment'), PARAM_RAW);
if (is_null($comment)) {
return $this->get_manual_comment();
} else {
$commentformat = $this->get_submitted_var(
... | php | public function get_current_manual_comment() {
$comment = $this->get_submitted_var($this->get_behaviour_field_name('comment'), PARAM_RAW);
if (is_null($comment)) {
return $this->get_manual_comment();
} else {
$commentformat = $this->get_submitted_var(
... | [
"public",
"function",
"get_current_manual_comment",
"(",
")",
"{",
"$",
"comment",
"=",
"$",
"this",
"->",
"get_submitted_var",
"(",
"$",
"this",
"->",
"get_behaviour_field_name",
"(",
"'comment'",
")",
",",
"PARAM_RAW",
")",
";",
"if",
"(",
"is_null",
"(",
... | This is used by the manual grading code, particularly in association with
validation. If there is a comment submitted in the request, then use that,
otherwise use the latest comment for this question.
@return array with three elements, comment, commentformat and mark. | [
"This",
"is",
"used",
"by",
"the",
"manual",
"grading",
"code",
"particularly",
"in",
"association",
"with",
"validation",
".",
"If",
"there",
"is",
"a",
"comment",
"submitted",
"in",
"the",
"request",
"then",
"use",
"that",
"otherwise",
"use",
"the",
"lates... | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/engine/questionattempt.php#L1447-L1459 |
216,252 | moodle/moodle | question/engine/questionattempt.php | question_attempt_steps_with_submitted_response_iterator.find_steps_with_submitted_response | protected function find_steps_with_submitted_response() {
$stepnos = array();
$lastsavedstep = null;
foreach ($this->qa->get_step_iterator() as $stepno => $step) {
if ($this->qa->get_behaviour()->step_has_a_submitted_response($step)) {
$stepnos[] = $stepno;
... | php | protected function find_steps_with_submitted_response() {
$stepnos = array();
$lastsavedstep = null;
foreach ($this->qa->get_step_iterator() as $stepno => $step) {
if ($this->qa->get_behaviour()->step_has_a_submitted_response($step)) {
$stepnos[] = $stepno;
... | [
"protected",
"function",
"find_steps_with_submitted_response",
"(",
")",
"{",
"$",
"stepnos",
"=",
"array",
"(",
")",
";",
"$",
"lastsavedstep",
"=",
"null",
";",
"foreach",
"(",
"$",
"this",
"->",
"qa",
"->",
"get_step_iterator",
"(",
")",
"as",
"$",
"ste... | Find the step nos in which a student has submitted a response. Including any step with a response that is saved before
the question attempt finishes.
Called from constructor, should not be called from elsewhere. | [
"Find",
"the",
"step",
"nos",
"in",
"which",
"a",
"student",
"has",
"submitted",
"a",
"response",
".",
"Including",
"any",
"step",
"with",
"a",
"response",
"that",
"is",
"saved",
"before",
"the",
"question",
"attempt",
"finishes",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/engine/questionattempt.php#L1792-L1816 |
216,253 | moodle/moodle | lib/phpexcel/PHPExcel/Chart.php | PHPExcel_Chart.setTopLeftPosition | public function setTopLeftPosition($cell, $xOffset = null, $yOffset = null)
{
$this->topLeftCellRef = $cell;
if (!is_null($xOffset)) {
$this->setTopLeftXOffset($xOffset);
}
if (!is_null($yOffset)) {
$this->setTopLeftYOffset($yOffset);
}
return... | php | public function setTopLeftPosition($cell, $xOffset = null, $yOffset = null)
{
$this->topLeftCellRef = $cell;
if (!is_null($xOffset)) {
$this->setTopLeftXOffset($xOffset);
}
if (!is_null($yOffset)) {
$this->setTopLeftYOffset($yOffset);
}
return... | [
"public",
"function",
"setTopLeftPosition",
"(",
"$",
"cell",
",",
"$",
"xOffset",
"=",
"null",
",",
"$",
"yOffset",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"topLeftCellRef",
"=",
"$",
"cell",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"xOffset",
")... | Set the Top Left position for the chart
@param string $cell
@param integer $xOffset
@param integer $yOffset
@return PHPExcel_Chart | [
"Set",
"the",
"Top",
"Left",
"position",
"for",
"the",
"chart"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/phpexcel/PHPExcel/Chart.php#L434-L445 |
216,254 | moodle/moodle | lib/phpexcel/PHPExcel/Chart.php | PHPExcel_Chart.setTopLeftOffset | public function setTopLeftOffset($xOffset = null, $yOffset = null)
{
if (!is_null($xOffset)) {
$this->setTopLeftXOffset($xOffset);
}
if (!is_null($yOffset)) {
$this->setTopLeftYOffset($yOffset);
}
return $this;
} | php | public function setTopLeftOffset($xOffset = null, $yOffset = null)
{
if (!is_null($xOffset)) {
$this->setTopLeftXOffset($xOffset);
}
if (!is_null($yOffset)) {
$this->setTopLeftYOffset($yOffset);
}
return $this;
} | [
"public",
"function",
"setTopLeftOffset",
"(",
"$",
"xOffset",
"=",
"null",
",",
"$",
"yOffset",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"xOffset",
")",
")",
"{",
"$",
"this",
"->",
"setTopLeftXOffset",
"(",
"$",
"xOffset",
")",
"... | Set the offset position within the Top Left cell for the chart
@param integer $xOffset
@param integer $yOffset
@return PHPExcel_Chart | [
"Set",
"the",
"offset",
"position",
"within",
"the",
"Top",
"Left",
"cell",
"for",
"the",
"chart"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/phpexcel/PHPExcel/Chart.php#L491-L501 |
216,255 | moodle/moodle | lib/phpexcel/PHPExcel/Chart.php | PHPExcel_Chart.setBottomRightOffset | public function setBottomRightOffset($xOffset = null, $yOffset = null)
{
if (!is_null($xOffset)) {
$this->setBottomRightXOffset($xOffset);
}
if (!is_null($yOffset)) {
$this->setBottomRightYOffset($yOffset);
}
return $this;
} | php | public function setBottomRightOffset($xOffset = null, $yOffset = null)
{
if (!is_null($xOffset)) {
$this->setBottomRightXOffset($xOffset);
}
if (!is_null($yOffset)) {
$this->setBottomRightYOffset($yOffset);
}
return $this;
} | [
"public",
"function",
"setBottomRightOffset",
"(",
"$",
"xOffset",
"=",
"null",
",",
"$",
"yOffset",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"xOffset",
")",
")",
"{",
"$",
"this",
"->",
"setBottomRightXOffset",
"(",
"$",
"xOffset",
... | Set the offset position within the Bottom Right cell for the chart
@param integer $xOffset
@param integer $yOffset
@return PHPExcel_Chart | [
"Set",
"the",
"offset",
"position",
"within",
"the",
"Bottom",
"Right",
"cell",
"for",
"the",
"chart"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/phpexcel/PHPExcel/Chart.php#L599-L609 |
216,256 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Mailbox/List.php | Horde_Imap_Client_Mailbox_List.sort | public function sort(array $opts = array())
{
$this->_delimiter = isset($opts['delimiter'])
? $opts['delimiter']
: '.';
$this->_sortinbox = (!isset($opts['inbox']) || !empty($opts['inbox']));
if (empty($opts['noupdate'])) {
$mboxes = &$this->_mboxes;
... | php | public function sort(array $opts = array())
{
$this->_delimiter = isset($opts['delimiter'])
? $opts['delimiter']
: '.';
$this->_sortinbox = (!isset($opts['inbox']) || !empty($opts['inbox']));
if (empty($opts['noupdate'])) {
$mboxes = &$this->_mboxes;
... | [
"public",
"function",
"sort",
"(",
"array",
"$",
"opts",
"=",
"array",
"(",
")",
")",
"{",
"$",
"this",
"->",
"_delimiter",
"=",
"isset",
"(",
"$",
"opts",
"[",
"'delimiter'",
"]",
")",
"?",
"$",
"opts",
"[",
"'delimiter'",
"]",
":",
"'.'",
";",
... | Sort the list of mailboxes.
@param array $opts Options:
- delimiter: (string) The delimiter to use.
DEFAULT: '.'
- inbox: (boolean) Always put INBOX at the head of the list?
DEFAULT: Yes
- noupdate: (boolean) Do not update the object's mailbox list?
DEFAULT: true
@return array List of sorted mailboxes (index associ... | [
"Sort",
"the",
"list",
"of",
"mailboxes",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Mailbox/List.php#L71-L87 |
216,257 | moodle/moodle | mod/quiz/classes/privacy/helper.php | helper.get_quiz_attempt_subcontext | public static function get_quiz_attempt_subcontext(\stdClass $attempt, \stdClass $user) {
$subcontext = [
get_string('attempts', 'mod_quiz'),
];
if ($attempt->userid != $user->id) {
$subcontext[] = fullname($user);
}
$subcontext[] = $attempt->attempt;
... | php | public static function get_quiz_attempt_subcontext(\stdClass $attempt, \stdClass $user) {
$subcontext = [
get_string('attempts', 'mod_quiz'),
];
if ($attempt->userid != $user->id) {
$subcontext[] = fullname($user);
}
$subcontext[] = $attempt->attempt;
... | [
"public",
"static",
"function",
"get_quiz_attempt_subcontext",
"(",
"\\",
"stdClass",
"$",
"attempt",
",",
"\\",
"stdClass",
"$",
"user",
")",
"{",
"$",
"subcontext",
"=",
"[",
"get_string",
"(",
"'attempts'",
",",
"'mod_quiz'",
")",
",",
"]",
";",
"if",
"... | Determine the subcontext for the specified quiz attempt.
@param \stdClass $attempt The attempt data retrieved from the database.
@param \stdClass $user The user record.
@return \array The calculated subcontext. | [
"Determine",
"the",
"subcontext",
"for",
"the",
"specified",
"quiz",
"attempt",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/classes/privacy/helper.php#L54-L64 |
216,258 | moodle/moodle | question/type/multichoice/questiontype.php | qtype_multichoice.create_default_options | protected function create_default_options($question) {
// Create a default question options record.
$options = new stdClass();
$options->questionid = $question->id;
// Get the default strings and just set the format.
$options->correctfeedback = get_string('correctfeedbackdefault... | php | protected function create_default_options($question) {
// Create a default question options record.
$options = new stdClass();
$options->questionid = $question->id;
// Get the default strings and just set the format.
$options->correctfeedback = get_string('correctfeedbackdefault... | [
"protected",
"function",
"create_default_options",
"(",
"$",
"question",
")",
"{",
"// Create a default question options record.",
"$",
"options",
"=",
"new",
"stdClass",
"(",
")",
";",
"$",
"options",
"->",
"questionid",
"=",
"$",
"question",
"->",
"id",
";",
"... | Create a default options object for the provided question.
@param object $question The queston we are working with.
@return object The options object. | [
"Create",
"a",
"default",
"options",
"object",
"for",
"the",
"provided",
"question",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/type/multichoice/questiontype.php#L62-L85 |
216,259 | moodle/moodle | analytics/classes/local/indicator/linear.php | linear.to_features | protected function to_features($calculatedvalues) {
// Null mean if all calculated values are null.
$nullmean = true;
foreach ($calculatedvalues as $value) {
if (!is_null($value)) {
// Early break, we don't want to spend a lot of time here.
$nullmean ... | php | protected function to_features($calculatedvalues) {
// Null mean if all calculated values are null.
$nullmean = true;
foreach ($calculatedvalues as $value) {
if (!is_null($value)) {
// Early break, we don't want to spend a lot of time here.
$nullmean ... | [
"protected",
"function",
"to_features",
"(",
"$",
"calculatedvalues",
")",
"{",
"// Null mean if all calculated values are null.",
"$",
"nullmean",
"=",
"true",
";",
"foreach",
"(",
"$",
"calculatedvalues",
"as",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"is_null",
... | Converts the calculated values to a list of features for the dataset.
@param array $calculatedvalues
@return array | [
"Converts",
"the",
"calculated",
"values",
"to",
"a",
"list",
"of",
"features",
"for",
"the",
"dataset",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/analytics/classes/local/indicator/linear.php#L112-L146 |
216,260 | moodle/moodle | lib/filterlib.php | filter_manager.instance | public static function instance() {
global $CFG;
if (is_null(self::$singletoninstance)) {
if (!empty($CFG->perfdebug) and $CFG->perfdebug > 7) {
self::$singletoninstance = new performance_measuring_filter_manager();
} else {
self::$singletoninstanc... | php | public static function instance() {
global $CFG;
if (is_null(self::$singletoninstance)) {
if (!empty($CFG->perfdebug) and $CFG->perfdebug > 7) {
self::$singletoninstance = new performance_measuring_filter_manager();
} else {
self::$singletoninstanc... | [
"public",
"static",
"function",
"instance",
"(",
")",
"{",
"global",
"$",
"CFG",
";",
"if",
"(",
"is_null",
"(",
"self",
"::",
"$",
"singletoninstance",
")",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"CFG",
"->",
"perfdebug",
")",
"and",
"$",
"C... | Factory method. Use this to get the filter manager.
@return filter_manager the singleton instance. | [
"Factory",
"method",
".",
"Use",
"this",
"to",
"get",
"the",
"filter",
"manager",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/filterlib.php#L85-L95 |
216,261 | moodle/moodle | lib/filterlib.php | filter_manager.load_filters | protected function load_filters($context) {
$filters = filter_get_active_in_context($context);
$this->textfilters[$context->id] = array();
$this->stringfilters[$context->id] = array();
foreach ($filters as $filtername => $localconfig) {
$filter = $this->make_filter_object($fi... | php | protected function load_filters($context) {
$filters = filter_get_active_in_context($context);
$this->textfilters[$context->id] = array();
$this->stringfilters[$context->id] = array();
foreach ($filters as $filtername => $localconfig) {
$filter = $this->make_filter_object($fi... | [
"protected",
"function",
"load_filters",
"(",
"$",
"context",
")",
"{",
"$",
"filters",
"=",
"filter_get_active_in_context",
"(",
"$",
"context",
")",
";",
"$",
"this",
"->",
"textfilters",
"[",
"$",
"context",
"->",
"id",
"]",
"=",
"array",
"(",
")",
";... | Load all the filters required by this context.
@param context $context the context. | [
"Load",
"all",
"the",
"filters",
"required",
"by",
"this",
"context",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/filterlib.php#L121-L135 |
216,262 | moodle/moodle | lib/filterlib.php | filter_manager.make_filter_object | protected function make_filter_object($filtername, $context, $localconfig) {
global $CFG;
$path = $CFG->dirroot .'/filter/'. $filtername .'/filter.php';
if (!is_readable($path)) {
return null;
}
include_once($path);
$filterclassname = 'filter_' . $filtername;... | php | protected function make_filter_object($filtername, $context, $localconfig) {
global $CFG;
$path = $CFG->dirroot .'/filter/'. $filtername .'/filter.php';
if (!is_readable($path)) {
return null;
}
include_once($path);
$filterclassname = 'filter_' . $filtername;... | [
"protected",
"function",
"make_filter_object",
"(",
"$",
"filtername",
",",
"$",
"context",
",",
"$",
"localconfig",
")",
"{",
"global",
"$",
"CFG",
";",
"$",
"path",
"=",
"$",
"CFG",
"->",
"dirroot",
".",
"'/filter/'",
".",
"$",
"filtername",
".",
"'/fi... | Factory method for creating a filter.
@param string $filtername The filter name, for example 'tex'.
@param context $context context object.
@param array $localconfig array of local configuration variables for this filter.
@return moodle_text_filter The filter, or null, if this type of filter is
not recognised or could... | [
"Factory",
"method",
"for",
"creating",
"a",
"filter",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/filterlib.php#L146-L160 |
216,263 | moodle/moodle | lib/filterlib.php | filter_manager.apply_filter_chain | protected function apply_filter_chain($text, $filterchain, array $options = array(),
array $skipfilters = null) {
foreach ($filterchain as $filtername => $filter) {
if ($skipfilters !== null && in_array($filtername, $skipfilters)) {
continue;
}
$te... | php | protected function apply_filter_chain($text, $filterchain, array $options = array(),
array $skipfilters = null) {
foreach ($filterchain as $filtername => $filter) {
if ($skipfilters !== null && in_array($filtername, $skipfilters)) {
continue;
}
$te... | [
"protected",
"function",
"apply_filter_chain",
"(",
"$",
"text",
",",
"$",
"filterchain",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
",",
"array",
"$",
"skipfilters",
"=",
"null",
")",
"{",
"foreach",
"(",
"$",
"filterchain",
"as",
"$",
"filte... | Apply a list of filters to some content.
@param string $text
@param moodle_text_filter[] $filterchain array filter name => filter object.
@param array $options options passed to the filters.
@param array $skipfilters of filter names. Any filters that should not be applied to this text.
@return string $text | [
"Apply",
"a",
"list",
"of",
"filters",
"to",
"some",
"content",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/filterlib.php#L170-L179 |
216,264 | moodle/moodle | lib/filterlib.php | filter_manager.get_text_filters | protected function get_text_filters($context) {
if (!isset($this->textfilters[$context->id])) {
$this->load_filters($context);
}
return $this->textfilters[$context->id];
} | php | protected function get_text_filters($context) {
if (!isset($this->textfilters[$context->id])) {
$this->load_filters($context);
}
return $this->textfilters[$context->id];
} | [
"protected",
"function",
"get_text_filters",
"(",
"$",
"context",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"textfilters",
"[",
"$",
"context",
"->",
"id",
"]",
")",
")",
"{",
"$",
"this",
"->",
"load_filters",
"(",
"$",
"context",
"... | Get all the filters that apply to a given context for calls to format_text.
@param context $context
@return moodle_text_filter[] A text filter | [
"Get",
"all",
"the",
"filters",
"that",
"apply",
"to",
"a",
"given",
"context",
"for",
"calls",
"to",
"format_text",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/filterlib.php#L187-L192 |
216,265 | moodle/moodle | lib/filterlib.php | filter_manager.get_string_filters | protected function get_string_filters($context) {
if (!isset($this->stringfilters[$context->id])) {
$this->load_filters($context);
}
return $this->stringfilters[$context->id];
} | php | protected function get_string_filters($context) {
if (!isset($this->stringfilters[$context->id])) {
$this->load_filters($context);
}
return $this->stringfilters[$context->id];
} | [
"protected",
"function",
"get_string_filters",
"(",
"$",
"context",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"stringfilters",
"[",
"$",
"context",
"->",
"id",
"]",
")",
")",
"{",
"$",
"this",
"->",
"load_filters",
"(",
"$",
"context",... | Get all the filters that apply to a given context for calls to format_string.
@param context $context the context.
@return moodle_text_filter[] A text filter | [
"Get",
"all",
"the",
"filters",
"that",
"apply",
"to",
"a",
"given",
"context",
"for",
"calls",
"to",
"format_string",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/filterlib.php#L200-L205 |
216,266 | moodle/moodle | lib/filterlib.php | filter_manager.filter_text | public function filter_text($text, $context, array $options = array(),
array $skipfilters = null) {
$text = $this->apply_filter_chain($text, $this->get_text_filters($context), $options, $skipfilters);
// Remove <nolink> tags for XHTML compatibility.
$text = str_replace(array('<nolink... | php | public function filter_text($text, $context, array $options = array(),
array $skipfilters = null) {
$text = $this->apply_filter_chain($text, $this->get_text_filters($context), $options, $skipfilters);
// Remove <nolink> tags for XHTML compatibility.
$text = str_replace(array('<nolink... | [
"public",
"function",
"filter_text",
"(",
"$",
"text",
",",
"$",
"context",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
",",
"array",
"$",
"skipfilters",
"=",
"null",
")",
"{",
"$",
"text",
"=",
"$",
"this",
"->",
"apply_filter_chain",
"(",
... | Filter some text
@param string $text The text to filter
@param context $context the context.
@param array $options options passed to the filters
@param array $skipfilters of filter names. Any filters that should not be applied to this text.
@return string resulting text | [
"Filter",
"some",
"text"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/filterlib.php#L216-L222 |
216,267 | moodle/moodle | lib/filterlib.php | filter_manager.setup_page_for_filters | public function setup_page_for_filters($page, $context) {
$filters = $this->get_text_filters($context);
foreach ($filters as $filter) {
$filter->setup($page, $context);
}
} | php | public function setup_page_for_filters($page, $context) {
$filters = $this->get_text_filters($context);
foreach ($filters as $filter) {
$filter->setup($page, $context);
}
} | [
"public",
"function",
"setup_page_for_filters",
"(",
"$",
"page",
",",
"$",
"context",
")",
"{",
"$",
"filters",
"=",
"$",
"this",
"->",
"get_text_filters",
"(",
"$",
"context",
")",
";",
"foreach",
"(",
"$",
"filters",
"as",
"$",
"filter",
")",
"{",
"... | Setup page with filters requirements and other prepare stuff.
This method is used by {@see format_text()} and {@see format_string()}
in order to allow filters to setup any page requirement (js, css...)
or perform any action needed to get them prepared before filtering itself
happens by calling to each every active set... | [
"Setup",
"page",
"with",
"filters",
"requirements",
"and",
"other",
"prepare",
"stuff",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/filterlib.php#L258-L263 |
216,268 | moodle/moodle | lib/filterlib.php | filter_manager.setup_page_for_globally_available_filters | public function setup_page_for_globally_available_filters($page) {
$context = context_system::instance();
$filterdata = filter_get_globally_enabled_filters_with_config();
foreach ($filterdata as $name => $config) {
if (isset($this->textfilters[$context->id][$name])) {
... | php | public function setup_page_for_globally_available_filters($page) {
$context = context_system::instance();
$filterdata = filter_get_globally_enabled_filters_with_config();
foreach ($filterdata as $name => $config) {
if (isset($this->textfilters[$context->id][$name])) {
... | [
"public",
"function",
"setup_page_for_globally_available_filters",
"(",
"$",
"page",
")",
"{",
"$",
"context",
"=",
"context_system",
"::",
"instance",
"(",
")",
";",
"$",
"filterdata",
"=",
"filter_get_globally_enabled_filters_with_config",
"(",
")",
";",
"foreach",
... | Setup the page for globally available filters.
This helps setting up the page for filters which may be applied to
the page, even if they do not belong to the current context, or are
not yet visible because the content is lazily added (ajax). This method
always uses to the system context which determines the globally
a... | [
"Setup",
"the",
"page",
"for",
"globally",
"available",
"filters",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/filterlib.php#L279-L293 |
216,269 | moodle/moodle | auth/cas/CAS/CAS/Request/CurlRequest.php | CAS_Request_CurlRequest.sendRequest | protected function sendRequest ()
{
phpCAS::traceBegin();
/*********************************************************
* initialize the CURL session
*********************************************************/
$ch = $this->initAndConfigure();
/*************************... | php | protected function sendRequest ()
{
phpCAS::traceBegin();
/*********************************************************
* initialize the CURL session
*********************************************************/
$ch = $this->initAndConfigure();
/*************************... | [
"protected",
"function",
"sendRequest",
"(",
")",
"{",
"phpCAS",
"::",
"traceBegin",
"(",
")",
";",
"/*********************************************************\n * initialize the CURL session\n *********************************************************/",
"$",
"ch",
"=",
... | Send the request and store the results.
@return bool true on success, false on failure. | [
"Send",
"the",
"request",
"and",
"store",
"the",
"results",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/auth/cas/CAS/CAS/Request/CurlRequest.php#L63-L93 |
216,270 | moodle/moodle | auth/cas/CAS/CAS/Request/CurlRequest.php | CAS_Request_CurlRequest.initAndConfigure | public function initAndConfigure()
{
/*********************************************************
* initialize the CURL session
*********************************************************/
$ch = curl_init($this->url);
if (version_compare(PHP_VERSION, '5.1.3', '>=')) {
... | php | public function initAndConfigure()
{
/*********************************************************
* initialize the CURL session
*********************************************************/
$ch = curl_init($this->url);
if (version_compare(PHP_VERSION, '5.1.3', '>=')) {
... | [
"public",
"function",
"initAndConfigure",
"(",
")",
"{",
"/*********************************************************\n * initialize the CURL session\n *********************************************************/",
"$",
"ch",
"=",
"curl_init",
"(",
"$",
"this",
"->",
"url",... | Internal method to initialize our cURL handle and configure the request.
This method should NOT be used outside of the CurlRequest or the
CurlMultiRequest.
@return resource The cURL handle on success, false on failure | [
"Internal",
"method",
"to",
"initialize",
"our",
"cURL",
"handle",
"and",
"configure",
"the",
"request",
".",
"This",
"method",
"should",
"NOT",
"be",
"used",
"outside",
"of",
"the",
"CurlRequest",
"or",
"the",
"CurlMultiRequest",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/auth/cas/CAS/CAS/Request/CurlRequest.php#L102-L171 |
216,271 | moodle/moodle | mod/quiz/report/statistics/report.php | quiz_statistics_report.output_individual_question_data | protected function output_individual_question_data($quiz, $questionstat) {
global $OUTPUT;
// On-screen display. Show a summary of the question's place in the quiz,
// and the question statistics.
$datumfromtable = $this->table->format_row($questionstat);
// Set up the question... | php | protected function output_individual_question_data($quiz, $questionstat) {
global $OUTPUT;
// On-screen display. Show a summary of the question's place in the quiz,
// and the question statistics.
$datumfromtable = $this->table->format_row($questionstat);
// Set up the question... | [
"protected",
"function",
"output_individual_question_data",
"(",
"$",
"quiz",
",",
"$",
"questionstat",
")",
"{",
"global",
"$",
"OUTPUT",
";",
"// On-screen display. Show a summary of the question's place in the quiz,",
"// and the question statistics.",
"$",
"datumfromtable",
... | Display the statistical and introductory information about a question.
Only called when not downloading.
@param object $quiz the quiz settings.
@param \core_question\statistics\questions\calculated $questionstat the question to report on. | [
"Display",
"the",
"statistical",
"and",
"introductory",
"information",
"about",
"a",
"question",
".",
"Only",
"called",
"when",
"not",
"downloading",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/report/statistics/report.php#L285-L346 |
216,272 | moodle/moodle | mod/quiz/report/statistics/report.php | quiz_statistics_report.render_question_text | protected function render_question_text($question) {
global $OUTPUT;
$text = question_rewrite_question_preview_urls($question->questiontext, $question->id,
$question->contextid, 'question', 'questiontext', $question->id,
$this->context->id, 'quiz_statistics');
r... | php | protected function render_question_text($question) {
global $OUTPUT;
$text = question_rewrite_question_preview_urls($question->questiontext, $question->id,
$question->contextid, 'question', 'questiontext', $question->id,
$this->context->id, 'quiz_statistics');
r... | [
"protected",
"function",
"render_question_text",
"(",
"$",
"question",
")",
"{",
"global",
"$",
"OUTPUT",
";",
"$",
"text",
"=",
"question_rewrite_question_preview_urls",
"(",
"$",
"question",
"->",
"questiontext",
",",
"$",
"question",
"->",
"id",
",",
"$",
"... | Output question text in a box with urls appropriate for a preview of the question.
@param object $question question data.
@return string HTML of question text, ready for display. | [
"Output",
"question",
"text",
"in",
"a",
"box",
"with",
"urls",
"appropriate",
"for",
"a",
"preview",
"of",
"the",
"question",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/report/statistics/report.php#L354-L364 |
216,273 | moodle/moodle | mod/quiz/report/statistics/report.php | quiz_statistics_report.output_individual_question_response_analysis | protected function output_individual_question_response_analysis($question, $variantno, $s, $reporturl, $qubaids,
$whichtries = question_attempt::LAST_TRY) {
global $OUTPUT;
if (!question_bank::get_qtype($question->qtype, false)->can_an... | php | protected function output_individual_question_response_analysis($question, $variantno, $s, $reporturl, $qubaids,
$whichtries = question_attempt::LAST_TRY) {
global $OUTPUT;
if (!question_bank::get_qtype($question->qtype, false)->can_an... | [
"protected",
"function",
"output_individual_question_response_analysis",
"(",
"$",
"question",
",",
"$",
"variantno",
",",
"$",
"s",
",",
"$",
"reporturl",
",",
"$",
"qubaids",
",",
"$",
"whichtries",
"=",
"question_attempt",
"::",
"LAST_TRY",
")",
"{",
"global"... | Display the response analysis for a question.
@param object $question the question to report on.
@param int|null $variantno the variant
@param int $s
@param moodle_url $reporturl the URL to redisplay this report.
@param qubaid_condition $qubaids
@param string $whichtries | [
"Display",
"the",
"response",
"analysis",
"for",
"a",
"question",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/report/statistics/report.php#L376-L442 |
216,274 | moodle/moodle | mod/quiz/report/statistics/report.php | quiz_statistics_report.output_quiz_structure_analysis_table | protected function output_quiz_structure_analysis_table($questionstats) {
$limitvariants = !$this->table->is_downloading();
foreach ($questionstats->get_all_slots() as $slot) {
// Output the data for these question statistics.
$structureanalysis = $questionstats->structure_analys... | php | protected function output_quiz_structure_analysis_table($questionstats) {
$limitvariants = !$this->table->is_downloading();
foreach ($questionstats->get_all_slots() as $slot) {
// Output the data for these question statistics.
$structureanalysis = $questionstats->structure_analys... | [
"protected",
"function",
"output_quiz_structure_analysis_table",
"(",
"$",
"questionstats",
")",
"{",
"$",
"limitvariants",
"=",
"!",
"$",
"this",
"->",
"table",
"->",
"is_downloading",
"(",
")",
";",
"foreach",
"(",
"$",
"questionstats",
"->",
"get_all_slots",
... | Output the table that lists all the questions in the quiz with their statistics.
@param \core_question\statistics\questions\all_calculated_for_qubaid_condition $questionstats the stats for all questions in
the quiz including subqs and
variants. | [
"Output",
"the",
"table",
"that",
"lists",
"all",
"the",
"questions",
"in",
"the",
"quiz",
"with",
"their",
"statistics",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/report/statistics/report.php#L451-L478 |
216,275 | moodle/moodle | mod/quiz/report/statistics/report.php | quiz_statistics_report.output_quiz_info_table | protected function output_quiz_info_table($quizinfo) {
$quizinfotable = new html_table();
$quizinfotable->align = array('center', 'center');
$quizinfotable->width = '60%';
$quizinfotable->attributes['class'] = 'generaltable titlesleft';
$quizinfotable->data = array();
f... | php | protected function output_quiz_info_table($quizinfo) {
$quizinfotable = new html_table();
$quizinfotable->align = array('center', 'center');
$quizinfotable->width = '60%';
$quizinfotable->attributes['class'] = 'generaltable titlesleft';
$quizinfotable->data = array();
f... | [
"protected",
"function",
"output_quiz_info_table",
"(",
"$",
"quizinfo",
")",
"{",
"$",
"quizinfotable",
"=",
"new",
"html_table",
"(",
")",
";",
"$",
"quizinfotable",
"->",
"align",
"=",
"array",
"(",
"'center'",
",",
"'center'",
")",
";",
"$",
"quizinfotab... | Return HTML for table of overall quiz statistics.
@param array $quizinfo as returned by {@link get_formatted_quiz_info_data()}.
@return string the HTML. | [
"Return",
"HTML",
"for",
"table",
"of",
"overall",
"quiz",
"statistics",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/report/statistics/report.php#L486-L499 |
216,276 | moodle/moodle | mod/quiz/report/statistics/report.php | quiz_statistics_report.download_quiz_info_table | protected function download_quiz_info_table($quizinfo) {
global $OUTPUT;
// HTML download is a special case.
if ($this->table->is_downloading() == 'html') {
echo $OUTPUT->heading(get_string('quizinformation', 'quiz_statistics'), 3);
echo $this->output_quiz_info_table($qu... | php | protected function download_quiz_info_table($quizinfo) {
global $OUTPUT;
// HTML download is a special case.
if ($this->table->is_downloading() == 'html') {
echo $OUTPUT->heading(get_string('quizinformation', 'quiz_statistics'), 3);
echo $this->output_quiz_info_table($qu... | [
"protected",
"function",
"download_quiz_info_table",
"(",
"$",
"quizinfo",
")",
"{",
"global",
"$",
"OUTPUT",
";",
"// HTML download is a special case.",
"if",
"(",
"$",
"this",
"->",
"table",
"->",
"is_downloading",
"(",
")",
"==",
"'html'",
")",
"{",
"echo",
... | Download the table of overall quiz statistics.
@param array $quizinfo as returned by {@link get_formatted_quiz_info_data()}. | [
"Download",
"the",
"table",
"of",
"overall",
"quiz",
"statistics",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/report/statistics/report.php#L506-L530 |
216,277 | moodle/moodle | mod/quiz/report/statistics/report.php | quiz_statistics_report.output_statistics_graph | protected function output_statistics_graph($quizorid, $qubaids) {
global $DB, $PAGE;
$quiz = $quizorid;
if (!is_object($quiz)) {
$quiz = $DB->get_record('quiz', array('id' => $quizorid), '*', MUST_EXIST);
}
// Load the rest of the required data.
$questions =... | php | protected function output_statistics_graph($quizorid, $qubaids) {
global $DB, $PAGE;
$quiz = $quizorid;
if (!is_object($quiz)) {
$quiz = $DB->get_record('quiz', array('id' => $quizorid), '*', MUST_EXIST);
}
// Load the rest of the required data.
$questions =... | [
"protected",
"function",
"output_statistics_graph",
"(",
"$",
"quizorid",
",",
"$",
"qubaids",
")",
"{",
"global",
"$",
"DB",
",",
"$",
"PAGE",
";",
"$",
"quiz",
"=",
"$",
"quizorid",
";",
"if",
"(",
"!",
"is_object",
"(",
"$",
"quiz",
")",
")",
"{",... | Output the HTML needed to show the statistics graph.
@param int|object $quizorid The quiz, or its ID.
@param qubaid_condition $qubaids the question usages whose responses to analyse.
@param string $whichattempts Which attempts constant. | [
"Output",
"the",
"HTML",
"needed",
"to",
"show",
"the",
"statistics",
"graph",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/report/statistics/report.php#L539-L609 |
216,278 | moodle/moodle | mod/quiz/report/statistics/report.php | quiz_statistics_report.get_all_stats_and_analysis | public function get_all_stats_and_analysis(
$quiz, $whichattempts, $whichtries, \core\dml\sql_join $groupstudentsjoins, $questions, $progress = null) {
if ($progress === null) {
$progress = new \core\progress\none();
}
$qubaids = quiz_statistics_qubaids_condition($quiz-... | php | public function get_all_stats_and_analysis(
$quiz, $whichattempts, $whichtries, \core\dml\sql_join $groupstudentsjoins, $questions, $progress = null) {
if ($progress === null) {
$progress = new \core\progress\none();
}
$qubaids = quiz_statistics_qubaids_condition($quiz-... | [
"public",
"function",
"get_all_stats_and_analysis",
"(",
"$",
"quiz",
",",
"$",
"whichattempts",
",",
"$",
"whichtries",
",",
"\\",
"core",
"\\",
"dml",
"\\",
"sql_join",
"$",
"groupstudentsjoins",
",",
"$",
"questions",
",",
"$",
"progress",
"=",
"null",
")... | Get the quiz and question statistics, either by loading the cached results,
or by recomputing them.
@param object $quiz the quiz settings.
@param string $whichattempts which attempts to use, represented internally as one of the constants as used in
$quiz->grademethod ie.
QUIZ_GRADEAVERAGE, QUIZ_GRAD... | [
"Get",
"the",
"quiz",
"and",
"question",
"statistics",
"either",
"by",
"loading",
"the",
"cached",
"results",
"or",
"by",
"recomputing",
"them",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/report/statistics/report.php#L628-L670 |
216,279 | moodle/moodle | mod/quiz/report/statistics/report.php | quiz_statistics_report.get_progress_trace_instance | protected function get_progress_trace_instance() {
if ($this->progress === null) {
if (!$this->table->is_downloading()) {
$this->progress = new \core\progress\display_if_slow(get_string('calculatingallstats', 'quiz_statistics'));
$this->progress->set_display_names();
... | php | protected function get_progress_trace_instance() {
if ($this->progress === null) {
if (!$this->table->is_downloading()) {
$this->progress = new \core\progress\display_if_slow(get_string('calculatingallstats', 'quiz_statistics'));
$this->progress->set_display_names();
... | [
"protected",
"function",
"get_progress_trace_instance",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"progress",
"===",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"table",
"->",
"is_downloading",
"(",
")",
")",
"{",
"$",
"this",
"->",
"progre... | Appropriate instance depending if we want html output for the user or not.
@return \core\progress\base child of \core\progress\base to handle the display (or not) of task progress. | [
"Appropriate",
"instance",
"depending",
"if",
"we",
"want",
"html",
"output",
"for",
"the",
"user",
"or",
"not",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/report/statistics/report.php#L677-L687 |
216,280 | moodle/moodle | mod/quiz/report/statistics/report.php | quiz_statistics_report.analyse_responses_for_all_questions_and_subquestions | protected function analyse_responses_for_all_questions_and_subquestions($questions, $subquestions, $qubaids,
$whichtries, $progress = null) {
if ($progress === null) {
$progress = new \core\progress\none();
}
... | php | protected function analyse_responses_for_all_questions_and_subquestions($questions, $subquestions, $qubaids,
$whichtries, $progress = null) {
if ($progress === null) {
$progress = new \core\progress\none();
}
... | [
"protected",
"function",
"analyse_responses_for_all_questions_and_subquestions",
"(",
"$",
"questions",
",",
"$",
"subquestions",
",",
"$",
"qubaids",
",",
"$",
"whichtries",
",",
"$",
"progress",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"progress",
"===",
"null",... | Analyse responses for all questions and sub questions in this quiz.
@param object[] $questions as returned by self::load_and_initialise_questions_for_calculations
@param object[] $subquestions full question objects.
@param qubaid_condition $qubaids the question usages whose responses to analyse.
@param string $whichtr... | [
"Analyse",
"responses",
"for",
"all",
"questions",
"and",
"sub",
"questions",
"in",
"this",
"quiz",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/report/statistics/report.php#L698-L713 |
216,281 | moodle/moodle | mod/quiz/report/statistics/report.php | quiz_statistics_report.analyse_responses_for_questions | protected function analyse_responses_for_questions($questions, $qubaids, $whichtries, $progress = null, $done = array()) {
$countquestions = count($questions);
if (!$countquestions) {
return array();
}
if ($progress === null) {
$progress = new \core\progress\none(... | php | protected function analyse_responses_for_questions($questions, $qubaids, $whichtries, $progress = null, $done = array()) {
$countquestions = count($questions);
if (!$countquestions) {
return array();
}
if ($progress === null) {
$progress = new \core\progress\none(... | [
"protected",
"function",
"analyse_responses_for_questions",
"(",
"$",
"questions",
",",
"$",
"qubaids",
",",
"$",
"whichtries",
",",
"$",
"progress",
"=",
"null",
",",
"$",
"done",
"=",
"array",
"(",
")",
")",
"{",
"$",
"countquestions",
"=",
"count",
"(",... | Analyse responses for an array of questions or sub questions.
@param object[] $questions as returned by self::load_and_initialise_questions_for_calculations.
@param qubaid_condition $qubaids the question usages whose responses to analyse.
@param string $whichtries which tries to analyse \question_attempt::FIRST_TRY, ... | [
"Analyse",
"responses",
"for",
"an",
"array",
"of",
"questions",
"or",
"sub",
"questions",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/report/statistics/report.php#L725-L746 |
216,282 | moodle/moodle | mod/quiz/report/statistics/report.php | quiz_statistics_report.everything_download_options | protected function everything_download_options(moodle_url $reporturl) {
global $OUTPUT;
return $OUTPUT->download_dataformat_selector(get_string('downloadeverything', 'quiz_statistics'),
$reporturl->out_omit_querystring(), 'download', $reporturl->params() + array('everything' => 1));
} | php | protected function everything_download_options(moodle_url $reporturl) {
global $OUTPUT;
return $OUTPUT->download_dataformat_selector(get_string('downloadeverything', 'quiz_statistics'),
$reporturl->out_omit_querystring(), 'download', $reporturl->params() + array('everything' => 1));
} | [
"protected",
"function",
"everything_download_options",
"(",
"moodle_url",
"$",
"reporturl",
")",
"{",
"global",
"$",
"OUTPUT",
";",
"return",
"$",
"OUTPUT",
"->",
"download_dataformat_selector",
"(",
"get_string",
"(",
"'downloadeverything'",
",",
"'quiz_statistics'",
... | Return a little form for the user to request to download the full report, including quiz stats and response analysis for
all questions and sub-questions.
@param moodle_url $reporturl the base URL of the report.
@return string HTML. | [
"Return",
"a",
"little",
"form",
"for",
"the",
"user",
"to",
"request",
"to",
"download",
"the",
"full",
"report",
"including",
"quiz",
"stats",
"and",
"response",
"analysis",
"for",
"all",
"questions",
"and",
"sub",
"-",
"questions",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/report/statistics/report.php#L755-L759 |
216,283 | moodle/moodle | mod/quiz/report/statistics/report.php | quiz_statistics_report.output_caching_info | protected function output_caching_info($lastcachetime, $quizid, $groupstudentsjoins, $whichattempts, $reporturl) {
global $DB, $OUTPUT;
if (empty($lastcachetime)) {
return '';
}
// Find the number of attempts since the cached statistics were computed.
list($fromqa, ... | php | protected function output_caching_info($lastcachetime, $quizid, $groupstudentsjoins, $whichattempts, $reporturl) {
global $DB, $OUTPUT;
if (empty($lastcachetime)) {
return '';
}
// Find the number of attempts since the cached statistics were computed.
list($fromqa, ... | [
"protected",
"function",
"output_caching_info",
"(",
"$",
"lastcachetime",
",",
"$",
"quizid",
",",
"$",
"groupstudentsjoins",
",",
"$",
"whichattempts",
",",
"$",
"reporturl",
")",
"{",
"global",
"$",
"DB",
",",
"$",
"OUTPUT",
";",
"if",
"(",
"empty",
"("... | Return HTML for a message that says when the stats were last calculated and a 'recalculate now' button.
@param int $lastcachetime the time the stats were last cached.
@param int $quizid the quiz id.
@param array $groupstudentsjoins (joins, wheres, params) for students in the group or empty array if gro... | [
"Return",
"HTML",
"for",
"a",
"message",
"that",
"says",
"when",
"the",
"stats",
"were",
"last",
"calculated",
"and",
"a",
"recalculate",
"now",
"button",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/report/statistics/report.php#L774-L809 |
216,284 | moodle/moodle | mod/quiz/report/statistics/report.php | quiz_statistics_report.clear_cached_data | protected function clear_cached_data($qubaids) {
global $DB;
$DB->delete_records('quiz_statistics', array('hashcode' => $qubaids->get_hash_code()));
$DB->delete_records('question_statistics', array('hashcode' => $qubaids->get_hash_code()));
$DB->delete_records('question_response_analysis... | php | protected function clear_cached_data($qubaids) {
global $DB;
$DB->delete_records('quiz_statistics', array('hashcode' => $qubaids->get_hash_code()));
$DB->delete_records('question_statistics', array('hashcode' => $qubaids->get_hash_code()));
$DB->delete_records('question_response_analysis... | [
"protected",
"function",
"clear_cached_data",
"(",
"$",
"qubaids",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"DB",
"->",
"delete_records",
"(",
"'quiz_statistics'",
",",
"array",
"(",
"'hashcode'",
"=>",
"$",
"qubaids",
"->",
"get_hash_code",
"(",
")",
")",
... | Clear the cached data for a particular report configuration. This will trigger a re-computation the next time the report
is displayed.
@param $qubaids qubaid_condition | [
"Clear",
"the",
"cached",
"data",
"for",
"a",
"particular",
"report",
"configuration",
".",
"This",
"will",
"trigger",
"a",
"re",
"-",
"computation",
"the",
"next",
"time",
"the",
"report",
"is",
"displayed",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/report/statistics/report.php#L817-L822 |
216,285 | moodle/moodle | mod/quiz/report/statistics/report.php | quiz_statistics_report.load_and_initialise_questions_for_calculations | public function load_and_initialise_questions_for_calculations($quiz) {
// Load the questions.
$questions = quiz_report_get_significant_questions($quiz);
$questionids = array();
foreach ($questions as $question) {
$questionids[] = $question->id;
}
$fullquestio... | php | public function load_and_initialise_questions_for_calculations($quiz) {
// Load the questions.
$questions = quiz_report_get_significant_questions($quiz);
$questionids = array();
foreach ($questions as $question) {
$questionids[] = $question->id;
}
$fullquestio... | [
"public",
"function",
"load_and_initialise_questions_for_calculations",
"(",
"$",
"quiz",
")",
"{",
"// Load the questions.",
"$",
"questions",
"=",
"quiz_report_get_significant_questions",
"(",
"$",
"quiz",
")",
";",
"$",
"questionids",
"=",
"array",
"(",
")",
";",
... | Load the questions in this quiz and add some properties to the objects needed in the reports.
@param object $quiz the quiz.
@return array of questions for this quiz. | [
"Load",
"the",
"questions",
"in",
"this",
"quiz",
"and",
"add",
"some",
"properties",
"to",
"the",
"objects",
"needed",
"in",
"the",
"reports",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/report/statistics/report.php#L830-L846 |
216,286 | moodle/moodle | mod/quiz/report/statistics/report.php | quiz_statistics_report.output_all_question_response_analysis | protected function output_all_question_response_analysis($qubaids,
$questions,
$questionstats,
$reporturl,
... | php | protected function output_all_question_response_analysis($qubaids,
$questions,
$questionstats,
$reporturl,
... | [
"protected",
"function",
"output_all_question_response_analysis",
"(",
"$",
"qubaids",
",",
"$",
"questions",
",",
"$",
"questionstats",
",",
"$",
"reporturl",
",",
"$",
"whichtries",
"=",
"question_attempt",
"::",
"LAST_TRY",
")",
"{",
"foreach",
"(",
"$",
"que... | Output all response analysis for all questions, sub-questions and variants. For download in a number of formats.
@param $qubaids
@param $questions
@param $questionstats
@param $reporturl
@param $whichtries string | [
"Output",
"all",
"response",
"analysis",
"for",
"all",
"questions",
"sub",
"-",
"questions",
"and",
"variants",
".",
"For",
"download",
"in",
"a",
"number",
"of",
"formats",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/report/statistics/report.php#L857-L908 |
216,287 | moodle/moodle | mod/choice/classes/privacy/provider.php | provider.export_choice_data_for_user | protected static function export_choice_data_for_user(array $choicedata, \context_module $context, \stdClass $user) {
// Fetch the generic module data for the choice.
$contextdata = helper::get_context_data($context, $user);
// Merge with choice data and write it.
$contextdata = (object... | php | protected static function export_choice_data_for_user(array $choicedata, \context_module $context, \stdClass $user) {
// Fetch the generic module data for the choice.
$contextdata = helper::get_context_data($context, $user);
// Merge with choice data and write it.
$contextdata = (object... | [
"protected",
"static",
"function",
"export_choice_data_for_user",
"(",
"array",
"$",
"choicedata",
",",
"\\",
"context_module",
"$",
"context",
",",
"\\",
"stdClass",
"$",
"user",
")",
"{",
"// Fetch the generic module data for the choice.",
"$",
"contextdata",
"=",
"... | Export the supplied personal data for a single choice activity, along with any generic data or area files.
@param array $choicedata the personal data to export for the choice.
@param \context_module $context the context of the choice.
@param \stdClass $user the user record | [
"Export",
"the",
"supplied",
"personal",
"data",
"for",
"a",
"single",
"choice",
"activity",
"along",
"with",
"any",
"generic",
"data",
"or",
"area",
"files",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/choice/classes/privacy/provider.php#L200-L210 |
216,288 | moodle/moodle | lib/spout/src/Spout/Writer/XLSX/Internal/Workbook.php | Workbook.close | public function close($finalFilePointer)
{
/** @var Worksheet[] $worksheets */
$worksheets = $this->worksheets;
foreach ($worksheets as $worksheet) {
$worksheet->close();
}
$this->sharedStringsHelper->close();
// Finish creating all the necessary files ... | php | public function close($finalFilePointer)
{
/** @var Worksheet[] $worksheets */
$worksheets = $this->worksheets;
foreach ($worksheets as $worksheet) {
$worksheet->close();
}
$this->sharedStringsHelper->close();
// Finish creating all the necessary files ... | [
"public",
"function",
"close",
"(",
"$",
"finalFilePointer",
")",
"{",
"/** @var Worksheet[] $worksheets */",
"$",
"worksheets",
"=",
"$",
"this",
"->",
"worksheets",
";",
"foreach",
"(",
"$",
"worksheets",
"as",
"$",
"worksheet",
")",
"{",
"$",
"worksheet",
"... | Closes the workbook and all its associated sheets.
All the necessary files are written to disk and zipped together to create the XLSX file.
All the temporary files are then deleted.
@param resource $finalFilePointer Pointer to the XLSX that will be created
@return void | [
"Closes",
"the",
"workbook",
"and",
"all",
"its",
"associated",
"sheets",
".",
"All",
"the",
"necessary",
"files",
"are",
"written",
"to",
"disk",
"and",
"zipped",
"together",
"to",
"create",
"the",
"XLSX",
"file",
".",
"All",
"the",
"temporary",
"files",
... | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/spout/src/Spout/Writer/XLSX/Internal/Workbook.php#L103-L123 |
216,289 | moodle/moodle | admin/tool/dataprivacy/classes/external/purpose_exporter.php | purpose_exporter.get_other_values | protected function get_other_values(renderer_base $output) {
$values = [];
$formattedbases = [];
$lawfulbases = explode(',', $this->persistent->get('lawfulbases'));
if (!empty($lawfulbases)) {
foreach ($lawfulbases as $basis) {
if (empty(trim($basis))) {
... | php | protected function get_other_values(renderer_base $output) {
$values = [];
$formattedbases = [];
$lawfulbases = explode(',', $this->persistent->get('lawfulbases'));
if (!empty($lawfulbases)) {
foreach ($lawfulbases as $basis) {
if (empty(trim($basis))) {
... | [
"protected",
"function",
"get_other_values",
"(",
"renderer_base",
"$",
"output",
")",
"{",
"$",
"values",
"=",
"[",
"]",
";",
"$",
"formattedbases",
"=",
"[",
"]",
";",
"$",
"lawfulbases",
"=",
"explode",
"(",
"','",
",",
"$",
"this",
"->",
"persistent"... | Return other properties.
@param renderer_base $output
@return array
@throws coding_exception
@throws Exception | [
"Return",
"other",
"properties",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/dataprivacy/classes/external/purpose_exporter.php#L95-L139 |
216,290 | moodle/moodle | admin/tool/dataprivacy/classes/external/purpose_exporter.php | purpose_exporter.get_name | public static function get_name($purposeid) {
global $PAGE;
if ($purposeid === false || $purposeid == context_instance::INHERIT) {
return get_string('inherit', 'tool_dataprivacy');
} else if ($purposeid == context_instance::NOTSET) {
return get_string('notset', 'tool_data... | php | public static function get_name($purposeid) {
global $PAGE;
if ($purposeid === false || $purposeid == context_instance::INHERIT) {
return get_string('inherit', 'tool_dataprivacy');
} else if ($purposeid == context_instance::NOTSET) {
return get_string('notset', 'tool_data... | [
"public",
"static",
"function",
"get_name",
"(",
"$",
"purposeid",
")",
"{",
"global",
"$",
"PAGE",
";",
"if",
"(",
"$",
"purposeid",
"===",
"false",
"||",
"$",
"purposeid",
"==",
"context_instance",
"::",
"INHERIT",
")",
"{",
"return",
"get_string",
"(",
... | Utility function that fetches a purpose name from the given ID.
@param int $purposeid The purpose ID. Could be INHERIT (false, -1), NOT_SET (0), or the actual ID.
@return string The purpose name. | [
"Utility",
"function",
"that",
"fetches",
"a",
"purpose",
"name",
"from",
"the",
"given",
"ID",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/dataprivacy/classes/external/purpose_exporter.php#L147-L160 |
216,291 | moodle/moodle | admin/tool/installaddon/classes/installer.php | tool_installaddon_installer.get_addons_repository_url | public function get_addons_repository_url() {
global $CFG;
if (!empty($CFG->config_php_settings['alternativeaddonsrepositoryurl'])) {
$url = $CFG->config_php_settings['alternativeaddonsrepositoryurl'];
} else {
$url = 'https://moodle.org/plugins/get.php';
}
... | php | public function get_addons_repository_url() {
global $CFG;
if (!empty($CFG->config_php_settings['alternativeaddonsrepositoryurl'])) {
$url = $CFG->config_php_settings['alternativeaddonsrepositoryurl'];
} else {
$url = 'https://moodle.org/plugins/get.php';
}
... | [
"public",
"function",
"get_addons_repository_url",
"(",
")",
"{",
"global",
"$",
"CFG",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"CFG",
"->",
"config_php_settings",
"[",
"'alternativeaddonsrepositoryurl'",
"]",
")",
")",
"{",
"$",
"url",
"=",
"$",
"CFG",
"-... | Returns URL to the repository that addons can be searched in and installed from
@return moodle_url | [
"Returns",
"URL",
"to",
"the",
"repository",
"that",
"addons",
"can",
"be",
"searched",
"in",
"and",
"installed",
"from"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/installaddon/classes/installer.php#L64-L87 |
216,292 | moodle/moodle | admin/tool/installaddon/classes/installer.php | tool_installaddon_installer.get_plugin_types_menu | public function get_plugin_types_menu() {
global $CFG;
$pluginman = core_plugin_manager::instance();
$menu = array('' => get_string('choosedots'));
foreach (array_keys($pluginman->get_plugin_types()) as $plugintype) {
$menu[$plugintype] = $pluginman->plugintype_name($plugin... | php | public function get_plugin_types_menu() {
global $CFG;
$pluginman = core_plugin_manager::instance();
$menu = array('' => get_string('choosedots'));
foreach (array_keys($pluginman->get_plugin_types()) as $plugintype) {
$menu[$plugintype] = $pluginman->plugintype_name($plugin... | [
"public",
"function",
"get_plugin_types_menu",
"(",
")",
"{",
"global",
"$",
"CFG",
";",
"$",
"pluginman",
"=",
"core_plugin_manager",
"::",
"instance",
"(",
")",
";",
"$",
"menu",
"=",
"array",
"(",
"''",
"=>",
"get_string",
"(",
"'choosedots'",
")",
")",... | Returns localised list of available plugin types
@return array (string)plugintype => (string)plugin name | [
"Returns",
"localised",
"list",
"of",
"available",
"plugin",
"types"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/installaddon/classes/installer.php#L123-L134 |
216,293 | moodle/moodle | admin/tool/installaddon/classes/installer.php | tool_installaddon_installer.handle_remote_request | public function handle_remote_request(tool_installaddon_renderer $output, $request) {
if (is_null($request)) {
return;
}
$data = $this->decode_remote_request($request);
if ($data === false) {
echo $output->remote_request_invalid_page($this->index_url());
... | php | public function handle_remote_request(tool_installaddon_renderer $output, $request) {
if (is_null($request)) {
return;
}
$data = $this->decode_remote_request($request);
if ($data === false) {
echo $output->remote_request_invalid_page($this->index_url());
... | [
"public",
"function",
"handle_remote_request",
"(",
"tool_installaddon_renderer",
"$",
"output",
",",
"$",
"request",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"request",
")",
")",
"{",
"return",
";",
"}",
"$",
"data",
"=",
"$",
"this",
"->",
"decode_remot... | Hook method to handle the remote request to install an add-on
This is used as a callback when the admin picks a plugin version in the
Moodle Plugins directory and is redirected back to their site to install
it.
This hook is called early from admin/tool/installaddon/index.php page so that
it has opportunity to take ov... | [
"Hook",
"method",
"to",
"handle",
"the",
"remote",
"request",
"to",
"install",
"an",
"add",
"-",
"on"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/installaddon/classes/installer.php#L149-L191 |
216,294 | moodle/moodle | admin/tool/installaddon/classes/installer.php | tool_installaddon_installer.detect_plugin_component | public function detect_plugin_component($zipfilepath) {
$workdir = make_request_directory();
$versionphp = $this->extract_versionphp_file($zipfilepath, $workdir);
if (empty($versionphp)) {
return false;
}
return $this->detect_plugin_component_from_versionphp(file_g... | php | public function detect_plugin_component($zipfilepath) {
$workdir = make_request_directory();
$versionphp = $this->extract_versionphp_file($zipfilepath, $workdir);
if (empty($versionphp)) {
return false;
}
return $this->detect_plugin_component_from_versionphp(file_g... | [
"public",
"function",
"detect_plugin_component",
"(",
"$",
"zipfilepath",
")",
"{",
"$",
"workdir",
"=",
"make_request_directory",
"(",
")",
";",
"$",
"versionphp",
"=",
"$",
"this",
"->",
"extract_versionphp_file",
"(",
"$",
"zipfilepath",
",",
"$",
"workdir",
... | Detect the given plugin's component name
Only plugins that declare valid $plugin->component value in the version.php
are supported.
@param string $zipfilepath full path to the saved ZIP file
@return string|bool declared component name or false if unable to detect | [
"Detect",
"the",
"given",
"plugin",
"s",
"component",
"name"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/installaddon/classes/installer.php#L202-L212 |
216,295 | moodle/moodle | admin/tool/installaddon/classes/installer.php | tool_installaddon_installer.decode_remote_request | protected function decode_remote_request($request) {
$data = base64_decode($request, true);
if ($data === false) {
return false;
}
$data = json_decode($data);
if (is_null($data)) {
return false;
}
if (!isset($data->name) or !isset($dat... | php | protected function decode_remote_request($request) {
$data = base64_decode($request, true);
if ($data === false) {
return false;
}
$data = json_decode($data);
if (is_null($data)) {
return false;
}
if (!isset($data->name) or !isset($dat... | [
"protected",
"function",
"decode_remote_request",
"(",
"$",
"request",
")",
"{",
"$",
"data",
"=",
"base64_decode",
"(",
"$",
"request",
",",
"true",
")",
";",
"if",
"(",
"$",
"data",
"===",
"false",
")",
"{",
"return",
"false",
";",
"}",
"$",
"data",
... | Decode the request from the Moodle Plugins directory
@param string $request submitted via 'installaddonrequest' HTTP parameter
@return stdClass|bool false on error, object otherwise | [
"Decode",
"the",
"request",
"from",
"the",
"Moodle",
"Plugins",
"directory"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/installaddon/classes/installer.php#L279-L328 |
216,296 | moodle/moodle | admin/tool/installaddon/classes/installer.php | tool_installaddon_installer.extract_versionphp_file | protected function extract_versionphp_file($zipfilepath, $targetdir) {
global $CFG;
require_once($CFG->libdir.'/filelib.php');
$fp = get_file_packer('application/zip');
$files = $fp->list_files($zipfilepath);
if (empty($files)) {
return false;
}
$ro... | php | protected function extract_versionphp_file($zipfilepath, $targetdir) {
global $CFG;
require_once($CFG->libdir.'/filelib.php');
$fp = get_file_packer('application/zip');
$files = $fp->list_files($zipfilepath);
if (empty($files)) {
return false;
}
$ro... | [
"protected",
"function",
"extract_versionphp_file",
"(",
"$",
"zipfilepath",
",",
"$",
"targetdir",
")",
"{",
"global",
"$",
"CFG",
";",
"require_once",
"(",
"$",
"CFG",
"->",
"libdir",
".",
"'/filelib.php'",
")",
";",
"$",
"fp",
"=",
"get_file_packer",
"(",... | Extracts the version.php from the given plugin ZIP file into the target directory
@param string $zipfilepath full path to the saved ZIP file
@param string $targetdir full path to extract the file to
@return string|bool path to the version.php within the $targetpath; false on error (e.g. not found) | [
"Extracts",
"the",
"version",
".",
"php",
"from",
"the",
"given",
"plugin",
"ZIP",
"file",
"into",
"the",
"target",
"directory"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/installaddon/classes/installer.php#L337-L390 |
216,297 | moodle/moodle | admin/tool/installaddon/classes/installer.php | tool_installaddon_installer.detect_plugin_component_from_versionphp | protected function detect_plugin_component_from_versionphp($code) {
$result = preg_match_all('#^\s*\$plugin\->component\s*=\s*([\'"])(.+?_.+?)\1\s*;#m', $code, $matches);
// Return if and only if the single match was detected.
if ($result === 1 and !empty($matches[2][0])) {
return ... | php | protected function detect_plugin_component_from_versionphp($code) {
$result = preg_match_all('#^\s*\$plugin\->component\s*=\s*([\'"])(.+?_.+?)\1\s*;#m', $code, $matches);
// Return if and only if the single match was detected.
if ($result === 1 and !empty($matches[2][0])) {
return ... | [
"protected",
"function",
"detect_plugin_component_from_versionphp",
"(",
"$",
"code",
")",
"{",
"$",
"result",
"=",
"preg_match_all",
"(",
"'#^\\s*\\$plugin\\->component\\s*=\\s*([\\'\"])(.+?_.+?)\\1\\s*;#m'",
",",
"$",
"code",
",",
"$",
"matches",
")",
";",
"// Return if... | Return the plugin component declared in its version.php file
@param string $code the contents of the version.php file
@return string|bool declared plugin component or false if unable to detect | [
"Return",
"the",
"plugin",
"component",
"declared",
"in",
"its",
"version",
".",
"php",
"file"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/installaddon/classes/installer.php#L398-L408 |
216,298 | moodle/moodle | question/classes/external/question_summary_exporter.php | question_summary_exporter.get_mandatory_properties | public static function get_mandatory_properties() {
$properties = self::define_properties();
$mandatoryproperties = array_filter($properties, function($property) {
return empty($property['optional']);
});
return array_keys($mandatoryproperties);
} | php | public static function get_mandatory_properties() {
$properties = self::define_properties();
$mandatoryproperties = array_filter($properties, function($property) {
return empty($property['optional']);
});
return array_keys($mandatoryproperties);
} | [
"public",
"static",
"function",
"get_mandatory_properties",
"(",
")",
"{",
"$",
"properties",
"=",
"self",
"::",
"define_properties",
"(",
")",
";",
"$",
"mandatoryproperties",
"=",
"array_filter",
"(",
"$",
"properties",
",",
"function",
"(",
"$",
"property",
... | The list of mandatory properties required on the question object to
export.
@return string[] List of properties. | [
"The",
"list",
"of",
"mandatory",
"properties",
"required",
"on",
"the",
"question",
"object",
"to",
"export",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/classes/external/question_summary_exporter.php#L68-L74 |
216,299 | moodle/moodle | question/classes/external/question_summary_exporter.php | question_summary_exporter.get_other_values | protected function get_other_values(\renderer_base $output) {
$iconexporter = new question_icon_exporter($this->question, $this->related);
return [
'icon' => $iconexporter->export($output),
];
} | php | protected function get_other_values(\renderer_base $output) {
$iconexporter = new question_icon_exporter($this->question, $this->related);
return [
'icon' => $iconexporter->export($output),
];
} | [
"protected",
"function",
"get_other_values",
"(",
"\\",
"renderer_base",
"$",
"output",
")",
"{",
"$",
"iconexporter",
"=",
"new",
"question_icon_exporter",
"(",
"$",
"this",
"->",
"question",
",",
"$",
"this",
"->",
"related",
")",
";",
"return",
"[",
"'ico... | Calculate the values for the properties defined in the define_other_properties
function.
@param renderer_base $output A renderer.
@return array The list of properties. | [
"Calculate",
"the",
"values",
"for",
"the",
"properties",
"defined",
"in",
"the",
"define_other_properties",
"function",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/classes/external/question_summary_exporter.php#L121-L127 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.