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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
214,200 | moodle/moodle | lib/classes/oauth2/api.php | api.create_issuer | public static function create_issuer($data) {
require_capability('moodle/site:config', context_system::instance());
$issuer = new issuer(0, $data);
// Will throw exceptions on validation failures.
$issuer->create();
// Perform service discovery.
self::discover_endpoints... | php | public static function create_issuer($data) {
require_capability('moodle/site:config', context_system::instance());
$issuer = new issuer(0, $data);
// Will throw exceptions on validation failures.
$issuer->create();
// Perform service discovery.
self::discover_endpoints... | [
"public",
"static",
"function",
"create_issuer",
"(",
"$",
"data",
")",
"{",
"require_capability",
"(",
"'moodle/site:config'",
",",
"context_system",
"::",
"instance",
"(",
")",
")",
";",
"$",
"issuer",
"=",
"new",
"issuer",
"(",
"0",
",",
"$",
"data",
")... | Take the data from the mform and create the issuer.
@param stdClass $data
@return \core\oauth2\issuer | [
"Take",
"the",
"data",
"from",
"the",
"mform",
"and",
"create",
"the",
"issuer",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/oauth2/api.php#L641-L652 |
214,201 | moodle/moodle | lib/classes/oauth2/api.php | api.update_endpoint | public static function update_endpoint($data) {
require_capability('moodle/site:config', context_system::instance());
$endpoint = new endpoint(0, $data);
// Will throw exceptions on validation failures.
$endpoint->update();
return $endpoint;
} | php | public static function update_endpoint($data) {
require_capability('moodle/site:config', context_system::instance());
$endpoint = new endpoint(0, $data);
// Will throw exceptions on validation failures.
$endpoint->update();
return $endpoint;
} | [
"public",
"static",
"function",
"update_endpoint",
"(",
"$",
"data",
")",
"{",
"require_capability",
"(",
"'moodle/site:config'",
",",
"context_system",
"::",
"instance",
"(",
")",
")",
";",
"$",
"endpoint",
"=",
"new",
"endpoint",
"(",
"0",
",",
"$",
"data"... | Take the data from the mform and update the endpoint.
@param stdClass $data
@return \core\oauth2\endpoint | [
"Take",
"the",
"data",
"from",
"the",
"mform",
"and",
"update",
"the",
"endpoint",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/oauth2/api.php#L660-L668 |
214,202 | moodle/moodle | lib/classes/oauth2/api.php | api.create_endpoint | public static function create_endpoint($data) {
require_capability('moodle/site:config', context_system::instance());
$endpoint = new endpoint(0, $data);
// Will throw exceptions on validation failures.
$endpoint->create();
return $endpoint;
} | php | public static function create_endpoint($data) {
require_capability('moodle/site:config', context_system::instance());
$endpoint = new endpoint(0, $data);
// Will throw exceptions on validation failures.
$endpoint->create();
return $endpoint;
} | [
"public",
"static",
"function",
"create_endpoint",
"(",
"$",
"data",
")",
"{",
"require_capability",
"(",
"'moodle/site:config'",
",",
"context_system",
"::",
"instance",
"(",
")",
")",
";",
"$",
"endpoint",
"=",
"new",
"endpoint",
"(",
"0",
",",
"$",
"data"... | Take the data from the mform and create the endpoint.
@param stdClass $data
@return \core\oauth2\endpoint | [
"Take",
"the",
"data",
"from",
"the",
"mform",
"and",
"create",
"the",
"endpoint",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/oauth2/api.php#L676-L683 |
214,203 | moodle/moodle | lib/classes/oauth2/api.php | api.update_user_field_mapping | public static function update_user_field_mapping($data) {
require_capability('moodle/site:config', context_system::instance());
$userfieldmapping = new user_field_mapping(0, $data);
// Will throw exceptions on validation failures.
$userfieldmapping->update();
return $userfieldm... | php | public static function update_user_field_mapping($data) {
require_capability('moodle/site:config', context_system::instance());
$userfieldmapping = new user_field_mapping(0, $data);
// Will throw exceptions on validation failures.
$userfieldmapping->update();
return $userfieldm... | [
"public",
"static",
"function",
"update_user_field_mapping",
"(",
"$",
"data",
")",
"{",
"require_capability",
"(",
"'moodle/site:config'",
",",
"context_system",
"::",
"instance",
"(",
")",
")",
";",
"$",
"userfieldmapping",
"=",
"new",
"user_field_mapping",
"(",
... | Take the data from the mform and update the user field mapping.
@param stdClass $data
@return \core\oauth2\user_field_mapping | [
"Take",
"the",
"data",
"from",
"the",
"mform",
"and",
"update",
"the",
"user",
"field",
"mapping",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/oauth2/api.php#L691-L699 |
214,204 | moodle/moodle | lib/classes/oauth2/api.php | api.create_user_field_mapping | public static function create_user_field_mapping($data) {
require_capability('moodle/site:config', context_system::instance());
$userfieldmapping = new user_field_mapping(0, $data);
// Will throw exceptions on validation failures.
$userfieldmapping->create();
return $userfieldma... | php | public static function create_user_field_mapping($data) {
require_capability('moodle/site:config', context_system::instance());
$userfieldmapping = new user_field_mapping(0, $data);
// Will throw exceptions on validation failures.
$userfieldmapping->create();
return $userfieldma... | [
"public",
"static",
"function",
"create_user_field_mapping",
"(",
"$",
"data",
")",
"{",
"require_capability",
"(",
"'moodle/site:config'",
",",
"context_system",
"::",
"instance",
"(",
")",
")",
";",
"$",
"userfieldmapping",
"=",
"new",
"user_field_mapping",
"(",
... | Take the data from the mform and create the user field mapping.
@param stdClass $data
@return \core\oauth2\user_field_mapping | [
"Take",
"the",
"data",
"from",
"the",
"mform",
"and",
"create",
"the",
"user",
"field",
"mapping",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/oauth2/api.php#L707-L714 |
214,205 | moodle/moodle | lib/classes/oauth2/api.php | api.move_up_issuer | public static function move_up_issuer($id) {
require_capability('moodle/site:config', context_system::instance());
$current = new issuer($id);
$sortorder = $current->get('sortorder');
if ($sortorder == 0) {
return false;
}
$sortorder = $sortorder - 1;
... | php | public static function move_up_issuer($id) {
require_capability('moodle/site:config', context_system::instance());
$current = new issuer($id);
$sortorder = $current->get('sortorder');
if ($sortorder == 0) {
return false;
}
$sortorder = $sortorder - 1;
... | [
"public",
"static",
"function",
"move_up_issuer",
"(",
"$",
"id",
")",
"{",
"require_capability",
"(",
"'moodle/site:config'",
",",
"context_system",
"::",
"instance",
"(",
")",
")",
";",
"$",
"current",
"=",
"new",
"issuer",
"(",
"$",
"id",
")",
";",
"$",... | Reorder this identity issuer.
Requires moodle/site:config capability at the system context.
@param int $id The id of the identity issuer to move.
@return boolean | [
"Reorder",
"this",
"identity",
"issuer",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/oauth2/api.php#L724-L747 |
214,206 | moodle/moodle | lib/classes/oauth2/api.php | api.disable_issuer | public static function disable_issuer($id) {
require_capability('moodle/site:config', context_system::instance());
$issuer = new issuer($id);
$issuer->set('enabled', 0);
return $issuer->update();
} | php | public static function disable_issuer($id) {
require_capability('moodle/site:config', context_system::instance());
$issuer = new issuer($id);
$issuer->set('enabled', 0);
return $issuer->update();
} | [
"public",
"static",
"function",
"disable_issuer",
"(",
"$",
"id",
")",
"{",
"require_capability",
"(",
"'moodle/site:config'",
",",
"context_system",
"::",
"instance",
"(",
")",
")",
";",
"$",
"issuer",
"=",
"new",
"issuer",
"(",
"$",
"id",
")",
";",
"$",
... | Disable an identity issuer.
Requires moodle/site:config capability at the system context.
@param int $id The id of the identity issuer to disable.
@return boolean | [
"Disable",
"an",
"identity",
"issuer",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/oauth2/api.php#L794-L800 |
214,207 | moodle/moodle | lib/classes/oauth2/api.php | api.enable_issuer | public static function enable_issuer($id) {
require_capability('moodle/site:config', context_system::instance());
$issuer = new issuer($id);
$issuer->set('enabled', 1);
return $issuer->update();
} | php | public static function enable_issuer($id) {
require_capability('moodle/site:config', context_system::instance());
$issuer = new issuer($id);
$issuer->set('enabled', 1);
return $issuer->update();
} | [
"public",
"static",
"function",
"enable_issuer",
"(",
"$",
"id",
")",
"{",
"require_capability",
"(",
"'moodle/site:config'",
",",
"context_system",
"::",
"instance",
"(",
")",
")",
";",
"$",
"issuer",
"=",
"new",
"issuer",
"(",
"$",
"id",
")",
";",
"$",
... | Enable an identity issuer.
Requires moodle/site:config capability at the system context.
@param int $id The id of the identity issuer to enable.
@return boolean | [
"Enable",
"an",
"identity",
"issuer",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/oauth2/api.php#L811-L817 |
214,208 | moodle/moodle | lib/classes/oauth2/api.php | api.delete_issuer | public static function delete_issuer($id) {
require_capability('moodle/site:config', context_system::instance());
$issuer = new issuer($id);
$systemaccount = self::get_system_account($issuer);
if ($systemaccount) {
$systemaccount->delete();
}
$endpoints = sel... | php | public static function delete_issuer($id) {
require_capability('moodle/site:config', context_system::instance());
$issuer = new issuer($id);
$systemaccount = self::get_system_account($issuer);
if ($systemaccount) {
$systemaccount->delete();
}
$endpoints = sel... | [
"public",
"static",
"function",
"delete_issuer",
"(",
"$",
"id",
")",
"{",
"require_capability",
"(",
"'moodle/site:config'",
",",
"context_system",
"::",
"instance",
"(",
")",
")",
";",
"$",
"issuer",
"=",
"new",
"issuer",
"(",
"$",
"id",
")",
";",
"$",
... | Delete an identity issuer.
Requires moodle/site:config capability at the system context.
@param int $id The id of the identity issuer to delete.
@return boolean | [
"Delete",
"an",
"identity",
"issuer",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/oauth2/api.php#L827-L844 |
214,209 | moodle/moodle | lib/classes/oauth2/api.php | api.delete_endpoint | public static function delete_endpoint($id) {
require_capability('moodle/site:config', context_system::instance());
$endpoint = new endpoint($id);
// Will throw exceptions on validation failures.
return $endpoint->delete();
} | php | public static function delete_endpoint($id) {
require_capability('moodle/site:config', context_system::instance());
$endpoint = new endpoint($id);
// Will throw exceptions on validation failures.
return $endpoint->delete();
} | [
"public",
"static",
"function",
"delete_endpoint",
"(",
"$",
"id",
")",
"{",
"require_capability",
"(",
"'moodle/site:config'",
",",
"context_system",
"::",
"instance",
"(",
")",
")",
";",
"$",
"endpoint",
"=",
"new",
"endpoint",
"(",
"$",
"id",
")",
";",
... | Delete an endpoint.
Requires moodle/site:config capability at the system context.
@param int $id The id of the endpoint to delete.
@return boolean | [
"Delete",
"an",
"endpoint",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/oauth2/api.php#L854-L860 |
214,210 | moodle/moodle | lib/classes/oauth2/api.php | api.delete_user_field_mapping | public static function delete_user_field_mapping($id) {
require_capability('moodle/site:config', context_system::instance());
$userfieldmapping = new user_field_mapping($id);
// Will throw exceptions on validation failures.
return $userfieldmapping->delete();
} | php | public static function delete_user_field_mapping($id) {
require_capability('moodle/site:config', context_system::instance());
$userfieldmapping = new user_field_mapping($id);
// Will throw exceptions on validation failures.
return $userfieldmapping->delete();
} | [
"public",
"static",
"function",
"delete_user_field_mapping",
"(",
"$",
"id",
")",
"{",
"require_capability",
"(",
"'moodle/site:config'",
",",
"context_system",
"::",
"instance",
"(",
")",
")",
";",
"$",
"userfieldmapping",
"=",
"new",
"user_field_mapping",
"(",
"... | Delete a user_field_mapping.
Requires moodle/site:config capability at the system context.
@param int $id The id of the user_field_mapping to delete.
@return boolean | [
"Delete",
"a",
"user_field_mapping",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/oauth2/api.php#L870-L876 |
214,211 | moodle/moodle | lib/classes/oauth2/api.php | api.connect_system_account | public static function connect_system_account($issuer, $returnurl) {
require_capability('moodle/site:config', context_system::instance());
// We need to authenticate with an oauth 2 client AS a system user and get a refresh token for offline access.
$scopes = self::get_system_scopes_for_issuer(... | php | public static function connect_system_account($issuer, $returnurl) {
require_capability('moodle/site:config', context_system::instance());
// We need to authenticate with an oauth 2 client AS a system user and get a refresh token for offline access.
$scopes = self::get_system_scopes_for_issuer(... | [
"public",
"static",
"function",
"connect_system_account",
"(",
"$",
"issuer",
",",
"$",
"returnurl",
")",
"{",
"require_capability",
"(",
"'moodle/site:config'",
",",
"context_system",
"::",
"instance",
"(",
")",
")",
";",
"// We need to authenticate with an oauth 2 cli... | Perform the OAuth dance and get a refresh token.
Requires moodle/site:config capability at the system context.
@param \core\oauth2\issuer $issuer
@param moodle_url $returnurl The url to the current page (we will be redirected back here after authentication).
@return boolean | [
"Perform",
"the",
"OAuth",
"dance",
"and",
"get",
"a",
"refresh",
"token",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/oauth2/api.php#L887-L934 |
214,212 | moodle/moodle | mod/forum/classes/output/forum_post.php | forum_post.get_permalink | public function get_permalink() {
$link = $this->_get_discussionlink();
$link->set_anchor($this->get_postanchor());
return $link->out(false);
} | php | public function get_permalink() {
$link = $this->_get_discussionlink();
$link->set_anchor($this->get_postanchor());
return $link->out(false);
} | [
"public",
"function",
"get_permalink",
"(",
")",
"{",
"$",
"link",
"=",
"$",
"this",
"->",
"_get_discussionlink",
"(",
")",
";",
"$",
"link",
"->",
"set_anchor",
"(",
"$",
"this",
"->",
"get_postanchor",
"(",
")",
")",
";",
"return",
"$",
"link",
"->",... | Get the link to the current post, including post anchor.
@return string | [
"Get",
"the",
"link",
"to",
"the",
"current",
"post",
"including",
"post",
"anchor",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/output/forum_post.php#L354-L359 |
214,213 | moodle/moodle | mod/forum/classes/output/forum_post.php | forum_post.get_parentpostlink | public function get_parentpostlink() {
$link = $this->_get_discussionlink();
$link->param('parent', $this->post->parent);
return $link->out(false);
} | php | public function get_parentpostlink() {
$link = $this->_get_discussionlink();
$link->param('parent', $this->post->parent);
return $link->out(false);
} | [
"public",
"function",
"get_parentpostlink",
"(",
")",
"{",
"$",
"link",
"=",
"$",
"this",
"->",
"_get_discussionlink",
"(",
")",
";",
"$",
"link",
"->",
"param",
"(",
"'parent'",
",",
"$",
"this",
"->",
"post",
"->",
"parent",
")",
";",
"return",
"$",
... | Get the link to the parent post.
@return string | [
"Get",
"the",
"link",
"to",
"the",
"parent",
"post",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/output/forum_post.php#L366-L371 |
214,214 | moodle/moodle | mod/forum/classes/output/forum_post.php | forum_post.get_authorlink | public function get_authorlink() {
$link = new \moodle_url(
'/user/view.php', array(
'id' => $this->post->userid,
'course' => $this->course->id,
)
);
return $link->out(false);
} | php | public function get_authorlink() {
$link = new \moodle_url(
'/user/view.php', array(
'id' => $this->post->userid,
'course' => $this->course->id,
)
);
return $link->out(false);
} | [
"public",
"function",
"get_authorlink",
"(",
")",
"{",
"$",
"link",
"=",
"new",
"\\",
"moodle_url",
"(",
"'/user/view.php'",
",",
"array",
"(",
"'id'",
"=>",
"$",
"this",
"->",
"post",
"->",
"userid",
",",
"'course'",
"=>",
"$",
"this",
"->",
"course",
... | Get the link to the author's profile page.
@return string | [
"Get",
"the",
"link",
"to",
"the",
"author",
"s",
"profile",
"page",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/output/forum_post.php#L378-L387 |
214,215 | moodle/moodle | mod/forum/classes/output/forum_post.php | forum_post.get_unsubscribeforumlink | public function get_unsubscribeforumlink() {
if (!\mod_forum\subscriptions::is_subscribable($this->forum)) {
return null;
}
$link = new \moodle_url(
'/mod/forum/subscribe.php', array(
'id' => $this->forum->id,
)
);
return $link... | php | public function get_unsubscribeforumlink() {
if (!\mod_forum\subscriptions::is_subscribable($this->forum)) {
return null;
}
$link = new \moodle_url(
'/mod/forum/subscribe.php', array(
'id' => $this->forum->id,
)
);
return $link... | [
"public",
"function",
"get_unsubscribeforumlink",
"(",
")",
"{",
"if",
"(",
"!",
"\\",
"mod_forum",
"\\",
"subscriptions",
"::",
"is_subscribable",
"(",
"$",
"this",
"->",
"forum",
")",
")",
"{",
"return",
"null",
";",
"}",
"$",
"link",
"=",
"new",
"\\",... | Get the link to unsubscribe from the forum.
@return string | [
"Get",
"the",
"link",
"to",
"unsubscribe",
"from",
"the",
"forum",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/output/forum_post.php#L394-L405 |
214,216 | moodle/moodle | mod/forum/classes/output/forum_post.php | forum_post.get_unsubscribediscussionlink | public function get_unsubscribediscussionlink() {
if (!\mod_forum\subscriptions::is_subscribable($this->forum)) {
return null;
}
$link = new \moodle_url(
'/mod/forum/subscribe.php', array(
'id' => $this->forum->id,
'd' => $this->discussi... | php | public function get_unsubscribediscussionlink() {
if (!\mod_forum\subscriptions::is_subscribable($this->forum)) {
return null;
}
$link = new \moodle_url(
'/mod/forum/subscribe.php', array(
'id' => $this->forum->id,
'd' => $this->discussi... | [
"public",
"function",
"get_unsubscribediscussionlink",
"(",
")",
"{",
"if",
"(",
"!",
"\\",
"mod_forum",
"\\",
"subscriptions",
"::",
"is_subscribable",
"(",
"$",
"this",
"->",
"forum",
")",
")",
"{",
"return",
"null",
";",
"}",
"$",
"link",
"=",
"new",
... | Get the link to unsubscribe from the discussion.
@return string | [
"Get",
"the",
"link",
"to",
"unsubscribe",
"from",
"the",
"discussion",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/output/forum_post.php#L412-L424 |
214,217 | moodle/moodle | mod/forum/classes/output/forum_post.php | forum_post.get_coursefullname | public function get_coursefullname() {
return format_string($this->course->fullname, true, array(
'context' => \context_course::instance($this->course->id),
));
} | php | public function get_coursefullname() {
return format_string($this->course->fullname, true, array(
'context' => \context_course::instance($this->course->id),
));
} | [
"public",
"function",
"get_coursefullname",
"(",
")",
"{",
"return",
"format_string",
"(",
"$",
"this",
"->",
"course",
"->",
"fullname",
",",
"true",
",",
"array",
"(",
"'context'",
"=>",
"\\",
"context_course",
"::",
"instance",
"(",
"$",
"this",
"->",
"... | The full name of the course that the forum is in.
@return string | [
"The",
"full",
"name",
"of",
"the",
"course",
"that",
"the",
"forum",
"is",
"in",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/output/forum_post.php#L471-L475 |
214,218 | moodle/moodle | mod/forum/classes/output/forum_post.php | forum_post.get_coursename | public function get_coursename() {
return format_string($this->course->shortname, true, array(
'context' => \context_course::instance($this->course->id),
));
} | php | public function get_coursename() {
return format_string($this->course->shortname, true, array(
'context' => \context_course::instance($this->course->id),
));
} | [
"public",
"function",
"get_coursename",
"(",
")",
"{",
"return",
"format_string",
"(",
"$",
"this",
"->",
"course",
"->",
"shortname",
",",
"true",
",",
"array",
"(",
"'context'",
"=>",
"\\",
"context_course",
"::",
"instance",
"(",
"$",
"this",
"->",
"cou... | The name of the course that the forum is in.
@return string | [
"The",
"name",
"of",
"the",
"course",
"that",
"the",
"forum",
"is",
"in",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/output/forum_post.php#L482-L486 |
214,219 | moodle/moodle | mod/forum/classes/output/forum_post.php | forum_post.get_postdate | public function get_postdate() {
global $CFG;
$postmodified = $this->post->modified;
if (!empty($CFG->forum_enabletimedposts) && ($this->discussion->timestart > $postmodified)) {
$postmodified = $this->discussion->timestart;
}
return userdate($postmodified, "", \cor... | php | public function get_postdate() {
global $CFG;
$postmodified = $this->post->modified;
if (!empty($CFG->forum_enabletimedposts) && ($this->discussion->timestart > $postmodified)) {
$postmodified = $this->discussion->timestart;
}
return userdate($postmodified, "", \cor... | [
"public",
"function",
"get_postdate",
"(",
")",
"{",
"global",
"$",
"CFG",
";",
"$",
"postmodified",
"=",
"$",
"this",
"->",
"post",
"->",
"modified",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"CFG",
"->",
"forum_enabletimedposts",
")",
"&&",
"(",
"$",
... | The date of the post, formatted according to the postto user's
preferences.
@return string. | [
"The",
"date",
"of",
"the",
"post",
"formatted",
"according",
"to",
"the",
"postto",
"user",
"s",
"preferences",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/output/forum_post.php#L546-L555 |
214,220 | moodle/moodle | mod/forum/classes/output/forum_post.php | forum_post.get_author_picture | public function get_author_picture(\renderer_base $renderer) {
return $renderer->user_picture($this->author, array('courseid' => $this->course->id));
} | php | public function get_author_picture(\renderer_base $renderer) {
return $renderer->user_picture($this->author, array('courseid' => $this->course->id));
} | [
"public",
"function",
"get_author_picture",
"(",
"\\",
"renderer_base",
"$",
"renderer",
")",
"{",
"return",
"$",
"renderer",
"->",
"user_picture",
"(",
"$",
"this",
"->",
"author",
",",
"array",
"(",
"'courseid'",
"=>",
"$",
"this",
"->",
"course",
"->",
... | The HTML for the author's user picture.
@param \renderer_base $renderer
@return string | [
"The",
"HTML",
"for",
"the",
"author",
"s",
"user",
"picture",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/output/forum_post.php#L563-L565 |
214,221 | moodle/moodle | mod/forum/classes/output/forum_post.php | forum_post.get_group_picture | public function get_group_picture(\renderer_base $renderer) {
if (isset($this->userfrom->groups)) {
$groups = $this->userfrom->groups[$this->forum->id];
} else {
$groups = groups_get_all_groups($this->course->id, $this->author->id, $this->cm->groupingid);
}
if ($... | php | public function get_group_picture(\renderer_base $renderer) {
if (isset($this->userfrom->groups)) {
$groups = $this->userfrom->groups[$this->forum->id];
} else {
$groups = groups_get_all_groups($this->course->id, $this->author->id, $this->cm->groupingid);
}
if ($... | [
"public",
"function",
"get_group_picture",
"(",
"\\",
"renderer_base",
"$",
"renderer",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"userfrom",
"->",
"groups",
")",
")",
"{",
"$",
"groups",
"=",
"$",
"this",
"->",
"userfrom",
"->",
"groups",
... | The HTML for a group picture.
@param \renderer_base $renderer
@return string | [
"The",
"HTML",
"for",
"a",
"group",
"picture",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/output/forum_post.php#L573-L583 |
214,222 | moodle/moodle | admin/tool/log/classes/helper/buffered_writer.php | buffered_writer.flush | public function flush() {
if ($this->count == 0) {
return;
}
$events = $this->buffer;
$this->count = 0;
$this->buffer = array();
$this->insert_event_entries($events);
} | php | public function flush() {
if ($this->count == 0) {
return;
}
$events = $this->buffer;
$this->count = 0;
$this->buffer = array();
$this->insert_event_entries($events);
} | [
"public",
"function",
"flush",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"count",
"==",
"0",
")",
"{",
"return",
";",
"}",
"$",
"events",
"=",
"$",
"this",
"->",
"buffer",
";",
"$",
"this",
"->",
"count",
"=",
"0",
";",
"$",
"this",
"->",
... | Flush event buffer. | [
"Flush",
"event",
"buffer",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/log/classes/helper/buffered_writer.php#L99-L107 |
214,223 | moodle/moodle | mod/quiz/classes/external.php | mod_quiz_external.validate_quiz | protected static function validate_quiz($quizid) {
global $DB;
// Request and permission validation.
$quiz = $DB->get_record('quiz', array('id' => $quizid), '*', MUST_EXIST);
list($course, $cm) = get_course_and_cm_from_instance($quiz, 'quiz');
$context = context_module::instanc... | php | protected static function validate_quiz($quizid) {
global $DB;
// Request and permission validation.
$quiz = $DB->get_record('quiz', array('id' => $quizid), '*', MUST_EXIST);
list($course, $cm) = get_course_and_cm_from_instance($quiz, 'quiz');
$context = context_module::instanc... | [
"protected",
"static",
"function",
"validate_quiz",
"(",
"$",
"quizid",
")",
"{",
"global",
"$",
"DB",
";",
"// Request and permission validation.",
"$",
"quiz",
"=",
"$",
"DB",
"->",
"get_record",
"(",
"'quiz'",
",",
"array",
"(",
"'id'",
"=>",
"$",
"quizid... | Utility function for validating a quiz.
@param int $quizid quiz instance id
@return array array containing the quiz, course, context and course module objects
@since Moodle 3.1 | [
"Utility",
"function",
"for",
"validating",
"a",
"quiz",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/classes/external.php#L287-L298 |
214,224 | moodle/moodle | mod/quiz/classes/external.php | mod_quiz_external.get_user_attempts_parameters | public static function get_user_attempts_parameters() {
return new external_function_parameters (
array(
'quizid' => new external_value(PARAM_INT, 'quiz instance id'),
'userid' => new external_value(PARAM_INT, 'user id, empty for current user', VALUE_DEFAULT, 0),
... | php | public static function get_user_attempts_parameters() {
return new external_function_parameters (
array(
'quizid' => new external_value(PARAM_INT, 'quiz instance id'),
'userid' => new external_value(PARAM_INT, 'user id, empty for current user', VALUE_DEFAULT, 0),
... | [
"public",
"static",
"function",
"get_user_attempts_parameters",
"(",
")",
"{",
"return",
"new",
"external_function_parameters",
"(",
"array",
"(",
"'quizid'",
"=>",
"new",
"external_value",
"(",
"PARAM_INT",
",",
"'quiz instance id'",
")",
",",
"'userid'",
"=>",
"ne... | Describes the parameters for get_user_attempts.
@return external_function_parameters
@since Moodle 3.1 | [
"Describes",
"the",
"parameters",
"for",
"get_user_attempts",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/classes/external.php#L360-L370 |
214,225 | moodle/moodle | mod/quiz/classes/external.php | mod_quiz_external.get_user_attempts | public static function get_user_attempts($quizid, $userid = 0, $status = 'finished', $includepreviews = false) {
global $DB, $USER;
$warnings = array();
$params = array(
'quizid' => $quizid,
'userid' => $userid,
'status' => $status,
'includeprevi... | php | public static function get_user_attempts($quizid, $userid = 0, $status = 'finished', $includepreviews = false) {
global $DB, $USER;
$warnings = array();
$params = array(
'quizid' => $quizid,
'userid' => $userid,
'status' => $status,
'includeprevi... | [
"public",
"static",
"function",
"get_user_attempts",
"(",
"$",
"quizid",
",",
"$",
"userid",
"=",
"0",
",",
"$",
"status",
"=",
"'finished'",
",",
"$",
"includepreviews",
"=",
"false",
")",
"{",
"global",
"$",
"DB",
",",
"$",
"USER",
";",
"$",
"warning... | Return a list of attempts for the given quiz and user.
@param int $quizid quiz instance id
@param int $userid user id
@param string $status quiz status: all, finished or unfinished
@param bool $includepreviews whether to include previews or not
@return array of warnings and the list of attempts
@since Moodle 3.1
@thro... | [
"Return",
"a",
"list",
"of",
"attempts",
"for",
"the",
"given",
"quiz",
"and",
"user",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/classes/external.php#L383-L421 |
214,226 | moodle/moodle | mod/quiz/classes/external.php | mod_quiz_external.attempt_structure | private static function attempt_structure() {
return new external_single_structure(
array(
'id' => new external_value(PARAM_INT, 'Attempt id.', VALUE_OPTIONAL),
'quiz' => new external_value(PARAM_INT, 'Foreign key reference to the quiz that was attempted.',
... | php | private static function attempt_structure() {
return new external_single_structure(
array(
'id' => new external_value(PARAM_INT, 'Attempt id.', VALUE_OPTIONAL),
'quiz' => new external_value(PARAM_INT, 'Foreign key reference to the quiz that was attempted.',
... | [
"private",
"static",
"function",
"attempt_structure",
"(",
")",
"{",
"return",
"new",
"external_single_structure",
"(",
"array",
"(",
"'id'",
"=>",
"new",
"external_value",
"(",
"PARAM_INT",
",",
"'Attempt id.'",
",",
"VALUE_OPTIONAL",
")",
",",
"'quiz'",
"=>",
... | Describes a single attempt structure.
@return external_single_structure the attempt structure | [
"Describes",
"a",
"single",
"attempt",
"structure",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/classes/external.php#L428-L456 |
214,227 | moodle/moodle | mod/quiz/classes/external.php | mod_quiz_external.get_user_best_grade | public static function get_user_best_grade($quizid, $userid = 0) {
global $DB, $USER;
$warnings = array();
$params = array(
'quizid' => $quizid,
'userid' => $userid,
);
$params = self::validate_parameters(self::get_user_best_grade_parameters(), $params);... | php | public static function get_user_best_grade($quizid, $userid = 0) {
global $DB, $USER;
$warnings = array();
$params = array(
'quizid' => $quizid,
'userid' => $userid,
);
$params = self::validate_parameters(self::get_user_best_grade_parameters(), $params);... | [
"public",
"static",
"function",
"get_user_best_grade",
"(",
"$",
"quizid",
",",
"$",
"userid",
"=",
"0",
")",
"{",
"global",
"$",
"DB",
",",
"$",
"USER",
";",
"$",
"warnings",
"=",
"array",
"(",
")",
";",
"$",
"params",
"=",
"array",
"(",
"'quizid'",... | Get the best current grade for the given user on a quiz.
@param int $quizid quiz instance id
@param int $userid user id
@return array of warnings and the grade information
@since Moodle 3.1 | [
"Get",
"the",
"best",
"current",
"grade",
"for",
"the",
"given",
"user",
"on",
"a",
"quiz",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/classes/external.php#L496-L533 |
214,228 | moodle/moodle | mod/quiz/classes/external.php | mod_quiz_external.get_combined_review_options | public static function get_combined_review_options($quizid, $userid = 0) {
global $DB, $USER;
$warnings = array();
$params = array(
'quizid' => $quizid,
'userid' => $userid,
);
$params = self::validate_parameters(self::get_combined_review_options_paramet... | php | public static function get_combined_review_options($quizid, $userid = 0) {
global $DB, $USER;
$warnings = array();
$params = array(
'quizid' => $quizid,
'userid' => $userid,
);
$params = self::validate_parameters(self::get_combined_review_options_paramet... | [
"public",
"static",
"function",
"get_combined_review_options",
"(",
"$",
"quizid",
",",
"$",
"userid",
"=",
"0",
")",
"{",
"global",
"$",
"DB",
",",
"$",
"USER",
";",
"$",
"warnings",
"=",
"array",
"(",
")",
";",
"$",
"params",
"=",
"array",
"(",
"'q... | Combines the review options from a number of different quiz attempts.
@param int $quizid quiz instance id
@param int $userid user id (empty for current user)
@return array of warnings and the review options
@since Moodle 3.1 | [
"Combines",
"the",
"review",
"options",
"from",
"a",
"number",
"of",
"different",
"quiz",
"attempts",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/classes/external.php#L575-L620 |
214,229 | moodle/moodle | mod/quiz/classes/external.php | mod_quiz_external.get_combined_review_options_returns | public static function get_combined_review_options_returns() {
return new external_single_structure(
array(
'someoptions' => new external_multiple_structure(
new external_single_structure(
array(
'name' => new ex... | php | public static function get_combined_review_options_returns() {
return new external_single_structure(
array(
'someoptions' => new external_multiple_structure(
new external_single_structure(
array(
'name' => new ex... | [
"public",
"static",
"function",
"get_combined_review_options_returns",
"(",
")",
"{",
"return",
"new",
"external_single_structure",
"(",
"array",
"(",
"'someoptions'",
"=>",
"new",
"external_multiple_structure",
"(",
"new",
"external_single_structure",
"(",
"array",
"(",
... | Describes the get_combined_review_options return value.
@return external_single_structure
@since Moodle 3.1 | [
"Describes",
"the",
"get_combined_review_options",
"return",
"value",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/classes/external.php#L628-L650 |
214,230 | moodle/moodle | mod/quiz/classes/external.php | mod_quiz_external.start_attempt_parameters | public static function start_attempt_parameters() {
return new external_function_parameters (
array(
'quizid' => new external_value(PARAM_INT, 'quiz instance id'),
'preflightdata' => new external_multiple_structure(
new external_single_structure(
... | php | public static function start_attempt_parameters() {
return new external_function_parameters (
array(
'quizid' => new external_value(PARAM_INT, 'quiz instance id'),
'preflightdata' => new external_multiple_structure(
new external_single_structure(
... | [
"public",
"static",
"function",
"start_attempt_parameters",
"(",
")",
"{",
"return",
"new",
"external_function_parameters",
"(",
"array",
"(",
"'quizid'",
"=>",
"new",
"external_value",
"(",
"PARAM_INT",
",",
"'quiz instance id'",
")",
",",
"'preflightdata'",
"=>",
... | Describes the parameters for start_attempt.
@return external_function_parameters
@since Moodle 3.1 | [
"Describes",
"the",
"parameters",
"for",
"start_attempt",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/classes/external.php#L658-L674 |
214,231 | moodle/moodle | mod/quiz/classes/external.php | mod_quiz_external.start_attempt | public static function start_attempt($quizid, $preflightdata = array(), $forcenew = false) {
global $DB, $USER;
$warnings = array();
$attempt = array();
$params = array(
'quizid' => $quizid,
'preflightdata' => $preflightdata,
'forcenew' => $forcenew,... | php | public static function start_attempt($quizid, $preflightdata = array(), $forcenew = false) {
global $DB, $USER;
$warnings = array();
$attempt = array();
$params = array(
'quizid' => $quizid,
'preflightdata' => $preflightdata,
'forcenew' => $forcenew,... | [
"public",
"static",
"function",
"start_attempt",
"(",
"$",
"quizid",
",",
"$",
"preflightdata",
"=",
"array",
"(",
")",
",",
"$",
"forcenew",
"=",
"false",
")",
"{",
"global",
"$",
"DB",
",",
"$",
"USER",
";",
"$",
"warnings",
"=",
"array",
"(",
")",... | Starts a new attempt at a quiz.
@param int $quizid quiz instance id
@param array $preflightdata preflight required data (like passwords)
@param bool $forcenew Whether to force a new attempt or not.
@return array of warnings and the attempt basic data
@since Moodle 3.1
@throws moodle_quiz_exception | [
"Starts",
"a",
"new",
"attempt",
"at",
"a",
"quiz",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/classes/external.php#L686-L762 |
214,232 | moodle/moodle | mod/quiz/classes/external.php | mod_quiz_external.validate_attempt | protected static function validate_attempt($params, $checkaccessrules = true, $failifoverdue = true) {
global $USER;
$attemptobj = quiz_attempt::create($params['attemptid']);
$context = context_module::instance($attemptobj->get_cm()->id);
self::validate_context($context);
// C... | php | protected static function validate_attempt($params, $checkaccessrules = true, $failifoverdue = true) {
global $USER;
$attemptobj = quiz_attempt::create($params['attemptid']);
$context = context_module::instance($attemptobj->get_cm()->id);
self::validate_context($context);
// C... | [
"protected",
"static",
"function",
"validate_attempt",
"(",
"$",
"params",
",",
"$",
"checkaccessrules",
"=",
"true",
",",
"$",
"failifoverdue",
"=",
"true",
")",
"{",
"global",
"$",
"USER",
";",
"$",
"attemptobj",
"=",
"quiz_attempt",
"::",
"create",
"(",
... | Utility function for validating a given attempt
@param array $params array of parameters including the attemptid and preflight data
@param bool $checkaccessrules whether to check the quiz access rules or not
@param bool $failifoverdue whether to return error if the attempt is overdue
@return array containing the a... | [
"Utility",
"function",
"for",
"validating",
"a",
"given",
"attempt"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/classes/external.php#L789-L863 |
214,233 | moodle/moodle | mod/quiz/classes/external.php | mod_quiz_external.question_structure | private static function question_structure() {
return new external_single_structure(
array(
'slot' => new external_value(PARAM_INT, 'slot number'),
'type' => new external_value(PARAM_ALPHANUMEXT, 'question type, i.e: multichoice'),
'page' => new extern... | php | private static function question_structure() {
return new external_single_structure(
array(
'slot' => new external_value(PARAM_INT, 'slot number'),
'type' => new external_value(PARAM_ALPHANUMEXT, 'question type, i.e: multichoice'),
'page' => new extern... | [
"private",
"static",
"function",
"question_structure",
"(",
")",
"{",
"return",
"new",
"external_single_structure",
"(",
"array",
"(",
"'slot'",
"=>",
"new",
"external_value",
"(",
"PARAM_INT",
",",
"'slot number'",
")",
",",
"'type'",
"=>",
"new",
"external_value... | Describes a single question structure.
@return external_single_structure the question data. Some fields may not be returned depending on the quiz display settings.
@since Moodle 3.1
@since Moodle 3.2 blockedbyprevious parameter added. | [
"Describes",
"a",
"single",
"question",
"structure",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/classes/external.php#L872-L899 |
214,234 | moodle/moodle | mod/quiz/classes/external.php | mod_quiz_external.get_attempt_questions_data | private static function get_attempt_questions_data(quiz_attempt $attemptobj, $review, $page = 'all') {
global $PAGE;
$questions = array();
$contextid = $attemptobj->get_quizobj()->get_context()->id;
$displayoptions = $attemptobj->get_display_options($review);
$renderer = $PAGE->... | php | private static function get_attempt_questions_data(quiz_attempt $attemptobj, $review, $page = 'all') {
global $PAGE;
$questions = array();
$contextid = $attemptobj->get_quizobj()->get_context()->id;
$displayoptions = $attemptobj->get_display_options($review);
$renderer = $PAGE->... | [
"private",
"static",
"function",
"get_attempt_questions_data",
"(",
"quiz_attempt",
"$",
"attemptobj",
",",
"$",
"review",
",",
"$",
"page",
"=",
"'all'",
")",
"{",
"global",
"$",
"PAGE",
";",
"$",
"questions",
"=",
"array",
"(",
")",
";",
"$",
"contextid"... | Return questions information for a given attempt.
@param quiz_attempt $attemptobj the quiz attempt object
@param bool $review whether if we are in review mode or not
@param mixed $page string 'all' or integer page number
@return array array of questions including data | [
"Return",
"questions",
"information",
"for",
"a",
"given",
"attempt",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/classes/external.php#L909-L949 |
214,235 | moodle/moodle | mod/quiz/classes/external.php | mod_quiz_external.get_attempt_data_parameters | public static function get_attempt_data_parameters() {
return new external_function_parameters (
array(
'attemptid' => new external_value(PARAM_INT, 'attempt id'),
'page' => new external_value(PARAM_INT, 'page number'),
'preflightdata' => new external_... | php | public static function get_attempt_data_parameters() {
return new external_function_parameters (
array(
'attemptid' => new external_value(PARAM_INT, 'attempt id'),
'page' => new external_value(PARAM_INT, 'page number'),
'preflightdata' => new external_... | [
"public",
"static",
"function",
"get_attempt_data_parameters",
"(",
")",
"{",
"return",
"new",
"external_function_parameters",
"(",
"array",
"(",
"'attemptid'",
"=>",
"new",
"external_value",
"(",
"PARAM_INT",
",",
"'attempt id'",
")",
",",
"'page'",
"=>",
"new",
... | Describes the parameters for get_attempt_data.
@return external_function_parameters
@since Moodle 3.1 | [
"Describes",
"the",
"parameters",
"for",
"get_attempt_data",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/classes/external.php#L957-L972 |
214,236 | moodle/moodle | mod/quiz/classes/external.php | mod_quiz_external.get_attempt_data | public static function get_attempt_data($attemptid, $page, $preflightdata = array()) {
$warnings = array();
$params = array(
'attemptid' => $attemptid,
'page' => $page,
'preflightdata' => $preflightdata,
);
$params = self::validate_parameters(self::g... | php | public static function get_attempt_data($attemptid, $page, $preflightdata = array()) {
$warnings = array();
$params = array(
'attemptid' => $attemptid,
'page' => $page,
'preflightdata' => $preflightdata,
);
$params = self::validate_parameters(self::g... | [
"public",
"static",
"function",
"get_attempt_data",
"(",
"$",
"attemptid",
",",
"$",
"page",
",",
"$",
"preflightdata",
"=",
"array",
"(",
")",
")",
"{",
"$",
"warnings",
"=",
"array",
"(",
")",
";",
"$",
"params",
"=",
"array",
"(",
"'attemptid'",
"=>... | Returns information for the given attempt page for a quiz attempt in progress.
@param int $attemptid attempt id
@param int $page page number
@param array $preflightdata preflight required data (like passwords)
@return array of warnings and the attempt data, next page, message and questions
@since Moodle 3.1
@throws mo... | [
"Returns",
"information",
"for",
"the",
"given",
"attempt",
"page",
"for",
"a",
"quiz",
"attempt",
"in",
"progress",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/classes/external.php#L984-L1011 |
214,237 | moodle/moodle | mod/quiz/classes/external.php | mod_quiz_external.get_attempt_data_returns | public static function get_attempt_data_returns() {
return new external_single_structure(
array(
'attempt' => self::attempt_structure(),
'messages' => new external_multiple_structure(
new external_value(PARAM_TEXT, 'access message'),
... | php | public static function get_attempt_data_returns() {
return new external_single_structure(
array(
'attempt' => self::attempt_structure(),
'messages' => new external_multiple_structure(
new external_value(PARAM_TEXT, 'access message'),
... | [
"public",
"static",
"function",
"get_attempt_data_returns",
"(",
")",
"{",
"return",
"new",
"external_single_structure",
"(",
"array",
"(",
"'attempt'",
"=>",
"self",
"::",
"attempt_structure",
"(",
")",
",",
"'messages'",
"=>",
"new",
"external_multiple_structure",
... | Describes the get_attempt_data return value.
@return external_single_structure
@since Moodle 3.1 | [
"Describes",
"the",
"get_attempt_data",
"return",
"value",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/classes/external.php#L1019-L1032 |
214,238 | moodle/moodle | mod/quiz/classes/external.php | mod_quiz_external.get_attempt_summary | public static function get_attempt_summary($attemptid, $preflightdata = array()) {
$warnings = array();
$params = array(
'attemptid' => $attemptid,
'preflightdata' => $preflightdata,
);
$params = self::validate_parameters(self::get_attempt_summary_parameters(), ... | php | public static function get_attempt_summary($attemptid, $preflightdata = array()) {
$warnings = array();
$params = array(
'attemptid' => $attemptid,
'preflightdata' => $preflightdata,
);
$params = self::validate_parameters(self::get_attempt_summary_parameters(), ... | [
"public",
"static",
"function",
"get_attempt_summary",
"(",
"$",
"attemptid",
",",
"$",
"preflightdata",
"=",
"array",
"(",
")",
")",
"{",
"$",
"warnings",
"=",
"array",
"(",
")",
";",
"$",
"params",
"=",
"array",
"(",
"'attemptid'",
"=>",
"$",
"attempti... | Returns a summary of a quiz attempt before it is submitted.
@param int $attemptid attempt id
@param int $preflightdata preflight required data (like passwords)
@return array of warnings and the attempt summary data for each question
@since Moodle 3.1 | [
"Returns",
"a",
"summary",
"of",
"a",
"quiz",
"attempt",
"before",
"it",
"is",
"submitted",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/classes/external.php#L1064-L1081 |
214,239 | moodle/moodle | mod/quiz/classes/external.php | mod_quiz_external.save_attempt_parameters | public static function save_attempt_parameters() {
return new external_function_parameters (
array(
'attemptid' => new external_value(PARAM_INT, 'attempt id'),
'data' => new external_multiple_structure(
new external_single_structure(
... | php | public static function save_attempt_parameters() {
return new external_function_parameters (
array(
'attemptid' => new external_value(PARAM_INT, 'attempt id'),
'data' => new external_multiple_structure(
new external_single_structure(
... | [
"public",
"static",
"function",
"save_attempt_parameters",
"(",
")",
"{",
"return",
"new",
"external_function_parameters",
"(",
"array",
"(",
"'attemptid'",
"=>",
"new",
"external_value",
"(",
"PARAM_INT",
",",
"'attempt id'",
")",
",",
"'data'",
"=>",
"new",
"ext... | Describes the parameters for save_attempt.
@return external_function_parameters
@since Moodle 3.1 | [
"Describes",
"the",
"parameters",
"for",
"save_attempt",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/classes/external.php#L1104-L1126 |
214,240 | moodle/moodle | mod/quiz/classes/external.php | mod_quiz_external.save_attempt | public static function save_attempt($attemptid, $data, $preflightdata = array()) {
global $DB;
$warnings = array();
$params = array(
'attemptid' => $attemptid,
'data' => $data,
'preflightdata' => $preflightdata,
);
$params = self::validate_pa... | php | public static function save_attempt($attemptid, $data, $preflightdata = array()) {
global $DB;
$warnings = array();
$params = array(
'attemptid' => $attemptid,
'data' => $data,
'preflightdata' => $preflightdata,
);
$params = self::validate_pa... | [
"public",
"static",
"function",
"save_attempt",
"(",
"$",
"attemptid",
",",
"$",
"data",
",",
"$",
"preflightdata",
"=",
"array",
"(",
")",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"warnings",
"=",
"array",
"(",
")",
";",
"$",
"params",
"=",
"array",... | Processes save requests during the quiz. This function is intended for the quiz auto-save feature.
@param int $attemptid attempt id
@param array $data the data to be saved
@param array $preflightdata preflight required data (like passwords)
@return array of warnings and execution result
@since Moodle 3.1 | [
"Processes",
"save",
"requests",
"during",
"the",
"quiz",
".",
"This",
"function",
"is",
"intended",
"for",
"the",
"quiz",
"auto",
"-",
"save",
"feature",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/classes/external.php#L1137-L1168 |
214,241 | moodle/moodle | mod/quiz/classes/external.php | mod_quiz_external.process_attempt_parameters | public static function process_attempt_parameters() {
return new external_function_parameters (
array(
'attemptid' => new external_value(PARAM_INT, 'attempt id'),
'data' => new external_multiple_structure(
new external_single_structure(
... | php | public static function process_attempt_parameters() {
return new external_function_parameters (
array(
'attemptid' => new external_value(PARAM_INT, 'attempt id'),
'data' => new external_multiple_structure(
new external_single_structure(
... | [
"public",
"static",
"function",
"process_attempt_parameters",
"(",
")",
"{",
"return",
"new",
"external_function_parameters",
"(",
"array",
"(",
"'attemptid'",
"=>",
"new",
"external_value",
"(",
"PARAM_INT",
",",
"'attempt id'",
")",
",",
"'data'",
"=>",
"new",
"... | Describes the parameters for process_attempt.
@return external_function_parameters
@since Moodle 3.1 | [
"Describes",
"the",
"parameters",
"for",
"process_attempt",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/classes/external.php#L1191-L1217 |
214,242 | moodle/moodle | mod/quiz/classes/external.php | mod_quiz_external.process_attempt | public static function process_attempt($attemptid, $data, $finishattempt = false, $timeup = false, $preflightdata = array()) {
$warnings = array();
$params = array(
'attemptid' => $attemptid,
'data' => $data,
'finishattempt' => $finishattempt,
'timeup' =... | php | public static function process_attempt($attemptid, $data, $finishattempt = false, $timeup = false, $preflightdata = array()) {
$warnings = array();
$params = array(
'attemptid' => $attemptid,
'data' => $data,
'finishattempt' => $finishattempt,
'timeup' =... | [
"public",
"static",
"function",
"process_attempt",
"(",
"$",
"attemptid",
",",
"$",
"data",
",",
"$",
"finishattempt",
"=",
"false",
",",
"$",
"timeup",
"=",
"false",
",",
"$",
"preflightdata",
"=",
"array",
"(",
")",
")",
"{",
"$",
"warnings",
"=",
"a... | Process responses during an attempt at a quiz and also deals with attempts finishing.
@param int $attemptid attempt id
@param array $data the data to be saved
@param bool $finishattempt whether to finish or not the attempt
@param bool $timeup whether the WS was called by a timer when the time is up
@param array $prefl... | [
"Process",
"responses",
"during",
"an",
"attempt",
"at",
"a",
"quiz",
"and",
"also",
"deals",
"with",
"attempts",
"finishing",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/classes/external.php#L1230-L1265 |
214,243 | moodle/moodle | mod/quiz/classes/external.php | mod_quiz_external.validate_attempt_review | protected static function validate_attempt_review($params) {
$attemptobj = quiz_attempt::create($params['attemptid']);
$attemptobj->check_review_capability();
$displayoptions = $attemptobj->get_display_options(true);
if ($attemptobj->is_own_attempt()) {
if (!$attemptobj->is... | php | protected static function validate_attempt_review($params) {
$attemptobj = quiz_attempt::create($params['attemptid']);
$attemptobj->check_review_capability();
$displayoptions = $attemptobj->get_display_options(true);
if ($attemptobj->is_own_attempt()) {
if (!$attemptobj->is... | [
"protected",
"static",
"function",
"validate_attempt_review",
"(",
"$",
"params",
")",
"{",
"$",
"attemptobj",
"=",
"quiz_attempt",
"::",
"create",
"(",
"$",
"params",
"[",
"'attemptid'",
"]",
")",
";",
"$",
"attemptobj",
"->",
"check_review_capability",
"(",
... | Validate an attempt finished for review. The attempt would be reviewed by a user or a teacher.
@param array $params Array of parameters including the attemptid
@return array containing the attempt object and display options
@since Moodle 3.1
@throws moodle_exception
@throws moodle_quiz_exception | [
"Validate",
"an",
"attempt",
"finished",
"for",
"review",
".",
"The",
"attempt",
"would",
"be",
"reviewed",
"by",
"a",
"user",
"or",
"a",
"teacher",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/classes/external.php#L1292-L1308 |
214,244 | moodle/moodle | mod/quiz/classes/external.php | mod_quiz_external.get_attempt_review | public static function get_attempt_review($attemptid, $page = -1) {
global $PAGE;
$warnings = array();
$params = array(
'attemptid' => $attemptid,
'page' => $page,
);
$params = self::validate_parameters(self::get_attempt_review_parameters(), $params);
... | php | public static function get_attempt_review($attemptid, $page = -1) {
global $PAGE;
$warnings = array();
$params = array(
'attemptid' => $attemptid,
'page' => $page,
);
$params = self::validate_parameters(self::get_attempt_review_parameters(), $params);
... | [
"public",
"static",
"function",
"get_attempt_review",
"(",
"$",
"attemptid",
",",
"$",
"page",
"=",
"-",
"1",
")",
"{",
"global",
"$",
"PAGE",
";",
"$",
"warnings",
"=",
"array",
"(",
")",
";",
"$",
"params",
"=",
"array",
"(",
"'attemptid'",
"=>",
"... | Returns review information for the given finished attempt, can be used by users or teachers.
@param int $attemptid attempt id
@param int $page page number, empty for all the questions in all the pages
@return array of warnings and the attempt data, feedback and questions
@since Moodle 3.1
@throws moodle_exception
@th... | [
"Returns",
"review",
"information",
"for",
"the",
"given",
"finished",
"attempt",
"can",
"be",
"used",
"by",
"users",
"or",
"teachers",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/classes/external.php#L1336-L1387 |
214,245 | moodle/moodle | mod/quiz/classes/external.php | mod_quiz_external.get_attempt_review_returns | public static function get_attempt_review_returns() {
return new external_single_structure(
array(
'grade' => new external_value(PARAM_RAW, 'grade for the quiz (or empty or "notyetgraded")'),
'attempt' => self::attempt_structure(),
'additionaldata' => ... | php | public static function get_attempt_review_returns() {
return new external_single_structure(
array(
'grade' => new external_value(PARAM_RAW, 'grade for the quiz (or empty or "notyetgraded")'),
'attempt' => self::attempt_structure(),
'additionaldata' => ... | [
"public",
"static",
"function",
"get_attempt_review_returns",
"(",
")",
"{",
"return",
"new",
"external_single_structure",
"(",
"array",
"(",
"'grade'",
"=>",
"new",
"external_value",
"(",
"PARAM_RAW",
",",
"'grade for the quiz (or empty or \"notyetgraded\")'",
")",
",",
... | Describes the get_attempt_review return value.
@return external_single_structure
@since Moodle 3.1 | [
"Describes",
"the",
"get_attempt_review",
"return",
"value",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/classes/external.php#L1395-L1413 |
214,246 | moodle/moodle | mod/quiz/classes/external.php | mod_quiz_external.view_attempt | public static function view_attempt($attemptid, $page, $preflightdata = array()) {
$warnings = array();
$params = array(
'attemptid' => $attemptid,
'page' => $page,
'preflightdata' => $preflightdata,
);
$params = self::validate_parameters(self::view_... | php | public static function view_attempt($attemptid, $page, $preflightdata = array()) {
$warnings = array();
$params = array(
'attemptid' => $attemptid,
'page' => $page,
'preflightdata' => $preflightdata,
);
$params = self::validate_parameters(self::view_... | [
"public",
"static",
"function",
"view_attempt",
"(",
"$",
"attemptid",
",",
"$",
"page",
",",
"$",
"preflightdata",
"=",
"array",
"(",
")",
")",
"{",
"$",
"warnings",
"=",
"array",
"(",
")",
";",
"$",
"params",
"=",
"array",
"(",
"'attemptid'",
"=>",
... | Trigger the attempt viewed event.
@param int $attemptid attempt id
@param int $page page number
@param array $preflightdata preflight required data (like passwords)
@return array of warnings and status result
@since Moodle 3.1 | [
"Trigger",
"the",
"attempt",
"viewed",
"event",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/classes/external.php#L1447-L1471 |
214,247 | moodle/moodle | mod/quiz/classes/external.php | mod_quiz_external.view_attempt_summary | public static function view_attempt_summary($attemptid, $preflightdata = array()) {
$warnings = array();
$params = array(
'attemptid' => $attemptid,
'preflightdata' => $preflightdata,
);
$params = self::validate_parameters(self::view_attempt_summary_parameters()... | php | public static function view_attempt_summary($attemptid, $preflightdata = array()) {
$warnings = array();
$params = array(
'attemptid' => $attemptid,
'preflightdata' => $preflightdata,
);
$params = self::validate_parameters(self::view_attempt_summary_parameters()... | [
"public",
"static",
"function",
"view_attempt_summary",
"(",
"$",
"attemptid",
",",
"$",
"preflightdata",
"=",
"array",
"(",
")",
")",
"{",
"$",
"warnings",
"=",
"array",
"(",
")",
";",
"$",
"params",
"=",
"array",
"(",
"'attemptid'",
"=>",
"$",
"attempt... | Trigger the attempt summary viewed event.
@param int $attemptid attempt id
@param array $preflightdata preflight required data (like passwords)
@return array of warnings and status result
@since Moodle 3.1 | [
"Trigger",
"the",
"attempt",
"summary",
"viewed",
"event",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/classes/external.php#L1518-L1536 |
214,248 | moodle/moodle | mod/quiz/classes/external.php | mod_quiz_external.view_attempt_review | public static function view_attempt_review($attemptid) {
$warnings = array();
$params = array(
'attemptid' => $attemptid,
);
$params = self::validate_parameters(self::view_attempt_review_parameters(), $params);
list($attemptobj, $displayoptions) = self::validate_att... | php | public static function view_attempt_review($attemptid) {
$warnings = array();
$params = array(
'attemptid' => $attemptid,
);
$params = self::validate_parameters(self::view_attempt_review_parameters(), $params);
list($attemptobj, $displayoptions) = self::validate_att... | [
"public",
"static",
"function",
"view_attempt_review",
"(",
"$",
"attemptid",
")",
"{",
"$",
"warnings",
"=",
"array",
"(",
")",
";",
"$",
"params",
"=",
"array",
"(",
"'attemptid'",
"=>",
"$",
"attemptid",
",",
")",
";",
"$",
"params",
"=",
"self",
":... | Trigger the attempt reviewed event.
@param int $attemptid attempt id
@return array of warnings and status result
@since Moodle 3.1 | [
"Trigger",
"the",
"attempt",
"reviewed",
"event",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/classes/external.php#L1574-L1591 |
214,249 | moodle/moodle | mod/quiz/classes/external.php | mod_quiz_external.get_quiz_feedback_for_grade | public static function get_quiz_feedback_for_grade($quizid, $grade) {
global $DB;
$params = array(
'quizid' => $quizid,
'grade' => $grade,
);
$params = self::validate_parameters(self::get_quiz_feedback_for_grade_parameters(), $params);
$warnings = array()... | php | public static function get_quiz_feedback_for_grade($quizid, $grade) {
global $DB;
$params = array(
'quizid' => $quizid,
'grade' => $grade,
);
$params = self::validate_parameters(self::get_quiz_feedback_for_grade_parameters(), $params);
$warnings = array()... | [
"public",
"static",
"function",
"get_quiz_feedback_for_grade",
"(",
"$",
"quizid",
",",
"$",
"grade",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"params",
"=",
"array",
"(",
"'quizid'",
"=>",
"$",
"quizid",
",",
"'grade'",
"=>",
"$",
"grade",
",",
")",
"... | Get the feedback text that should be show to a student who got the given grade in the given quiz.
@param int $quizid quiz instance id
@param float $grade the grade to check
@return array of warnings and status result
@since Moodle 3.1
@throws moodle_exception | [
"Get",
"the",
"feedback",
"text",
"that",
"should",
"be",
"show",
"to",
"a",
"student",
"who",
"got",
"the",
"given",
"grade",
"in",
"the",
"given",
"quiz",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/classes/external.php#L1632-L1662 |
214,250 | moodle/moodle | mod/quiz/classes/external.php | mod_quiz_external.get_quiz_access_information | public static function get_quiz_access_information($quizid) {
global $DB, $USER;
$warnings = array();
$params = array(
'quizid' => $quizid
);
$params = self::validate_parameters(self::get_quiz_access_information_parameters(), $params);
list($quiz, $course, ... | php | public static function get_quiz_access_information($quizid) {
global $DB, $USER;
$warnings = array();
$params = array(
'quizid' => $quizid
);
$params = self::validate_parameters(self::get_quiz_access_information_parameters(), $params);
list($quiz, $course, ... | [
"public",
"static",
"function",
"get_quiz_access_information",
"(",
"$",
"quizid",
")",
"{",
"global",
"$",
"DB",
",",
"$",
"USER",
";",
"$",
"warnings",
"=",
"array",
"(",
")",
";",
"$",
"params",
"=",
"array",
"(",
"'quizid'",
"=>",
"$",
"quizid",
")... | Return access information for a given quiz.
@param int $quizid quiz instance id
@return array of warnings and the access information
@since Moodle 3.1
@throws moodle_quiz_exception | [
"Return",
"access",
"information",
"for",
"a",
"given",
"quiz",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/classes/external.php#L1703-L1735 |
214,251 | moodle/moodle | mod/quiz/classes/external.php | mod_quiz_external.get_quiz_access_information_returns | public static function get_quiz_access_information_returns() {
return new external_single_structure(
array(
'canattempt' => new external_value(PARAM_BOOL, 'Whether the user can do the quiz or not.'),
'canmanage' => new external_value(PARAM_BOOL, 'Whether the user can ... | php | public static function get_quiz_access_information_returns() {
return new external_single_structure(
array(
'canattempt' => new external_value(PARAM_BOOL, 'Whether the user can do the quiz or not.'),
'canmanage' => new external_value(PARAM_BOOL, 'Whether the user can ... | [
"public",
"static",
"function",
"get_quiz_access_information_returns",
"(",
")",
"{",
"return",
"new",
"external_single_structure",
"(",
"array",
"(",
"'canattempt'",
"=>",
"new",
"external_value",
"(",
"PARAM_BOOL",
",",
"'Whether the user can do the quiz or not.'",
")",
... | Describes the get_quiz_access_information return value.
@return external_single_structure
@since Moodle 3.1 | [
"Describes",
"the",
"get_quiz_access_information",
"return",
"value",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/classes/external.php#L1743-L1761 |
214,252 | moodle/moodle | mod/quiz/classes/external.php | mod_quiz_external.get_attempt_access_information | public static function get_attempt_access_information($quizid, $attemptid = 0) {
global $DB, $USER;
$warnings = array();
$params = array(
'quizid' => $quizid,
'attemptid' => $attemptid,
);
$params = self::validate_parameters(self::get_attempt_access_info... | php | public static function get_attempt_access_information($quizid, $attemptid = 0) {
global $DB, $USER;
$warnings = array();
$params = array(
'quizid' => $quizid,
'attemptid' => $attemptid,
);
$params = self::validate_parameters(self::get_attempt_access_info... | [
"public",
"static",
"function",
"get_attempt_access_information",
"(",
"$",
"quizid",
",",
"$",
"attemptid",
"=",
"0",
")",
"{",
"global",
"$",
"DB",
",",
"$",
"USER",
";",
"$",
"warnings",
"=",
"array",
"(",
")",
";",
"$",
"params",
"=",
"array",
"(",... | Return access information for a given attempt in a quiz.
@param int $quizid quiz instance id
@param int $attemptid attempt id, 0 for the user last attempt if exists
@return array of warnings and the access information
@since Moodle 3.1
@throws moodle_quiz_exception | [
"Return",
"access",
"information",
"for",
"a",
"given",
"attempt",
"in",
"a",
"quiz",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/classes/external.php#L1787-L1846 |
214,253 | moodle/moodle | mod/quiz/classes/external.php | mod_quiz_external.get_attempt_access_information_returns | public static function get_attempt_access_information_returns() {
return new external_single_structure(
array(
'endtime' => new external_value(PARAM_INT, 'When the attempt must be submitted (determined by rules).',
VALUE_OPTIONAL),
... | php | public static function get_attempt_access_information_returns() {
return new external_single_structure(
array(
'endtime' => new external_value(PARAM_INT, 'When the attempt must be submitted (determined by rules).',
VALUE_OPTIONAL),
... | [
"public",
"static",
"function",
"get_attempt_access_information_returns",
"(",
")",
"{",
"return",
"new",
"external_single_structure",
"(",
"array",
"(",
"'endtime'",
"=>",
"new",
"external_value",
"(",
"PARAM_INT",
",",
"'When the attempt must be submitted (determined by rul... | Describes the get_attempt_access_information return value.
@return external_single_structure
@since Moodle 3.1 | [
"Describes",
"the",
"get_attempt_access_information",
"return",
"value",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/classes/external.php#L1854-L1868 |
214,254 | moodle/moodle | mod/quiz/classes/external.php | mod_quiz_external.get_quiz_required_qtypes | public static function get_quiz_required_qtypes($quizid) {
global $DB, $USER;
$warnings = array();
$params = array(
'quizid' => $quizid
);
$params = self::validate_parameters(self::get_quiz_required_qtypes_parameters(), $params);
list($quiz, $course, $cm, $... | php | public static function get_quiz_required_qtypes($quizid) {
global $DB, $USER;
$warnings = array();
$params = array(
'quizid' => $quizid
);
$params = self::validate_parameters(self::get_quiz_required_qtypes_parameters(), $params);
list($quiz, $course, $cm, $... | [
"public",
"static",
"function",
"get_quiz_required_qtypes",
"(",
"$",
"quizid",
")",
"{",
"global",
"$",
"DB",
",",
"$",
"USER",
";",
"$",
"warnings",
"=",
"array",
"(",
")",
";",
"$",
"params",
"=",
"array",
"(",
"'quizid'",
"=>",
"$",
"quizid",
")",
... | Return the potential question types that would be required for a given quiz.
Please note that for random question types we return the potential question types in the category choosen.
@param int $quizid quiz instance id
@return array of warnings and the access information
@since Moodle 3.1
@throws moodle_quiz_excepti... | [
"Return",
"the",
"potential",
"question",
"types",
"that",
"would",
"be",
"required",
"for",
"a",
"given",
"quiz",
".",
"Please",
"note",
"that",
"for",
"random",
"question",
"types",
"we",
"return",
"the",
"potential",
"question",
"types",
"in",
"the",
"cat... | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/classes/external.php#L1893-L1914 |
214,255 | moodle/moodle | enrol/lti/classes/manage_table.php | manage_table.col_name | public function col_name($tool) {
$name = helper::get_name($tool);
return $this->get_display_text($tool, $name);
} | php | public function col_name($tool) {
$name = helper::get_name($tool);
return $this->get_display_text($tool, $name);
} | [
"public",
"function",
"col_name",
"(",
"$",
"tool",
")",
"{",
"$",
"name",
"=",
"helper",
"::",
"get_name",
"(",
"$",
"tool",
")",
";",
"return",
"$",
"this",
"->",
"get_display_text",
"(",
"$",
"tool",
",",
"$",
"name",
")",
";",
"}"
] | Generate the name column.
@param \stdClass $tool event data.
@return string | [
"Generate",
"the",
"name",
"column",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/enrol/lti/classes/manage_table.php#L103-L107 |
214,256 | moodle/moodle | enrol/lti/classes/manage_table.php | manage_table.col_launch | public function col_launch($tool) {
global $OUTPUT;
$url = helper::get_cartridge_url($tool);
$cartridgeurllabel = get_string('cartridgeurl', 'enrol_lti');
$cartridgeurl = $url;
$secretlabel = get_string('secret', 'enrol_lti');
$secret = $tool->secret;
$launchurl... | php | public function col_launch($tool) {
global $OUTPUT;
$url = helper::get_cartridge_url($tool);
$cartridgeurllabel = get_string('cartridgeurl', 'enrol_lti');
$cartridgeurl = $url;
$secretlabel = get_string('secret', 'enrol_lti');
$secret = $tool->secret;
$launchurl... | [
"public",
"function",
"col_launch",
"(",
"$",
"tool",
")",
"{",
"global",
"$",
"OUTPUT",
";",
"$",
"url",
"=",
"helper",
"::",
"get_cartridge_url",
"(",
"$",
"tool",
")",
";",
"$",
"cartridgeurllabel",
"=",
"get_string",
"(",
"'cartridgeurl'",
",",
"'enrol... | Generate the launch column.
@param \stdClass $tool instance data.
@return string | [
"Generate",
"the",
"launch",
"column",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/enrol/lti/classes/manage_table.php#L115-L138 |
214,257 | moodle/moodle | enrol/lti/classes/manage_table.php | manage_table.col_registration | public function col_registration($tool) {
global $OUTPUT;
$url = helper::get_proxy_url($tool);
$toolurllabel = get_string("registrationurl", "enrol_lti");
$toolurl = $url;
$data = [
"rows" => [
[ "label" => $toolurllabel, "text" => $toolurl,... | php | public function col_registration($tool) {
global $OUTPUT;
$url = helper::get_proxy_url($tool);
$toolurllabel = get_string("registrationurl", "enrol_lti");
$toolurl = $url;
$data = [
"rows" => [
[ "label" => $toolurllabel, "text" => $toolurl,... | [
"public",
"function",
"col_registration",
"(",
"$",
"tool",
")",
"{",
"global",
"$",
"OUTPUT",
";",
"$",
"url",
"=",
"helper",
"::",
"get_proxy_url",
"(",
"$",
"tool",
")",
";",
"$",
"toolurllabel",
"=",
"get_string",
"(",
"\"registrationurl\"",
",",
"\"en... | Generate the Registration column.
@param \stdClass $tool instance data.
@return string | [
"Generate",
"the",
"Registration",
"column",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/enrol/lti/classes/manage_table.php#L146-L162 |
214,258 | moodle/moodle | enrol/lti/classes/manage_table.php | manage_table.col_edit | public function col_edit($tool) {
global $OUTPUT;
$buttons = array();
$instance = new \stdClass();
$instance->id = $tool->enrolid;
$instance->courseid = $tool->courseid;
$instance->enrol = 'lti';
$instance->status = $tool->status;
$strdelete = get_strin... | php | public function col_edit($tool) {
global $OUTPUT;
$buttons = array();
$instance = new \stdClass();
$instance->id = $tool->enrolid;
$instance->courseid = $tool->courseid;
$instance->enrol = 'lti';
$instance->status = $tool->status;
$strdelete = get_strin... | [
"public",
"function",
"col_edit",
"(",
"$",
"tool",
")",
"{",
"global",
"$",
"OUTPUT",
";",
"$",
"buttons",
"=",
"array",
"(",
")",
";",
"$",
"instance",
"=",
"new",
"\\",
"stdClass",
"(",
")",
";",
"$",
"instance",
"->",
"id",
"=",
"$",
"tool",
... | Generate the edit column.
@param \stdClass $tool event data.
@return string | [
"Generate",
"the",
"edit",
"column",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/enrol/lti/classes/manage_table.php#L170-L217 |
214,259 | moodle/moodle | enrol/lti/classes/manage_table.php | manage_table.get_display_text | protected function get_display_text($tool, $text) {
if ($tool->status != ENROL_INSTANCE_ENABLED) {
return \html_writer::tag('span', $text, array('class' => 'dimmed_text'));
}
return $text;
} | php | protected function get_display_text($tool, $text) {
if ($tool->status != ENROL_INSTANCE_ENABLED) {
return \html_writer::tag('span', $text, array('class' => 'dimmed_text'));
}
return $text;
} | [
"protected",
"function",
"get_display_text",
"(",
"$",
"tool",
",",
"$",
"text",
")",
"{",
"if",
"(",
"$",
"tool",
"->",
"status",
"!=",
"ENROL_INSTANCE_ENABLED",
")",
"{",
"return",
"\\",
"html_writer",
"::",
"tag",
"(",
"'span'",
",",
"$",
"text",
",",... | Returns text to display in the columns.
@param \stdClass $tool the tool
@param string $text the text to alter
@return string | [
"Returns",
"text",
"to",
"display",
"in",
"the",
"columns",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/enrol/lti/classes/manage_table.php#L244-L250 |
214,260 | moodle/moodle | webservice/classes/privacy/provider.php | provider.transform_token | protected static function transform_token($record) {
$notexportedstr = get_string('privacy:request:notexportedsecurity', 'core_webservice');
return [
'external_service' => $record->externalservicename,
'token' => $notexportedstr,
'private_token' => $record->privatetok... | php | protected static function transform_token($record) {
$notexportedstr = get_string('privacy:request:notexportedsecurity', 'core_webservice');
return [
'external_service' => $record->externalservicename,
'token' => $notexportedstr,
'private_token' => $record->privatetok... | [
"protected",
"static",
"function",
"transform_token",
"(",
"$",
"record",
")",
"{",
"$",
"notexportedstr",
"=",
"get_string",
"(",
"'privacy:request:notexportedsecurity'",
",",
"'core_webservice'",
")",
";",
"return",
"[",
"'external_service'",
"=>",
"$",
"record",
... | Transform a token entry.
@param object $record The token record.
@return array | [
"Transform",
"a",
"token",
"entry",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/webservice/classes/privacy/provider.php#L295-L306 |
214,261 | moodle/moodle | backup/util/dbops/backup_controller_dbops.class.php | backup_controller_dbops.get_courseid_from_type_id | public static function get_courseid_from_type_id($type, $id) {
global $DB;
if ($type == backup::TYPE_1COURSE) {
return $id; // id is the course id
} else if ($type == backup::TYPE_1SECTION) {
if (! $courseid = $DB->get_field('course_sections', 'course', array('id' => $id... | php | public static function get_courseid_from_type_id($type, $id) {
global $DB;
if ($type == backup::TYPE_1COURSE) {
return $id; // id is the course id
} else if ($type == backup::TYPE_1SECTION) {
if (! $courseid = $DB->get_field('course_sections', 'course', array('id' => $id... | [
"public",
"static",
"function",
"get_courseid_from_type_id",
"(",
"$",
"type",
",",
"$",
"id",
")",
"{",
"global",
"$",
"DB",
";",
"if",
"(",
"$",
"type",
"==",
"backup",
"::",
"TYPE_1COURSE",
")",
"{",
"return",
"$",
"id",
";",
"// id is the course id",
... | Given one type and id from controller, return the corresponding courseid | [
"Given",
"one",
"type",
"and",
"id",
"from",
"controller",
"return",
"the",
"corresponding",
"courseid"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/util/dbops/backup_controller_dbops.class.php#L208-L224 |
214,262 | moodle/moodle | backup/util/dbops/backup_controller_dbops.class.php | backup_controller_dbops.apply_version_and_release | public static function apply_version_and_release() {
global $CFG;
if ($CFG->backup_version < backup::VERSION) {
set_config('backup_version', backup::VERSION);
set_config('backup_release', backup::RELEASE);
}
} | php | public static function apply_version_and_release() {
global $CFG;
if ($CFG->backup_version < backup::VERSION) {
set_config('backup_version', backup::VERSION);
set_config('backup_release', backup::RELEASE);
}
} | [
"public",
"static",
"function",
"apply_version_and_release",
"(",
")",
"{",
"global",
"$",
"CFG",
";",
"if",
"(",
"$",
"CFG",
"->",
"backup_version",
"<",
"backup",
"::",
"VERSION",
")",
"{",
"set_config",
"(",
"'backup_version'",
",",
"backup",
"::",
"VERSI... | Update CFG->backup_version and CFG->backup_release if change in
version is detected. | [
"Update",
"CFG",
"-",
">",
"backup_version",
"and",
"CFG",
"-",
">",
"backup_release",
"if",
"change",
"in",
"version",
"is",
"detected",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/util/dbops/backup_controller_dbops.class.php#L456-L463 |
214,263 | moodle/moodle | backup/util/dbops/backup_controller_dbops.class.php | backup_controller_dbops.backup_includes_mnet_remote_users | public static function backup_includes_mnet_remote_users($backupid) {
global $CFG, $DB;
$sql = "SELECT COUNT(*)
FROM {backup_ids_temp} b
JOIN {user} u ON u.id = b.itemid
WHERE b.backupid = ?
AND b.itemname = 'userfinal'
... | php | public static function backup_includes_mnet_remote_users($backupid) {
global $CFG, $DB;
$sql = "SELECT COUNT(*)
FROM {backup_ids_temp} b
JOIN {user} u ON u.id = b.itemid
WHERE b.backupid = ?
AND b.itemname = 'userfinal'
... | [
"public",
"static",
"function",
"backup_includes_mnet_remote_users",
"(",
"$",
"backupid",
")",
"{",
"global",
"$",
"CFG",
",",
"$",
"DB",
";",
"$",
"sql",
"=",
"\"SELECT COUNT(*)\n FROM {backup_ids_temp} b\n JOIN {user} u ON u.id = b.itemid\n ... | Given the backupid, detect if the backup includes "mnet" remote users or no | [
"Given",
"the",
"backupid",
"detect",
"if",
"the",
"backup",
"includes",
"mnet",
"remote",
"users",
"or",
"no"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/util/dbops/backup_controller_dbops.class.php#L468-L479 |
214,264 | moodle/moodle | backup/util/dbops/backup_controller_dbops.class.php | backup_controller_dbops.backup_includes_files | public static function backup_includes_files($backupid) {
// This function is called repeatedly in a backup with many files.
// Loading the controller is a nontrivial operation (in a large test
// backup it took 0.3 seconds), so we do a temporary cache of it within
// this request.
... | php | public static function backup_includes_files($backupid) {
// This function is called repeatedly in a backup with many files.
// Loading the controller is a nontrivial operation (in a large test
// backup it took 0.3 seconds), so we do a temporary cache of it within
// this request.
... | [
"public",
"static",
"function",
"backup_includes_files",
"(",
"$",
"backupid",
")",
"{",
"// This function is called repeatedly in a backup with many files.",
"// Loading the controller is a nontrivial operation (in a large test",
"// backup it took 0.3 seconds), so we do a temporary cache of ... | Given the backupid, determine whether this backup should include
files from the moodle file storage system.
@param string $backupid The ID of the backup.
@return int Indicates whether files should be included in backups. | [
"Given",
"the",
"backupid",
"determine",
"whether",
"this",
"backup",
"should",
"include",
"files",
"from",
"the",
"moodle",
"file",
"storage",
"system",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/util/dbops/backup_controller_dbops.class.php#L488-L503 |
214,265 | moodle/moodle | backup/util/dbops/backup_controller_dbops.class.php | backup_controller_dbops.backup_includes_file_references | public static function backup_includes_file_references($backupid) {
global $CFG, $DB;
$sql = "SELECT count(r.repositoryid)
FROM {files} f
LEFT JOIN {files_reference} r
ON r.id = f.referencefileid
JOIN {backup_ids_temp} bi
... | php | public static function backup_includes_file_references($backupid) {
global $CFG, $DB;
$sql = "SELECT count(r.repositoryid)
FROM {files} f
LEFT JOIN {files_reference} r
ON r.id = f.referencefileid
JOIN {backup_ids_temp} bi
... | [
"public",
"static",
"function",
"backup_includes_file_references",
"(",
"$",
"backupid",
")",
"{",
"global",
"$",
"CFG",
",",
"$",
"DB",
";",
"$",
"sql",
"=",
"\"SELECT count(r.repositoryid)\n FROM {files} f\n LEFT JOIN {files_reference} r\n ... | Given the backupid, detect if the backup contains references to external contents
@copyright 2012 Dongsheng Cai {@link http://dongsheng.org}
@return int | [
"Given",
"the",
"backupid",
"detect",
"if",
"the",
"backup",
"contains",
"references",
"to",
"external",
"contents"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/util/dbops/backup_controller_dbops.class.php#L511-L524 |
214,266 | moodle/moodle | backup/util/dbops/backup_controller_dbops.class.php | backup_controller_dbops.apply_config_defaults | public static function apply_config_defaults(backup_controller $controller) {
// Based on the mode of the backup (general, automated, import, hub...)
// decide the action to perform to get defaults loaded
$mode = $controller->get_mode();
switch ($mode) {
case backup::MODE_GE... | php | public static function apply_config_defaults(backup_controller $controller) {
// Based on the mode of the backup (general, automated, import, hub...)
// decide the action to perform to get defaults loaded
$mode = $controller->get_mode();
switch ($mode) {
case backup::MODE_GE... | [
"public",
"static",
"function",
"apply_config_defaults",
"(",
"backup_controller",
"$",
"controller",
")",
"{",
"// Based on the mode of the backup (general, automated, import, hub...)",
"// decide the action to perform to get defaults loaded",
"$",
"mode",
"=",
"$",
"controller",
... | Sets the default values for the settings in a backup operation
Based on the mode of the backup it will load proper defaults
using {@link apply_admin_config_defaults}.
@param backup_controller $controller | [
"Sets",
"the",
"default",
"values",
"for",
"the",
"settings",
"in",
"a",
"backup",
"operation"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/util/dbops/backup_controller_dbops.class.php#L544-L619 |
214,267 | moodle/moodle | backup/util/dbops/backup_controller_dbops.class.php | backup_controller_dbops.get_progress | public static function get_progress($backupid) {
global $DB;
$progress = array();
$backuprecord = $DB->get_record(
'backup_controllers',
array('backupid' => $backupid),
'status, progress, operation',
MUST_EXIST);
$status = $backuprecord->... | php | public static function get_progress($backupid) {
global $DB;
$progress = array();
$backuprecord = $DB->get_record(
'backup_controllers',
array('backupid' => $backupid),
'status, progress, operation',
MUST_EXIST);
$status = $backuprecord->... | [
"public",
"static",
"function",
"get_progress",
"(",
"$",
"backupid",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"progress",
"=",
"array",
"(",
")",
";",
"$",
"backuprecord",
"=",
"$",
"DB",
"->",
"get_record",
"(",
"'backup_controllers'",
",",
"array",
"(... | Get the progress details of a backup operation.
Get backup records directly from database, if the backup has successfully completed
there will be no controller object to load.
@param string $backupid The backup id to query.
@return array $progress The backup progress details. | [
"Get",
"the",
"progress",
"details",
"of",
"a",
"backup",
"operation",
".",
"Get",
"backup",
"records",
"directly",
"from",
"database",
"if",
"the",
"backup",
"has",
"successfully",
"completed",
"there",
"will",
"be",
"no",
"controller",
"object",
"to",
"load"... | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/util/dbops/backup_controller_dbops.class.php#L688-L705 |
214,268 | moodle/moodle | admin/tool/log/store/standard/backup/moodle2/restore_logstore_standard_subplugin.class.php | restore_logstore_standard_subplugin.process_logstore_standard_log | public function process_logstore_standard_log($data) {
global $DB;
$data = $this->process_log($data, get_config('logstore_standard', 'jsonformat'));
if ($data) {
$DB->insert_record('logstore_standard_log', $data);
}
} | php | public function process_logstore_standard_log($data) {
global $DB;
$data = $this->process_log($data, get_config('logstore_standard', 'jsonformat'));
if ($data) {
$DB->insert_record('logstore_standard_log', $data);
}
} | [
"public",
"function",
"process_logstore_standard_log",
"(",
"$",
"data",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"data",
"=",
"$",
"this",
"->",
"process_log",
"(",
"$",
"data",
",",
"get_config",
"(",
"'logstore_standard'",
",",
"'jsonformat'",
")",
")",
... | Process logstore_standard_log entries.
This method proceeds to read, complete, remap and, finally,
discard or save every log entry.
@param array() $data log entry. | [
"Process",
"logstore_standard_log",
"entries",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/log/store/standard/backup/moodle2/restore_logstore_standard_subplugin.class.php#L60-L68 |
214,269 | moodle/moodle | lib/classes/message/inbound/address_manager.php | address_manager.set_data | public function set_data($datavalue, $datakey = null) {
$this->datavalue = $datavalue;
// We must clear the datakey when changing the datavalue.
$this->set_data_key($datakey);
} | php | public function set_data($datavalue, $datakey = null) {
$this->datavalue = $datavalue;
// We must clear the datakey when changing the datavalue.
$this->set_data_key($datakey);
} | [
"public",
"function",
"set_data",
"(",
"$",
"datavalue",
",",
"$",
"datakey",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"datavalue",
"=",
"$",
"datavalue",
";",
"// We must clear the datakey when changing the datavalue.",
"$",
"this",
"->",
"set_data_key",
"(",
... | Specify an integer data item value for this record.
@param int $datavalue The value of the data item.
@param string $datakey A hash to use for the datakey | [
"Specify",
"an",
"integer",
"data",
"item",
"value",
"for",
"this",
"record",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/message/inbound/address_manager.php#L152-L157 |
214,270 | moodle/moodle | lib/classes/message/inbound/address_manager.php | address_manager.fetch_data_key | public function fetch_data_key() {
global $CFG, $DB;
// Only generate a key if Inbound Message is actually enabled, and the handler is enabled.
if (!isset($CFG->messageinbound_enabled) || !$this->handler || !$this->handler->enabled) {
return null;
}
if (!isset($this... | php | public function fetch_data_key() {
global $CFG, $DB;
// Only generate a key if Inbound Message is actually enabled, and the handler is enabled.
if (!isset($CFG->messageinbound_enabled) || !$this->handler || !$this->handler->enabled) {
return null;
}
if (!isset($this... | [
"public",
"function",
"fetch_data_key",
"(",
")",
"{",
"global",
"$",
"CFG",
",",
"$",
"DB",
";",
"// Only generate a key if Inbound Message is actually enabled, and the handler is enabled.",
"if",
"(",
"!",
"isset",
"(",
"$",
"CFG",
"->",
"messageinbound_enabled",
")",... | Return the data key for the data item.
If no data key has been defined yet, this will call generate_data_key() to generate a new key on the fly.
@return string The secret key for this data item. | [
"Return",
"the",
"data",
"key",
"for",
"the",
"data",
"item",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/message/inbound/address_manager.php#L180-L201 |
214,271 | moodle/moodle | lib/classes/message/inbound/address_manager.php | address_manager.generate_data_key | protected function generate_data_key() {
global $DB;
$key = new \stdClass();
$key->handler = $this->handler->id;
$key->datavalue = $this->datavalue;
$key->datakey = md5($this->datavalue . '_' . time() . random_string(40));
$key->timecreated = time();
if ($this->... | php | protected function generate_data_key() {
global $DB;
$key = new \stdClass();
$key->handler = $this->handler->id;
$key->datavalue = $this->datavalue;
$key->datakey = md5($this->datavalue . '_' . time() . random_string(40));
$key->timecreated = time();
if ($this->... | [
"protected",
"function",
"generate_data_key",
"(",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"key",
"=",
"new",
"\\",
"stdClass",
"(",
")",
";",
"$",
"key",
"->",
"handler",
"=",
"$",
"this",
"->",
"handler",
"->",
"id",
";",
"$",
"key",
"->",
"data... | Generate a new secret key for the current data item and handler combination.
@return string The new generated secret key for this data item. | [
"Generate",
"a",
"new",
"secret",
"key",
"for",
"the",
"current",
"data",
"item",
"and",
"handler",
"combination",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/message/inbound/address_manager.php#L208-L224 |
214,272 | moodle/moodle | lib/classes/message/inbound/address_manager.php | address_manager.generate | public function generate($userid, $userkey = null) {
global $CFG;
// Ensure that Inbound Message is enabled and that there is enough information to proceed.
if (!manager::is_enabled()) {
return null;
}
if ($userkey == null) {
$userkey = get_user_key('mes... | php | public function generate($userid, $userkey = null) {
global $CFG;
// Ensure that Inbound Message is enabled and that there is enough information to proceed.
if (!manager::is_enabled()) {
return null;
}
if ($userkey == null) {
$userkey = get_user_key('mes... | [
"public",
"function",
"generate",
"(",
"$",
"userid",
",",
"$",
"userkey",
"=",
"null",
")",
"{",
"global",
"$",
"CFG",
";",
"// Ensure that Inbound Message is enabled and that there is enough information to proceed.",
"if",
"(",
"!",
"manager",
"::",
"is_enabled",
"(... | Generate an e-mail address for the Inbound Message handler, storing a private
key for the data object if one was not specified.
@param int $userid The ID of the user to generated an address for.
@param string $userkey The unique key for this user. If not specified this will be retrieved using
get_user_key(). This key ... | [
"Generate",
"an",
"e",
"-",
"mail",
"address",
"for",
"the",
"Inbound",
"Message",
"handler",
"storing",
"a",
"private",
"key",
"for",
"the",
"data",
"object",
"if",
"one",
"was",
"not",
"specified",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/message/inbound/address_manager.php#L236-L271 |
214,273 | moodle/moodle | lib/classes/message/inbound/address_manager.php | address_manager.process | protected function process($address) {
global $DB;
if (!self::is_correct_format($address)) {
// This address does not contain a subaddress to parse.
return;
}
// Ensure that the instance record is empty.
$this->record = null;
$record = new \stdC... | php | protected function process($address) {
global $DB;
if (!self::is_correct_format($address)) {
// This address does not contain a subaddress to parse.
return;
}
// Ensure that the instance record is empty.
$this->record = null;
$record = new \stdC... | [
"protected",
"function",
"process",
"(",
"$",
"address",
")",
"{",
"global",
"$",
"DB",
";",
"if",
"(",
"!",
"self",
"::",
"is_correct_format",
"(",
"$",
"address",
")",
")",
"{",
"// This address does not contain a subaddress to parse.",
"return",
";",
"}",
"... | Process an inbound address to obtain the data stored within it.
@param string $address The fully formed e-mail address to process. | [
"Process",
"an",
"inbound",
"address",
"to",
"obtain",
"the",
"data",
"stored",
"within",
"it",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/message/inbound/address_manager.php#L290-L359 |
214,274 | moodle/moodle | lib/classes/message/inbound/address_manager.php | address_manager.validate | protected function validate($address) {
if (!$this->record) {
// The record does not exist, so there is nothing to validate against.
return self::VALIDATION_INVALID_ADDRESS_FORMAT;
}
// Build the list of validation errors.
$returnvalue = 0;
if (!$this->h... | php | protected function validate($address) {
if (!$this->record) {
// The record does not exist, so there is nothing to validate against.
return self::VALIDATION_INVALID_ADDRESS_FORMAT;
}
// Build the list of validation errors.
$returnvalue = 0;
if (!$this->h... | [
"protected",
"function",
"validate",
"(",
"$",
"address",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"record",
")",
"{",
"// The record does not exist, so there is nothing to validate against.",
"return",
"self",
"::",
"VALIDATION_INVALID_ADDRESS_FORMAT",
";",
"}",
... | Ensure that the parsed data is valid, and if the handler requires address validation, validate the sender against
the user record of identified user record.
@param string $address The fully formed e-mail address to process.
@return int The validation status. | [
"Ensure",
"that",
"the",
"parsed",
"data",
"is",
"valid",
"and",
"if",
"the",
"handler",
"requires",
"address",
"validation",
"validate",
"the",
"sender",
"against",
"the",
"user",
"record",
"of",
"identified",
"user",
"record",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/message/inbound/address_manager.php#L377-L424 |
214,275 | moodle/moodle | lib/classes/message/inbound/address_manager.php | address_manager.process_envelope | public function process_envelope($recipient, $sender) {
// Process the recipient address to retrieve the handler data.
$this->process($recipient);
// Validate the retrieved data against the e-mail address of the originator.
$this->status = $this->validate($sender);
return $this... | php | public function process_envelope($recipient, $sender) {
// Process the recipient address to retrieve the handler data.
$this->process($recipient);
// Validate the retrieved data against the e-mail address of the originator.
$this->status = $this->validate($sender);
return $this... | [
"public",
"function",
"process_envelope",
"(",
"$",
"recipient",
",",
"$",
"sender",
")",
"{",
"// Process the recipient address to retrieve the handler data.",
"$",
"this",
"->",
"process",
"(",
"$",
"recipient",
")",
";",
"// Validate the retrieved data against the e-mail... | Process the message recipient, load the handler, and then validate
the sender with the associated data record.
@param string $recipient The recipient of the message
@param string $sender The sender of the message | [
"Process",
"the",
"message",
"recipient",
"load",
"the",
"handler",
"and",
"then",
"validate",
"the",
"sender",
"with",
"the",
"associated",
"data",
"record",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/message/inbound/address_manager.php#L433-L441 |
214,276 | moodle/moodle | lib/classes/message/inbound/address_manager.php | address_manager.handle_message | public function handle_message(\stdClass $messagedata) {
$this->record = $this->get_data();
return $this->handler->process_message($this->record, $messagedata);
} | php | public function handle_message(\stdClass $messagedata) {
$this->record = $this->get_data();
return $this->handler->process_message($this->record, $messagedata);
} | [
"public",
"function",
"handle_message",
"(",
"\\",
"stdClass",
"$",
"messagedata",
")",
"{",
"$",
"this",
"->",
"record",
"=",
"$",
"this",
"->",
"get_data",
"(",
")",
";",
"return",
"$",
"this",
"->",
"handler",
"->",
"process_message",
"(",
"$",
"this"... | Process the message against the relevant handler.
@param \stdClass $messagedata The data for the current message being processed.
@return mixed The result of the handler's message processor. A truthy result suggests a successful send. | [
"Process",
"the",
"message",
"against",
"the",
"relevant",
"handler",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/message/inbound/address_manager.php#L449-L452 |
214,277 | moodle/moodle | lib/classes/message/inbound/address_manager.php | address_manager.pack_int | protected function pack_int($int) {
if (PHP_INT_SIZE === 8) {
$left = 0xffffffff00000000;
$right = 0x00000000ffffffff;
$l = ($int & $left) >>32;
$r = $int & $right;
return pack('NN', $l, $r);
} else {
return pack('NN', 0, $int);
... | php | protected function pack_int($int) {
if (PHP_INT_SIZE === 8) {
$left = 0xffffffff00000000;
$right = 0x00000000ffffffff;
$l = ($int & $left) >>32;
$r = $int & $right;
return pack('NN', $l, $r);
} else {
return pack('NN', 0, $int);
... | [
"protected",
"function",
"pack_int",
"(",
"$",
"int",
")",
"{",
"if",
"(",
"PHP_INT_SIZE",
"===",
"8",
")",
"{",
"$",
"left",
"=",
"0xffffffff00000000",
";",
"$",
"right",
"=",
"0x00000000ffffffff",
";",
"$",
"l",
"=",
"(",
"$",
"int",
"&",
"$",
"lef... | Pack an integer into a pair of 32-bit numbers.
@param int $int The integer to pack
@return string The encoded binary data | [
"Pack",
"an",
"integer",
"into",
"a",
"pair",
"of",
"32",
"-",
"bit",
"numbers",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/message/inbound/address_manager.php#L460-L471 |
214,278 | moodle/moodle | lib/htmlpurifier/HTMLPurifier/Token.php | HTMLPurifier_Token.position | public function position($l = null, $c = null)
{
$this->line = $l;
$this->col = $c;
} | php | public function position($l = null, $c = null)
{
$this->line = $l;
$this->col = $c;
} | [
"public",
"function",
"position",
"(",
"$",
"l",
"=",
"null",
",",
"$",
"c",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"line",
"=",
"$",
"l",
";",
"$",
"this",
"->",
"col",
"=",
"$",
"c",
";",
"}"
] | Sets the position of the token in the source document.
@param int $l
@param int $c | [
"Sets",
"the",
"position",
"of",
"the",
"token",
"in",
"the",
"source",
"document",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/htmlpurifier/HTMLPurifier/Token.php#L74-L78 |
214,279 | moodle/moodle | lib/horde/framework/Horde/String/Transliterate.php | Horde_String_Transliterate.toAscii | public static function toAscii($str)
{
$methods = array(
'_intlToAscii',
'_iconvToAscii',
'_fallbackToAscii'
);
foreach ($methods as $val) {
if (($out = call_user_func(array(__CLASS__, $val), $str)) !== false) {
return $out;
... | php | public static function toAscii($str)
{
$methods = array(
'_intlToAscii',
'_iconvToAscii',
'_fallbackToAscii'
);
foreach ($methods as $val) {
if (($out = call_user_func(array(__CLASS__, $val), $str)) !== false) {
return $out;
... | [
"public",
"static",
"function",
"toAscii",
"(",
"$",
"str",
")",
"{",
"$",
"methods",
"=",
"array",
"(",
"'_intlToAscii'",
",",
"'_iconvToAscii'",
",",
"'_fallbackToAscii'",
")",
";",
"foreach",
"(",
"$",
"methods",
"as",
"$",
"val",
")",
"{",
"if",
"(",... | Transliterates an UTF-8 string to ASCII, replacing non-English
characters to their English equivalents.
Note: there is no guarantee that the output string will be ASCII-only,
since any non-ASCII character not in the transliteration list will
be ignored.
@param string $str Input string (UTF-8).
@return string Trans... | [
"Transliterates",
"an",
"UTF",
"-",
"8",
"string",
"to",
"ASCII",
"replacing",
"non",
"-",
"English",
"characters",
"to",
"their",
"English",
"equivalents",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/String/Transliterate.php#L53-L68 |
214,280 | moodle/moodle | lib/horde/framework/Horde/String/Transliterate.php | Horde_String_Transliterate._intlToAscii | protected static function _intlToAscii($str)
{
if (class_exists('Transliterator')) {
if (!isset(self::$_transliterator)) {
self::$_transliterator = Transliterator::create(
'Any-Latin; Latin-ASCII'
);
}
if (!is_null(self... | php | protected static function _intlToAscii($str)
{
if (class_exists('Transliterator')) {
if (!isset(self::$_transliterator)) {
self::$_transliterator = Transliterator::create(
'Any-Latin; Latin-ASCII'
);
}
if (!is_null(self... | [
"protected",
"static",
"function",
"_intlToAscii",
"(",
"$",
"str",
")",
"{",
"if",
"(",
"class_exists",
"(",
"'Transliterator'",
")",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"_transliterator",
")",
")",
"{",
"self",
"::",
"$",
"_tra... | Transliterate using the Transliterator package.
@param string $str Input string (UTF-8).
@return mixed Transliterated string (UTF-8), or false on error. | [
"Transliterate",
"using",
"the",
"Transliterator",
"package",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/String/Transliterate.php#L77-L93 |
214,281 | moodle/moodle | blocks/rss_client/block_rss_client.php | block_rss_client.get_footer | protected function get_footer($feedrecords) {
global $PAGE;
$footer = null;
if ($this->config->block_rss_client_show_channel_link) {
global $CFG;
require_once($CFG->libdir.'/simplepie/moodle_simplepie.php');
$feedrecord = array_pop($feedrecords);
... | php | protected function get_footer($feedrecords) {
global $PAGE;
$footer = null;
if ($this->config->block_rss_client_show_channel_link) {
global $CFG;
require_once($CFG->libdir.'/simplepie/moodle_simplepie.php');
$feedrecord = array_pop($feedrecords);
... | [
"protected",
"function",
"get_footer",
"(",
"$",
"feedrecords",
")",
"{",
"global",
"$",
"PAGE",
";",
"$",
"footer",
"=",
"null",
";",
"if",
"(",
"$",
"this",
"->",
"config",
"->",
"block_rss_client_show_channel_link",
")",
"{",
"global",
"$",
"CFG",
";",
... | Gets the footer, which is the channel link of the last feed in our list of feeds
@param array $feedrecords The feed records from the database.
@return block_rss_client\output\footer|null The renderable footer or null if none should be displayed. | [
"Gets",
"the",
"footer",
"which",
"is",
"the",
"channel",
"link",
"of",
"the",
"last",
"feed",
"in",
"our",
"list",
"of",
"feeds"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/blocks/rss_client/block_rss_client.php#L61-L89 |
214,282 | moodle/moodle | blocks/rss_client/block_rss_client.php | block_rss_client.get_feed | public function get_feed($feedrecord, $maxentries, $showtitle) {
global $CFG;
require_once($CFG->libdir.'/simplepie/moodle_simplepie.php');
if ($feedrecord->skipuntil) {
// Last attempt to gather this feed via cron failed - do not try to fetch it now.
$this->hasfailedfee... | php | public function get_feed($feedrecord, $maxentries, $showtitle) {
global $CFG;
require_once($CFG->libdir.'/simplepie/moodle_simplepie.php');
if ($feedrecord->skipuntil) {
// Last attempt to gather this feed via cron failed - do not try to fetch it now.
$this->hasfailedfee... | [
"public",
"function",
"get_feed",
"(",
"$",
"feedrecord",
",",
"$",
"maxentries",
",",
"$",
"showtitle",
")",
"{",
"global",
"$",
"CFG",
";",
"require_once",
"(",
"$",
"CFG",
"->",
"libdir",
".",
"'/simplepie/moodle_simplepie.php'",
")",
";",
"if",
"(",
"$... | Returns the html of a feed to be displaed in the block
@param mixed feedrecord The feed record from the database
@param int maxentries The maximum number of entries to be displayed
@param boolean showtitle Should the feed title be displayed in html
@return block_rss_client\output\feed|null The renderable feed or null ... | [
"Returns",
"the",
"html",
"of",
"a",
"feed",
"to",
"be",
"displaed",
"in",
"the",
"block"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/blocks/rss_client/block_rss_client.php#L183-L263 |
214,283 | moodle/moodle | blocks/rss_client/block_rss_client.php | block_rss_client.format_title | function format_title($title,$max=64) {
if (core_text::strlen($title) <= $max) {
return $title;
} else {
return core_text::substr($title, 0, $max - 3) . '...';
}
} | php | function format_title($title,$max=64) {
if (core_text::strlen($title) <= $max) {
return $title;
} else {
return core_text::substr($title, 0, $max - 3) . '...';
}
} | [
"function",
"format_title",
"(",
"$",
"title",
",",
"$",
"max",
"=",
"64",
")",
"{",
"if",
"(",
"core_text",
"::",
"strlen",
"(",
"$",
"title",
")",
"<=",
"$",
"max",
")",
"{",
"return",
"$",
"title",
";",
"}",
"else",
"{",
"return",
"core_text",
... | Strips a large title to size and adds ... if title too long
This function does not escape HTML entities, so they have to be escaped
before being passed here.
@param string title to shorten
@param int max character length of title
@return string title shortened if necessary | [
"Strips",
"a",
"large",
"title",
"to",
"size",
"and",
"adds",
"...",
"if",
"title",
"too",
"long",
"This",
"function",
"does",
"not",
"escape",
"HTML",
"entities",
"so",
"they",
"have",
"to",
"be",
"escaped",
"before",
"being",
"passed",
"here",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/blocks/rss_client/block_rss_client.php#L274-L281 |
214,284 | moodle/moodle | grade/report/overview/lib.php | grade_report_overview.setup_table | public function setup_table() {
/*
* Table has 3 columns
*| course | final grade | rank (optional) |
*/
// setting up table headers
if ($this->showrank['any']) {
$tablecolumns = array('coursename', 'grade', 'rank');
$tableheaders = array($this... | php | public function setup_table() {
/*
* Table has 3 columns
*| course | final grade | rank (optional) |
*/
// setting up table headers
if ($this->showrank['any']) {
$tablecolumns = array('coursename', 'grade', 'rank');
$tableheaders = array($this... | [
"public",
"function",
"setup_table",
"(",
")",
"{",
"/*\n * Table has 3 columns\n *| course | final grade | rank (optional) |\n */",
"// setting up table headers",
"if",
"(",
"$",
"this",
"->",
"showrank",
"[",
"'any'",
"]",
")",
"{",
"$",
"tablecolum... | Prepares the headers and attributes of the flexitable. | [
"Prepares",
"the",
"headers",
"and",
"attributes",
"of",
"the",
"flexitable",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/report/overview/lib.php#L137-L165 |
214,285 | moodle/moodle | grade/report/overview/lib.php | grade_report_overview.fill_table | public function fill_table($activitylink = false, $studentcoursesonly = false) {
global $CFG, $DB, $OUTPUT, $USER;
if ($studentcoursesonly && count($this->studentcourseids) == 0) {
return false;
}
// Only show user's courses instead of all courses.
if ($this->course... | php | public function fill_table($activitylink = false, $studentcoursesonly = false) {
global $CFG, $DB, $OUTPUT, $USER;
if ($studentcoursesonly && count($this->studentcourseids) == 0) {
return false;
}
// Only show user's courses instead of all courses.
if ($this->course... | [
"public",
"function",
"fill_table",
"(",
"$",
"activitylink",
"=",
"false",
",",
"$",
"studentcoursesonly",
"=",
"false",
")",
"{",
"global",
"$",
"CFG",
",",
"$",
"DB",
",",
"$",
"OUTPUT",
",",
"$",
"USER",
";",
"if",
"(",
"$",
"studentcoursesonly",
"... | Fill the table for displaying.
@param bool $activitylink If this report link to the activity report or the user report.
@param bool $studentcoursesonly Only show courses that the user is a student of. | [
"Fill",
"the",
"table",
"for",
"displaying",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/report/overview/lib.php#L264-L314 |
214,286 | moodle/moodle | grade/report/overview/lib.php | grade_report_overview.print_table | public function print_table($return=false) {
ob_start();
$this->table->print_html();
$html = ob_get_clean();
if ($return) {
return $html;
} else {
echo $html;
}
} | php | public function print_table($return=false) {
ob_start();
$this->table->print_html();
$html = ob_get_clean();
if ($return) {
return $html;
} else {
echo $html;
}
} | [
"public",
"function",
"print_table",
"(",
"$",
"return",
"=",
"false",
")",
"{",
"ob_start",
"(",
")",
";",
"$",
"this",
"->",
"table",
"->",
"print_html",
"(",
")",
";",
"$",
"html",
"=",
"ob_get_clean",
"(",
")",
";",
"if",
"(",
"$",
"return",
")... | Prints or returns the HTML from the flexitable.
@param bool $return Whether or not to return the data instead of printing it directly.
@return string | [
"Prints",
"or",
"returns",
"the",
"HTML",
"from",
"the",
"flexitable",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/report/overview/lib.php#L321-L330 |
214,287 | moodle/moodle | grade/report/overview/lib.php | grade_report_overview.print_teacher_table | public function print_teacher_table() {
$table = new html_table();
$table->head = array(get_string('coursename', 'grades'));
$table->data = null;
foreach ($this->teachercourses as $courseid => $course) {
$url = new moodle_url('/grade/report/index.php', array('id' => $courseid... | php | public function print_teacher_table() {
$table = new html_table();
$table->head = array(get_string('coursename', 'grades'));
$table->data = null;
foreach ($this->teachercourses as $courseid => $course) {
$url = new moodle_url('/grade/report/index.php', array('id' => $courseid... | [
"public",
"function",
"print_teacher_table",
"(",
")",
"{",
"$",
"table",
"=",
"new",
"html_table",
"(",
")",
";",
"$",
"table",
"->",
"head",
"=",
"array",
"(",
"get_string",
"(",
"'coursename'",
",",
"'grades'",
")",
")",
";",
"$",
"table",
"->",
"da... | Print a table to show courses that the user is able to grade. | [
"Print",
"a",
"table",
"to",
"show",
"courses",
"that",
"the",
"user",
"is",
"able",
"to",
"grade",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/report/overview/lib.php#L335-L344 |
214,288 | moodle/moodle | grade/report/overview/lib.php | grade_report_overview.check_access | public static function check_access($systemcontext, $context, $personalcontext, $course, $userid) {
global $USER;
$access = false;
if (has_capability('moodle/grade:viewall', $systemcontext)) {
// Ok - can view all course grades.
$access = true;
} else if (has_ca... | php | public static function check_access($systemcontext, $context, $personalcontext, $course, $userid) {
global $USER;
$access = false;
if (has_capability('moodle/grade:viewall', $systemcontext)) {
// Ok - can view all course grades.
$access = true;
} else if (has_ca... | [
"public",
"static",
"function",
"check_access",
"(",
"$",
"systemcontext",
",",
"$",
"context",
",",
"$",
"personalcontext",
",",
"$",
"course",
",",
"$",
"userid",
")",
"{",
"global",
"$",
"USER",
";",
"$",
"access",
"=",
"false",
";",
"if",
"(",
"has... | Check if the user can access the report.
@param stdClass $systemcontext system context
@param stdClass $context course context
@param stdClass $personalcontext personal context
@param stdClass $course course object
@param int $userid userid
@return bool true if the user can access... | [
"Check",
"if",
"the",
"user",
"can",
"access",
"the",
"report",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/report/overview/lib.php#L374-L399 |
214,289 | moodle/moodle | grade/report/overview/lib.php | grade_report_overview.viewed | public static function viewed($context, $courseid, $userid) {
$event = \gradereport_overview\event\grade_report_viewed::create(
array(
'context' => $context,
'courseid' => $courseid,
'relateduserid' => $userid,
)
);
$event->... | php | public static function viewed($context, $courseid, $userid) {
$event = \gradereport_overview\event\grade_report_viewed::create(
array(
'context' => $context,
'courseid' => $courseid,
'relateduserid' => $userid,
)
);
$event->... | [
"public",
"static",
"function",
"viewed",
"(",
"$",
"context",
",",
"$",
"courseid",
",",
"$",
"userid",
")",
"{",
"$",
"event",
"=",
"\\",
"gradereport_overview",
"\\",
"event",
"\\",
"grade_report_viewed",
"::",
"create",
"(",
"array",
"(",
"'context'",
... | Trigger the grade_report_viewed event
@param stdClass $context course context
@param int $courseid course id
@param int $userid user id
@since Moodle 3.2 | [
"Trigger",
"the",
"grade_report_viewed",
"event"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/report/overview/lib.php#L409-L418 |
214,290 | moodle/moodle | lib/bennu/iCalendar_properties.php | iCalendar_property.is_valid_value | function is_valid_value($value) {
if(is_array($value)) {
if(!$this->val_multi) {
return false;
}
else {
foreach($value as $oneval) {
if(!rfc2445_is_valid_value($oneval, $this->val_type)) {
return fals... | php | function is_valid_value($value) {
if(is_array($value)) {
if(!$this->val_multi) {
return false;
}
else {
foreach($value as $oneval) {
if(!rfc2445_is_valid_value($oneval, $this->val_type)) {
return fals... | [
"function",
"is_valid_value",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"value",
")",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"val_multi",
")",
"{",
"return",
"false",
";",
"}",
"else",
"{",
"foreach",
"(",
"$",
"value",
... | Only data type validation is done here | [
"Only",
"data",
"type",
"validation",
"is",
"done",
"here"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/bennu/iCalendar_properties.php#L57-L72 |
214,291 | moodle/moodle | mod/workshop/form/rubric/backup/moodle1/lib.php | moodle1_workshopform_rubric_handler.on_elements_end | public function on_elements_end() {
$numofrubrics = 0;
foreach ($this->rubrics as $itemid => $levels) {
$numofrubrics += count($levels);
}
if ($numofrubrics == 0) {
$this->convert_legacy_criterion_elements();
} else {
$this->convert_legacy_r... | php | public function on_elements_end() {
$numofrubrics = 0;
foreach ($this->rubrics as $itemid => $levels) {
$numofrubrics += count($levels);
}
if ($numofrubrics == 0) {
$this->convert_legacy_criterion_elements();
} else {
$this->convert_legacy_r... | [
"public",
"function",
"on_elements_end",
"(",
")",
"{",
"$",
"numofrubrics",
"=",
"0",
";",
"foreach",
"(",
"$",
"this",
"->",
"rubrics",
"as",
"$",
"itemid",
"=>",
"$",
"levels",
")",
"{",
"$",
"numofrubrics",
"+=",
"count",
"(",
"$",
"levels",
")",
... | Processes gathered elements and rubrics | [
"Processes",
"gathered",
"elements",
"and",
"rubrics"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/form/rubric/backup/moodle1/lib.php#L68-L81 |
214,292 | moodle/moodle | mod/workshop/form/rubric/backup/moodle1/lib.php | moodle1_workshopform_rubric_handler.convert_legacy_criterion_elements | protected function convert_legacy_criterion_elements() {
$this->write_xml('workshopform_rubric_config', array('layout' => 'list'));
$firstelement = reset($this->elements);
if ($firstelement === false) {
// no elements defined in moodle.xml
return;
}
// ... | php | protected function convert_legacy_criterion_elements() {
$this->write_xml('workshopform_rubric_config', array('layout' => 'list'));
$firstelement = reset($this->elements);
if ($firstelement === false) {
// no elements defined in moodle.xml
return;
}
// ... | [
"protected",
"function",
"convert_legacy_criterion_elements",
"(",
")",
"{",
"$",
"this",
"->",
"write_xml",
"(",
"'workshopform_rubric_config'",
",",
"array",
"(",
"'layout'",
"=>",
"'list'",
")",
")",
";",
"$",
"firstelement",
"=",
"reset",
"(",
"$",
"this",
... | Processes gathered elements coming from the legacy criterion strategy
Legacy criterion strategy is converted to a rubric with single rubric item
and the layout set to 'list'. | [
"Processes",
"gathered",
"elements",
"coming",
"from",
"the",
"legacy",
"criterion",
"strategy"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/form/rubric/backup/moodle1/lib.php#L89-L115 |
214,293 | moodle/moodle | mod/workshop/form/rubric/backup/moodle1/lib.php | moodle1_workshopform_rubric_handler.convert_legacy_rubric_elements | protected function convert_legacy_rubric_elements() {
$this->write_xml('workshopform_rubric_config', array('layout' => 'grid'));
foreach ($this->elements as $element) {
$this->xmlwriter->begin_tag('workshopform_rubric_dimension', array('id' => $element['id']));
$this->xmlwriter-... | php | protected function convert_legacy_rubric_elements() {
$this->write_xml('workshopform_rubric_config', array('layout' => 'grid'));
foreach ($this->elements as $element) {
$this->xmlwriter->begin_tag('workshopform_rubric_dimension', array('id' => $element['id']));
$this->xmlwriter-... | [
"protected",
"function",
"convert_legacy_rubric_elements",
"(",
")",
"{",
"$",
"this",
"->",
"write_xml",
"(",
"'workshopform_rubric_config'",
",",
"array",
"(",
"'layout'",
"=>",
"'grid'",
")",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"elements",
"as",
"$... | Processes gathered elements coming from the legacy rubric strategy | [
"Processes",
"gathered",
"elements",
"coming",
"from",
"the",
"legacy",
"rubric",
"strategy"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/form/rubric/backup/moodle1/lib.php#L120-L142 |
214,294 | moodle/moodle | backup/cc/cc_lib/cc_resources.php | cc_resource.import_resource | public function import_resource(DOMElement &$node, cc_i_manifest &$doc) {
$searchstr = "//imscc:manifest[@identifier='".$doc->manifestID().
"']/imscc:resources/imscc:resource";
$this->identifier = $this->get_attr_value($node, "identifier");
$this->type = $this->ge... | php | public function import_resource(DOMElement &$node, cc_i_manifest &$doc) {
$searchstr = "//imscc:manifest[@identifier='".$doc->manifestID().
"']/imscc:resources/imscc:resource";
$this->identifier = $this->get_attr_value($node, "identifier");
$this->type = $this->ge... | [
"public",
"function",
"import_resource",
"(",
"DOMElement",
"&",
"$",
"node",
",",
"cc_i_manifest",
"&",
"$",
"doc",
")",
"{",
"$",
"searchstr",
"=",
"\"//imscc:manifest[@identifier='\"",
".",
"$",
"doc",
"->",
"manifestID",
"(",
")",
".",
"\"']/imscc:resources/... | Import a resource
@param DOMElement $node
@param cc_i_manifest $doc | [
"Import",
"a",
"resource"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/cc/cc_lib/cc_resources.php#L129-L155 |
214,295 | moodle/moodle | backup/cc/cc_lib/cc_resources.php | cc_resource.process_resource | public function process_resource($manifestroot, &$fname, $folder) {
$file = empty($folder) ? $manifestroot.'/'.$fname : $manifestroot.'/'.$folder.'/'.$fname;
if (!file_exists($file) && $this->throwonerror) {
throw new Exception('The file doesnt exist!');
}
GetDepFiles($manif... | php | public function process_resource($manifestroot, &$fname, $folder) {
$file = empty($folder) ? $manifestroot.'/'.$fname : $manifestroot.'/'.$folder.'/'.$fname;
if (!file_exists($file) && $this->throwonerror) {
throw new Exception('The file doesnt exist!');
}
GetDepFiles($manif... | [
"public",
"function",
"process_resource",
"(",
"$",
"manifestroot",
",",
"&",
"$",
"fname",
",",
"$",
"folder",
")",
"{",
"$",
"file",
"=",
"empty",
"(",
"$",
"folder",
")",
"?",
"$",
"manifestroot",
".",
"'/'",
".",
"$",
"fname",
":",
"$",
"manifest... | Process a resource
@param string $manifestroot
@param string $fname
@param string $folder | [
"Process",
"a",
"resource"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/backup/cc/cc_lib/cc_resources.php#L179-L193 |
214,296 | moodle/moodle | completion/classes/progress.php | progress.get_course_progress_percentage | public static function get_course_progress_percentage($course, $userid = 0) {
global $USER;
// Make sure we continue with a valid userid.
if (empty($userid)) {
$userid = $USER->id;
}
$completion = new \completion_info($course);
// First, let's make sure com... | php | public static function get_course_progress_percentage($course, $userid = 0) {
global $USER;
// Make sure we continue with a valid userid.
if (empty($userid)) {
$userid = $USER->id;
}
$completion = new \completion_info($course);
// First, let's make sure com... | [
"public",
"static",
"function",
"get_course_progress_percentage",
"(",
"$",
"course",
",",
"$",
"userid",
"=",
"0",
")",
"{",
"global",
"$",
"USER",
";",
"// Make sure we continue with a valid userid.",
"if",
"(",
"empty",
"(",
"$",
"userid",
")",
")",
"{",
"$... | Returns the course percentage completed by a certain user, returns null if no completion data is available.
@param \stdClass $course Moodle course object
@param int $userid The id of the user, 0 for the current user
@return null|float The percentage, or null if completion is not supported in the course,
or there are n... | [
"Returns",
"the",
"course",
"percentage",
"completed",
"by",
"a",
"certain",
"user",
"returns",
"null",
"if",
"no",
"completion",
"data",
"is",
"available",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/completion/classes/progress.php#L48-L87 |
214,297 | moodle/moodle | lib/phpexcel/PHPExcel/Style/Color.php | PHPExcel_Style_Color.changeBrightness | public static function changeBrightness($hex, $adjustPercentage)
{
$rgba = (strlen($hex) == 8);
$red = self::getRed($hex, false);
$green = self::getGreen($hex, false);
$blue = self::getBlue($hex, false);
if ($adjustPercentage > 0) {
$red += (255 - $red) * $adjust... | php | public static function changeBrightness($hex, $adjustPercentage)
{
$rgba = (strlen($hex) == 8);
$red = self::getRed($hex, false);
$green = self::getGreen($hex, false);
$blue = self::getBlue($hex, false);
if ($adjustPercentage > 0) {
$red += (255 - $red) * $adjust... | [
"public",
"static",
"function",
"changeBrightness",
"(",
"$",
"hex",
",",
"$",
"adjustPercentage",
")",
"{",
"$",
"rgba",
"=",
"(",
"strlen",
"(",
"$",
"hex",
")",
"==",
"8",
")",
";",
"$",
"red",
"=",
"self",
"::",
"getRed",
"(",
"$",
"hex",
",",
... | Adjust the brightness of a color
@param string $hex The colour as an RGBA or RGB value (e.g. FF00CCCC or CCDDEE)
@param float $adjustPercentage The percentage by which to adjust the colour as a float from -1 to 1
@return string The adjusted colour as an RGBA or RGB value (e.g. FF00C... | [
"Adjust",
"the",
"brightness",
"of",
"a",
"color"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/phpexcel/PHPExcel/Style/Color.php#L302-L341 |
214,298 | moodle/moodle | grade/report/singleview/classes/local/ui/feedback.php | feedback.is_disabled | public function is_disabled() {
$locked = 0;
$gradeitemlocked = 0;
$overridden = 0;
/* Disable editing if grade item or grade score is locked
* if any of these items are set, then we will disable editing
* at some point, we might want to show the reason for the lock
... | php | public function is_disabled() {
$locked = 0;
$gradeitemlocked = 0;
$overridden = 0;
/* Disable editing if grade item or grade score is locked
* if any of these items are set, then we will disable editing
* at some point, we might want to show the reason for the lock
... | [
"public",
"function",
"is_disabled",
"(",
")",
"{",
"$",
"locked",
"=",
"0",
";",
"$",
"gradeitemlocked",
"=",
"0",
";",
"$",
"overridden",
"=",
"0",
";",
"/* Disable editing if grade item or grade score is locked\n * if any of these items are set, then we will disa... | Determine if this input should be disabled based on the other settings.
@return boolean Should this input be disabled when the page loads. | [
"Determine",
"if",
"this",
"input",
"should",
"be",
"disabled",
"based",
"on",
"the",
"other",
"settings",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/report/singleview/classes/local/ui/feedback.php#L67-L86 |
214,299 | moodle/moodle | grade/report/singleview/classes/local/ui/feedback.php | feedback.determine_format | public function determine_format() {
return new text_attribute(
$this->get_name(),
$this->get_value(),
$this->get_label(),
$this->is_disabled()
);
} | php | public function determine_format() {
return new text_attribute(
$this->get_name(),
$this->get_value(),
$this->get_label(),
$this->is_disabled()
);
} | [
"public",
"function",
"determine_format",
"(",
")",
"{",
"return",
"new",
"text_attribute",
"(",
"$",
"this",
"->",
"get_name",
"(",
")",
",",
"$",
"this",
"->",
"get_value",
"(",
")",
",",
"$",
"this",
"->",
"get_label",
"(",
")",
",",
"$",
"this",
... | Create a text_attribute for this ui element.
@return text_attribute | [
"Create",
"a",
"text_attribute",
"for",
"this",
"ui",
"element",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/report/singleview/classes/local/ui/feedback.php#L93-L100 |
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.