id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
215,100 | moodle/moodle | lib/ddl/database_manager.php | database_manager.change_field_default | public function change_field_default(xmldb_table $xmldb_table, xmldb_field $xmldb_field) {
if (!$this->table_exists($xmldb_table)) {
throw new ddl_table_missing_exception($xmldb_table->getName());
}
// Check the field exists
if (!$this->field_exists($xmldb_table, $xmldb_field... | php | public function change_field_default(xmldb_table $xmldb_table, xmldb_field $xmldb_field) {
if (!$this->table_exists($xmldb_table)) {
throw new ddl_table_missing_exception($xmldb_table->getName());
}
// Check the field exists
if (!$this->field_exists($xmldb_table, $xmldb_field... | [
"public",
"function",
"change_field_default",
"(",
"xmldb_table",
"$",
"xmldb_table",
",",
"xmldb_field",
"$",
"xmldb_field",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"table_exists",
"(",
"$",
"xmldb_table",
")",
")",
"{",
"throw",
"new",
"ddl_table_missin... | This function will change the default of the field in the table passed as arguments
One null value in the default field means delete the default
@param xmldb_table $xmldb_table Table object (just the name is mandatory).
@param xmldb_field $xmldb_field Index object (full specs are required).
@return void | [
"This",
"function",
"will",
"change",
"the",
"default",
"of",
"the",
"field",
"in",
"the",
"table",
"passed",
"as",
"arguments",
"One",
"null",
"value",
"in",
"the",
"default",
"field",
"means",
"delete",
"the",
"default"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/ddl/database_manager.php#L643-L659 |
215,101 | moodle/moodle | lib/ddl/database_manager.php | database_manager.rename_field | public function rename_field(xmldb_table $xmldb_table, xmldb_field $xmldb_field, $newname) {
if (empty($newname)) {
throw new ddl_exception('ddlunknownerror', null, 'newname can not be empty');
}
if (!$this->table_exists($xmldb_table)) {
throw new ddl_table_missing_excep... | php | public function rename_field(xmldb_table $xmldb_table, xmldb_field $xmldb_field, $newname) {
if (empty($newname)) {
throw new ddl_exception('ddlunknownerror', null, 'newname can not be empty');
}
if (!$this->table_exists($xmldb_table)) {
throw new ddl_table_missing_excep... | [
"public",
"function",
"rename_field",
"(",
"xmldb_table",
"$",
"xmldb_table",
",",
"xmldb_field",
"$",
"xmldb_field",
",",
"$",
"newname",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"newname",
")",
")",
"{",
"throw",
"new",
"ddl_exception",
"(",
"'ddlunknownerr... | This function will rename the field in the table passed as arguments
Before renaming the field, the function will check it exists
@param xmldb_table $xmldb_table Table object (just the name is mandatory).
@param xmldb_field $xmldb_field Index object (full specs are required).
@param string $newname New name of the fie... | [
"This",
"function",
"will",
"rename",
"the",
"field",
"in",
"the",
"table",
"passed",
"as",
"arguments",
"Before",
"renaming",
"the",
"field",
"the",
"function",
"will",
"check",
"it",
"exists"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/ddl/database_manager.php#L670-L703 |
215,102 | moodle/moodle | lib/ddl/database_manager.php | database_manager.check_field_dependencies | private function check_field_dependencies(xmldb_table $xmldb_table, xmldb_field $xmldb_field) {
// Check the table exists
if (!$this->table_exists($xmldb_table)) {
throw new ddl_table_missing_exception($xmldb_table->getName());
}
// Check the field exists
if (!$this... | php | private function check_field_dependencies(xmldb_table $xmldb_table, xmldb_field $xmldb_field) {
// Check the table exists
if (!$this->table_exists($xmldb_table)) {
throw new ddl_table_missing_exception($xmldb_table->getName());
}
// Check the field exists
if (!$this... | [
"private",
"function",
"check_field_dependencies",
"(",
"xmldb_table",
"$",
"xmldb_table",
",",
"xmldb_field",
"$",
"xmldb_field",
")",
"{",
"// Check the table exists",
"if",
"(",
"!",
"$",
"this",
"->",
"table_exists",
"(",
"$",
"xmldb_table",
")",
")",
"{",
"... | This function will check, for the given table and field, if there there is any dependency
preventing the field to be modified. It's used by all the public methods that perform any
DDL change on fields, throwing one ddl_dependency_exception if dependencies are found.
@param xmldb_table $xmldb_table Table object (just t... | [
"This",
"function",
"will",
"check",
"for",
"the",
"given",
"table",
"and",
"field",
"if",
"there",
"there",
"is",
"any",
"dependency",
"preventing",
"the",
"field",
"to",
"be",
"modified",
".",
"It",
"s",
"used",
"by",
"all",
"the",
"public",
"methods",
... | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/ddl/database_manager.php#L715-L737 |
215,103 | moodle/moodle | lib/ddl/database_manager.php | database_manager.add_key | public function add_key(xmldb_table $xmldb_table, xmldb_key $xmldb_key) {
if ($xmldb_key->getType() == XMLDB_KEY_PRIMARY) { // Prevent PRIMARY to be added (only in create table, being serious :-P)
throw new ddl_exception('ddlunknownerror', null, 'Primary Keys can be added at table create time only... | php | public function add_key(xmldb_table $xmldb_table, xmldb_key $xmldb_key) {
if ($xmldb_key->getType() == XMLDB_KEY_PRIMARY) { // Prevent PRIMARY to be added (only in create table, being serious :-P)
throw new ddl_exception('ddlunknownerror', null, 'Primary Keys can be added at table create time only... | [
"public",
"function",
"add_key",
"(",
"xmldb_table",
"$",
"xmldb_table",
",",
"xmldb_key",
"$",
"xmldb_key",
")",
"{",
"if",
"(",
"$",
"xmldb_key",
"->",
"getType",
"(",
")",
"==",
"XMLDB_KEY_PRIMARY",
")",
"{",
"// Prevent PRIMARY to be added (only in create table,... | This function will create the key in the table passed as arguments
@param xmldb_table $xmldb_table Table object (just the name is mandatory).
@param xmldb_key $xmldb_key Index object (full specs are required).
@return void | [
"This",
"function",
"will",
"create",
"the",
"key",
"in",
"the",
"table",
"passed",
"as",
"arguments"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/ddl/database_manager.php#L746-L757 |
215,104 | moodle/moodle | lib/ddl/database_manager.php | database_manager.drop_key | public function drop_key(xmldb_table $xmldb_table, xmldb_key $xmldb_key) {
if ($xmldb_key->getType() == XMLDB_KEY_PRIMARY) { // Prevent PRIMARY to be dropped (only in drop table, being serious :-P)
throw new ddl_exception('ddlunknownerror', null, 'Primary Keys can be deleted at table drop time only... | php | public function drop_key(xmldb_table $xmldb_table, xmldb_key $xmldb_key) {
if ($xmldb_key->getType() == XMLDB_KEY_PRIMARY) { // Prevent PRIMARY to be dropped (only in drop table, being serious :-P)
throw new ddl_exception('ddlunknownerror', null, 'Primary Keys can be deleted at table drop time only... | [
"public",
"function",
"drop_key",
"(",
"xmldb_table",
"$",
"xmldb_table",
",",
"xmldb_key",
"$",
"xmldb_key",
")",
"{",
"if",
"(",
"$",
"xmldb_key",
"->",
"getType",
"(",
")",
"==",
"XMLDB_KEY_PRIMARY",
")",
"{",
"// Prevent PRIMARY to be dropped (only in drop table... | This function will drop the key in the table passed as arguments
@param xmldb_table $xmldb_table Table object (just the name is mandatory).
@param xmldb_key $xmldb_key Key object (full specs are required).
@return void | [
"This",
"function",
"will",
"drop",
"the",
"key",
"in",
"the",
"table",
"passed",
"as",
"arguments"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/ddl/database_manager.php#L766-L776 |
215,105 | moodle/moodle | lib/ddl/database_manager.php | database_manager.add_index | public function add_index($xmldb_table, $xmldb_intex) {
if (!$this->table_exists($xmldb_table)) {
throw new ddl_table_missing_exception($xmldb_table->getName());
}
// Check index doesn't exist
if ($this->index_exists($xmldb_table, $xmldb_intex)) {
throw new ddl_e... | php | public function add_index($xmldb_table, $xmldb_intex) {
if (!$this->table_exists($xmldb_table)) {
throw new ddl_table_missing_exception($xmldb_table->getName());
}
// Check index doesn't exist
if ($this->index_exists($xmldb_table, $xmldb_intex)) {
throw new ddl_e... | [
"public",
"function",
"add_index",
"(",
"$",
"xmldb_table",
",",
"$",
"xmldb_intex",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"table_exists",
"(",
"$",
"xmldb_table",
")",
")",
"{",
"throw",
"new",
"ddl_table_missing_exception",
"(",
"$",
"xmldb_table",
... | This function will create the index in the table passed as arguments
Before creating the index, the function will check it doesn't exists
@param xmldb_table $xmldb_table Table object (just the name is mandatory).
@param xmldb_index $xmldb_intex Index object (full specs are required).
@return void | [
"This",
"function",
"will",
"create",
"the",
"index",
"in",
"the",
"table",
"passed",
"as",
"arguments",
"Before",
"creating",
"the",
"index",
"the",
"function",
"will",
"check",
"it",
"doesn",
"t",
"exists"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/ddl/database_manager.php#L810-L840 |
215,106 | moodle/moodle | lib/ddl/database_manager.php | database_manager.drop_index | public function drop_index($xmldb_table, $xmldb_intex) {
if (!$this->table_exists($xmldb_table)) {
throw new ddl_table_missing_exception($xmldb_table->getName());
}
// Check index exists
if (!$this->index_exists($xmldb_table, $xmldb_intex)) {
throw new ddl_except... | php | public function drop_index($xmldb_table, $xmldb_intex) {
if (!$this->table_exists($xmldb_table)) {
throw new ddl_table_missing_exception($xmldb_table->getName());
}
// Check index exists
if (!$this->index_exists($xmldb_table, $xmldb_intex)) {
throw new ddl_except... | [
"public",
"function",
"drop_index",
"(",
"$",
"xmldb_table",
",",
"$",
"xmldb_intex",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"table_exists",
"(",
"$",
"xmldb_table",
")",
")",
"{",
"throw",
"new",
"ddl_table_missing_exception",
"(",
"$",
"xmldb_table",... | This function will drop the index in the table passed as arguments
Before dropping the index, the function will check it exists
@param xmldb_table $xmldb_table Table object (just the name is mandatory).
@param xmldb_index $xmldb_intex Index object (full specs are required).
@return void | [
"This",
"function",
"will",
"drop",
"the",
"index",
"in",
"the",
"table",
"passed",
"as",
"arguments",
"Before",
"dropping",
"the",
"index",
"the",
"function",
"will",
"check",
"it",
"exists"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/ddl/database_manager.php#L850-L867 |
215,107 | moodle/moodle | lib/ddl/database_manager.php | database_manager.rename_index | public function rename_index($xmldb_table, $xmldb_intex, $newname) {
debugging('rename_index() is one experimental feature. You must not use it in production!', DEBUG_DEVELOPER);
// Check newname isn't empty
if (!$newname) {
throw new ddl_exception('ddlunknownerror', null, 'newname ... | php | public function rename_index($xmldb_table, $xmldb_intex, $newname) {
debugging('rename_index() is one experimental feature. You must not use it in production!', DEBUG_DEVELOPER);
// Check newname isn't empty
if (!$newname) {
throw new ddl_exception('ddlunknownerror', null, 'newname ... | [
"public",
"function",
"rename_index",
"(",
"$",
"xmldb_table",
",",
"$",
"xmldb_intex",
",",
"$",
"newname",
")",
"{",
"debugging",
"(",
"'rename_index() is one experimental feature. You must not use it in production!'",
",",
"DEBUG_DEVELOPER",
")",
";",
"// Check newname i... | This function will rename the index in the table passed as arguments
Before renaming the index, the function will check it exists
Experimental. Shouldn't be used at all!
@param xmldb_table $xmldb_table Table object (just the name is mandatory).
@param xmldb_index $xmldb_intex Index object (full specs are required).
@p... | [
"This",
"function",
"will",
"rename",
"the",
"index",
"in",
"the",
"table",
"passed",
"as",
"arguments",
"Before",
"renaming",
"the",
"index",
"the",
"function",
"will",
"check",
"it",
"exists",
"Experimental",
".",
"Shouldn",
"t",
"be",
"used",
"at",
"all!"... | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/ddl/database_manager.php#L879-L899 |
215,108 | moodle/moodle | lib/ddl/database_manager.php | database_manager.get_install_xml_files | public function get_install_xml_files(): array {
global $CFG;
require_once($CFG->libdir.'/adminlib.php');
$files = [];
$dbdirs = get_db_directories();
foreach ($dbdirs as $dbdir) {
$filename = "{$dbdir}/install.xml";
if (file_exists($filename)) {
... | php | public function get_install_xml_files(): array {
global $CFG;
require_once($CFG->libdir.'/adminlib.php');
$files = [];
$dbdirs = get_db_directories();
foreach ($dbdirs as $dbdir) {
$filename = "{$dbdir}/install.xml";
if (file_exists($filename)) {
... | [
"public",
"function",
"get_install_xml_files",
"(",
")",
":",
"array",
"{",
"global",
"$",
"CFG",
";",
"require_once",
"(",
"$",
"CFG",
"->",
"libdir",
".",
"'/adminlib.php'",
")",
";",
"$",
"files",
"=",
"[",
"]",
";",
"$",
"dbdirs",
"=",
"get_db_direct... | Get the list of install.xml files.
@return array | [
"Get",
"the",
"list",
"of",
"install",
".",
"xml",
"files",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/ddl/database_manager.php#L906-L920 |
215,109 | moodle/moodle | lib/ddl/database_manager.php | database_manager.get_install_xml_schema | public function get_install_xml_schema() {
global $CFG;
require_once($CFG->libdir.'/adminlib.php');
$schema = new xmldb_structure('export');
$schema->setVersion($CFG->version);
foreach ($this->get_install_xml_files() as $filename) {
$xmldb_file = new xmldb_file($fil... | php | public function get_install_xml_schema() {
global $CFG;
require_once($CFG->libdir.'/adminlib.php');
$schema = new xmldb_structure('export');
$schema->setVersion($CFG->version);
foreach ($this->get_install_xml_files() as $filename) {
$xmldb_file = new xmldb_file($fil... | [
"public",
"function",
"get_install_xml_schema",
"(",
")",
"{",
"global",
"$",
"CFG",
";",
"require_once",
"(",
"$",
"CFG",
"->",
"libdir",
".",
"'/adminlib.php'",
")",
";",
"$",
"schema",
"=",
"new",
"xmldb_structure",
"(",
"'export'",
")",
";",
"$",
"sche... | Reads the install.xml files for Moodle core and modules and returns an array of
xmldb_structure object with xmldb_table from these files.
@return xmldb_structure schema from install.xml files | [
"Reads",
"the",
"install",
".",
"xml",
"files",
"for",
"Moodle",
"core",
"and",
"modules",
"and",
"returns",
"an",
"array",
"of",
"xmldb_structure",
"object",
"with",
"xmldb_table",
"from",
"these",
"files",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/ddl/database_manager.php#L927-L948 |
215,110 | moodle/moodle | mod/forum/classes/local/vaults/discussion.php | discussion.get_first_discussion_in_forum | public function get_first_discussion_in_forum(forum_entity $forum) : ?discussion_entity {
$records = $this->get_db()->get_records(self::TABLE, [
'forum' => $forum->get_id(),
], 'timemodified ASC', '*', 0, 1);
$records = $this->transform_db_records_to_entities($records);
retu... | php | public function get_first_discussion_in_forum(forum_entity $forum) : ?discussion_entity {
$records = $this->get_db()->get_records(self::TABLE, [
'forum' => $forum->get_id(),
], 'timemodified ASC', '*', 0, 1);
$records = $this->transform_db_records_to_entities($records);
retu... | [
"public",
"function",
"get_first_discussion_in_forum",
"(",
"forum_entity",
"$",
"forum",
")",
":",
"?",
"discussion_entity",
"{",
"$",
"records",
"=",
"$",
"this",
"->",
"get_db",
"(",
")",
"->",
"get_records",
"(",
"self",
"::",
"TABLE",
",",
"[",
"'forum'... | Get the first discussion in the specified forum.
@param forum_entity $forum
@return discussion_entity|null | [
"Get",
"the",
"first",
"discussion",
"in",
"the",
"specified",
"forum",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/local/vaults/discussion.php#L95-L102 |
215,111 | moodle/moodle | mod/forum/classes/local/vaults/discussion.php | discussion.get_count_discussions_in_forum | public function get_count_discussions_in_forum(forum_entity $forum) : ?int {
return $this->get_db()->count_records(self::TABLE, [
'forum' => $forum->get_id()]);
} | php | public function get_count_discussions_in_forum(forum_entity $forum) : ?int {
return $this->get_db()->count_records(self::TABLE, [
'forum' => $forum->get_id()]);
} | [
"public",
"function",
"get_count_discussions_in_forum",
"(",
"forum_entity",
"$",
"forum",
")",
":",
"?",
"int",
"{",
"return",
"$",
"this",
"->",
"get_db",
"(",
")",
"->",
"count_records",
"(",
"self",
"::",
"TABLE",
",",
"[",
"'forum'",
"=>",
"$",
"forum... | Get the count of the discussions in the specified forum.
@param forum_entity $forum
@return int | [
"Get",
"the",
"count",
"of",
"the",
"discussions",
"in",
"the",
"specified",
"forum",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/local/vaults/discussion.php#L125-L128 |
215,112 | moodle/moodle | mod/forum/classes/local/vaults/discussion.php | discussion.update_discussion | public function update_discussion(discussion_entity $discussion) : ?discussion_entity {
$discussionrecord = $this->get_legacy_factory()->to_legacy_object($discussion);
if ($this->get_db()->update_record('forum_discussions', $discussionrecord)) {
$records = $this->transform_db_records_to_enti... | php | public function update_discussion(discussion_entity $discussion) : ?discussion_entity {
$discussionrecord = $this->get_legacy_factory()->to_legacy_object($discussion);
if ($this->get_db()->update_record('forum_discussions', $discussionrecord)) {
$records = $this->transform_db_records_to_enti... | [
"public",
"function",
"update_discussion",
"(",
"discussion_entity",
"$",
"discussion",
")",
":",
"?",
"discussion_entity",
"{",
"$",
"discussionrecord",
"=",
"$",
"this",
"->",
"get_legacy_factory",
"(",
")",
"->",
"to_legacy_object",
"(",
"$",
"discussion",
")",... | Update the discussion
@param discussion_entity $discussion
@return discussion_entity|null | [
"Update",
"the",
"discussion"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/local/vaults/discussion.php#L136-L145 |
215,113 | moodle/moodle | user/profile/field/datetime/field.class.php | profile_field_datetime.edit_field_add | public function edit_field_add($mform) {
// Get the current calendar in use - see MDL-18375.
$calendartype = \core_calendar\type_factory::get_calendar_instance();
// Check if the field is required.
if ($this->field->required) {
$optional = false;
} else {
... | php | public function edit_field_add($mform) {
// Get the current calendar in use - see MDL-18375.
$calendartype = \core_calendar\type_factory::get_calendar_instance();
// Check if the field is required.
if ($this->field->required) {
$optional = false;
} else {
... | [
"public",
"function",
"edit_field_add",
"(",
"$",
"mform",
")",
"{",
"// Get the current calendar in use - see MDL-18375.",
"$",
"calendartype",
"=",
"\\",
"core_calendar",
"\\",
"type_factory",
"::",
"get_calendar_instance",
"(",
")",
";",
"// Check if the field is require... | Handles editing datetime fields.
@param moodleform $mform | [
"Handles",
"editing",
"datetime",
"fields",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/user/profile/field/datetime/field.class.php#L38-L68 |
215,114 | moodle/moodle | user/profile/field/datetime/field.class.php | profile_field_datetime.edit_save_data_preprocess | public function edit_save_data_preprocess($datetime, $datarecord) {
if (!$datetime) {
return 0;
}
if (is_numeric($datetime)) {
$gregoriancalendar = \core_calendar\type_factory::get_calendar_instance('gregorian');
$datetime = $gregoriancalendar->timestamp_to_d... | php | public function edit_save_data_preprocess($datetime, $datarecord) {
if (!$datetime) {
return 0;
}
if (is_numeric($datetime)) {
$gregoriancalendar = \core_calendar\type_factory::get_calendar_instance('gregorian');
$datetime = $gregoriancalendar->timestamp_to_d... | [
"public",
"function",
"edit_save_data_preprocess",
"(",
"$",
"datetime",
",",
"$",
"datarecord",
")",
"{",
"if",
"(",
"!",
"$",
"datetime",
")",
"{",
"return",
"0",
";",
"}",
"if",
"(",
"is_numeric",
"(",
"$",
"datetime",
")",
")",
"{",
"$",
"gregorian... | If timestamp is in YYYY-MM-DD or YYYY-MM-DD-HH-MM-SS format, then convert it to timestamp.
@param string|int $datetime datetime to be converted.
@param stdClass $datarecord The object that will be used to save the record
@return int timestamp
@since Moodle 2.5 | [
"If",
"timestamp",
"is",
"in",
"YYYY",
"-",
"MM",
"-",
"DD",
"or",
"YYYY",
"-",
"MM",
"-",
"DD",
"-",
"HH",
"-",
"MM",
"-",
"SS",
"format",
"then",
"convert",
"it",
"to",
"timestamp",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/user/profile/field/datetime/field.class.php#L78-L97 |
215,115 | moodle/moodle | user/profile/field/datetime/field.class.php | profile_field_datetime.display_data | public function display_data() {
// Check if time was specified.
if (!empty($this->field->param3)) {
$format = get_string('strftimedaydatetime', 'langconfig');
} else {
$format = get_string('strftimedate', 'langconfig');
}
// Check if a date has been spec... | php | public function display_data() {
// Check if time was specified.
if (!empty($this->field->param3)) {
$format = get_string('strftimedaydatetime', 'langconfig');
} else {
$format = get_string('strftimedate', 'langconfig');
}
// Check if a date has been spec... | [
"public",
"function",
"display_data",
"(",
")",
"{",
"// Check if time was specified.",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"field",
"->",
"param3",
")",
")",
"{",
"$",
"format",
"=",
"get_string",
"(",
"'strftimedaydatetime'",
",",
"'langconfig'"... | Display the data for this field. | [
"Display",
"the",
"data",
"for",
"this",
"field",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/user/profile/field/datetime/field.class.php#L102-L116 |
215,116 | moodle/moodle | cache/stores/mongodb/MongoDB/GridFS/ReadableStream.php | ReadableStream.isEOF | public function isEOF()
{
if ($this->chunkOffset === $this->numChunks - 1) {
return $this->bufferOffset >= $this->expectedLastChunkSize;
}
return $this->chunkOffset >= $this->numChunks;
} | php | public function isEOF()
{
if ($this->chunkOffset === $this->numChunks - 1) {
return $this->bufferOffset >= $this->expectedLastChunkSize;
}
return $this->chunkOffset >= $this->numChunks;
} | [
"public",
"function",
"isEOF",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"chunkOffset",
"===",
"$",
"this",
"->",
"numChunks",
"-",
"1",
")",
"{",
"return",
"$",
"this",
"->",
"bufferOffset",
">=",
"$",
"this",
"->",
"expectedLastChunkSize",
";",
"}... | Return whether the current read position is at the end of the stream.
@return boolean | [
"Return",
"whether",
"the",
"current",
"read",
"position",
"is",
"at",
"the",
"end",
"of",
"the",
"stream",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/stores/mongodb/MongoDB/GridFS/ReadableStream.php#L121-L128 |
215,117 | moodle/moodle | cache/stores/mongodb/MongoDB/GridFS/ReadableStream.php | ReadableStream.seek | public function seek($offset)
{
if ($offset < 0 || $offset > $this->file->length) {
throw new InvalidArgumentException(sprintf('$offset must be >= 0 and <= %d; given: %d', $this->file->length, $offset));
}
/* Compute the offsets for the chunk and buffer (i.e. chunk data) from
... | php | public function seek($offset)
{
if ($offset < 0 || $offset > $this->file->length) {
throw new InvalidArgumentException(sprintf('$offset must be >= 0 and <= %d; given: %d', $this->file->length, $offset));
}
/* Compute the offsets for the chunk and buffer (i.e. chunk data) from
... | [
"public",
"function",
"seek",
"(",
"$",
"offset",
")",
"{",
"if",
"(",
"$",
"offset",
"<",
"0",
"||",
"$",
"offset",
">",
"$",
"this",
"->",
"file",
"->",
"length",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"'$offset mu... | Seeks the chunk and buffer offsets for the next read operation.
@param integer $offset
@throws InvalidArgumentException if $offset is out of range | [
"Seeks",
"the",
"chunk",
"and",
"buffer",
"offsets",
"for",
"the",
"next",
"read",
"operation",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/stores/mongodb/MongoDB/GridFS/ReadableStream.php#L175-L216 |
215,118 | moodle/moodle | cache/stores/mongodb/MongoDB/GridFS/ReadableStream.php | ReadableStream.initBufferFromCurrentChunk | private function initBufferFromCurrentChunk()
{
if ($this->chunkOffset === 0 && $this->numChunks === 0) {
return false;
}
if ( ! $this->chunksIterator->valid()) {
throw CorruptFileException::missingChunk($this->chunkOffset);
}
$currentChunk = $this->... | php | private function initBufferFromCurrentChunk()
{
if ($this->chunkOffset === 0 && $this->numChunks === 0) {
return false;
}
if ( ! $this->chunksIterator->valid()) {
throw CorruptFileException::missingChunk($this->chunkOffset);
}
$currentChunk = $this->... | [
"private",
"function",
"initBufferFromCurrentChunk",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"chunkOffset",
"===",
"0",
"&&",
"$",
"this",
"->",
"numChunks",
"===",
"0",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"!",
"$",
"this",
"->",
"... | Initialize the buffer to the current chunk's data.
@return boolean Whether there was a current chunk to read
@throws CorruptFileException if an expected chunk could not be read successfully | [
"Initialize",
"the",
"buffer",
"to",
"the",
"current",
"chunk",
"s",
"data",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/stores/mongodb/MongoDB/GridFS/ReadableStream.php#L236-L265 |
215,119 | moodle/moodle | cache/stores/mongodb/MongoDB/GridFS/ReadableStream.php | ReadableStream.initBufferFromNextChunk | private function initBufferFromNextChunk()
{
if ($this->chunkOffset === $this->numChunks - 1) {
return false;
}
$this->bufferOffset = 0;
$this->chunkOffset++;
$this->chunksIterator->next();
return $this->initBufferFromCurrentChunk();
} | php | private function initBufferFromNextChunk()
{
if ($this->chunkOffset === $this->numChunks - 1) {
return false;
}
$this->bufferOffset = 0;
$this->chunkOffset++;
$this->chunksIterator->next();
return $this->initBufferFromCurrentChunk();
} | [
"private",
"function",
"initBufferFromNextChunk",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"chunkOffset",
"===",
"$",
"this",
"->",
"numChunks",
"-",
"1",
")",
"{",
"return",
"false",
";",
"}",
"$",
"this",
"->",
"bufferOffset",
"=",
"0",
";",
"$",... | Advance to the next chunk and initialize the buffer to its data.
@return boolean Whether there was a next chunk to read
@throws CorruptFileException if an expected chunk could not be read successfully | [
"Advance",
"to",
"the",
"next",
"chunk",
"and",
"initialize",
"the",
"buffer",
"to",
"its",
"data",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/stores/mongodb/MongoDB/GridFS/ReadableStream.php#L273-L284 |
215,120 | moodle/moodle | cache/stores/mongodb/MongoDB/GridFS/ReadableStream.php | ReadableStream.initChunksIterator | private function initChunksIterator()
{
$cursor = $this->collectionWrapper->findChunksByFileId($this->file->_id, $this->chunkOffset);
$this->chunksIterator = new IteratorIterator($cursor);
$this->chunksIterator->rewind();
} | php | private function initChunksIterator()
{
$cursor = $this->collectionWrapper->findChunksByFileId($this->file->_id, $this->chunkOffset);
$this->chunksIterator = new IteratorIterator($cursor);
$this->chunksIterator->rewind();
} | [
"private",
"function",
"initChunksIterator",
"(",
")",
"{",
"$",
"cursor",
"=",
"$",
"this",
"->",
"collectionWrapper",
"->",
"findChunksByFileId",
"(",
"$",
"this",
"->",
"file",
"->",
"_id",
",",
"$",
"this",
"->",
"chunkOffset",
")",
";",
"$",
"this",
... | Initializes the chunk iterator starting from the current offset. | [
"Initializes",
"the",
"chunk",
"iterator",
"starting",
"from",
"the",
"current",
"offset",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/stores/mongodb/MongoDB/GridFS/ReadableStream.php#L289-L295 |
215,121 | moodle/moodle | admin/tool/xmldb/actions/view_table_php/view_table_php.class.php | view_table_php.add_field_php | function add_field_php($structure, $table, $field) {
$result = '';
// Validate if we can do it
if (!$table = $structure->getTable($table)) {
return false;
}
if (!$field = $table->getField($field)) {
return false;
}
if ($table->getAllErrors... | php | function add_field_php($structure, $table, $field) {
$result = '';
// Validate if we can do it
if (!$table = $structure->getTable($table)) {
return false;
}
if (!$field = $table->getField($field)) {
return false;
}
if ($table->getAllErrors... | [
"function",
"add_field_php",
"(",
"$",
"structure",
",",
"$",
"table",
",",
"$",
"field",
")",
"{",
"$",
"result",
"=",
"''",
";",
"// Validate if we can do it",
"if",
"(",
"!",
"$",
"table",
"=",
"$",
"structure",
"->",
"getTable",
"(",
"$",
"table",
... | This function will generate all the PHP code needed to
create one field using XMLDB objects and functions
@param xmldb_structure structure object containing all the info
@param string table table name
@param string field field name to be created
@return string PHP code to be used to create the field | [
"This",
"function",
"will",
"generate",
"all",
"the",
"PHP",
"code",
"needed",
"to",
"create",
"one",
"field",
"using",
"XMLDB",
"objects",
"and",
"functions"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/xmldb/actions/view_table_php/view_table_php.class.php#L298-L335 |
215,122 | moodle/moodle | admin/tool/xmldb/actions/view_table_php/view_table_php.class.php | view_table_php.drop_field_php | function drop_field_php($structure, $table, $field) {
$result = '';
// Validate if we can do it
if (!$table = $structure->getTable($table)) {
return false;
}
if (!$field = $table->getField($field)) {
return false;
}
if ($table->getAllError... | php | function drop_field_php($structure, $table, $field) {
$result = '';
// Validate if we can do it
if (!$table = $structure->getTable($table)) {
return false;
}
if (!$field = $table->getField($field)) {
return false;
}
if ($table->getAllError... | [
"function",
"drop_field_php",
"(",
"$",
"structure",
",",
"$",
"table",
",",
"$",
"field",
")",
"{",
"$",
"result",
"=",
"''",
";",
"// Validate if we can do it",
"if",
"(",
"!",
"$",
"table",
"=",
"$",
"structure",
"->",
"getTable",
"(",
"$",
"table",
... | This function will generate all the PHP code needed to
drop one field using XMLDB objects and functions
@param xmldb_structure structure object containing all the info
@param string table table name
@param string field field name to be dropped
@return string PHP code to be used to drop the field | [
"This",
"function",
"will",
"generate",
"all",
"the",
"PHP",
"code",
"needed",
"to",
"drop",
"one",
"field",
"using",
"XMLDB",
"objects",
"and",
"functions"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/xmldb/actions/view_table_php/view_table_php.class.php#L346-L383 |
215,123 | moodle/moodle | admin/tool/xmldb/actions/view_table_php/view_table_php.class.php | view_table_php.change_field_precision_php | function change_field_precision_php($structure, $table, $field) {
$result = '';
// Validate if we can do it
if (!$table = $structure->getTable($table)) {
return false;
}
if (!$field = $table->getField($field)) {
return false;
}
if ($table-... | php | function change_field_precision_php($structure, $table, $field) {
$result = '';
// Validate if we can do it
if (!$table = $structure->getTable($table)) {
return false;
}
if (!$field = $table->getField($field)) {
return false;
}
if ($table-... | [
"function",
"change_field_precision_php",
"(",
"$",
"structure",
",",
"$",
"table",
",",
"$",
"field",
")",
"{",
"$",
"result",
"=",
"''",
";",
"// Validate if we can do it",
"if",
"(",
"!",
"$",
"table",
"=",
"$",
"structure",
"->",
"getTable",
"(",
"$",
... | This function will generate all the PHP code needed to
change the precision of one field using XMLDB objects and functions
@param xmldb_structure structure object containing all the info
@param string table table name
@param string field field name to change precision | [
"This",
"function",
"will",
"generate",
"all",
"the",
"PHP",
"code",
"needed",
"to",
"change",
"the",
"precision",
"of",
"one",
"field",
"using",
"XMLDB",
"objects",
"and",
"functions"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/xmldb/actions/view_table_php/view_table_php.class.php#L494-L536 |
215,124 | moodle/moodle | admin/tool/xmldb/actions/view_table_php/view_table_php.class.php | view_table_php.drop_key_php | function drop_key_php($structure, $table, $key) {
$result = '';
// Validate if we can do it
if (!$table = $structure->getTable($table)) {
return false;
}
if (!$key = $table->getKey($key)) {
return false;
}
if ($table->getAllErrors()) {
... | php | function drop_key_php($structure, $table, $key) {
$result = '';
// Validate if we can do it
if (!$table = $structure->getTable($table)) {
return false;
}
if (!$key = $table->getKey($key)) {
return false;
}
if ($table->getAllErrors()) {
... | [
"function",
"drop_key_php",
"(",
"$",
"structure",
",",
"$",
"table",
",",
"$",
"key",
")",
"{",
"$",
"result",
"=",
"''",
";",
"// Validate if we can do it",
"if",
"(",
"!",
"$",
"table",
"=",
"$",
"structure",
"->",
"getTable",
"(",
"$",
"table",
")"... | This function will generate all the PHP code needed to
drop one key using XMLDB objects and functions
@param xmldb_structure structure object containing all the info
@param string table table name
@param string key key name to be dropped
@return string PHP code to be used to drop the key | [
"This",
"function",
"will",
"generate",
"all",
"the",
"PHP",
"code",
"needed",
"to",
"drop",
"one",
"key",
"using",
"XMLDB",
"objects",
"and",
"functions"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/xmldb/actions/view_table_php/view_table_php.class.php#L689-L724 |
215,125 | moodle/moodle | admin/tool/xmldb/actions/view_table_php/view_table_php.class.php | view_table_php.add_index_php | function add_index_php($structure, $table, $index) {
$result = '';
// Validate if we can do it
if (!$table = $structure->getTable($table)) {
return false;
}
if (!$index = $table->getIndex($index)) {
return false;
}
if ($table->getAllErrors... | php | function add_index_php($structure, $table, $index) {
$result = '';
// Validate if we can do it
if (!$table = $structure->getTable($table)) {
return false;
}
if (!$index = $table->getIndex($index)) {
return false;
}
if ($table->getAllErrors... | [
"function",
"add_index_php",
"(",
"$",
"structure",
",",
"$",
"table",
",",
"$",
"index",
")",
"{",
"$",
"result",
"=",
"''",
";",
"// Validate if we can do it",
"if",
"(",
"!",
"$",
"table",
"=",
"$",
"structure",
"->",
"getTable",
"(",
"$",
"table",
... | This function will generate all the PHP code needed to
create one index using XMLDB objects and functions
@param xmldb_structure structure object containing all the info
@param string table table name
@param string index index name to be created
@return string PHP code to be used to create the index | [
"This",
"function",
"will",
"generate",
"all",
"the",
"PHP",
"code",
"needed",
"to",
"create",
"one",
"index",
"using",
"XMLDB",
"objects",
"and",
"functions"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/xmldb/actions/view_table_php/view_table_php.class.php#L784-L821 |
215,126 | moodle/moodle | course/format/singleactivity/renderer.php | format_singleactivity_renderer.display | public function display($course, $orphaned) {
$courserenderer = $this->page->get_renderer('core', 'course');
$output = '';
$modinfo = get_fast_modinfo($course);
if ($orphaned) {
if (!empty($modinfo->sections[1])) {
$output .= $this->output->heading(get_string(... | php | public function display($course, $orphaned) {
$courserenderer = $this->page->get_renderer('core', 'course');
$output = '';
$modinfo = get_fast_modinfo($course);
if ($orphaned) {
if (!empty($modinfo->sections[1])) {
$output .= $this->output->heading(get_string(... | [
"public",
"function",
"display",
"(",
"$",
"course",
",",
"$",
"orphaned",
")",
"{",
"$",
"courserenderer",
"=",
"$",
"this",
"->",
"page",
"->",
"get_renderer",
"(",
"'core'",
",",
"'course'",
")",
";",
"$",
"output",
"=",
"''",
";",
"$",
"modinfo",
... | Displays the activities list in cases when course view page is not
redirected to the activity page.
@param stdClass $course record from table course
@param bool $orphaned if false displays the main activity (if present)
if true displays all other activities | [
"Displays",
"the",
"activities",
"list",
"in",
"cases",
"when",
"course",
"view",
"page",
"is",
"not",
"redirected",
"to",
"the",
"activity",
"page",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/course/format/singleactivity/renderer.php#L44-L62 |
215,127 | moodle/moodle | lib/horde/framework/Horde/Crypt/Blowfish/Php/Base.php | Horde_Crypt_Blowfish_Php_Base._binxor | protected function _binxor($l, $r)
{
$x = (($l < 0) ? (float)($l + 4294967296) : (float)$l)
^ (($r < 0) ? (float)($r + 4294967296) : (float)$r);
return (float)(($x < 0) ? $x + 4294967296 : $x);
} | php | protected function _binxor($l, $r)
{
$x = (($l < 0) ? (float)($l + 4294967296) : (float)$l)
^ (($r < 0) ? (float)($r + 4294967296) : (float)$r);
return (float)(($x < 0) ? $x + 4294967296 : $x);
} | [
"protected",
"function",
"_binxor",
"(",
"$",
"l",
",",
"$",
"r",
")",
"{",
"$",
"x",
"=",
"(",
"(",
"$",
"l",
"<",
"0",
")",
"?",
"(",
"float",
")",
"(",
"$",
"l",
"+",
"4294967296",
")",
":",
"(",
"float",
")",
"$",
"l",
")",
"^",
"(",
... | Workaround for XOR on certain systems.
@param integer|float $l
@param integer|float $r
@return float | [
"Workaround",
"for",
"XOR",
"on",
"certain",
"systems",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Crypt/Blowfish/Php/Base.php#L386-L392 |
215,128 | moodle/moodle | lib/horde/framework/Horde/Crypt/Blowfish/Php/Base.php | Horde_Crypt_Blowfish_Php_Base._decipher | protected function _decipher(&$Xl, &$Xr)
{
if ($Xl < 0) {
$Xl += 4294967296;
}
if ($Xr < 0) {
$Xr += 4294967296;
}
for ($i = 17; $i > 1; --$i) {
$temp = $Xl ^ $this->_P[$i];
if ($temp < 0) {
$temp += 4294967296;... | php | protected function _decipher(&$Xl, &$Xr)
{
if ($Xl < 0) {
$Xl += 4294967296;
}
if ($Xr < 0) {
$Xr += 4294967296;
}
for ($i = 17; $i > 1; --$i) {
$temp = $Xl ^ $this->_P[$i];
if ($temp < 0) {
$temp += 4294967296;... | [
"protected",
"function",
"_decipher",
"(",
"&",
"$",
"Xl",
",",
"&",
"$",
"Xr",
")",
"{",
"if",
"(",
"$",
"Xl",
"<",
"0",
")",
"{",
"$",
"Xl",
"+=",
"4294967296",
";",
"}",
"if",
"(",
"$",
"Xr",
"<",
"0",
")",
"{",
"$",
"Xr",
"+=",
"4294967... | Deciphers a single 64-bit block.
@param int &$Xl
@param int &$Xr | [
"Deciphers",
"a",
"single",
"64",
"-",
"bit",
"block",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Crypt/Blowfish/Php/Base.php#L433-L457 |
215,129 | moodle/moodle | lib/google/src/Google/IO/Curl.php | Google_IO_Curl.setTimeout | public function setTimeout($timeout)
{
// Since this timeout is really for putting a bound on the time
// we'll set them both to the same. If you need to specify a longer
// CURLOPT_TIMEOUT, or a higher CONNECTTIMEOUT, the best thing to
// do is use the setOptions method for the values individually.
... | php | public function setTimeout($timeout)
{
// Since this timeout is really for putting a bound on the time
// we'll set them both to the same. If you need to specify a longer
// CURLOPT_TIMEOUT, or a higher CONNECTTIMEOUT, the best thing to
// do is use the setOptions method for the values individually.
... | [
"public",
"function",
"setTimeout",
"(",
"$",
"timeout",
")",
"{",
"// Since this timeout is really for putting a bound on the time",
"// we'll set them both to the same. If you need to specify a longer",
"// CURLOPT_TIMEOUT, or a higher CONNECTTIMEOUT, the best thing to",
"// do is use the se... | Set the maximum request time in seconds.
@param $timeout in seconds | [
"Set",
"the",
"maximum",
"request",
"time",
"in",
"seconds",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/google/src/Google/IO/Curl.php#L158-L166 |
215,130 | moodle/moodle | course/classes/analytics/target/course_completion.php | course_completion.calculate_sample | protected function calculate_sample($sampleid, \core_analytics\analysable $course, $starttime = false, $endtime = false) {
$userenrol = $this->retrieve('user_enrolments', $sampleid);
// We use completion as a success metric.
$ccompletion = new \completion_completion(array('userid' => $userenro... | php | protected function calculate_sample($sampleid, \core_analytics\analysable $course, $starttime = false, $endtime = false) {
$userenrol = $this->retrieve('user_enrolments', $sampleid);
// We use completion as a success metric.
$ccompletion = new \completion_completion(array('userid' => $userenro... | [
"protected",
"function",
"calculate_sample",
"(",
"$",
"sampleid",
",",
"\\",
"core_analytics",
"\\",
"analysable",
"$",
"course",
",",
"$",
"starttime",
"=",
"false",
",",
"$",
"endtime",
"=",
"false",
")",
"{",
"$",
"userenrol",
"=",
"$",
"this",
"->",
... | Course completion sets the target value.
@param int $sampleid
@param \core_analytics\analysable $course
@param int $starttime
@param int $endtime
@return float 0 -> course not completed, 1 -> course completed | [
"Course",
"completion",
"sets",
"the",
"target",
"value",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/course/classes/analytics/target/course_completion.php#L97-L108 |
215,131 | moodle/moodle | question/type/shortanswer/question.php | qtype_shortanswer_question.safe_normalize | protected static function safe_normalize($string) {
if ($string === '') {
return '';
}
if (!function_exists('normalizer_normalize')) {
return $string;
}
$normalised = normalizer_normalize($string, Normalizer::FORM_C);
if (is_null($normalised)) {
... | php | protected static function safe_normalize($string) {
if ($string === '') {
return '';
}
if (!function_exists('normalizer_normalize')) {
return $string;
}
$normalised = normalizer_normalize($string, Normalizer::FORM_C);
if (is_null($normalised)) {
... | [
"protected",
"static",
"function",
"safe_normalize",
"(",
"$",
"string",
")",
"{",
"if",
"(",
"$",
"string",
"===",
"''",
")",
"{",
"return",
"''",
";",
"}",
"if",
"(",
"!",
"function_exists",
"(",
"'normalizer_normalize'",
")",
")",
"{",
"return",
"$",
... | Normalise a UTf-8 string to FORM_C, avoiding the pitfalls in PHP's
normalizer_normalize function.
@param string $string the input string.
@return string the normalised string. | [
"Normalise",
"a",
"UTf",
"-",
"8",
"string",
"to",
"FORM_C",
"avoiding",
"the",
"pitfalls",
"in",
"PHP",
"s",
"normalizer_normalize",
"function",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/type/shortanswer/question.php#L130-L147 |
215,132 | moodle/moodle | lib/spout/src/Spout/Reader/ReaderFactory.php | ReaderFactory.create | public static function create($readerType)
{
$reader = null;
switch ($readerType) {
case Type::CSV:
$reader = new CSV\Reader();
break;
case Type::XLSX:
$reader = new XLSX\Reader();
break;
case Type::... | php | public static function create($readerType)
{
$reader = null;
switch ($readerType) {
case Type::CSV:
$reader = new CSV\Reader();
break;
case Type::XLSX:
$reader = new XLSX\Reader();
break;
case Type::... | [
"public",
"static",
"function",
"create",
"(",
"$",
"readerType",
")",
"{",
"$",
"reader",
"=",
"null",
";",
"switch",
"(",
"$",
"readerType",
")",
"{",
"case",
"Type",
"::",
"CSV",
":",
"$",
"reader",
"=",
"new",
"CSV",
"\\",
"Reader",
"(",
")",
"... | This creates an instance of the appropriate reader, given the type of the file to be read
@api
@param string $readerType Type of the reader to instantiate
@return ReaderInterface
@throws \Box\Spout\Common\Exception\UnsupportedTypeException | [
"This",
"creates",
"an",
"instance",
"of",
"the",
"appropriate",
"reader",
"given",
"the",
"type",
"of",
"the",
"file",
"to",
"be",
"read"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/spout/src/Spout/Reader/ReaderFactory.php#L26-L47 |
215,133 | moodle/moodle | mod/forum/renderer.php | mod_forum_renderer.neighbouring_discussion_navigation | public function neighbouring_discussion_navigation($prev, $next) {
$html = '';
if ($prev || $next) {
$html .= html_writer::start_tag('div', array('class' => 'discussion-nav clearfix'));
$html .= html_writer::start_tag('ul');
if ($prev) {
$url = new moo... | php | public function neighbouring_discussion_navigation($prev, $next) {
$html = '';
if ($prev || $next) {
$html .= html_writer::start_tag('div', array('class' => 'discussion-nav clearfix'));
$html .= html_writer::start_tag('ul');
if ($prev) {
$url = new moo... | [
"public",
"function",
"neighbouring_discussion_navigation",
"(",
"$",
"prev",
",",
"$",
"next",
")",
"{",
"$",
"html",
"=",
"''",
";",
"if",
"(",
"$",
"prev",
"||",
"$",
"next",
")",
"{",
"$",
"html",
".=",
"html_writer",
"::",
"start_tag",
"(",
"'div'... | Returns the navigation to the previous and next discussion.
@param mixed $prev Previous discussion record, or false.
@param mixed $next Next discussion record, or false.
@return string The output. | [
"Returns",
"the",
"navigation",
"to",
"the",
"previous",
"and",
"next",
"discussion",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/renderer.php#L43-L66 |
215,134 | moodle/moodle | mod/forum/renderer.php | mod_forum_renderer.subscriber_selection_form | public function subscriber_selection_form(user_selector_base $existinguc, user_selector_base $potentialuc) {
$output = '';
$formattributes = array();
$formattributes['id'] = 'subscriberform';
$formattributes['action'] = '';
$formattributes['method'] = 'post';
$output .= h... | php | public function subscriber_selection_form(user_selector_base $existinguc, user_selector_base $potentialuc) {
$output = '';
$formattributes = array();
$formattributes['id'] = 'subscriberform';
$formattributes['action'] = '';
$formattributes['method'] = 'post';
$output .= h... | [
"public",
"function",
"subscriber_selection_form",
"(",
"user_selector_base",
"$",
"existinguc",
",",
"user_selector_base",
"$",
"potentialuc",
")",
"{",
"$",
"output",
"=",
"''",
";",
"$",
"formattributes",
"=",
"array",
"(",
")",
";",
"$",
"formattributes",
"[... | This method is used to generate HTML for a subscriber selection form that
uses two user_selector controls
@param user_selector_base $existinguc
@param user_selector_base $potentialuc
@return string | [
"This",
"method",
"is",
"used",
"to",
"generate",
"HTML",
"for",
"a",
"subscriber",
"selection",
"form",
"that",
"uses",
"two",
"user_selector",
"controls"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/renderer.php#L76-L106 |
215,135 | moodle/moodle | mod/forum/renderer.php | mod_forum_renderer.subscriber_overview | public function subscriber_overview($users, $forum , $course) {
$output = '';
$modinfo = get_fast_modinfo($course);
if (!$users || !is_array($users) || count($users)===0) {
$output .= $this->output->heading(get_string("nosubscribers", "forum"));
} else if (!isset($modinfo->in... | php | public function subscriber_overview($users, $forum , $course) {
$output = '';
$modinfo = get_fast_modinfo($course);
if (!$users || !is_array($users) || count($users)===0) {
$output .= $this->output->heading(get_string("nosubscribers", "forum"));
} else if (!isset($modinfo->in... | [
"public",
"function",
"subscriber_overview",
"(",
"$",
"users",
",",
"$",
"forum",
",",
"$",
"course",
")",
"{",
"$",
"output",
"=",
"''",
";",
"$",
"modinfo",
"=",
"get_fast_modinfo",
"(",
"$",
"course",
")",
";",
"if",
"(",
"!",
"$",
"users",
"||",... | This function generates HTML to display a subscriber overview, primarily used on
the subscribers page if editing was turned off
@param array $users
@param object $forum
@param object $course
@return string | [
"This",
"function",
"generates",
"HTML",
"to",
"display",
"a",
"subscriber",
"overview",
"primarily",
"used",
"on",
"the",
"subscribers",
"page",
"if",
"editing",
"was",
"turned",
"off"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/renderer.php#L117-L146 |
215,136 | moodle/moodle | mod/forum/renderer.php | mod_forum_renderer.subscribed_users | public function subscribed_users(user_selector_base $existingusers) {
$output = $this->output->box_start('subscriberdiv boxaligncenter');
$output .= html_writer::tag('p', get_string('forcesubscribed', 'forum'));
$output .= $existingusers->display(true);
$output .= $this->output->box_end... | php | public function subscribed_users(user_selector_base $existingusers) {
$output = $this->output->box_start('subscriberdiv boxaligncenter');
$output .= html_writer::tag('p', get_string('forcesubscribed', 'forum'));
$output .= $existingusers->display(true);
$output .= $this->output->box_end... | [
"public",
"function",
"subscribed_users",
"(",
"user_selector_base",
"$",
"existingusers",
")",
"{",
"$",
"output",
"=",
"$",
"this",
"->",
"output",
"->",
"box_start",
"(",
"'subscriberdiv boxaligncenter'",
")",
";",
"$",
"output",
".=",
"html_writer",
"::",
"t... | This is used to display a control containing all of the subscribed users so that
it can be searched
@param user_selector_base $existingusers
@return string | [
"This",
"is",
"used",
"to",
"display",
"a",
"control",
"containing",
"all",
"of",
"the",
"subscribed",
"users",
"so",
"that",
"it",
"can",
"be",
"searched"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/renderer.php#L155-L161 |
215,137 | moodle/moodle | mod/forum/renderer.php | mod_forum_renderer.timed_discussion_tooltip | public function timed_discussion_tooltip($discussion, $visiblenow) {
$dates = array();
if ($discussion->timestart) {
$dates[] = get_string('displaystart', 'mod_forum').': '.userdate($discussion->timestart);
}
if ($discussion->timeend) {
$dates[] = get_string('disp... | php | public function timed_discussion_tooltip($discussion, $visiblenow) {
$dates = array();
if ($discussion->timestart) {
$dates[] = get_string('displaystart', 'mod_forum').': '.userdate($discussion->timestart);
}
if ($discussion->timeend) {
$dates[] = get_string('disp... | [
"public",
"function",
"timed_discussion_tooltip",
"(",
"$",
"discussion",
",",
"$",
"visiblenow",
")",
"{",
"$",
"dates",
"=",
"array",
"(",
")",
";",
"if",
"(",
"$",
"discussion",
"->",
"timestart",
")",
"{",
"$",
"dates",
"[",
"]",
"=",
"get_string",
... | Generate the HTML for an icon to be displayed beside the subject of a timed discussion.
@param object $discussion
@param bool $visiblenow Indicicates that the discussion is currently
visible to all users.
@return string | [
"Generate",
"the",
"HTML",
"for",
"an",
"icon",
"to",
"be",
"displayed",
"beside",
"the",
"subject",
"of",
"a",
"timed",
"discussion",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/renderer.php#L171-L185 |
215,138 | moodle/moodle | mod/forum/renderer.php | mod_forum_renderer.render_forum_post_email | public function render_forum_post_email(\mod_forum\output\forum_post_email $post) {
$data = $post->export_for_template($this, $this->target === RENDERER_TARGET_TEXTEMAIL);
return $this->render_from_template('mod_forum/' . $this->forum_post_template(), $data);
} | php | public function render_forum_post_email(\mod_forum\output\forum_post_email $post) {
$data = $post->export_for_template($this, $this->target === RENDERER_TARGET_TEXTEMAIL);
return $this->render_from_template('mod_forum/' . $this->forum_post_template(), $data);
} | [
"public",
"function",
"render_forum_post_email",
"(",
"\\",
"mod_forum",
"\\",
"output",
"\\",
"forum_post_email",
"$",
"post",
")",
"{",
"$",
"data",
"=",
"$",
"post",
"->",
"export_for_template",
"(",
"$",
"this",
",",
"$",
"this",
"->",
"target",
"===",
... | Display a forum post in the relevant context.
@param \mod_forum\output\forum_post $post The post to display.
@return string | [
"Display",
"a",
"forum",
"post",
"in",
"the",
"relevant",
"context",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/renderer.php#L193-L196 |
215,139 | moodle/moodle | mod/forum/renderer.php | mod_forum_renderer.render_digest_options | public function render_digest_options($forum, $value) {
$options = forum_get_user_digest_options();
$editable = new \core\output\inplace_editable(
'mod_forum',
'digestoptions',
$forum->id,
true,
$options[$value],
$value
);
... | php | public function render_digest_options($forum, $value) {
$options = forum_get_user_digest_options();
$editable = new \core\output\inplace_editable(
'mod_forum',
'digestoptions',
$forum->id,
true,
$options[$value],
$value
);
... | [
"public",
"function",
"render_digest_options",
"(",
"$",
"forum",
",",
"$",
"value",
")",
"{",
"$",
"options",
"=",
"forum_get_user_digest_options",
"(",
")",
";",
"$",
"editable",
"=",
"new",
"\\",
"core",
"\\",
"output",
"\\",
"inplace_editable",
"(",
"'mo... | Create the inplace_editable used to select forum digest options.
@param stdClass $forum The forum to create the editable for.
@param int $value The current value for this user
@return inplace_editable | [
"Create",
"the",
"inplace_editable",
"used",
"to",
"select",
"forum",
"digest",
"options",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/renderer.php#L214-L228 |
215,140 | moodle/moodle | mod/forum/renderer.php | mod_forum_renderer.render_quick_search_form | public function render_quick_search_form(\mod_forum\output\quick_search_form $form) {
return $this->render_from_template('mod_forum/quick_search_form', $form->export_for_template($this));
} | php | public function render_quick_search_form(\mod_forum\output\quick_search_form $form) {
return $this->render_from_template('mod_forum/quick_search_form', $form->export_for_template($this));
} | [
"public",
"function",
"render_quick_search_form",
"(",
"\\",
"mod_forum",
"\\",
"output",
"\\",
"quick_search_form",
"$",
"form",
")",
"{",
"return",
"$",
"this",
"->",
"render_from_template",
"(",
"'mod_forum/quick_search_form'",
",",
"$",
"form",
"->",
"export_for... | Render quick search form.
@param \mod_forum\output\quick_search_form $form The renderable.
@return string | [
"Render",
"quick",
"search",
"form",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/renderer.php#L236-L238 |
215,141 | moodle/moodle | mod/forum/renderer.php | mod_forum_renderer.render_big_search_form | public function render_big_search_form(\mod_forum\output\big_search_form $form) {
return $this->render_from_template('mod_forum/big_search_form', $form->export_for_template($this));
} | php | public function render_big_search_form(\mod_forum\output\big_search_form $form) {
return $this->render_from_template('mod_forum/big_search_form', $form->export_for_template($this));
} | [
"public",
"function",
"render_big_search_form",
"(",
"\\",
"mod_forum",
"\\",
"output",
"\\",
"big_search_form",
"$",
"form",
")",
"{",
"return",
"$",
"this",
"->",
"render_from_template",
"(",
"'mod_forum/big_search_form'",
",",
"$",
"form",
"->",
"export_for_templ... | Render big search form.
@param \mod_forum\output\big_search_form $form The renderable.
@return string | [
"Render",
"big",
"search",
"form",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/renderer.php#L246-L248 |
215,142 | moodle/moodle | cache/stores/mongodb/MongoDB/Operation/ListCollections.php | ListCollections.executeCommand | private function executeCommand(Server $server)
{
$cmd = ['listCollections' => 1];
if ( ! empty($this->options['filter'])) {
$cmd['filter'] = (object) $this->options['filter'];
}
if (isset($this->options['maxTimeMS'])) {
$cmd['maxTimeMS'] = $this->options['m... | php | private function executeCommand(Server $server)
{
$cmd = ['listCollections' => 1];
if ( ! empty($this->options['filter'])) {
$cmd['filter'] = (object) $this->options['filter'];
}
if (isset($this->options['maxTimeMS'])) {
$cmd['maxTimeMS'] = $this->options['m... | [
"private",
"function",
"executeCommand",
"(",
"Server",
"$",
"server",
")",
"{",
"$",
"cmd",
"=",
"[",
"'listCollections'",
"=>",
"1",
"]",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"options",
"[",
"'filter'",
"]",
")",
")",
"{",
"$",
"... | Returns information for all collections in this database using the
listCollections command.
@param Server $server
@return CollectionInfoCommandIterator
@throws DriverRuntimeException for other driver errors (e.g. connection errors) | [
"Returns",
"information",
"for",
"all",
"collections",
"in",
"this",
"database",
"using",
"the",
"listCollections",
"command",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/stores/mongodb/MongoDB/Operation/ListCollections.php#L120-L136 |
215,143 | moodle/moodle | mod/workshop/locallib.php | workshop.installed_allocators | public static function installed_allocators() {
$installed = core_component::get_plugin_list('workshopallocation');
$forms = array();
foreach ($installed as $allocation => $allocationpath) {
if (file_exists($allocationpath . '/lib.php')) {
$forms[$allocation] = get_st... | php | public static function installed_allocators() {
$installed = core_component::get_plugin_list('workshopallocation');
$forms = array();
foreach ($installed as $allocation => $allocationpath) {
if (file_exists($allocationpath . '/lib.php')) {
$forms[$allocation] = get_st... | [
"public",
"static",
"function",
"installed_allocators",
"(",
")",
"{",
"$",
"installed",
"=",
"core_component",
"::",
"get_plugin_list",
"(",
"'workshopallocation'",
")",
";",
"$",
"forms",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"installed",
"as",
... | Return list of available allocation methods
@return array Array ['string' => 'string'] of localized allocation method names | [
"Return",
"list",
"of",
"available",
"allocation",
"methods"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L239-L254 |
215,144 | moodle/moodle | mod/workshop/locallib.php | workshop.available_example_modes_list | public static function available_example_modes_list() {
$options = array();
$options[self::EXAMPLES_VOLUNTARY] = get_string('examplesvoluntary', 'workshop');
$options[self::EXAMPLES_BEFORE_SUBMISSION] = get_string('examplesbeforesubmission', 'workshop');
$options[self::EXAMPLES_B... | php | public static function available_example_modes_list() {
$options = array();
$options[self::EXAMPLES_VOLUNTARY] = get_string('examplesvoluntary', 'workshop');
$options[self::EXAMPLES_BEFORE_SUBMISSION] = get_string('examplesbeforesubmission', 'workshop');
$options[self::EXAMPLES_B... | [
"public",
"static",
"function",
"available_example_modes_list",
"(",
")",
"{",
"$",
"options",
"=",
"array",
"(",
")",
";",
"$",
"options",
"[",
"self",
"::",
"EXAMPLES_VOLUNTARY",
"]",
"=",
"get_string",
"(",
"'examplesvoluntary'",
",",
"'workshop'",
")",
";"... | Returns the localized list of supported examples modes
@return array | [
"Returns",
"the",
"localized",
"list",
"of",
"supported",
"examples",
"modes"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L301-L307 |
215,145 | moodle/moodle | mod/workshop/locallib.php | workshop.available_strategies_list | public static function available_strategies_list() {
$installed = core_component::get_plugin_list('workshopform');
$forms = array();
foreach ($installed as $strategy => $strategypath) {
if (file_exists($strategypath . '/lib.php')) {
$forms[$strategy] = get_string('plu... | php | public static function available_strategies_list() {
$installed = core_component::get_plugin_list('workshopform');
$forms = array();
foreach ($installed as $strategy => $strategypath) {
if (file_exists($strategypath . '/lib.php')) {
$forms[$strategy] = get_string('plu... | [
"public",
"static",
"function",
"available_strategies_list",
"(",
")",
"{",
"$",
"installed",
"=",
"core_component",
"::",
"get_plugin_list",
"(",
"'workshopform'",
")",
";",
"$",
"forms",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"installed",
"as",
... | Returns the list of available grading strategy methods
@return array ['string' => 'string'] | [
"Returns",
"the",
"list",
"of",
"available",
"grading",
"strategy",
"methods"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L314-L323 |
215,146 | moodle/moodle | mod/workshop/locallib.php | workshop.available_evaluators_list | public static function available_evaluators_list() {
$evals = array();
foreach (core_component::get_plugin_list_with_file('workshopeval', 'lib.php', false) as $eval => $evalpath) {
$evals[$eval] = get_string('pluginname', 'workshopeval_' . $eval);
}
return $evals;
} | php | public static function available_evaluators_list() {
$evals = array();
foreach (core_component::get_plugin_list_with_file('workshopeval', 'lib.php', false) as $eval => $evalpath) {
$evals[$eval] = get_string('pluginname', 'workshopeval_' . $eval);
}
return $evals;
} | [
"public",
"static",
"function",
"available_evaluators_list",
"(",
")",
"{",
"$",
"evals",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"core_component",
"::",
"get_plugin_list_with_file",
"(",
"'workshopeval'",
",",
"'lib.php'",
",",
"false",
")",
"as",
"$",
"... | Returns the list of available grading evaluation methods
@return array of (string)name => (string)localized title | [
"Returns",
"the",
"list",
"of",
"available",
"grading",
"evaluation",
"methods"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L330-L336 |
215,147 | moodle/moodle | mod/workshop/locallib.php | workshop.gcd | public static function gcd($a, $b) {
return ($b == 0) ? ($a):(self::gcd($b, $a % $b));
} | php | public static function gcd($a, $b) {
return ($b == 0) ? ($a):(self::gcd($b, $a % $b));
} | [
"public",
"static",
"function",
"gcd",
"(",
"$",
"a",
",",
"$",
"b",
")",
"{",
"return",
"(",
"$",
"b",
"==",
"0",
")",
"?",
"(",
"$",
"a",
")",
":",
"(",
"self",
"::",
"gcd",
"(",
"$",
"b",
",",
"$",
"a",
"%",
"$",
"b",
")",
")",
";",
... | Helper function returning the greatest common divisor
@param int $a
@param int $b
@return int | [
"Helper",
"function",
"returning",
"the",
"greatest",
"common",
"divisor"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L377-L379 |
215,148 | moodle/moodle | mod/workshop/locallib.php | workshop.clean_file_extensions | public static function clean_file_extensions($extensions) {
debugging('The method workshop::clean_file_extensions() is deprecated.
Please use the methods provided by the \core_form\filetypes_util class.', DEBUG_DEVELOPER);
$extensions = self::normalize_file_extensions($extensions);
... | php | public static function clean_file_extensions($extensions) {
debugging('The method workshop::clean_file_extensions() is deprecated.
Please use the methods provided by the \core_form\filetypes_util class.', DEBUG_DEVELOPER);
$extensions = self::normalize_file_extensions($extensions);
... | [
"public",
"static",
"function",
"clean_file_extensions",
"(",
"$",
"extensions",
")",
"{",
"debugging",
"(",
"'The method workshop::clean_file_extensions() is deprecated.\n Please use the methods provided by the \\core_form\\filetypes_util class.'",
",",
"DEBUG_DEVELOPER",
")"... | Cleans the user provided list of file extensions.
@deprecated since Moodle 3.4 MDL-56486 - please use the {@link core_form\filetypes_util}
@param string $extensions
@return string | [
"Cleans",
"the",
"user",
"provided",
"list",
"of",
"file",
"extensions",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L485-L497 |
215,149 | moodle/moodle | mod/workshop/locallib.php | workshop.is_allowed_file_type | public static function is_allowed_file_type($filename, $whitelist) {
debugging('The method workshop::is_allowed_file_type() is deprecated.
Please use the methods provided by the \core_form\filetypes_util class.', DEBUG_DEVELOPER);
$whitelist = self::normalize_file_extensions($whitelist);
... | php | public static function is_allowed_file_type($filename, $whitelist) {
debugging('The method workshop::is_allowed_file_type() is deprecated.
Please use the methods provided by the \core_form\filetypes_util class.', DEBUG_DEVELOPER);
$whitelist = self::normalize_file_extensions($whitelist);
... | [
"public",
"static",
"function",
"is_allowed_file_type",
"(",
"$",
"filename",
",",
"$",
"whitelist",
")",
"{",
"debugging",
"(",
"'The method workshop::is_allowed_file_type() is deprecated.\n Please use the methods provided by the \\core_form\\filetypes_util class.'",
",",
... | Is the file have allowed to be uploaded to the workshop?
Empty whitelist is interpretted as "any file type is allowed" rather
than "no file can be uploaded".
@deprecated since Moodle 3.4 MDL-56486 - please use the {@link core_form\filetypes_util}
@param string $filename the file name
@param string|array $whitelist li... | [
"Is",
"the",
"file",
"have",
"allowed",
"to",
"be",
"uploaded",
"to",
"the",
"workshop?"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L536-L557 |
215,150 | moodle/moodle | mod/workshop/locallib.php | workshop.is_participant | public function is_participant($userid=null) {
global $USER, $DB;
if (is_null($userid)) {
$userid = $USER->id;
}
list($sql, $params) = $this->get_participants_sql();
if (empty($sql)) {
return false;
}
$sql = "SELECT COUNT(*)
... | php | public function is_participant($userid=null) {
global $USER, $DB;
if (is_null($userid)) {
$userid = $USER->id;
}
list($sql, $params) = $this->get_participants_sql();
if (empty($sql)) {
return false;
}
$sql = "SELECT COUNT(*)
... | [
"public",
"function",
"is_participant",
"(",
"$",
"userid",
"=",
"null",
")",
"{",
"global",
"$",
"USER",
",",
"$",
"DB",
";",
"if",
"(",
"is_null",
"(",
"$",
"userid",
")",
")",
"{",
"$",
"userid",
"=",
"$",
"USER",
"->",
"id",
";",
"}",
"list",... | Checks if the given user is an actively enrolled participant in the workshop
@param int $userid, defaults to the current $USER
@return boolean | [
"Checks",
"if",
"the",
"given",
"user",
"is",
"an",
"actively",
"enrolled",
"participant",
"in",
"the",
"workshop"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L724-L748 |
215,151 | moodle/moodle | mod/workshop/locallib.php | workshop.get_grouped | public function get_grouped($users) {
global $DB;
global $CFG;
$grouped = array(); // grouped users to be returned
if (empty($users)) {
return $grouped;
}
if ($this->cm->groupingid) {
// Group workshop set to specified grouping - only consider gr... | php | public function get_grouped($users) {
global $DB;
global $CFG;
$grouped = array(); // grouped users to be returned
if (empty($users)) {
return $grouped;
}
if ($this->cm->groupingid) {
// Group workshop set to specified grouping - only consider gr... | [
"public",
"function",
"get_grouped",
"(",
"$",
"users",
")",
"{",
"global",
"$",
"DB",
";",
"global",
"$",
"CFG",
";",
"$",
"grouped",
"=",
"array",
"(",
")",
";",
"// grouped users to be returned",
"if",
"(",
"empty",
"(",
"$",
"users",
")",
")",
"{",... | Groups the given users by the group membership
This takes the module grouping settings into account. If a grouping is
set, returns only groups withing the course module grouping. Always
returns group [0] with all the given users.
@param array $users array[userid] => stdclass{->id ->lastname ->firstname}
@return array... | [
"Groups",
"the",
"given",
"users",
"by",
"the",
"group",
"membership"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L760-L792 |
215,152 | moodle/moodle | mod/workshop/locallib.php | workshop.get_submissions | public function get_submissions($authorid='all', $groupid=0, $limitfrom=0, $limitnum=0) {
global $DB;
$authorfields = user_picture::fields('u', null, 'authoridx', 'author');
$gradeoverbyfields = user_picture::fields('t', null, 'gradeoverbyx', 'over');
$params = array('wo... | php | public function get_submissions($authorid='all', $groupid=0, $limitfrom=0, $limitnum=0) {
global $DB;
$authorfields = user_picture::fields('u', null, 'authoridx', 'author');
$gradeoverbyfields = user_picture::fields('t', null, 'gradeoverbyx', 'over');
$params = array('wo... | [
"public",
"function",
"get_submissions",
"(",
"$",
"authorid",
"=",
"'all'",
",",
"$",
"groupid",
"=",
"0",
",",
"$",
"limitfrom",
"=",
"0",
",",
"$",
"limitnum",
"=",
"0",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"authorfields",
"=",
"user_picture",
... | Returns submissions from this workshop
Fetches data from {workshop_submissions} and adds some useful information from other
tables. Does not return textual fields to prevent possible memory lack issues.
@see self::count_submissions()
@param mixed $authorid int|array|'all' If set to [array of] integer, return submissi... | [
"Returns",
"submissions",
"from",
"this",
"workshop"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L861-L893 |
215,153 | moodle/moodle | mod/workshop/locallib.php | workshop.get_submission_by_id | public function get_submission_by_id($id) {
global $DB;
// we intentionally check the workshopid here, too, so the workshop can't touch submissions
// from other instances
$authorfields = user_picture::fields('u', null, 'authoridx', 'author');
$gradeoverbyfields = user_pict... | php | public function get_submission_by_id($id) {
global $DB;
// we intentionally check the workshopid here, too, so the workshop can't touch submissions
// from other instances
$authorfields = user_picture::fields('u', null, 'authoridx', 'author');
$gradeoverbyfields = user_pict... | [
"public",
"function",
"get_submission_by_id",
"(",
"$",
"id",
")",
"{",
"global",
"$",
"DB",
";",
"// we intentionally check the workshopid here, too, so the workshop can't touch submissions",
"// from other instances",
"$",
"authorfields",
"=",
"user_picture",
"::",
"fields",
... | Returns a submission record with the author's data
@param int $id submission id
@return stdclass | [
"Returns",
"a",
"submission",
"record",
"with",
"the",
"author",
"s",
"data"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L964-L978 |
215,154 | moodle/moodle | mod/workshop/locallib.php | workshop.get_submission_by_author | public function get_submission_by_author($authorid) {
global $DB;
if (empty($authorid)) {
return false;
}
$authorfields = user_picture::fields('u', null, 'authoridx', 'author');
$gradeoverbyfields = user_picture::fields('g', null, 'gradeoverbyx', 'gradeoverby');... | php | public function get_submission_by_author($authorid) {
global $DB;
if (empty($authorid)) {
return false;
}
$authorfields = user_picture::fields('u', null, 'authoridx', 'author');
$gradeoverbyfields = user_picture::fields('g', null, 'gradeoverbyx', 'gradeoverby');... | [
"public",
"function",
"get_submission_by_author",
"(",
"$",
"authorid",
")",
"{",
"global",
"$",
"DB",
";",
"if",
"(",
"empty",
"(",
"$",
"authorid",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"authorfields",
"=",
"user_picture",
"::",
"fields",
"(... | Returns a submission submitted by the given author
@param int $id author id
@return stdclass|false | [
"Returns",
"a",
"submission",
"submitted",
"by",
"the",
"given",
"author"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L986-L1001 |
215,155 | moodle/moodle | mod/workshop/locallib.php | workshop.get_published_submissions | public function get_published_submissions($orderby='finalgrade DESC') {
global $DB;
$authorfields = user_picture::fields('u', null, 'authoridx', 'author');
$sql = "SELECT s.id, s.authorid, s.timecreated, s.timemodified,
s.title, s.grade, s.gradeover, COALESCE(s.gradeover,... | php | public function get_published_submissions($orderby='finalgrade DESC') {
global $DB;
$authorfields = user_picture::fields('u', null, 'authoridx', 'author');
$sql = "SELECT s.id, s.authorid, s.timecreated, s.timemodified,
s.title, s.grade, s.gradeover, COALESCE(s.gradeover,... | [
"public",
"function",
"get_published_submissions",
"(",
"$",
"orderby",
"=",
"'finalgrade DESC'",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"authorfields",
"=",
"user_picture",
"::",
"fields",
"(",
"'u'",
",",
"null",
",",
"'authoridx'",
",",
"'author'",
")",
... | Returns published submissions with their authors data
@return array of stdclass | [
"Returns",
"published",
"submissions",
"with",
"their",
"authors",
"data"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L1008-L1021 |
215,156 | moodle/moodle | mod/workshop/locallib.php | workshop.get_examples_for_reviewer | public function get_examples_for_reviewer($reviewerid) {
global $DB;
if (empty($reviewerid)) {
return false;
}
$sql = 'SELECT s.id, s.title,
a.id AS assessmentid, a.grade, a.gradinggrade
FROM {workshop_submissions} s
LEFT... | php | public function get_examples_for_reviewer($reviewerid) {
global $DB;
if (empty($reviewerid)) {
return false;
}
$sql = 'SELECT s.id, s.title,
a.id AS assessmentid, a.grade, a.gradinggrade
FROM {workshop_submissions} s
LEFT... | [
"public",
"function",
"get_examples_for_reviewer",
"(",
"$",
"reviewerid",
")",
"{",
"global",
"$",
"DB",
";",
"if",
"(",
"empty",
"(",
"$",
"reviewerid",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"sql",
"=",
"'SELECT s.id, s.title,\n ... | Returns the list of all example submissions in this workshop with the information of assessments done by the given user
@param int $reviewerid user id
@return array of objects, indexed by example submission id
@see workshop::prepare_example_summary() | [
"Returns",
"the",
"list",
"of",
"all",
"example",
"submissions",
"in",
"this",
"workshop",
"with",
"the",
"information",
"of",
"assessments",
"done",
"by",
"the",
"given",
"user"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L1060-L1073 |
215,157 | moodle/moodle | mod/workshop/locallib.php | workshop.prepare_submission | public function prepare_submission(stdClass $record, $showauthor = false) {
$submission = new workshop_submission($this, $record, $showauthor);
$submission->url = $this->submission_url($record->id);
return $submission;
} | php | public function prepare_submission(stdClass $record, $showauthor = false) {
$submission = new workshop_submission($this, $record, $showauthor);
$submission->url = $this->submission_url($record->id);
return $submission;
} | [
"public",
"function",
"prepare_submission",
"(",
"stdClass",
"$",
"record",
",",
"$",
"showauthor",
"=",
"false",
")",
"{",
"$",
"submission",
"=",
"new",
"workshop_submission",
"(",
"$",
"this",
",",
"$",
"record",
",",
"$",
"showauthor",
")",
";",
"$",
... | Prepares renderable submission component
@param stdClass $record required by {@see workshop_submission}
@param bool $showauthor show the author-related information
@return workshop_submission | [
"Prepares",
"renderable",
"submission",
"component"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L1082-L1088 |
215,158 | moodle/moodle | mod/workshop/locallib.php | workshop.prepare_submission_summary | public function prepare_submission_summary(stdClass $record, $showauthor = false) {
$summary = new workshop_submission_summary($this, $record, $showauthor);
$summary->url = $this->submission_url($record->id);
return $summary;
} | php | public function prepare_submission_summary(stdClass $record, $showauthor = false) {
$summary = new workshop_submission_summary($this, $record, $showauthor);
$summary->url = $this->submission_url($record->id);
return $summary;
} | [
"public",
"function",
"prepare_submission_summary",
"(",
"stdClass",
"$",
"record",
",",
"$",
"showauthor",
"=",
"false",
")",
"{",
"$",
"summary",
"=",
"new",
"workshop_submission_summary",
"(",
"$",
"this",
",",
"$",
"record",
",",
"$",
"showauthor",
")",
... | Prepares renderable submission summary component
@param stdClass $record required by {@see workshop_submission_summary}
@param bool $showauthor show the author-related information
@return workshop_submission_summary | [
"Prepares",
"renderable",
"submission",
"summary",
"component"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L1097-L1103 |
215,159 | moodle/moodle | mod/workshop/locallib.php | workshop.prepare_example_summary | public function prepare_example_summary(stdClass $example) {
$summary = new workshop_example_submission_summary($this, $example);
if (is_null($example->grade)) {
$summary->status = 'notgraded';
$summary->assesslabel = get_string('assess', 'workshop');
} else {
... | php | public function prepare_example_summary(stdClass $example) {
$summary = new workshop_example_submission_summary($this, $example);
if (is_null($example->grade)) {
$summary->status = 'notgraded';
$summary->assesslabel = get_string('assess', 'workshop');
} else {
... | [
"public",
"function",
"prepare_example_summary",
"(",
"stdClass",
"$",
"example",
")",
"{",
"$",
"summary",
"=",
"new",
"workshop_example_submission_summary",
"(",
"$",
"this",
",",
"$",
"example",
")",
";",
"if",
"(",
"is_null",
"(",
"$",
"example",
"->",
"... | Prepares renderable example submission summary component
If the example is editable, the caller must set the 'editable' flag explicitly.
@param stdClass $example as returned by {@link workshop::get_examples_for_manager()} or {@link workshop::get_examples_for_reviewer()}
@return workshop_example_submission_summary to ... | [
"Prepares",
"renderable",
"example",
"submission",
"summary",
"component"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L1126-L1147 |
215,160 | moodle/moodle | mod/workshop/locallib.php | workshop.prepare_assessment | public function prepare_assessment(stdClass $record, $form, array $options = array()) {
$assessment = new workshop_assessment($this, $record, $options);
$assessment->url = $this->assess_url($record->id);
$assessment->maxgrade = $this->real_grade(100);
if (!empty($o... | php | public function prepare_assessment(stdClass $record, $form, array $options = array()) {
$assessment = new workshop_assessment($this, $record, $options);
$assessment->url = $this->assess_url($record->id);
$assessment->maxgrade = $this->real_grade(100);
if (!empty($o... | [
"public",
"function",
"prepare_assessment",
"(",
"stdClass",
"$",
"record",
",",
"$",
"form",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"assessment",
"=",
"new",
"workshop_assessment",
"(",
"$",
"this",
",",
"$",
"record",
",",... | Prepares renderable assessment component
The $options array supports the following keys:
showauthor - should the author user info be available for the renderer
showreviewer - should the reviewer user info be available for the renderer
showform - show the assessment form if it is available
showweight - should the asses... | [
"Prepares",
"renderable",
"assessment",
"component"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L1163-L1186 |
215,161 | moodle/moodle | mod/workshop/locallib.php | workshop.prepare_example_assessment | public function prepare_example_assessment(stdClass $record, $form = null, array $options = array()) {
$assessment = new workshop_example_assessment($this, $record, $options);
$assessment->url = $this->exassess_url($record->id);
$assessment->maxgrade = $this->real_grade(100... | php | public function prepare_example_assessment(stdClass $record, $form = null, array $options = array()) {
$assessment = new workshop_example_assessment($this, $record, $options);
$assessment->url = $this->exassess_url($record->id);
$assessment->maxgrade = $this->real_grade(100... | [
"public",
"function",
"prepare_example_assessment",
"(",
"stdClass",
"$",
"record",
",",
"$",
"form",
"=",
"null",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"assessment",
"=",
"new",
"workshop_example_assessment",
"(",
"$",
"this",... | Prepares renderable example submission's assessment component
The $options array supports the following keys:
showauthor - should the author user info be available for the renderer
showreviewer - should the reviewer user info be available for the renderer
showform - show the assessment form if it is available
@param ... | [
"Prepares",
"renderable",
"example",
"submission",
"s",
"assessment",
"component"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L1201-L1222 |
215,162 | moodle/moodle | mod/workshop/locallib.php | workshop.prepare_example_reference_assessment | public function prepare_example_reference_assessment(stdClass $record, $form = null, array $options = array()) {
$assessment = new workshop_example_reference_assessment($this, $record, $options);
$assessment->maxgrade = $this->real_grade(100);
if (!empty($options['showform']) and... | php | public function prepare_example_reference_assessment(stdClass $record, $form = null, array $options = array()) {
$assessment = new workshop_example_reference_assessment($this, $record, $options);
$assessment->maxgrade = $this->real_grade(100);
if (!empty($options['showform']) and... | [
"public",
"function",
"prepare_example_reference_assessment",
"(",
"stdClass",
"$",
"record",
",",
"$",
"form",
"=",
"null",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"assessment",
"=",
"new",
"workshop_example_reference_assessment",
"... | Prepares renderable example submission's reference assessment component
The $options array supports the following keys:
showauthor - should the author user info be available for the renderer
showreviewer - should the reviewer user info be available for the renderer
showform - show the assessment form if it is availabl... | [
"Prepares",
"renderable",
"example",
"submission",
"s",
"reference",
"assessment",
"component"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L1237-L1257 |
215,163 | moodle/moodle | mod/workshop/locallib.php | workshop.delete_submission | public function delete_submission(stdclass $submission) {
global $DB;
$assessments = $DB->get_records('workshop_assessments', array('submissionid' => $submission->id), '', 'id');
$this->delete_assessment(array_keys($assessments));
$fs = get_file_storage();
$fs->delete_area_file... | php | public function delete_submission(stdclass $submission) {
global $DB;
$assessments = $DB->get_records('workshop_assessments', array('submissionid' => $submission->id), '', 'id');
$this->delete_assessment(array_keys($assessments));
$fs = get_file_storage();
$fs->delete_area_file... | [
"public",
"function",
"delete_submission",
"(",
"stdclass",
"$",
"submission",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"assessments",
"=",
"$",
"DB",
"->",
"get_records",
"(",
"'workshop_assessments'",
",",
"array",
"(",
"'submissionid'",
"=>",
"$",
"submissi... | Removes the submission and all relevant data
@param stdClass $submission record to delete
@return void | [
"Removes",
"the",
"submission",
"and",
"all",
"relevant",
"data"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L1265-L1290 |
215,164 | moodle/moodle | mod/workshop/locallib.php | workshop.get_all_assessments | public function get_all_assessments() {
global $DB;
$reviewerfields = user_picture::fields('reviewer', null, 'revieweridx', 'reviewer');
$authorfields = user_picture::fields('author', null, 'authorid', 'author');
$overbyfields = user_picture::fields('overby', null, 'gradinggradeover... | php | public function get_all_assessments() {
global $DB;
$reviewerfields = user_picture::fields('reviewer', null, 'revieweridx', 'reviewer');
$authorfields = user_picture::fields('author', null, 'authorid', 'author');
$overbyfields = user_picture::fields('overby', null, 'gradinggradeover... | [
"public",
"function",
"get_all_assessments",
"(",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"reviewerfields",
"=",
"user_picture",
"::",
"fields",
"(",
"'reviewer'",
",",
"null",
",",
"'revieweridx'",
",",
"'reviewer'",
")",
";",
"$",
"authorfields",
"=",
"us... | Returns the list of all assessments in the workshop with some data added
Fetches data from {workshop_assessments} and adds some useful information from other
tables. The returned object does not contain textual fields (i.e. comments) to prevent memory
lack issues.
@return array [assessmentid] => assessment stdclass | [
"Returns",
"the",
"list",
"of",
"all",
"assessments",
"in",
"the",
"workshop",
"with",
"some",
"data",
"added"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L1301-L1322 |
215,165 | moodle/moodle | mod/workshop/locallib.php | workshop.get_assessment_by_id | public function get_assessment_by_id($id) {
global $DB;
$reviewerfields = user_picture::fields('reviewer', null, 'revieweridx', 'reviewer');
$authorfields = user_picture::fields('author', null, 'authorid', 'author');
$overbyfields = user_picture::fields('overby', null, 'gradinggrade... | php | public function get_assessment_by_id($id) {
global $DB;
$reviewerfields = user_picture::fields('reviewer', null, 'revieweridx', 'reviewer');
$authorfields = user_picture::fields('author', null, 'authorid', 'author');
$overbyfields = user_picture::fields('overby', null, 'gradinggrade... | [
"public",
"function",
"get_assessment_by_id",
"(",
"$",
"id",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"reviewerfields",
"=",
"user_picture",
"::",
"fields",
"(",
"'reviewer'",
",",
"null",
",",
"'revieweridx'",
",",
"'reviewer'",
")",
";",
"$",
"authorfield... | Get the complete information about the given assessment
@param int $id Assessment ID
@return stdclass | [
"Get",
"the",
"complete",
"information",
"about",
"the",
"given",
"assessment"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L1330-L1346 |
215,166 | moodle/moodle | mod/workshop/locallib.php | workshop.get_assessment_of_submission_by_user | public function get_assessment_of_submission_by_user($submissionid, $reviewerid) {
global $DB;
$reviewerfields = user_picture::fields('reviewer', null, 'revieweridx', 'reviewer');
$authorfields = user_picture::fields('author', null, 'authorid', 'author');
$overbyfields = user_pictur... | php | public function get_assessment_of_submission_by_user($submissionid, $reviewerid) {
global $DB;
$reviewerfields = user_picture::fields('reviewer', null, 'revieweridx', 'reviewer');
$authorfields = user_picture::fields('author', null, 'authorid', 'author');
$overbyfields = user_pictur... | [
"public",
"function",
"get_assessment_of_submission_by_user",
"(",
"$",
"submissionid",
",",
"$",
"reviewerid",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"reviewerfields",
"=",
"user_picture",
"::",
"fields",
"(",
"'reviewer'",
",",
"null",
",",
"'revieweridx'",
... | Get the complete information about the user's assessment of the given submission
@param int $sid submission ID
@param int $uid user ID of the reviewer
@return false|stdclass false if not found, stdclass otherwise | [
"Get",
"the",
"complete",
"information",
"about",
"the",
"user",
"s",
"assessment",
"of",
"the",
"given",
"submission"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L1355-L1371 |
215,167 | moodle/moodle | mod/workshop/locallib.php | workshop.get_assessments_of_submission | public function get_assessments_of_submission($submissionid) {
global $DB;
$reviewerfields = user_picture::fields('reviewer', null, 'revieweridx', 'reviewer');
$overbyfields = user_picture::fields('overby', null, 'gradinggradeoverbyx', 'overby');
list($sort, $params) = users_order_by_... | php | public function get_assessments_of_submission($submissionid) {
global $DB;
$reviewerfields = user_picture::fields('reviewer', null, 'revieweridx', 'reviewer');
$overbyfields = user_picture::fields('overby', null, 'gradinggradeoverbyx', 'overby');
list($sort, $params) = users_order_by_... | [
"public",
"function",
"get_assessments_of_submission",
"(",
"$",
"submissionid",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"reviewerfields",
"=",
"user_picture",
"::",
"fields",
"(",
"'reviewer'",
",",
"null",
",",
"'revieweridx'",
",",
"'reviewer'",
")",
";",
... | Get the complete information about all assessments of the given submission
@param int $submissionid
@return array | [
"Get",
"the",
"complete",
"information",
"about",
"all",
"assessments",
"of",
"the",
"given",
"submission"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L1379-L1396 |
215,168 | moodle/moodle | mod/workshop/locallib.php | workshop.get_assessments_by_reviewer | public function get_assessments_by_reviewer($reviewerid) {
global $DB;
$reviewerfields = user_picture::fields('reviewer', null, 'revieweridx', 'reviewer');
$authorfields = user_picture::fields('author', null, 'authorid', 'author');
$overbyfields = user_picture::fields('overby', null... | php | public function get_assessments_by_reviewer($reviewerid) {
global $DB;
$reviewerfields = user_picture::fields('reviewer', null, 'revieweridx', 'reviewer');
$authorfields = user_picture::fields('author', null, 'authorid', 'author');
$overbyfields = user_picture::fields('overby', null... | [
"public",
"function",
"get_assessments_by_reviewer",
"(",
"$",
"reviewerid",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"reviewerfields",
"=",
"user_picture",
"::",
"fields",
"(",
"'reviewer'",
",",
"null",
",",
"'revieweridx'",
",",
"'reviewer'",
")",
";",
"$",... | Get the complete information about all assessments allocated to the given reviewer
@param int $reviewerid
@return array | [
"Get",
"the",
"complete",
"information",
"about",
"all",
"assessments",
"allocated",
"to",
"the",
"given",
"reviewer"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L1404-L1422 |
215,169 | moodle/moodle | mod/workshop/locallib.php | workshop.get_pending_assessments_by_reviewer | public function get_pending_assessments_by_reviewer($reviewerid, $exclude = null) {
$assessments = $this->get_assessments_by_reviewer($reviewerid);
foreach ($assessments as $id => $assessment) {
if (!is_null($assessment->grade)) {
unset($assessments[$id]);
c... | php | public function get_pending_assessments_by_reviewer($reviewerid, $exclude = null) {
$assessments = $this->get_assessments_by_reviewer($reviewerid);
foreach ($assessments as $id => $assessment) {
if (!is_null($assessment->grade)) {
unset($assessments[$id]);
c... | [
"public",
"function",
"get_pending_assessments_by_reviewer",
"(",
"$",
"reviewerid",
",",
"$",
"exclude",
"=",
"null",
")",
"{",
"$",
"assessments",
"=",
"$",
"this",
"->",
"get_assessments_by_reviewer",
"(",
"$",
"reviewerid",
")",
";",
"foreach",
"(",
"$",
"... | Get allocated assessments not graded yet by the given reviewer
@see self::get_assessments_by_reviewer()
@param int $reviewerid the reviewer id
@param null|int|array $exclude optional assessment id (or list of them) to be excluded
@return array | [
"Get",
"allocated",
"assessments",
"not",
"graded",
"yet",
"by",
"the",
"given",
"reviewer"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L1432-L1453 |
215,170 | moodle/moodle | mod/workshop/locallib.php | workshop.add_allocation | public function add_allocation(stdclass $submission, $reviewerid, $weight=1, $bulk=false) {
global $DB;
if ($DB->record_exists('workshop_assessments', array('submissionid' => $submission->id, 'reviewerid' => $reviewerid))) {
return self::ALLOCATION_EXISTS;
}
$weight = (int)... | php | public function add_allocation(stdclass $submission, $reviewerid, $weight=1, $bulk=false) {
global $DB;
if ($DB->record_exists('workshop_assessments', array('submissionid' => $submission->id, 'reviewerid' => $reviewerid))) {
return self::ALLOCATION_EXISTS;
}
$weight = (int)... | [
"public",
"function",
"add_allocation",
"(",
"stdclass",
"$",
"submission",
",",
"$",
"reviewerid",
",",
"$",
"weight",
"=",
"1",
",",
"$",
"bulk",
"=",
"false",
")",
"{",
"global",
"$",
"DB",
";",
"if",
"(",
"$",
"DB",
"->",
"record_exists",
"(",
"'... | Allocate a submission to a user for review
@param stdClass $submission Submission object with at least id property
@param int $reviewerid User ID
@param int $weight of the new assessment, from 0 to 16
@param bool $bulk repeated inserts into DB expected
@return int ID of the new assessment or an error code {@link self:... | [
"Allocate",
"a",
"submission",
"to",
"a",
"user",
"for",
"review"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L1464-L1489 |
215,171 | moodle/moodle | mod/workshop/locallib.php | workshop.delete_assessment | public function delete_assessment($id) {
global $DB;
if (empty($id)) {
return true;
}
$fs = get_file_storage();
if (is_array($id)) {
$DB->delete_records_list('workshop_grades', 'assessmentid', $id);
foreach ($id as $itemid) {
... | php | public function delete_assessment($id) {
global $DB;
if (empty($id)) {
return true;
}
$fs = get_file_storage();
if (is_array($id)) {
$DB->delete_records_list('workshop_grades', 'assessmentid', $id);
foreach ($id as $itemid) {
... | [
"public",
"function",
"delete_assessment",
"(",
"$",
"id",
")",
"{",
"global",
"$",
"DB",
";",
"if",
"(",
"empty",
"(",
"$",
"id",
")",
")",
"{",
"return",
"true",
";",
"}",
"$",
"fs",
"=",
"get_file_storage",
"(",
")",
";",
"if",
"(",
"is_array",
... | Delete assessment record or records.
Removes associated records from the workshop_grades table, too.
@param int|array $id assessment id or array of assessments ids
@todo Give grading strategy plugins a chance to clean up their data, too.
@return bool true | [
"Delete",
"assessment",
"record",
"or",
"records",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L1500-L1525 |
215,172 | moodle/moodle | mod/workshop/locallib.php | workshop.grading_strategy_instance | public function grading_strategy_instance() {
global $CFG; // because we require other libs here
if (is_null($this->strategyinstance)) {
$strategylib = __DIR__ . '/form/' . $this->strategy . '/lib.php';
if (is_readable($strategylib)) {
require_once($strategyli... | php | public function grading_strategy_instance() {
global $CFG; // because we require other libs here
if (is_null($this->strategyinstance)) {
$strategylib = __DIR__ . '/form/' . $this->strategy . '/lib.php';
if (is_readable($strategylib)) {
require_once($strategyli... | [
"public",
"function",
"grading_strategy_instance",
"(",
")",
"{",
"global",
"$",
"CFG",
";",
"// because we require other libs here",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"strategyinstance",
")",
")",
"{",
"$",
"strategylib",
"=",
"__DIR__",
".",
"'/for... | Returns instance of grading strategy class
@return stdclass Instance of a grading strategy | [
"Returns",
"instance",
"of",
"grading",
"strategy",
"class"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L1532-L1549 |
215,173 | moodle/moodle | mod/workshop/locallib.php | workshop.set_grading_evaluation_method | public function set_grading_evaluation_method($method) {
global $DB;
$evaluationlib = __DIR__ . '/eval/' . $method . '/lib.php';
if (is_readable($evaluationlib)) {
$this->evaluationinstance = null;
$this->evaluation = $method;
$DB->set_field('workshop', 'eva... | php | public function set_grading_evaluation_method($method) {
global $DB;
$evaluationlib = __DIR__ . '/eval/' . $method . '/lib.php';
if (is_readable($evaluationlib)) {
$this->evaluationinstance = null;
$this->evaluation = $method;
$DB->set_field('workshop', 'eva... | [
"public",
"function",
"set_grading_evaluation_method",
"(",
"$",
"method",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"evaluationlib",
"=",
"__DIR__",
".",
"'/eval/'",
".",
"$",
"method",
".",
"'/lib.php'",
";",
"if",
"(",
"is_readable",
"(",
"$",
"evaluationl... | Sets the current evaluation method to the given plugin.
@param string $method the name of the workshopeval subplugin
@return bool true if successfully set
@throws coding_exception if attempting to set a non-installed evaluation method | [
"Sets",
"the",
"current",
"evaluation",
"method",
"to",
"the",
"given",
"plugin",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L1558-L1571 |
215,174 | moodle/moodle | mod/workshop/locallib.php | workshop.grading_evaluation_instance | public function grading_evaluation_instance() {
global $CFG; // because we require other libs here
if (is_null($this->evaluationinstance)) {
if (empty($this->evaluation)) {
$this->evaluation = 'best';
}
$evaluationlib = __DIR__ . '/eval/' . $this->... | php | public function grading_evaluation_instance() {
global $CFG; // because we require other libs here
if (is_null($this->evaluationinstance)) {
if (empty($this->evaluation)) {
$this->evaluation = 'best';
}
$evaluationlib = __DIR__ . '/eval/' . $this->... | [
"public",
"function",
"grading_evaluation_instance",
"(",
")",
"{",
"global",
"$",
"CFG",
";",
"// because we require other libs here",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"evaluationinstance",
")",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->... | Returns instance of grading evaluation class
@return stdclass Instance of a grading evaluation | [
"Returns",
"instance",
"of",
"grading",
"evaluation",
"class"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L1578-L1606 |
215,175 | moodle/moodle | mod/workshop/locallib.php | workshop.allocator_instance | public function allocator_instance($method) {
global $CFG; // because we require other libs here
$allocationlib = __DIR__ . '/allocation/' . $method . '/lib.php';
if (is_readable($allocationlib)) {
require_once($allocationlib);
} else {
throw new coding_except... | php | public function allocator_instance($method) {
global $CFG; // because we require other libs here
$allocationlib = __DIR__ . '/allocation/' . $method . '/lib.php';
if (is_readable($allocationlib)) {
require_once($allocationlib);
} else {
throw new coding_except... | [
"public",
"function",
"allocator_instance",
"(",
"$",
"method",
")",
"{",
"global",
"$",
"CFG",
";",
"// because we require other libs here",
"$",
"allocationlib",
"=",
"__DIR__",
".",
"'/allocation/'",
".",
"$",
"method",
".",
"'/lib.php'",
";",
"if",
"(",
"is_... | Returns instance of submissions allocator
@param string $method The name of the allocation method, must be PARAM_ALPHA
@return stdclass Instance of submissions allocator | [
"Returns",
"instance",
"of",
"submissions",
"allocator"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L1614-L1625 |
215,176 | moodle/moodle | mod/workshop/locallib.php | workshop.creating_submission_allowed | public function creating_submission_allowed($userid) {
$now = time();
$ignoredeadlines = has_capability('mod/workshop:ignoredeadlines', $this->context, $userid);
if ($this->latesubmissions) {
if ($this->phase != self::PHASE_SUBMISSION and $this->phase != self::PHASE_ASSESSMENT) {
... | php | public function creating_submission_allowed($userid) {
$now = time();
$ignoredeadlines = has_capability('mod/workshop:ignoredeadlines', $this->context, $userid);
if ($this->latesubmissions) {
if ($this->phase != self::PHASE_SUBMISSION and $this->phase != self::PHASE_ASSESSMENT) {
... | [
"public",
"function",
"creating_submission_allowed",
"(",
"$",
"userid",
")",
"{",
"$",
"now",
"=",
"time",
"(",
")",
";",
"$",
"ignoredeadlines",
"=",
"has_capability",
"(",
"'mod/workshop:ignoredeadlines'",
",",
"$",
"this",
"->",
"context",
",",
"$",
"useri... | Is the given user allowed to create their submission?
@param int $userid
@return bool | [
"Is",
"the",
"given",
"user",
"allowed",
"to",
"create",
"their",
"submission?"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L1797-L1828 |
215,177 | moodle/moodle | mod/workshop/locallib.php | workshop.modifying_submission_allowed | public function modifying_submission_allowed($userid) {
$now = time();
$ignoredeadlines = has_capability('mod/workshop:ignoredeadlines', $this->context, $userid);
if ($this->phase != self::PHASE_SUBMISSION) {
// submissions can be edited during the submission phase only
... | php | public function modifying_submission_allowed($userid) {
$now = time();
$ignoredeadlines = has_capability('mod/workshop:ignoredeadlines', $this->context, $userid);
if ($this->phase != self::PHASE_SUBMISSION) {
// submissions can be edited during the submission phase only
... | [
"public",
"function",
"modifying_submission_allowed",
"(",
"$",
"userid",
")",
"{",
"$",
"now",
"=",
"time",
"(",
")",
";",
"$",
"ignoredeadlines",
"=",
"has_capability",
"(",
"'mod/workshop:ignoredeadlines'",
",",
"$",
"this",
"->",
"context",
",",
"$",
"user... | Is the given user allowed to modify their existing submission?
@param int $userid
@return bool | [
"Is",
"the",
"given",
"user",
"allowed",
"to",
"modify",
"their",
"existing",
"submission?"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L1836-L1854 |
215,178 | moodle/moodle | mod/workshop/locallib.php | workshop.switch_phase | public function switch_phase($newphase) {
global $DB;
$known = $this->available_phases_list();
if (!isset($known[$newphase])) {
return false;
}
if (self::PHASE_CLOSED == $newphase) {
// push the grades into the gradebook
$workshop = new stdcl... | php | public function switch_phase($newphase) {
global $DB;
$known = $this->available_phases_list();
if (!isset($known[$newphase])) {
return false;
}
if (self::PHASE_CLOSED == $newphase) {
// push the grades into the gradebook
$workshop = new stdcl... | [
"public",
"function",
"switch_phase",
"(",
"$",
"newphase",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"known",
"=",
"$",
"this",
"->",
"available_phases_list",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"known",
"[",
"$",
"newphase",
"]",
")",
... | Switch to a new workshop phase
Modifies the underlying database record. You should terminate the script shortly after calling this.
@param int $newphase new phase code
@return bool true if success, false otherwise | [
"Switch",
"to",
"a",
"new",
"workshop",
"phase"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L1929-L1961 |
215,179 | moodle/moodle | mod/workshop/locallib.php | workshop.set_peer_grade | public function set_peer_grade($assessmentid, $grade) {
global $DB;
if (is_null($grade)) {
return false;
}
$data = new stdclass();
$data->id = $assessmentid;
$data->grade = $grade;
$data->timemodified = time();
$DB->update_record('workshop_ass... | php | public function set_peer_grade($assessmentid, $grade) {
global $DB;
if (is_null($grade)) {
return false;
}
$data = new stdclass();
$data->id = $assessmentid;
$data->grade = $grade;
$data->timemodified = time();
$DB->update_record('workshop_ass... | [
"public",
"function",
"set_peer_grade",
"(",
"$",
"assessmentid",
",",
"$",
"grade",
")",
"{",
"global",
"$",
"DB",
";",
"if",
"(",
"is_null",
"(",
"$",
"grade",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"data",
"=",
"new",
"stdclass",
"(",
... | Saves a raw grade for submission as calculated from the assessment form fields
@param array $assessmentid assessment record id, must exists
@param mixed $grade raw percentual grade from 0.00000 to 100.00000
@return false|float the saved grade | [
"Saves",
"a",
"raw",
"grade",
"for",
"submission",
"as",
"calculated",
"from",
"the",
"assessment",
"form",
"fields"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L1970-L1982 |
215,180 | moodle/moodle | mod/workshop/locallib.php | workshop.real_grade_value | public function real_grade_value($value, $max) {
$localized = true;
if (is_null($value) or $value === '') {
return null;
} elseif ($max == 0) {
return 0;
} else {
return format_float($max * $value / 100, $this->gradedecimals, $localized);
}
... | php | public function real_grade_value($value, $max) {
$localized = true;
if (is_null($value) or $value === '') {
return null;
} elseif ($max == 0) {
return 0;
} else {
return format_float($max * $value / 100, $this->gradedecimals, $localized);
}
... | [
"public",
"function",
"real_grade_value",
"(",
"$",
"value",
",",
"$",
"max",
")",
"{",
"$",
"localized",
"=",
"true",
";",
"if",
"(",
"is_null",
"(",
"$",
"value",
")",
"or",
"$",
"value",
"===",
"''",
")",
"{",
"return",
"null",
";",
"}",
"elseif... | Calculates the real value of a grade
@param float $value percentual value from 0 to 100
@param float $max the maximal grade
@return string | [
"Calculates",
"the",
"real",
"value",
"of",
"a",
"grade"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L2221-L2230 |
215,181 | moodle/moodle | mod/workshop/locallib.php | workshop.clear_assessments | public function clear_assessments() {
global $DB;
$submissions = $this->get_submissions();
if (empty($submissions)) {
// no money, no love
return;
}
$submissions = array_keys($submissions);
list($sql, $params) = $DB->get_in_or_equal($submissions, ... | php | public function clear_assessments() {
global $DB;
$submissions = $this->get_submissions();
if (empty($submissions)) {
// no money, no love
return;
}
$submissions = array_keys($submissions);
list($sql, $params) = $DB->get_in_or_equal($submissions, ... | [
"public",
"function",
"clear_assessments",
"(",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"submissions",
"=",
"$",
"this",
"->",
"get_submissions",
"(",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"submissions",
")",
")",
"{",
"// no money, no love",
"return",
... | Sets the given grades and received grading grades to null
This does not clear the information about how the peers filled the assessment forms, but
clears the calculated grades in workshop_assessments. Therefore reviewers have to re-assess
the allocated submissions.
@return void | [
"Sets",
"the",
"given",
"grades",
"and",
"received",
"grading",
"grades",
"to",
"null"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L2284-L2297 |
215,182 | moodle/moodle | mod/workshop/locallib.php | workshop.clear_grading_grades | public function clear_grading_grades($restrict=null) {
global $DB;
$sql = "workshopid = :workshopid";
$params = array('workshopid' => $this->id);
if (is_null($restrict)) {
// update all users - no more conditions
} elseif (!empty($restrict)) {
list($usql... | php | public function clear_grading_grades($restrict=null) {
global $DB;
$sql = "workshopid = :workshopid";
$params = array('workshopid' => $this->id);
if (is_null($restrict)) {
// update all users - no more conditions
} elseif (!empty($restrict)) {
list($usql... | [
"public",
"function",
"clear_grading_grades",
"(",
"$",
"restrict",
"=",
"null",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"sql",
"=",
"\"workshopid = :workshopid\"",
";",
"$",
"params",
"=",
"array",
"(",
"'workshopid'",
"=>",
"$",
"this",
"->",
"id",
")",... | Sets the aggregated grades for assessment to null
@param null|int|array $restrict If null, update all reviewers, otherwise update just grades for the given reviewer(s)
@return void | [
"Sets",
"the",
"aggregated",
"grades",
"for",
"assessment",
"to",
"null"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L2384-L2401 |
215,183 | moodle/moodle | mod/workshop/locallib.php | workshop.get_feedbackreviewer_form | public function get_feedbackreviewer_form($actionurl, stdclass $assessment, $options=array()) {
global $CFG;
require_once(__DIR__ . '/feedbackreviewer_form.php');
$current = new stdclass();
$current->asid = $assessment->id;
$current->weight ... | php | public function get_feedbackreviewer_form($actionurl, stdclass $assessment, $options=array()) {
global $CFG;
require_once(__DIR__ . '/feedbackreviewer_form.php');
$current = new stdclass();
$current->asid = $assessment->id;
$current->weight ... | [
"public",
"function",
"get_feedbackreviewer_form",
"(",
"$",
"actionurl",
",",
"stdclass",
"$",
"assessment",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"global",
"$",
"CFG",
";",
"require_once",
"(",
"__DIR__",
".",
"'/feedbackreviewer_form.php'",
... | Returns the mform the teachers use to put a feedback for the reviewer
@param mixed moodle_url|null $actionurl
@param stdClass $assessment
@param array $options editable, editableweight, overridablegradinggrade
@return workshop_feedbackreviewer_form | [
"Returns",
"the",
"mform",
"the",
"teachers",
"use",
"to",
"put",
"a",
"feedback",
"for",
"the",
"reviewer"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L2469-L2495 |
215,184 | moodle/moodle | mod/workshop/locallib.php | workshop.get_feedbackauthor_form | public function get_feedbackauthor_form($actionurl, stdclass $submission, $options=array()) {
global $CFG;
require_once(__DIR__ . '/feedbackauthor_form.php');
$current = new stdclass();
$current->submissionid = $submission->id;
$current->published = $submiss... | php | public function get_feedbackauthor_form($actionurl, stdclass $submission, $options=array()) {
global $CFG;
require_once(__DIR__ . '/feedbackauthor_form.php');
$current = new stdclass();
$current->submissionid = $submission->id;
$current->published = $submiss... | [
"public",
"function",
"get_feedbackauthor_form",
"(",
"$",
"actionurl",
",",
"stdclass",
"$",
"submission",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"global",
"$",
"CFG",
";",
"require_once",
"(",
"__DIR__",
".",
"'/feedbackauthor_form.php'",
")"... | Returns the mform the teachers use to put a feedback for the author on their submission
@mixed moodle_url|null $actionurl
@param stdClass $submission
@param array $options editable
@return workshop_feedbackauthor_form | [
"Returns",
"the",
"mform",
"the",
"teachers",
"use",
"to",
"put",
"a",
"feedback",
"for",
"the",
"author",
"on",
"their",
"submission"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L2505-L2531 |
215,185 | moodle/moodle | mod/workshop/locallib.php | workshop.get_gradebook_grades | public function get_gradebook_grades($userid) {
global $CFG;
require_once($CFG->libdir.'/gradelib.php');
if (empty($userid)) {
throw new coding_exception('User id expected, empty value given.');
}
// Read data via the Gradebook API
$gradebook = grade_get_gra... | php | public function get_gradebook_grades($userid) {
global $CFG;
require_once($CFG->libdir.'/gradelib.php');
if (empty($userid)) {
throw new coding_exception('User id expected, empty value given.');
}
// Read data via the Gradebook API
$gradebook = grade_get_gra... | [
"public",
"function",
"get_gradebook_grades",
"(",
"$",
"userid",
")",
"{",
"global",
"$",
"CFG",
";",
"require_once",
"(",
"$",
"CFG",
"->",
"libdir",
".",
"'/gradelib.php'",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"userid",
")",
")",
"{",
"throw",
"n... | Returns the information about the user's grades as they are stored in the gradebook
The submission grade is returned for users with the capability mod/workshop:submit and the
assessment grade is returned for users with the capability mod/workshop:peerassess. Unless the
user has the capability to view hidden grades, gr... | [
"Returns",
"the",
"information",
"about",
"the",
"user",
"s",
"grades",
"as",
"they",
"are",
"stored",
"in",
"the",
"gradebook"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L2544-L2584 |
215,186 | moodle/moodle | mod/workshop/locallib.php | workshop.submission_content_options | public function submission_content_options() {
global $CFG;
require_once($CFG->dirroot.'/repository/lib.php');
return array(
'trusttext' => true,
'subdirs' => false,
'maxfiles' => $this->nattachments,
'maxbytes' => $this->maxbytes,
'co... | php | public function submission_content_options() {
global $CFG;
require_once($CFG->dirroot.'/repository/lib.php');
return array(
'trusttext' => true,
'subdirs' => false,
'maxfiles' => $this->nattachments,
'maxbytes' => $this->maxbytes,
'co... | [
"public",
"function",
"submission_content_options",
"(",
")",
"{",
"global",
"$",
"CFG",
";",
"require_once",
"(",
"$",
"CFG",
"->",
"dirroot",
".",
"'/repository/lib.php'",
")",
";",
"return",
"array",
"(",
"'trusttext'",
"=>",
"true",
",",
"'subdirs'",
"=>",... | Return the editor options for the submission content field.
@return array | [
"Return",
"the",
"editor",
"options",
"for",
"the",
"submission",
"content",
"field",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L2591-L2603 |
215,187 | moodle/moodle | mod/workshop/locallib.php | workshop.submission_attachment_options | public function submission_attachment_options() {
global $CFG;
require_once($CFG->dirroot.'/repository/lib.php');
$options = array(
'subdirs' => true,
'maxfiles' => $this->nattachments,
'maxbytes' => $this->maxbytes,
'return_types' => FILE_INTERNA... | php | public function submission_attachment_options() {
global $CFG;
require_once($CFG->dirroot.'/repository/lib.php');
$options = array(
'subdirs' => true,
'maxfiles' => $this->nattachments,
'maxbytes' => $this->maxbytes,
'return_types' => FILE_INTERNA... | [
"public",
"function",
"submission_attachment_options",
"(",
")",
"{",
"global",
"$",
"CFG",
";",
"require_once",
"(",
"$",
"CFG",
"->",
"dirroot",
".",
"'/repository/lib.php'",
")",
";",
"$",
"options",
"=",
"array",
"(",
"'subdirs'",
"=>",
"true",
",",
"'ma... | Return the filemanager options for the submission attachments field.
@return array | [
"Return",
"the",
"filemanager",
"options",
"for",
"the",
"submission",
"attachments",
"field",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L2610-L2625 |
215,188 | moodle/moodle | mod/workshop/locallib.php | workshop.overall_feedback_content_options | public function overall_feedback_content_options() {
global $CFG;
require_once($CFG->dirroot.'/repository/lib.php');
return array(
'subdirs' => 0,
'maxbytes' => $this->overallfeedbackmaxbytes,
'maxfiles' => $this->overallfeedbackfiles,
'changeform... | php | public function overall_feedback_content_options() {
global $CFG;
require_once($CFG->dirroot.'/repository/lib.php');
return array(
'subdirs' => 0,
'maxbytes' => $this->overallfeedbackmaxbytes,
'maxfiles' => $this->overallfeedbackfiles,
'changeform... | [
"public",
"function",
"overall_feedback_content_options",
"(",
")",
"{",
"global",
"$",
"CFG",
";",
"require_once",
"(",
"$",
"CFG",
"->",
"dirroot",
".",
"'/repository/lib.php'",
")",
";",
"return",
"array",
"(",
"'subdirs'",
"=>",
"0",
",",
"'maxbytes'",
"=>... | Return the editor options for the overall feedback for the author.
@return array | [
"Return",
"the",
"editor",
"options",
"for",
"the",
"overall",
"feedback",
"for",
"the",
"author",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L2632-L2644 |
215,189 | moodle/moodle | mod/workshop/locallib.php | workshop.overall_feedback_attachment_options | public function overall_feedback_attachment_options() {
global $CFG;
require_once($CFG->dirroot.'/repository/lib.php');
$options = array(
'subdirs' => 1,
'maxbytes' => $this->overallfeedbackmaxbytes,
'maxfiles' => $this->overallfeedbackfiles,
'ret... | php | public function overall_feedback_attachment_options() {
global $CFG;
require_once($CFG->dirroot.'/repository/lib.php');
$options = array(
'subdirs' => 1,
'maxbytes' => $this->overallfeedbackmaxbytes,
'maxfiles' => $this->overallfeedbackfiles,
'ret... | [
"public",
"function",
"overall_feedback_attachment_options",
"(",
")",
"{",
"global",
"$",
"CFG",
";",
"require_once",
"(",
"$",
"CFG",
"->",
"dirroot",
".",
"'/repository/lib.php'",
")",
";",
"$",
"options",
"=",
"array",
"(",
"'subdirs'",
"=>",
"1",
",",
"... | Return the filemanager options for the overall feedback for the author.
@return array | [
"Return",
"the",
"filemanager",
"options",
"for",
"the",
"overall",
"feedback",
"for",
"the",
"author",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L2651-L2666 |
215,190 | moodle/moodle | mod/workshop/locallib.php | workshop.reset_userdata | public function reset_userdata(stdClass $data) {
$componentstr = get_string('pluginname', 'workshop').': '.format_string($this->name);
$status = array();
if (!empty($data->reset_workshop_assessments) or !empty($data->reset_workshop_submissions)) {
// Reset all data related to asses... | php | public function reset_userdata(stdClass $data) {
$componentstr = get_string('pluginname', 'workshop').': '.format_string($this->name);
$status = array();
if (!empty($data->reset_workshop_assessments) or !empty($data->reset_workshop_submissions)) {
// Reset all data related to asses... | [
"public",
"function",
"reset_userdata",
"(",
"stdClass",
"$",
"data",
")",
"{",
"$",
"componentstr",
"=",
"get_string",
"(",
"'pluginname'",
",",
"'workshop'",
")",
".",
"': '",
".",
"format_string",
"(",
"$",
"this",
"->",
"name",
")",
";",
"$",
"status",... | Performs the reset of this workshop instance.
@param stdClass $data The actual course reset settings.
@return array List of results, each being array[(string)component, (string)item, (string)error] | [
"Performs",
"the",
"reset",
"of",
"this",
"workshop",
"instance",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L2674-L2728 |
215,191 | moodle/moodle | mod/workshop/locallib.php | workshop.check_group_membership | public function check_group_membership($otheruserid) {
global $USER;
if (groups_get_activity_groupmode($this->cm) != SEPARATEGROUPS) {
// The workshop is not in a group mode, or it is in a visible group mode.
return true;
} else if (has_capability('moodle/site:accessall... | php | public function check_group_membership($otheruserid) {
global $USER;
if (groups_get_activity_groupmode($this->cm) != SEPARATEGROUPS) {
// The workshop is not in a group mode, or it is in a visible group mode.
return true;
} else if (has_capability('moodle/site:accessall... | [
"public",
"function",
"check_group_membership",
"(",
"$",
"otheruserid",
")",
"{",
"global",
"$",
"USER",
";",
"if",
"(",
"groups_get_activity_groupmode",
"(",
"$",
"this",
"->",
"cm",
")",
"!=",
"SEPARATEGROUPS",
")",
"{",
"// The workshop is not in a group mode, o... | Check if the current user can access the other user's group.
This is typically used for teacher roles that have permissions like
'view all submissions'. Even with such a permission granted, we have to
check the workshop activity group mode.
If the workshop is not in a group mode, or if it is in the visible group
mode... | [
"Check",
"if",
"the",
"current",
"user",
"can",
"access",
"the",
"other",
"user",
"s",
"group",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L2748-L2773 |
215,192 | moodle/moodle | mod/workshop/locallib.php | workshop.check_examples_assessed_before_submission | public function check_examples_assessed_before_submission($userid) {
if ($this->useexamples and $this->examplesmode == self::EXAMPLES_BEFORE_SUBMISSION
and !has_capability('mod/workshop:manageexamples', $this->context)) {
// Check that all required examples have been assessed by the us... | php | public function check_examples_assessed_before_submission($userid) {
if ($this->useexamples and $this->examplesmode == self::EXAMPLES_BEFORE_SUBMISSION
and !has_capability('mod/workshop:manageexamples', $this->context)) {
// Check that all required examples have been assessed by the us... | [
"public",
"function",
"check_examples_assessed_before_submission",
"(",
"$",
"userid",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"useexamples",
"and",
"$",
"this",
"->",
"examplesmode",
"==",
"self",
"::",
"EXAMPLES_BEFORE_SUBMISSION",
"and",
"!",
"has_capability",
... | Check whether the given user has assessed all his required examples before submission.
@param int $userid the user to check
@return bool false if there are examples missing assessment, true otherwise.
@since Moodle 3.4 | [
"Check",
"whether",
"the",
"given",
"user",
"has",
"assessed",
"all",
"his",
"required",
"examples",
"before",
"submission",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L2782-L2799 |
215,193 | moodle/moodle | mod/workshop/locallib.php | workshop.check_examples_assessed_before_assessment | public function check_examples_assessed_before_assessment($userid) {
if ($this->useexamples and $this->examplesmode == self::EXAMPLES_BEFORE_ASSESSMENT
and !has_capability('mod/workshop:manageexamples', $this->context)) {
// The reviewer must have submitted their own submission.
... | php | public function check_examples_assessed_before_assessment($userid) {
if ($this->useexamples and $this->examplesmode == self::EXAMPLES_BEFORE_ASSESSMENT
and !has_capability('mod/workshop:manageexamples', $this->context)) {
// The reviewer must have submitted their own submission.
... | [
"public",
"function",
"check_examples_assessed_before_assessment",
"(",
"$",
"userid",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"useexamples",
"and",
"$",
"this",
"->",
"examplesmode",
"==",
"self",
"::",
"EXAMPLES_BEFORE_ASSESSMENT",
"and",
"!",
"has_capability",
... | Check that all required examples have been assessed by the given user.
@param stdClass $userid the user (reviewer) to check
@return mixed bool|state false and notice code if there are examples missing assessment, true otherwise.
@since Moodle 3.4 | [
"Check",
"that",
"all",
"required",
"examples",
"have",
"been",
"assessed",
"by",
"the",
"given",
"user",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L2808-L2828 |
215,194 | moodle/moodle | mod/workshop/locallib.php | workshop.validate_submission_data | public function validate_submission_data($data) {
global $DB, $USER;
$errors = array();
if (empty($data['id']) and empty($data['example'])) {
// Make sure there is no submission saved meanwhile from another browser window.
$sql = "SELECT COUNT(s.id)
... | php | public function validate_submission_data($data) {
global $DB, $USER;
$errors = array();
if (empty($data['id']) and empty($data['example'])) {
// Make sure there is no submission saved meanwhile from another browser window.
$sql = "SELECT COUNT(s.id)
... | [
"public",
"function",
"validate_submission_data",
"(",
"$",
"data",
")",
"{",
"global",
"$",
"DB",
",",
"$",
"USER",
";",
"$",
"errors",
"=",
"array",
"(",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"data",
"[",
"'id'",
"]",
")",
"and",
"empty",
"(",
... | Validates the submission form or WS data.
@param array $data the data to be validated
@return array the validation errors (if any)
@since Moodle 3.4 | [
"Validates",
"the",
"submission",
"form",
"or",
"WS",
"data",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L2862-L2917 |
215,195 | moodle/moodle | mod/workshop/locallib.php | workshop.check_view_assessment | public function check_view_assessment($assessment, $submission) {
global $USER;
$isauthor = $submission->authorid == $USER->id;
$isreviewer = $assessment->reviewerid == $USER->id;
$canviewallassessments = has_capability('mod/workshop:viewallassessments', $this->context);
$canvi... | php | public function check_view_assessment($assessment, $submission) {
global $USER;
$isauthor = $submission->authorid == $USER->id;
$isreviewer = $assessment->reviewerid == $USER->id;
$canviewallassessments = has_capability('mod/workshop:viewallassessments', $this->context);
$canvi... | [
"public",
"function",
"check_view_assessment",
"(",
"$",
"assessment",
",",
"$",
"submission",
")",
"{",
"global",
"$",
"USER",
";",
"$",
"isauthor",
"=",
"$",
"submission",
"->",
"authorid",
"==",
"$",
"USER",
"->",
"id",
";",
"$",
"isreviewer",
"=",
"$... | Helper method for validating if the current user can view the given assessment.
@param stdClass $assessment assessment object
@param stdClass $submission submission object
@return void
@throws moodle_exception
@since Moodle 3.4 | [
"Helper",
"method",
"for",
"validating",
"if",
"the",
"current",
"user",
"can",
"view",
"the",
"given",
"assessment",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L3019-L3037 |
215,196 | moodle/moodle | mod/workshop/locallib.php | workshop.check_edit_assessment | public function check_edit_assessment($assessment, $submission) {
global $USER;
$this->check_view_assessment($assessment, $submission);
// Further checks.
$isreviewer = ($USER->id == $assessment->reviewerid);
$assessmenteditable = $isreviewer && $this->assessing_allowed($USER->... | php | public function check_edit_assessment($assessment, $submission) {
global $USER;
$this->check_view_assessment($assessment, $submission);
// Further checks.
$isreviewer = ($USER->id == $assessment->reviewerid);
$assessmenteditable = $isreviewer && $this->assessing_allowed($USER->... | [
"public",
"function",
"check_edit_assessment",
"(",
"$",
"assessment",
",",
"$",
"submission",
")",
"{",
"global",
"$",
"USER",
";",
"$",
"this",
"->",
"check_view_assessment",
"(",
"$",
"assessment",
",",
"$",
"submission",
")",
";",
"// Further checks.",
"$"... | Helper method for validating if the current user can edit the given assessment.
@param stdClass $assessment assessment object
@param stdClass $submission submission object
@return void
@throws moodle_exception
@since Moodle 3.4 | [
"Helper",
"method",
"for",
"validating",
"if",
"the",
"current",
"user",
"can",
"edit",
"the",
"given",
"assessment",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L3048-L3064 |
215,197 | moodle/moodle | mod/workshop/locallib.php | workshop.evaluate_assessment | public function evaluate_assessment($assessment, $data, $cansetassessmentweight, $canoverridegrades) {
global $DB, $USER;
$data = file_postupdate_standard_editor($data, 'feedbackreviewer', array(), $this->context);
$record = new stdclass();
$record->id = $assessment->id;
if ($ca... | php | public function evaluate_assessment($assessment, $data, $cansetassessmentweight, $canoverridegrades) {
global $DB, $USER;
$data = file_postupdate_standard_editor($data, 'feedbackreviewer', array(), $this->context);
$record = new stdclass();
$record->id = $assessment->id;
if ($ca... | [
"public",
"function",
"evaluate_assessment",
"(",
"$",
"assessment",
",",
"$",
"data",
",",
"$",
"cansetassessmentweight",
",",
"$",
"canoverridegrades",
")",
"{",
"global",
"$",
"DB",
",",
"$",
"USER",
";",
"$",
"data",
"=",
"file_postupdate_standard_editor",
... | Evaluates an assessment.
@param stdClass $assessment the assessment
@param stdClass $data the assessment data to be updated
@param bool $cansetassessmentweight whether the user can change the assessment weight
@param bool $canoverridegrades whether the user can override the assessment grades
@return void... | [
"Evaluates",
"an",
"assessment",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L3141-L3157 |
215,198 | moodle/moodle | mod/workshop/locallib.php | workshop.set_submission_viewed | public function set_submission_viewed($submission) {
$params = array(
'objectid' => $submission->id,
'context' => $this->context,
'courseid' => $this->course->id,
'relateduserid' => $submission->authorid,
'other' => array(
'workshopid' ... | php | public function set_submission_viewed($submission) {
$params = array(
'objectid' => $submission->id,
'context' => $this->context,
'courseid' => $this->course->id,
'relateduserid' => $submission->authorid,
'other' => array(
'workshopid' ... | [
"public",
"function",
"set_submission_viewed",
"(",
"$",
"submission",
")",
"{",
"$",
"params",
"=",
"array",
"(",
"'objectid'",
"=>",
"$",
"submission",
"->",
"id",
",",
"'context'",
"=>",
"$",
"this",
"->",
"context",
",",
"'courseid'",
"=>",
"$",
"this"... | Trigger submission viewed event.
@param stdClass $submission submission object
@since Moodle 3.4 | [
"Trigger",
"submission",
"viewed",
"event",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L3165-L3178 |
215,199 | moodle/moodle | mod/workshop/locallib.php | workshop.evaluate_submission | public function evaluate_submission($submission, $data, $canpublish, $canoverride) {
global $DB, $USER;
$data = file_postupdate_standard_editor($data, 'feedbackauthor', array(), $this->context);
$record = new stdclass();
$record->id = $submission->id;
if ($canoverride) {
... | php | public function evaluate_submission($submission, $data, $canpublish, $canoverride) {
global $DB, $USER;
$data = file_postupdate_standard_editor($data, 'feedbackauthor', array(), $this->context);
$record = new stdclass();
$record->id = $submission->id;
if ($canoverride) {
... | [
"public",
"function",
"evaluate_submission",
"(",
"$",
"submission",
",",
"$",
"data",
",",
"$",
"canpublish",
",",
"$",
"canoverride",
")",
"{",
"global",
"$",
"DB",
",",
"$",
"USER",
";",
"$",
"data",
"=",
"file_postupdate_standard_editor",
"(",
"$",
"da... | Evaluates a submission.
@param stdClass $submission the submission
@param stdClass $data the submission data to be updated
@param bool $canpublish whether the user can publish the submission
@param bool $canoverride whether the user can override the submission grade
@return void
@since Moodle 3.4 | [
"Evaluates",
"a",
"submission",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/locallib.php#L3190-L3206 |
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.