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,600 | moodle/moodle | lib/badgeslib.php | badge.get_related_badges | public function get_related_badges(bool $activeonly = false) {
global $DB;
$params = array('badgeid' => $this->id, 'badgeid2' => $this->id, 'badgeid3' => $this->id);
$query = "SELECT DISTINCT b.id, b.name, b.version, b.language, b.type
FROM {badge_related} br
... | php | public function get_related_badges(bool $activeonly = false) {
global $DB;
$params = array('badgeid' => $this->id, 'badgeid2' => $this->id, 'badgeid3' => $this->id);
$query = "SELECT DISTINCT b.id, b.name, b.version, b.language, b.type
FROM {badge_related} br
... | [
"public",
"function",
"get_related_badges",
"(",
"bool",
"$",
"activeonly",
"=",
"false",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"params",
"=",
"array",
"(",
"'badgeid'",
"=>",
"$",
"this",
"->",
"id",
",",
"'badgeid2'",
"=>",
"$",
"this",
"->",
"id"... | Get related badges of badge.
@param bool $activeonly Do not get the inactive badges when is true.
@return array Related badges information. | [
"Get",
"related",
"badges",
"of",
"badge",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/badgeslib.php#L822-L836 |
214,601 | moodle/moodle | lib/badgeslib.php | badge.markdown_badge_criteria | public function markdown_badge_criteria() {
$agg = $this->get_aggregation_methods();
if (empty($this->criteria)) {
return get_string('nocriteria', 'badges');
}
$overalldescr = '';
$overall = $this->criteria[BADGE_CRITERIA_TYPE_OVERALL];
if (!empty($overall->de... | php | public function markdown_badge_criteria() {
$agg = $this->get_aggregation_methods();
if (empty($this->criteria)) {
return get_string('nocriteria', 'badges');
}
$overalldescr = '';
$overall = $this->criteria[BADGE_CRITERIA_TYPE_OVERALL];
if (!empty($overall->de... | [
"public",
"function",
"markdown_badge_criteria",
"(",
")",
"{",
"$",
"agg",
"=",
"$",
"this",
"->",
"get_aggregation_methods",
"(",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"criteria",
")",
")",
"{",
"return",
"get_string",
"(",
"'nocriteria'"... | Markdown language support for criteria.
@return string $output Markdown content to output. | [
"Markdown",
"language",
"support",
"for",
"criteria",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/badgeslib.php#L922-L973 |
214,602 | moodle/moodle | lib/badgeslib.php | badge.get_badge_issuer | public function get_badge_issuer() {
$issuer = array();
$issuerurl = new moodle_url('/badges/badge_json.php', array('id' => $this->id, 'action' => 0));
$issuer['name'] = $this->issuername;
$issuer['url'] = $this->issuerurl;
$issuer['email'] = $this->issuercontact;
$issuer... | php | public function get_badge_issuer() {
$issuer = array();
$issuerurl = new moodle_url('/badges/badge_json.php', array('id' => $this->id, 'action' => 0));
$issuer['name'] = $this->issuername;
$issuer['url'] = $this->issuerurl;
$issuer['email'] = $this->issuercontact;
$issuer... | [
"public",
"function",
"get_badge_issuer",
"(",
")",
"{",
"$",
"issuer",
"=",
"array",
"(",
")",
";",
"$",
"issuerurl",
"=",
"new",
"moodle_url",
"(",
"'/badges/badge_json.php'",
",",
"array",
"(",
"'id'",
"=>",
"$",
"this",
"->",
"id",
",",
"'action'",
"... | Define issuer information by format Open Badges specification version 2.
@return array Issuer informations of the badge. | [
"Define",
"issuer",
"information",
"by",
"format",
"Open",
"Badges",
"specification",
"version",
"2",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/badgeslib.php#L980-L990 |
214,603 | moodle/moodle | mod/wiki/pagelib.php | page_wiki.print_header | function print_header() {
global $OUTPUT, $PAGE, $CFG, $USER, $SESSION;
$PAGE->set_heading($PAGE->course->fullname);
$this->set_url();
if (isset($SESSION->wikipreviousurl) && is_array($SESSION->wikipreviousurl)) {
$this->process_session_url();
}
$this->set_... | php | function print_header() {
global $OUTPUT, $PAGE, $CFG, $USER, $SESSION;
$PAGE->set_heading($PAGE->course->fullname);
$this->set_url();
if (isset($SESSION->wikipreviousurl) && is_array($SESSION->wikipreviousurl)) {
$this->process_session_url();
}
$this->set_... | [
"function",
"print_header",
"(",
")",
"{",
"global",
"$",
"OUTPUT",
",",
"$",
"PAGE",
",",
"$",
"CFG",
",",
"$",
"USER",
",",
"$",
"SESSION",
";",
"$",
"PAGE",
"->",
"set_heading",
"(",
"$",
"PAGE",
"->",
"course",
"->",
"fullname",
")",
";",
"$",
... | This method prints the top of the page. | [
"This",
"method",
"prints",
"the",
"top",
"of",
"the",
"page",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/wiki/pagelib.php#L123-L148 |
214,604 | moodle/moodle | mod/wiki/pagelib.php | page_wiki.setup_tabs | protected function setup_tabs($options = array()) {
global $CFG, $PAGE;
$groupmode = groups_get_activity_groupmode($this->cm);
if (empty($CFG->usecomments) || !has_capability('mod/wiki:viewcomment', $PAGE->context)){
unset($this->tabs['comments']);
}
if (!has_capabi... | php | protected function setup_tabs($options = array()) {
global $CFG, $PAGE;
$groupmode = groups_get_activity_groupmode($this->cm);
if (empty($CFG->usecomments) || !has_capability('mod/wiki:viewcomment', $PAGE->context)){
unset($this->tabs['comments']);
}
if (!has_capabi... | [
"protected",
"function",
"setup_tabs",
"(",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"global",
"$",
"CFG",
",",
"$",
"PAGE",
";",
"$",
"groupmode",
"=",
"groups_get_activity_groupmode",
"(",
"$",
"this",
"->",
"cm",
")",
";",
"if",
"(",
"empty... | Setup page tabs, if options is empty, will set up active tab automatically
@param array $options, tabs options | [
"Setup",
"page",
"tabs",
"if",
"options",
"is",
"empty",
"will",
"set",
"up",
"active",
"tab",
"automatically"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/wiki/pagelib.php#L167-L194 |
214,605 | moodle/moodle | mod/wiki/pagelib.php | page_wiki.set_page | function set_page($page) {
global $PAGE;
$this->page = $page;
$this->title = $page->title;
// set_title calls format_string itself so no probs there
$PAGE->set_title($this->title);
} | php | function set_page($page) {
global $PAGE;
$this->page = $page;
$this->title = $page->title;
// set_title calls format_string itself so no probs there
$PAGE->set_title($this->title);
} | [
"function",
"set_page",
"(",
"$",
"page",
")",
"{",
"global",
"$",
"PAGE",
";",
"$",
"this",
"->",
"page",
"=",
"$",
"page",
";",
"$",
"this",
"->",
"title",
"=",
"$",
"page",
"->",
"title",
";",
"// set_title calls format_string itself so no probs there",
... | Method to set the current page
@param object $page Current page | [
"Method",
"to",
"set",
"the",
"current",
"page"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/wiki/pagelib.php#L208-L215 |
214,606 | moodle/moodle | mod/wiki/pagelib.php | page_wiki.set_title | function set_title($title) {
global $PAGE;
$this->page = null;
$this->title = $title;
// set_title calls format_string itself so no probs there
$PAGE->set_title($this->title);
} | php | function set_title($title) {
global $PAGE;
$this->page = null;
$this->title = $title;
// set_title calls format_string itself so no probs there
$PAGE->set_title($this->title);
} | [
"function",
"set_title",
"(",
"$",
"title",
")",
"{",
"global",
"$",
"PAGE",
";",
"$",
"this",
"->",
"page",
"=",
"null",
";",
"$",
"this",
"->",
"title",
"=",
"$",
"title",
";",
"// set_title calls format_string itself so no probs there",
"$",
"PAGE",
"->",... | Method to set the current page title.
This method must be called when the current page is not created yet.
@param string $title Current page title. | [
"Method",
"to",
"set",
"the",
"current",
"page",
"title",
".",
"This",
"method",
"must",
"be",
"called",
"when",
"the",
"current",
"page",
"is",
"not",
"created",
"yet",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/wiki/pagelib.php#L222-L229 |
214,607 | moodle/moodle | mod/wiki/pagelib.php | page_wiki.create_navbar | protected function create_navbar() {
global $PAGE, $CFG;
$PAGE->navbar->add(format_string($this->title), $CFG->wwwroot . '/mod/wiki/view.php?pageid=' . $this->page->id);
} | php | protected function create_navbar() {
global $PAGE, $CFG;
$PAGE->navbar->add(format_string($this->title), $CFG->wwwroot . '/mod/wiki/view.php?pageid=' . $this->page->id);
} | [
"protected",
"function",
"create_navbar",
"(",
")",
"{",
"global",
"$",
"PAGE",
",",
"$",
"CFG",
";",
"$",
"PAGE",
"->",
"navbar",
"->",
"add",
"(",
"format_string",
"(",
"$",
"this",
"->",
"title",
")",
",",
"$",
"CFG",
"->",
"wwwroot",
".",
"'/mod/... | Protected method to create the common items of the navbar in every page type. | [
"Protected",
"method",
"to",
"create",
"the",
"common",
"items",
"of",
"the",
"navbar",
"in",
"every",
"page",
"type",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/wiki/pagelib.php#L258-L262 |
214,608 | moodle/moodle | mod/wiki/pagelib.php | page_wiki_diff.print_diff_content | private function print_diff_content() {
global $CFG, $OUTPUT, $PAGE;
$pageid = $this->page->id;
$total = wiki_count_wiki_page_versions($pageid) - 1;
$oldversion = wiki_get_wiki_page_version($pageid, $this->compare);
$newversion = wiki_get_wiki_page_version($pageid, $this->comp... | php | private function print_diff_content() {
global $CFG, $OUTPUT, $PAGE;
$pageid = $this->page->id;
$total = wiki_count_wiki_page_versions($pageid) - 1;
$oldversion = wiki_get_wiki_page_version($pageid, $this->compare);
$newversion = wiki_get_wiki_page_version($pageid, $this->comp... | [
"private",
"function",
"print_diff_content",
"(",
")",
"{",
"global",
"$",
"CFG",
",",
"$",
"OUTPUT",
",",
"$",
"PAGE",
";",
"$",
"pageid",
"=",
"$",
"this",
"->",
"page",
"->",
"id",
";",
"$",
"total",
"=",
"wiki_count_wiki_page_versions",
"(",
"$",
"... | Given two versions of a page, prints a page displaying the differences between them.
@global object $CFG
@global object $OUTPUT
@global object $PAGE | [
"Given",
"two",
"versions",
"of",
"a",
"page",
"prints",
"a",
"page",
"displaying",
"the",
"differences",
"between",
"them",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/wiki/pagelib.php#L1136-L1160 |
214,609 | moodle/moodle | mod/wiki/pagelib.php | page_wiki_history.choose_from_radio | private function choose_from_radio($options, $name, $onclick = '', $checked = '', $return = false) {
static $idcounter = 0;
if (!$name) {
$name = 'unnamed';
}
$output = '<span class="radiogroup ' . $name . "\">\n";
if (!empty($options)) {
$currentradio... | php | private function choose_from_radio($options, $name, $onclick = '', $checked = '', $return = false) {
static $idcounter = 0;
if (!$name) {
$name = 'unnamed';
}
$output = '<span class="radiogroup ' . $name . "\">\n";
if (!empty($options)) {
$currentradio... | [
"private",
"function",
"choose_from_radio",
"(",
"$",
"options",
",",
"$",
"name",
",",
"$",
"onclick",
"=",
"''",
",",
"$",
"checked",
"=",
"''",
",",
"$",
"return",
"=",
"false",
")",
"{",
"static",
"$",
"idcounter",
"=",
"0",
";",
"if",
"(",
"!"... | Given an array of values, creates a group of radio buttons to be part of a form
@param array $options An array of value-label pairs for the radio group (values as keys).
@param string $name Name of the radiogroup (unique in the form).
@param string $onclick Function to be executed when the radios are clicked.
@... | [
"Given",
"an",
"array",
"of",
"values",
"creates",
"a",
"group",
"of",
"radio",
"buttons",
"to",
"be",
"part",
"of",
"a",
"form"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/wiki/pagelib.php#L1357-L1395 |
214,610 | moodle/moodle | mod/wiki/pagelib.php | page_wiki_map.print_contributions_content | private function print_contributions_content() {
global $CFG, $OUTPUT, $USER;
$page = $this->page;
if ($page->timerendered + WIKI_REFRESH_CACHE_TIME < time()) {
$fresh = wiki_refresh_cachedcontent($page);
$page = $fresh['page'];
}
$swid = $this->subwiki-... | php | private function print_contributions_content() {
global $CFG, $OUTPUT, $USER;
$page = $this->page;
if ($page->timerendered + WIKI_REFRESH_CACHE_TIME < time()) {
$fresh = wiki_refresh_cachedcontent($page);
$page = $fresh['page'];
}
$swid = $this->subwiki-... | [
"private",
"function",
"print_contributions_content",
"(",
")",
"{",
"global",
"$",
"CFG",
",",
"$",
"OUTPUT",
",",
"$",
"USER",
";",
"$",
"page",
"=",
"$",
"this",
"->",
"page",
";",
"if",
"(",
"$",
"page",
"->",
"timerendered",
"+",
"WIKI_REFRESH_CACHE... | Prints the contributions tab content
@uses $OUTPUT, $USER | [
"Prints",
"the",
"contributions",
"tab",
"content"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/wiki/pagelib.php#L1473-L1529 |
214,611 | moodle/moodle | mod/wiki/pagelib.php | page_wiki_map.print_navigation_content | private function print_navigation_content() {
global $OUTPUT;
$page = $this->page;
if ($page->timerendered + WIKI_REFRESH_CACHE_TIME < time()) {
$fresh = wiki_refresh_cachedcontent($page);
$page = $fresh['page'];
}
$tolinks = wiki_get_linked_to_pages($pa... | php | private function print_navigation_content() {
global $OUTPUT;
$page = $this->page;
if ($page->timerendered + WIKI_REFRESH_CACHE_TIME < time()) {
$fresh = wiki_refresh_cachedcontent($page);
$page = $fresh['page'];
}
$tolinks = wiki_get_linked_to_pages($pa... | [
"private",
"function",
"print_navigation_content",
"(",
")",
"{",
"global",
"$",
"OUTPUT",
";",
"$",
"page",
"=",
"$",
"this",
"->",
"page",
";",
"if",
"(",
"$",
"page",
"->",
"timerendered",
"+",
"WIKI_REFRESH_CACHE_TIME",
"<",
"time",
"(",
")",
")",
"{... | Prints the navigation tab content
@uses $OUTPUT | [
"Prints",
"the",
"navigation",
"tab",
"content"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/wiki/pagelib.php#L1537-L1579 |
214,612 | moodle/moodle | mod/wiki/pagelib.php | page_wiki_map.print_index_content | private function print_index_content() {
global $OUTPUT;
$page = $this->page;
if ($page->timerendered + WIKI_REFRESH_CACHE_TIME < time()) {
$fresh = wiki_refresh_cachedcontent($page);
$page = $fresh['page'];
}
// navigation_node get_content calls format ... | php | private function print_index_content() {
global $OUTPUT;
$page = $this->page;
if ($page->timerendered + WIKI_REFRESH_CACHE_TIME < time()) {
$fresh = wiki_refresh_cachedcontent($page);
$page = $fresh['page'];
}
// navigation_node get_content calls format ... | [
"private",
"function",
"print_index_content",
"(",
")",
"{",
"global",
"$",
"OUTPUT",
";",
"$",
"page",
"=",
"$",
"this",
"->",
"page",
";",
"if",
"(",
"$",
"page",
"->",
"timerendered",
"+",
"WIKI_REFRESH_CACHE_TIME",
"<",
"time",
"(",
")",
")",
"{",
... | Prints the index page tab content | [
"Prints",
"the",
"index",
"page",
"tab",
"content"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/wiki/pagelib.php#L1586-L1608 |
214,613 | moodle/moodle | mod/wiki/pagelib.php | page_wiki_map.print_page_list_content | private function print_page_list_content() {
global $OUTPUT;
$page = $this->page;
if ($page->timerendered + WIKI_REFRESH_CACHE_TIME < time()) {
$fresh = wiki_refresh_cachedcontent($page);
$page = $fresh['page'];
}
$pages = wiki_get_page_list($this->subwi... | php | private function print_page_list_content() {
global $OUTPUT;
$page = $this->page;
if ($page->timerendered + WIKI_REFRESH_CACHE_TIME < time()) {
$fresh = wiki_refresh_cachedcontent($page);
$page = $fresh['page'];
}
$pages = wiki_get_page_list($this->subwi... | [
"private",
"function",
"print_page_list_content",
"(",
")",
"{",
"global",
"$",
"OUTPUT",
";",
"$",
"page",
"=",
"$",
"this",
"->",
"page",
";",
"if",
"(",
"$",
"page",
"->",
"timerendered",
"+",
"WIKI_REFRESH_CACHE_TIME",
"<",
"time",
"(",
")",
")",
"{"... | Prints the page list tab content | [
"Prints",
"the",
"page",
"list",
"tab",
"content"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/wiki/pagelib.php#L1615-L1651 |
214,614 | moodle/moodle | mod/wiki/pagelib.php | page_wiki_map.print_orphaned_content | private function print_orphaned_content() {
global $OUTPUT;
$page = $this->page;
if ($page->timerendered + WIKI_REFRESH_CACHE_TIME < time()) {
$fresh = wiki_refresh_cachedcontent($page);
$page = $fresh['page'];
}
$swid = $this->subwiki->id;
$ta... | php | private function print_orphaned_content() {
global $OUTPUT;
$page = $this->page;
if ($page->timerendered + WIKI_REFRESH_CACHE_TIME < time()) {
$fresh = wiki_refresh_cachedcontent($page);
$page = $fresh['page'];
}
$swid = $this->subwiki->id;
$ta... | [
"private",
"function",
"print_orphaned_content",
"(",
")",
"{",
"global",
"$",
"OUTPUT",
";",
"$",
"page",
"=",
"$",
"this",
"->",
"page",
";",
"if",
"(",
"$",
"page",
"->",
"timerendered",
"+",
"WIKI_REFRESH_CACHE_TIME",
"<",
"time",
"(",
")",
")",
"{",... | Prints the orphaned tab content | [
"Prints",
"the",
"orphaned",
"tab",
"content"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/wiki/pagelib.php#L1658-L1687 |
214,615 | moodle/moodle | mod/wiki/pagelib.php | page_wiki_map.print_updated_content | private function print_updated_content() {
global $COURSE, $OUTPUT;
$page = $this->page;
if ($page->timerendered + WIKI_REFRESH_CACHE_TIME < time()) {
$fresh = wiki_refresh_cachedcontent($page);
$page = $fresh['page'];
}
$swid = $this->subwiki->id;
... | php | private function print_updated_content() {
global $COURSE, $OUTPUT;
$page = $this->page;
if ($page->timerendered + WIKI_REFRESH_CACHE_TIME < time()) {
$fresh = wiki_refresh_cachedcontent($page);
$page = $fresh['page'];
}
$swid = $this->subwiki->id;
... | [
"private",
"function",
"print_updated_content",
"(",
")",
"{",
"global",
"$",
"COURSE",
",",
"$",
"OUTPUT",
";",
"$",
"page",
"=",
"$",
"this",
"->",
"page",
";",
"if",
"(",
"$",
"page",
"->",
"timerendered",
"+",
"WIKI_REFRESH_CACHE_TIME",
"<",
"time",
... | Prints the updated tab content
@uses $COURSE, $OUTPUT | [
"Prints",
"the",
"updated",
"tab",
"content"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/wiki/pagelib.php#L1695-L1733 |
214,616 | moodle/moodle | mod/wiki/pagelib.php | page_wiki_restoreversion.print_restoreversion | private function print_restoreversion() {
global $OUTPUT;
$version = wiki_get_version($this->version->id);
$optionsyes = array('confirm'=>1, 'pageid'=>$this->page->id, 'versionid'=>$version->id, 'sesskey'=>sesskey());
$restoreurl = new moodle_url('/mod/wiki/restoreversion.php', $option... | php | private function print_restoreversion() {
global $OUTPUT;
$version = wiki_get_version($this->version->id);
$optionsyes = array('confirm'=>1, 'pageid'=>$this->page->id, 'versionid'=>$version->id, 'sesskey'=>sesskey());
$restoreurl = new moodle_url('/mod/wiki/restoreversion.php', $option... | [
"private",
"function",
"print_restoreversion",
"(",
")",
"{",
"global",
"$",
"OUTPUT",
";",
"$",
"version",
"=",
"wiki_get_version",
"(",
"$",
"this",
"->",
"version",
"->",
"id",
")",
";",
"$",
"optionsyes",
"=",
"array",
"(",
"'confirm'",
"=>",
"1",
",... | Prints the restore version content
@uses $CFG
@param page $page The page whose version will be restored
@param int $versionid The version to be restored
@param bool $confirm If false, shows a yes/no confirmation page.
If true, restores the old version and redirects the user to the 'view' tab. | [
"Prints",
"the",
"restore",
"version",
"content"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/wiki/pagelib.php#L1884-L1904 |
214,617 | moodle/moodle | mod/wiki/pagelib.php | page_wiki_deletecomment.printconfirmdelete | private function printconfirmdelete() {
global $OUTPUT;
$strdeletecheck = get_string('deletecommentcheck', 'wiki');
$strdeletecheckfull = get_string('deletecommentcheckfull', 'wiki');
//ask confirmation
$optionsyes = array('confirm'=>1, 'pageid'=>$this->page->id, 'action'=>'del... | php | private function printconfirmdelete() {
global $OUTPUT;
$strdeletecheck = get_string('deletecommentcheck', 'wiki');
$strdeletecheckfull = get_string('deletecommentcheckfull', 'wiki');
//ask confirmation
$optionsyes = array('confirm'=>1, 'pageid'=>$this->page->id, 'action'=>'del... | [
"private",
"function",
"printconfirmdelete",
"(",
")",
"{",
"global",
"$",
"OUTPUT",
";",
"$",
"strdeletecheck",
"=",
"get_string",
"(",
"'deletecommentcheck'",
",",
"'wiki'",
")",
";",
"$",
"strdeletecheckfull",
"=",
"get_string",
"(",
"'deletecommentcheckfull'",
... | Prints the comment deletion confirmation form
@param page $page The page whose version will be restored
@param int $versionid The version to be restored
@param bool $confirm If false, shows a yes/no confirmation page.
If true, restores the old version and redirects the user to the 'view' tab. | [
"Prints",
"the",
"comment",
"deletion",
"confirmation",
"form"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/wiki/pagelib.php#L1952-L1975 |
214,618 | moodle/moodle | mod/wiki/pagelib.php | page_wiki_viewversion.print_version_view | private function print_version_view() {
global $CFG, $OUTPUT, $PAGE;
$pageversion = wiki_get_version($this->version->id);
if ($pageversion) {
$restorelink = new moodle_url('/mod/wiki/restoreversion.php', array('pageid' => $this->page->id, 'versionid' => $this->version->id));
... | php | private function print_version_view() {
global $CFG, $OUTPUT, $PAGE;
$pageversion = wiki_get_version($this->version->id);
if ($pageversion) {
$restorelink = new moodle_url('/mod/wiki/restoreversion.php', array('pageid' => $this->page->id, 'versionid' => $this->version->id));
... | [
"private",
"function",
"print_version_view",
"(",
")",
"{",
"global",
"$",
"CFG",
",",
"$",
"OUTPUT",
",",
"$",
"PAGE",
";",
"$",
"pageversion",
"=",
"wiki_get_version",
"(",
"$",
"this",
"->",
"version",
"->",
"id",
")",
";",
"if",
"(",
"$",
"pagevers... | Given an old page version, output the version content
@global object $CFG
@global object $OUTPUT
@global object $PAGE | [
"Given",
"an",
"old",
"page",
"version",
"output",
"the",
"version",
"content"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/wiki/pagelib.php#L2123-L2149 |
214,619 | moodle/moodle | mod/wiki/pagelib.php | page_wiki_admin.print_content | function print_content() {
//make sure anyone trying to access this page has managewiki capabilities
require_capability('mod/wiki:managewiki', $this->modcontext, NULL, true, 'noviewpagepermission', 'wiki');
//update wiki cache if timedout
$page = $this->page;
if ($page->timerend... | php | function print_content() {
//make sure anyone trying to access this page has managewiki capabilities
require_capability('mod/wiki:managewiki', $this->modcontext, NULL, true, 'noviewpagepermission', 'wiki');
//update wiki cache if timedout
$page = $this->page;
if ($page->timerend... | [
"function",
"print_content",
"(",
")",
"{",
"//make sure anyone trying to access this page has managewiki capabilities",
"require_capability",
"(",
"'mod/wiki:managewiki'",
",",
"$",
"this",
"->",
"modcontext",
",",
"NULL",
",",
"true",
",",
"'noviewpagepermission'",
",",
"... | This function will display administration view to users with managewiki capability | [
"This",
"function",
"will",
"display",
"administration",
"view",
"to",
"users",
"with",
"managewiki",
"capability"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/wiki/pagelib.php#L2438-L2464 |
214,620 | moodle/moodle | mod/wiki/pagelib.php | page_wiki_admin.set_view | public function set_view($view, $listorphan = true) {
$this->view = $view;
$this->listorphan = $listorphan;
} | php | public function set_view($view, $listorphan = true) {
$this->view = $view;
$this->listorphan = $listorphan;
} | [
"public",
"function",
"set_view",
"(",
"$",
"view",
",",
"$",
"listorphan",
"=",
"true",
")",
"{",
"$",
"this",
"->",
"view",
"=",
"$",
"view",
";",
"$",
"this",
"->",
"listorphan",
"=",
"$",
"listorphan",
";",
"}"
] | Sets admin view option
@param int $view page view id
@param bool $listorphan is only valid for view 1. | [
"Sets",
"admin",
"view",
"option"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/wiki/pagelib.php#L2472-L2475 |
214,621 | moodle/moodle | mod/wiki/pagelib.php | page_wiki_admin.print_delete_content | protected function print_delete_content($showorphan = true) {
$contents = array();
$table = new html_table();
$table->head = array('', get_string('pagename','wiki'));
$table->attributes['class'] = 'table generaltable';
$swid = $this->subwiki->id;
if ($showorphan) {
... | php | protected function print_delete_content($showorphan = true) {
$contents = array();
$table = new html_table();
$table->head = array('', get_string('pagename','wiki'));
$table->attributes['class'] = 'table generaltable';
$swid = $this->subwiki->id;
if ($showorphan) {
... | [
"protected",
"function",
"print_delete_content",
"(",
"$",
"showorphan",
"=",
"true",
")",
"{",
"$",
"contents",
"=",
"array",
"(",
")",
";",
"$",
"table",
"=",
"new",
"html_table",
"(",
")",
";",
"$",
"table",
"->",
"head",
"=",
"array",
"(",
"''",
... | Show wiki page delete options
@param bool $showorphan | [
"Show",
"wiki",
"page",
"delete",
"options"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/wiki/pagelib.php#L2505-L2553 |
214,622 | moodle/moodle | mod/wiki/pagelib.php | page_wiki_admin.add_page_delete_options | protected function add_page_delete_options($pages, $swid, &$table) {
global $OUTPUT;
foreach ($pages as $page) {
$link = wiki_parser_link($page->title, array('swid' => $swid));
$class = ($link['new']) ? 'class="wiki_newentry"' : '';
$pagelink = '<a href="' . $link['ur... | php | protected function add_page_delete_options($pages, $swid, &$table) {
global $OUTPUT;
foreach ($pages as $page) {
$link = wiki_parser_link($page->title, array('swid' => $swid));
$class = ($link['new']) ? 'class="wiki_newentry"' : '';
$pagelink = '<a href="' . $link['ur... | [
"protected",
"function",
"add_page_delete_options",
"(",
"$",
"pages",
",",
"$",
"swid",
",",
"&",
"$",
"table",
")",
"{",
"global",
"$",
"OUTPUT",
";",
"foreach",
"(",
"$",
"pages",
"as",
"$",
"page",
")",
"{",
"$",
"link",
"=",
"wiki_parser_link",
"(... | helper function for print_delete_content. This will add data to the table.
@global object $OUTPUT
@param array $pages objects of wiki pages in subwiki
@param int $swid id of subwiki
@param object $table reference to the table in which data needs to be added | [
"helper",
"function",
"for",
"print_delete_content",
".",
"This",
"will",
"add",
"data",
"to",
"the",
"table",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/wiki/pagelib.php#L2563-L2581 |
214,623 | moodle/moodle | completion/classes/external.php | core_completion_external.update_activity_completion_status_manually | public static function update_activity_completion_status_manually($cmid, $completed) {
// Validate and normalize parameters.
$params = self::validate_parameters(self::update_activity_completion_status_manually_parameters(),
array('cmid' => $cmid, 'completed' => $completed));
$cmid ... | php | public static function update_activity_completion_status_manually($cmid, $completed) {
// Validate and normalize parameters.
$params = self::validate_parameters(self::update_activity_completion_status_manually_parameters(),
array('cmid' => $cmid, 'completed' => $completed));
$cmid ... | [
"public",
"static",
"function",
"update_activity_completion_status_manually",
"(",
"$",
"cmid",
",",
"$",
"completed",
")",
"{",
"// Validate and normalize parameters.",
"$",
"params",
"=",
"self",
"::",
"validate_parameters",
"(",
"self",
"::",
"update_activity_completio... | Update completion status for the current user in an activity, only for activities with manual tracking.
@param int $cmid Course module id
@param bool $completed Activity completed or not
@return array Result and possible warnings
@since Moodle 2.9
@throws moodle_exception | [
"Update",
"completion",
"status",
"for",
"the",
"current",
"user",
"in",
"an",
"activity",
"only",
"for",
"activities",
"with",
"manual",
"tracking",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/completion/classes/external.php#L66-L100 |
214,624 | moodle/moodle | completion/classes/external.php | core_completion_external.override_activity_completion_status | public static function override_activity_completion_status($userid, $cmid, $newstate) {
// Validate and normalize parameters.
$params = self::validate_parameters(self::override_activity_completion_status_parameters(),
array('userid' => $userid, 'cmid' => $cmid, 'newstate' => $newstate));
... | php | public static function override_activity_completion_status($userid, $cmid, $newstate) {
// Validate and normalize parameters.
$params = self::validate_parameters(self::override_activity_completion_status_parameters(),
array('userid' => $userid, 'cmid' => $cmid, 'newstate' => $newstate));
... | [
"public",
"static",
"function",
"override_activity_completion_status",
"(",
"$",
"userid",
",",
"$",
"cmid",
",",
"$",
"newstate",
")",
"{",
"// Validate and normalize parameters.",
"$",
"params",
"=",
"self",
"::",
"validate_parameters",
"(",
"self",
"::",
"overrid... | Update completion status for a user in an activity.
@param int $userid User id
@param int $cmid Course module id
@param int $newstate Activity completion
@return array Array containing the current (updated) completion status.
@since Moodle 3.4
@throws moodle_exception | [
"Update",
"completion",
"status",
"for",
"a",
"user",
"in",
"an",
"activity",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/completion/classes/external.php#L143-L175 |
214,625 | moodle/moodle | completion/classes/external.php | core_completion_external.override_activity_completion_status_returns | public static function override_activity_completion_status_returns() {
return new external_single_structure(
array(
'cmid' => new external_value(PARAM_INT, 'The course module id'),
'userid' => new external_value(PARAM_INT, 'The user id to which the completion info be... | php | public static function override_activity_completion_status_returns() {
return new external_single_structure(
array(
'cmid' => new external_value(PARAM_INT, 'The course module id'),
'userid' => new external_value(PARAM_INT, 'The user id to which the completion info be... | [
"public",
"static",
"function",
"override_activity_completion_status_returns",
"(",
")",
"{",
"return",
"new",
"external_single_structure",
"(",
"array",
"(",
"'cmid'",
"=>",
"new",
"external_value",
"(",
"PARAM_INT",
",",
"'The course module id'",
")",
",",
"'userid'",... | Describes the override_activity_completion_status return value.
@return external_single_structure
@since Moodle 3.4 | [
"Describes",
"the",
"override_activity_completion_status",
"return",
"value",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/completion/classes/external.php#L183-L196 |
214,626 | moodle/moodle | completion/classes/external.php | core_completion_external.get_activities_completion_status | public static function get_activities_completion_status($courseid, $userid) {
global $CFG, $USER;
require_once($CFG->libdir . '/grouplib.php');
$warnings = array();
$arrayparams = array(
'courseid' => $courseid,
'userid' => $userid,
);
$params ... | php | public static function get_activities_completion_status($courseid, $userid) {
global $CFG, $USER;
require_once($CFG->libdir . '/grouplib.php');
$warnings = array();
$arrayparams = array(
'courseid' => $courseid,
'userid' => $userid,
);
$params ... | [
"public",
"static",
"function",
"get_activities_completion_status",
"(",
"$",
"courseid",
",",
"$",
"userid",
")",
"{",
"global",
"$",
"CFG",
",",
"$",
"USER",
";",
"require_once",
"(",
"$",
"CFG",
"->",
"libdir",
".",
"'/grouplib.php'",
")",
";",
"$",
"wa... | Get Activities completion status
@param int $courseid ID of the Course
@param int $userid ID of the User
@return array of activities progress and warnings
@throws moodle_exception
@since Moodle 2.9
@throws moodle_exception | [
"Get",
"Activities",
"completion",
"status"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/completion/classes/external.php#L223-L282 |
214,627 | moodle/moodle | completion/classes/external.php | core_completion_external.get_course_completion_status | public static function get_course_completion_status($courseid, $userid) {
global $CFG, $USER;
require_once($CFG->libdir . '/grouplib.php');
$warnings = array();
$arrayparams = array(
'courseid' => $courseid,
'userid' => $userid,
);
$params = sel... | php | public static function get_course_completion_status($courseid, $userid) {
global $CFG, $USER;
require_once($CFG->libdir . '/grouplib.php');
$warnings = array();
$arrayparams = array(
'courseid' => $courseid,
'userid' => $userid,
);
$params = sel... | [
"public",
"static",
"function",
"get_course_completion_status",
"(",
"$",
"courseid",
",",
"$",
"userid",
")",
"{",
"global",
"$",
"CFG",
",",
"$",
"USER",
";",
"require_once",
"(",
"$",
"CFG",
"->",
"libdir",
".",
"'/grouplib.php'",
")",
";",
"$",
"warnin... | Get Course completion status
@param int $courseid ID of the Course
@param int $userid ID of the User
@return array of course completion status and warnings
@since Moodle 2.9
@throws moodle_exception | [
"Get",
"Course",
"completion",
"status"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/completion/classes/external.php#L340-L422 |
214,628 | moodle/moodle | lib/classes/requirejs.php | core_requirejs.find_one_amd_module | public static function find_one_amd_module($component, $jsfilename, $debug = false) {
$jsfileroot = core_component::get_component_directory($component);
if (!$jsfileroot) {
return array();
}
$module = str_replace('.js', '', $jsfilename);
$srcdir = $jsfileroot . '/am... | php | public static function find_one_amd_module($component, $jsfilename, $debug = false) {
$jsfileroot = core_component::get_component_directory($component);
if (!$jsfileroot) {
return array();
}
$module = str_replace('.js', '', $jsfilename);
$srcdir = $jsfileroot . '/am... | [
"public",
"static",
"function",
"find_one_amd_module",
"(",
"$",
"component",
",",
"$",
"jsfilename",
",",
"$",
"debug",
"=",
"false",
")",
"{",
"$",
"jsfileroot",
"=",
"core_component",
"::",
"get_component_directory",
"(",
"$",
"component",
")",
";",
"if",
... | Check a single module exists and return the full path to it.
The expected location for amd modules is:
<componentdir>/amd/src/modulename.js
@param string $component The component determines the folder the js file should be in.
@param string $jsfilename The filename for the module (with the js extension).
@param boole... | [
"Check",
"a",
"single",
"module",
"exists",
"and",
"return",
"the",
"full",
"path",
"to",
"it",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/requirejs.php#L47-L69 |
214,629 | moodle/moodle | lib/classes/requirejs.php | core_requirejs.find_all_amd_modules | public static function find_all_amd_modules($debug = false) {
global $CFG;
$jsdirs = array();
$jsfiles = array();
$dir = $CFG->libdir . '/amd';
if (!empty($dir) && is_dir($dir)) {
$jsdirs['core'] = $dir;
}
$subsystems = core_component::get_core_subsy... | php | public static function find_all_amd_modules($debug = false) {
global $CFG;
$jsdirs = array();
$jsfiles = array();
$dir = $CFG->libdir . '/amd';
if (!empty($dir) && is_dir($dir)) {
$jsdirs['core'] = $dir;
}
$subsystems = core_component::get_core_subsy... | [
"public",
"static",
"function",
"find_all_amd_modules",
"(",
"$",
"debug",
"=",
"false",
")",
"{",
"global",
"$",
"CFG",
";",
"$",
"jsdirs",
"=",
"array",
"(",
")",
";",
"$",
"jsfiles",
"=",
"array",
"(",
")",
";",
"$",
"dir",
"=",
"$",
"CFG",
"->"... | Scan the source for AMD modules and return them all.
The expected location for amd modules is:
<componentdir>/amd/src/modulename.js
@param boolean $debug If true, returns the paths to the original (unminified) source files.
@return array $files An array of mappings from module names to file paths. | [
"Scan",
"the",
"source",
"for",
"AMD",
"modules",
"and",
"return",
"them",
"all",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/requirejs.php#L80-L133 |
214,630 | moodle/moodle | mod/workshop/classes/external.php | mod_workshop_external.get_workshops_by_courses | public static function get_workshops_by_courses($courseids = array()) {
global $PAGE;
$warnings = array();
$returnedworkshops = array();
$params = array(
'courseids' => $courseids,
);
$params = self::validate_parameters(self::get_workshops_by_courses_paramet... | php | public static function get_workshops_by_courses($courseids = array()) {
global $PAGE;
$warnings = array();
$returnedworkshops = array();
$params = array(
'courseids' => $courseids,
);
$params = self::validate_parameters(self::get_workshops_by_courses_paramet... | [
"public",
"static",
"function",
"get_workshops_by_courses",
"(",
"$",
"courseids",
"=",
"array",
"(",
")",
")",
"{",
"global",
"$",
"PAGE",
";",
"$",
"warnings",
"=",
"array",
"(",
")",
";",
"$",
"returnedworkshops",
"=",
"array",
"(",
")",
";",
"$",
"... | Returns a list of workshops in a provided list of courses.
If no list is provided all workshops that the user can view will be returned.
@param array $courseids course ids
@return array of warnings and workshops
@since Moodle 3.4 | [
"Returns",
"a",
"list",
"of",
"workshops",
"in",
"a",
"provided",
"list",
"of",
"courses",
".",
"If",
"no",
"list",
"is",
"provided",
"all",
"workshops",
"that",
"the",
"user",
"can",
"view",
"will",
"be",
"returned",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/classes/external.php#L71-L114 |
214,631 | moodle/moodle | mod/workshop/classes/external.php | mod_workshop_external.validate_workshop | protected static function validate_workshop($workshopid) {
global $DB, $USER;
// Request and permission validation.
$workshop = $DB->get_record('workshop', array('id' => $workshopid), '*', MUST_EXIST);
list($course, $cm) = get_course_and_cm_from_instance($workshop, 'workshop');
... | php | protected static function validate_workshop($workshopid) {
global $DB, $USER;
// Request and permission validation.
$workshop = $DB->get_record('workshop', array('id' => $workshopid), '*', MUST_EXIST);
list($course, $cm) = get_course_and_cm_from_instance($workshop, 'workshop');
... | [
"protected",
"static",
"function",
"validate_workshop",
"(",
"$",
"workshopid",
")",
"{",
"global",
"$",
"DB",
",",
"$",
"USER",
";",
"// Request and permission validation.",
"$",
"workshop",
"=",
"$",
"DB",
"->",
"get_record",
"(",
"'workshop'",
",",
"array",
... | Utility function for validating a workshop.
@param int $workshopid workshop instance id
@return array array containing the workshop object, course, context and course module objects
@since Moodle 3.4 | [
"Utility",
"function",
"for",
"validating",
"a",
"workshop",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/classes/external.php#L140-L153 |
214,632 | moodle/moodle | mod/workshop/classes/external.php | mod_workshop_external.get_workshop_access_information | public static function get_workshop_access_information($workshopid) {
global $USER;
$params = self::validate_parameters(self::get_workshop_access_information_parameters(), array('workshopid' => $workshopid));
list($workshop, $course, $cm, $context) = self::validate_workshop($params['workshopid... | php | public static function get_workshop_access_information($workshopid) {
global $USER;
$params = self::validate_parameters(self::get_workshop_access_information_parameters(), array('workshopid' => $workshopid));
list($workshop, $course, $cm, $context) = self::validate_workshop($params['workshopid... | [
"public",
"static",
"function",
"get_workshop_access_information",
"(",
"$",
"workshopid",
")",
"{",
"global",
"$",
"USER",
";",
"$",
"params",
"=",
"self",
"::",
"validate_parameters",
"(",
"self",
"::",
"get_workshop_access_information_parameters",
"(",
")",
",",
... | Return access information for a given workshop.
@param int $workshopid workshop instance id
@return array of warnings and the access information
@since Moodle 3.4
@throws moodle_exception | [
"Return",
"access",
"information",
"for",
"a",
"given",
"workshop",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/classes/external.php#L178-L207 |
214,633 | moodle/moodle | mod/workshop/classes/external.php | mod_workshop_external.get_workshop_access_information_returns | public static function get_workshop_access_information_returns() {
$structure = array(
'creatingsubmissionallowed' => new external_value(PARAM_BOOL,
'Is the given user allowed to create their submission?'),
'modifyingsubmissionallowed' => new external_value(PARAM_BOOL,
... | php | public static function get_workshop_access_information_returns() {
$structure = array(
'creatingsubmissionallowed' => new external_value(PARAM_BOOL,
'Is the given user allowed to create their submission?'),
'modifyingsubmissionallowed' => new external_value(PARAM_BOOL,
... | [
"public",
"static",
"function",
"get_workshop_access_information_returns",
"(",
")",
"{",
"$",
"structure",
"=",
"array",
"(",
"'creatingsubmissionallowed'",
"=>",
"new",
"external_value",
"(",
"PARAM_BOOL",
",",
"'Is the given user allowed to create their submission?'",
")",... | Describes the get_workshop_access_information return value.
@return external_single_structure
@since Moodle 3.4 | [
"Describes",
"the",
"get_workshop_access_information",
"return",
"value",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/classes/external.php#L215-L243 |
214,634 | moodle/moodle | mod/workshop/classes/external.php | mod_workshop_external.get_user_plan | public static function get_user_plan($workshopid, $userid = 0) {
global $USER;
$params = array(
'workshopid' => $workshopid,
'userid' => $userid,
);
$params = self::validate_parameters(self::get_user_plan_parameters(), $params);
list($workshop, $course, ... | php | public static function get_user_plan($workshopid, $userid = 0) {
global $USER;
$params = array(
'workshopid' => $workshopid,
'userid' => $userid,
);
$params = self::validate_parameters(self::get_user_plan_parameters(), $params);
list($workshop, $course, ... | [
"public",
"static",
"function",
"get_user_plan",
"(",
"$",
"workshopid",
",",
"$",
"userid",
"=",
"0",
")",
"{",
"global",
"$",
"USER",
";",
"$",
"params",
"=",
"array",
"(",
"'workshopid'",
"=>",
"$",
"workshopid",
",",
"'userid'",
"=>",
"$",
"userid",
... | Return the planner information for the given user.
@param int $workshopid workshop instance id
@param int $userid user id
@return array of warnings and the user plan
@since Moodle 3.4
@throws moodle_exception | [
"Return",
"the",
"planner",
"information",
"for",
"the",
"given",
"user",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/classes/external.php#L269-L317 |
214,635 | moodle/moodle | mod/workshop/classes/external.php | mod_workshop_external.get_user_plan_returns | public static function get_user_plan_returns() {
return new external_single_structure(
array(
'userplan' => new external_single_structure(
array(
'phases' => new external_multiple_structure(
new external_single_s... | php | public static function get_user_plan_returns() {
return new external_single_structure(
array(
'userplan' => new external_single_structure(
array(
'phases' => new external_multiple_structure(
new external_single_s... | [
"public",
"static",
"function",
"get_user_plan_returns",
"(",
")",
"{",
"return",
"new",
"external_single_structure",
"(",
"array",
"(",
"'userplan'",
"=>",
"new",
"external_single_structure",
"(",
"array",
"(",
"'phases'",
"=>",
"new",
"external_multiple_structure",
... | Describes the get_user_plan return value.
@return external_single_structure
@since Moodle 3.4 | [
"Describes",
"the",
"get_user_plan",
"return",
"value",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/classes/external.php#L325-L377 |
214,636 | moodle/moodle | mod/workshop/classes/external.php | mod_workshop_external.add_submission | public static function add_submission($workshopid, $title, $content = '', $contentformat = FORMAT_MOODLE,
$inlineattachmentsid = 0, $attachmentsid = 0) {
global $USER;
$params = self::validate_parameters(self::add_submission_parameters(), array(
'workshopid' => $workshopid,
... | php | public static function add_submission($workshopid, $title, $content = '', $contentformat = FORMAT_MOODLE,
$inlineattachmentsid = 0, $attachmentsid = 0) {
global $USER;
$params = self::validate_parameters(self::add_submission_parameters(), array(
'workshopid' => $workshopid,
... | [
"public",
"static",
"function",
"add_submission",
"(",
"$",
"workshopid",
",",
"$",
"title",
",",
"$",
"content",
"=",
"''",
",",
"$",
"contentformat",
"=",
"FORMAT_MOODLE",
",",
"$",
"inlineattachmentsid",
"=",
"0",
",",
"$",
"attachmentsid",
"=",
"0",
")... | Add a new submission to a given workshop.
@param int $workshopid the workshop id
@param string $title the submission title
@param string $content the submission text content
@param int $contentformat the format used for the content
@param int $inlineattachmentsid the draft file area id fo... | [
"Add",
"a",
"new",
"submission",
"to",
"a",
"given",
"workshop",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/classes/external.php#L464-L530 |
214,637 | moodle/moodle | mod/workshop/classes/external.php | mod_workshop_external.update_submission | public static function update_submission($submissionid, $title, $content = '', $contentformat = FORMAT_MOODLE,
$inlineattachmentsid = 0, $attachmentsid = 0) {
global $USER, $DB;
$params = self::validate_parameters(self::update_submission_parameters(), array(
'submissionid' => $s... | php | public static function update_submission($submissionid, $title, $content = '', $contentformat = FORMAT_MOODLE,
$inlineattachmentsid = 0, $attachmentsid = 0) {
global $USER, $DB;
$params = self::validate_parameters(self::update_submission_parameters(), array(
'submissionid' => $s... | [
"public",
"static",
"function",
"update_submission",
"(",
"$",
"submissionid",
",",
"$",
"title",
",",
"$",
"content",
"=",
"''",
",",
"$",
"contentformat",
"=",
"FORMAT_MOODLE",
",",
"$",
"inlineattachmentsid",
"=",
"0",
",",
"$",
"attachmentsid",
"=",
"0",... | Updates the given submission.
@param int $submissionid the submission id
@param string $title the submission title
@param string $content the submission text content
@param int $contentformat the format used for the content
@param int $inlineattachmentsid the draft file area id fo... | [
"Updates",
"the",
"given",
"submission",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/classes/external.php#L578-L638 |
214,638 | moodle/moodle | mod/workshop/classes/external.php | mod_workshop_external.delete_submission | public static function delete_submission($submissionid) {
global $USER, $DB;
$params = self::validate_parameters(self::delete_submission_parameters(), array('submissionid' => $submissionid));
$warnings = array();
// Get and validate the submission and workshop.
$submission = $D... | php | public static function delete_submission($submissionid) {
global $USER, $DB;
$params = self::validate_parameters(self::delete_submission_parameters(), array('submissionid' => $submissionid));
$warnings = array();
// Get and validate the submission and workshop.
$submission = $D... | [
"public",
"static",
"function",
"delete_submission",
"(",
"$",
"submissionid",
")",
"{",
"global",
"$",
"USER",
",",
"$",
"DB",
";",
"$",
"params",
"=",
"self",
"::",
"validate_parameters",
"(",
"self",
"::",
"delete_submission_parameters",
"(",
")",
",",
"a... | Deletes the given submission.
@param int $submissionid the submission id.
@return array containing the result status and warnings.
@since Moodle 3.4
@throws moodle_exception | [
"Deletes",
"the",
"given",
"submission",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/classes/external.php#L676-L704 |
214,639 | moodle/moodle | mod/workshop/classes/external.php | mod_workshop_external.prepare_submission_for_external | protected static function prepare_submission_for_external($submission, workshop $workshop, $canviewauthorpublished = null,
$canviewauthornames = null, $canviewallsubmissions = null) {
global $USER;
if (is_null($canviewauthorpublished)) {
$canviewauthorpublished = has_capability(... | php | protected static function prepare_submission_for_external($submission, workshop $workshop, $canviewauthorpublished = null,
$canviewauthornames = null, $canviewallsubmissions = null) {
global $USER;
if (is_null($canviewauthorpublished)) {
$canviewauthorpublished = has_capability(... | [
"protected",
"static",
"function",
"prepare_submission_for_external",
"(",
"$",
"submission",
",",
"workshop",
"$",
"workshop",
",",
"$",
"canviewauthorpublished",
"=",
"null",
",",
"$",
"canviewauthornames",
"=",
"null",
",",
"$",
"canviewallsubmissions",
"=",
"nul... | Helper method for returning the submission data according the current user capabilities and current phase.
@param stdClass $submission the submission data
@param workshop $workshop the workshop class
@param bool $canviewauthorpublished whether the user has the capability mod/workshop:viewauthorpublished on
@param... | [
"Helper",
"method",
"for",
"returning",
"the",
"submission",
"data",
"according",
"the",
"current",
"user",
"capabilities",
"and",
"current",
"phase",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/classes/external.php#L730-L766 |
214,640 | moodle/moodle | mod/workshop/classes/external.php | mod_workshop_external.validate_submission | protected static function validate_submission($submission, workshop $workshop) {
global $USER;
$workshopclosed = $workshop->phase == workshop::PHASE_CLOSED;
$canviewpublished = has_capability('mod/workshop:viewpublishedsubmissions', $workshop->context);
$canview = $submission->authorid... | php | protected static function validate_submission($submission, workshop $workshop) {
global $USER;
$workshopclosed = $workshop->phase == workshop::PHASE_CLOSED;
$canviewpublished = has_capability('mod/workshop:viewpublishedsubmissions', $workshop->context);
$canview = $submission->authorid... | [
"protected",
"static",
"function",
"validate_submission",
"(",
"$",
"submission",
",",
"workshop",
"$",
"workshop",
")",
"{",
"global",
"$",
"USER",
";",
"$",
"workshopclosed",
"=",
"$",
"workshop",
"->",
"phase",
"==",
"workshop",
"::",
"PHASE_CLOSED",
";",
... | Helper method for validating a submission.
@param stdClass $submission submission object
@param workshop $workshop workshop instance
@return void
@since Moodle 3.4 | [
"Helper",
"method",
"for",
"validating",
"a",
"submission",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/classes/external.php#L898-L918 |
214,641 | moodle/moodle | mod/workshop/classes/external.php | mod_workshop_external.get_submission | public static function get_submission($submissionid) {
global $USER, $DB, $PAGE;
$params = self::validate_parameters(self::get_submission_parameters(), array('submissionid' => $submissionid));
$warnings = array();
// Get and validate the submission and workshop.
$submission = $... | php | public static function get_submission($submissionid) {
global $USER, $DB, $PAGE;
$params = self::validate_parameters(self::get_submission_parameters(), array('submissionid' => $submissionid));
$warnings = array();
// Get and validate the submission and workshop.
$submission = $... | [
"public",
"static",
"function",
"get_submission",
"(",
"$",
"submissionid",
")",
"{",
"global",
"$",
"USER",
",",
"$",
"DB",
",",
"$",
"PAGE",
";",
"$",
"params",
"=",
"self",
"::",
"validate_parameters",
"(",
"self",
"::",
"get_submission_parameters",
"(",
... | Retrieves the given submission.
@param int $submissionid the submission id
@return array containing the submission and warnings.
@since Moodle 3.4
@throws moodle_exception | [
"Retrieves",
"the",
"given",
"submission",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/classes/external.php#L943-L963 |
214,642 | moodle/moodle | mod/workshop/classes/external.php | mod_workshop_external.check_view_submission_assessments | protected static function check_view_submission_assessments($submission, workshop $workshop) {
global $USER;
$ownsubmission = $submission->authorid == $USER->id;
$canview = has_capability('mod/workshop:viewallassessments', $workshop->context) ||
($ownsubmission && $workshop->assessm... | php | protected static function check_view_submission_assessments($submission, workshop $workshop) {
global $USER;
$ownsubmission = $submission->authorid == $USER->id;
$canview = has_capability('mod/workshop:viewallassessments', $workshop->context) ||
($ownsubmission && $workshop->assessm... | [
"protected",
"static",
"function",
"check_view_submission_assessments",
"(",
"$",
"submission",
",",
"workshop",
"$",
"workshop",
")",
"{",
"global",
"$",
"USER",
";",
"$",
"ownsubmission",
"=",
"$",
"submission",
"->",
"authorid",
"==",
"$",
"USER",
"->",
"id... | Helper method for validating if the current user can view the submission assessments.
@param stdClass $submission submission object
@param workshop $workshop workshop instance
@return void
@since Moodle 3.4 | [
"Helper",
"method",
"for",
"validating",
"if",
"the",
"current",
"user",
"can",
"view",
"the",
"submission",
"assessments",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/classes/external.php#L988-L1004 |
214,643 | moodle/moodle | mod/workshop/classes/external.php | mod_workshop_external.prepare_assessment_for_external | protected static function prepare_assessment_for_external($assessment, workshop $workshop) {
global $USER;
static $canviewallassessments = null;
static $canviewreviewers = null;
static $canoverridegrades = null;
// Remove all the properties that does not belong to the assessment... | php | protected static function prepare_assessment_for_external($assessment, workshop $workshop) {
global $USER;
static $canviewallassessments = null;
static $canviewreviewers = null;
static $canoverridegrades = null;
// Remove all the properties that does not belong to the assessment... | [
"protected",
"static",
"function",
"prepare_assessment_for_external",
"(",
"$",
"assessment",
",",
"workshop",
"$",
"workshop",
")",
"{",
"global",
"$",
"USER",
";",
"static",
"$",
"canviewallassessments",
"=",
"null",
";",
"static",
"$",
"canviewreviewers",
"=",
... | Helper method for returning the assessment data according the current user capabilities and current phase.
@param stdClass $assessment the assessment data
@param workshop $workshop the workshop class
@return stdClass object with the assessment data filtered or null if is not viewable yet
@since Moodle 3.4 | [
"Helper",
"method",
"for",
"returning",
"the",
"assessment",
"data",
"according",
"the",
"current",
"user",
"capabilities",
"and",
"current",
"phase",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/classes/external.php#L1014-L1063 |
214,644 | moodle/moodle | mod/workshop/classes/external.php | mod_workshop_external.get_submission_assessments | public static function get_submission_assessments($submissionid) {
global $USER, $DB, $PAGE;
$params = self::validate_parameters(self::get_submission_assessments_parameters(), array('submissionid' => $submissionid));
$warnings = $assessments = array();
// Get and validate the submissio... | php | public static function get_submission_assessments($submissionid) {
global $USER, $DB, $PAGE;
$params = self::validate_parameters(self::get_submission_assessments_parameters(), array('submissionid' => $submissionid));
$warnings = $assessments = array();
// Get and validate the submissio... | [
"public",
"static",
"function",
"get_submission_assessments",
"(",
"$",
"submissionid",
")",
"{",
"global",
"$",
"USER",
",",
"$",
"DB",
",",
"$",
"PAGE",
";",
"$",
"params",
"=",
"self",
"::",
"validate_parameters",
"(",
"self",
"::",
"get_submission_assessme... | Retrieves the given submission assessments.
@param int $submissionid the submission id
@return array containing the assessments and warnings.
@since Moodle 3.4
@throws moodle_exception | [
"Retrieves",
"the",
"given",
"submission",
"assessments",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/classes/external.php#L1088-L1116 |
214,645 | moodle/moodle | mod/workshop/classes/external.php | mod_workshop_external.get_assessment | public static function get_assessment($assessmentid) {
global $DB, $PAGE;
$params = self::validate_parameters(self::get_assessment_parameters(), array('assessmentid' => $assessmentid));
$warnings = array();
// Get and validate the assessment, submission and workshop.
$assessmen... | php | public static function get_assessment($assessmentid) {
global $DB, $PAGE;
$params = self::validate_parameters(self::get_assessment_parameters(), array('assessmentid' => $assessmentid));
$warnings = array();
// Get and validate the assessment, submission and workshop.
$assessmen... | [
"public",
"static",
"function",
"get_assessment",
"(",
"$",
"assessmentid",
")",
"{",
"global",
"$",
"DB",
",",
"$",
"PAGE",
";",
"$",
"params",
"=",
"self",
"::",
"validate_parameters",
"(",
"self",
"::",
"get_assessment_parameters",
"(",
")",
",",
"array",... | Retrieves the given assessment.
@param int $assessmentid the assessment id
@return array containing the assessment and warnings.
@since Moodle 3.4
@throws moodle_exception | [
"Retrieves",
"the",
"given",
"assessment",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/classes/external.php#L1158-L1184 |
214,646 | moodle/moodle | mod/workshop/classes/external.php | mod_workshop_external.get_reviewer_assessments | public static function get_reviewer_assessments($workshopid, $userid = 0) {
global $USER, $DB, $PAGE;
$params = self::validate_parameters(
self::get_reviewer_assessments_parameters(), array('workshopid' => $workshopid, 'userid' => $userid)
);
$warnings = $assessments = array... | php | public static function get_reviewer_assessments($workshopid, $userid = 0) {
global $USER, $DB, $PAGE;
$params = self::validate_parameters(
self::get_reviewer_assessments_parameters(), array('workshopid' => $workshopid, 'userid' => $userid)
);
$warnings = $assessments = array... | [
"public",
"static",
"function",
"get_reviewer_assessments",
"(",
"$",
"workshopid",
",",
"$",
"userid",
"=",
"0",
")",
"{",
"global",
"$",
"USER",
",",
"$",
"DB",
",",
"$",
"PAGE",
";",
"$",
"params",
"=",
"self",
"::",
"validate_parameters",
"(",
"self"... | Retrieves all the assessments reviewed by the given user.
@param int $workshopid the workshop instance id
@param int $userid the reviewer user id
@return array containing the user assessments and warnings.
@since Moodle 3.4
@throws moodle_exception | [
"Retrieves",
"all",
"the",
"assessments",
"reviewed",
"by",
"the",
"given",
"user",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/classes/external.php#L1375-L1422 |
214,647 | moodle/moodle | mod/workshop/classes/external.php | mod_workshop_external.update_assessment | public static function update_assessment($assessmentid, $data) {
global $DB, $USER;
$params = self::validate_parameters(
self::update_assessment_parameters(), array('assessmentid' => $assessmentid, 'data' => $data)
);
$warnings = array();
// Get and validate the ass... | php | public static function update_assessment($assessmentid, $data) {
global $DB, $USER;
$params = self::validate_parameters(
self::update_assessment_parameters(), array('assessmentid' => $assessmentid, 'data' => $data)
);
$warnings = array();
// Get and validate the ass... | [
"public",
"static",
"function",
"update_assessment",
"(",
"$",
"assessmentid",
",",
"$",
"data",
")",
"{",
"global",
"$",
"DB",
",",
"$",
"USER",
";",
"$",
"params",
"=",
"self",
"::",
"validate_parameters",
"(",
"self",
"::",
"update_assessment_parameters",
... | Updates an assessment.
@param int $assessmentid the assessment id
@param array $data the assessment data
@return array indicates if the assessment was updated, the new raw grade and possible warnings.
@since Moodle 3.4
@throws moodle_exception | [
"Updates",
"an",
"assessment",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/classes/external.php#L1480-L1550 |
214,648 | moodle/moodle | mod/workshop/classes/external.php | mod_workshop_external.get_grades | public static function get_grades($workshopid, $userid = 0) {
global $USER;
$params = array(
'workshopid' => $workshopid,
'userid' => $userid,
);
$params = self::validate_parameters(self::get_grades_parameters(), $params);
$warnings = array();
li... | php | public static function get_grades($workshopid, $userid = 0) {
global $USER;
$params = array(
'workshopid' => $workshopid,
'userid' => $userid,
);
$params = self::validate_parameters(self::get_grades_parameters(), $params);
$warnings = array();
li... | [
"public",
"static",
"function",
"get_grades",
"(",
"$",
"workshopid",
",",
"$",
"userid",
"=",
"0",
")",
"{",
"global",
"$",
"USER",
";",
"$",
"params",
"=",
"array",
"(",
"'workshopid'",
"=>",
"$",
"workshopid",
",",
"'userid'",
"=>",
"$",
"userid",
"... | Returns the grades information for the given workshop and user.
@param int $workshopid workshop instance id
@param int $userid user id
@return array of warnings and the user plan
@since Moodle 3.4
@throws moodle_exception | [
"Returns",
"the",
"grades",
"information",
"for",
"the",
"given",
"workshop",
"and",
"user",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/classes/external.php#L1593-L1639 |
214,649 | moodle/moodle | mod/workshop/classes/external.php | mod_workshop_external.view_submission | public static function view_submission($submissionid) {
global $DB;
$params = self::validate_parameters(self::view_submission_parameters(), array('submissionid' => $submissionid));
$warnings = array();
// Get and validate the submission and workshop.
$submission = $DB->get_reco... | php | public static function view_submission($submissionid) {
global $DB;
$params = self::validate_parameters(self::view_submission_parameters(), array('submissionid' => $submissionid));
$warnings = array();
// Get and validate the submission and workshop.
$submission = $DB->get_reco... | [
"public",
"static",
"function",
"view_submission",
"(",
"$",
"submissionid",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"params",
"=",
"self",
"::",
"validate_parameters",
"(",
"self",
"::",
"view_submission_parameters",
"(",
")",
",",
"array",
"(",
"'submission... | Trigger the submission viewed event.
@param int $submissionid submission id
@return array of warnings and status result
@since Moodle 3.4
@throws moodle_exception | [
"Trigger",
"the",
"submission",
"viewed",
"event",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/classes/external.php#L1981-L2000 |
214,650 | moodle/moodle | cache/renderer.php | core_cache_renderer.store_plugin_summaries | public function store_plugin_summaries(array $plugins) {
$table = new html_table();
$table->head = array(
get_string('plugin', 'cache'),
get_string('storeready', 'cache'),
get_string('stores', 'cache'),
get_string('modes', 'cache'),
get_string(... | php | public function store_plugin_summaries(array $plugins) {
$table = new html_table();
$table->head = array(
get_string('plugin', 'cache'),
get_string('storeready', 'cache'),
get_string('stores', 'cache'),
get_string('modes', 'cache'),
get_string(... | [
"public",
"function",
"store_plugin_summaries",
"(",
"array",
"$",
"plugins",
")",
"{",
"$",
"table",
"=",
"new",
"html_table",
"(",
")",
";",
"$",
"table",
"->",
"head",
"=",
"array",
"(",
"get_string",
"(",
"'plugin'",
",",
"'cache'",
")",
",",
"get_st... | Displays plugin summaries
@param array $plugins
@return string HTML | [
"Displays",
"plugin",
"summaries"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/renderer.php#L148-L208 |
214,651 | moodle/moodle | cache/renderer.php | core_cache_renderer.definition_summaries | public function definition_summaries(array $definitions, context $context) {
$table = new html_table();
$table->head = array(
get_string('definition', 'cache'),
get_string('mode', 'cache'),
get_string('component', 'cache'),
get_string('area', 'cache'),
... | php | public function definition_summaries(array $definitions, context $context) {
$table = new html_table();
$table->head = array(
get_string('definition', 'cache'),
get_string('mode', 'cache'),
get_string('component', 'cache'),
get_string('area', 'cache'),
... | [
"public",
"function",
"definition_summaries",
"(",
"array",
"$",
"definitions",
",",
"context",
"$",
"context",
")",
"{",
"$",
"table",
"=",
"new",
"html_table",
"(",
")",
";",
"$",
"table",
"->",
"head",
"=",
"array",
"(",
"get_string",
"(",
"'definition'... | Displays definition summaries
@param array $definitions
@return string HTML | [
"Displays",
"definition",
"summaries"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/renderer.php#L216-L277 |
214,652 | moodle/moodle | cache/renderer.php | core_cache_renderer.mode_mappings | public function mode_mappings($applicationstore, $sessionstore, $requeststore, moodle_url $editurl) {
$table = new html_table();
$table->colclasses = array(
'mode',
'mapping',
);
$table->rowclasses = array(
'mode_application',
'mode_session... | php | public function mode_mappings($applicationstore, $sessionstore, $requeststore, moodle_url $editurl) {
$table = new html_table();
$table->colclasses = array(
'mode',
'mapping',
);
$table->rowclasses = array(
'mode_application',
'mode_session... | [
"public",
"function",
"mode_mappings",
"(",
"$",
"applicationstore",
",",
"$",
"sessionstore",
",",
"$",
"requeststore",
",",
"moodle_url",
"$",
"editurl",
")",
"{",
"$",
"table",
"=",
"new",
"html_table",
"(",
")",
";",
"$",
"table",
"->",
"colclasses",
"... | Displays mode mappings
@param string $applicationstore
@param string $sessionstore
@param string $requeststore
@param moodle_url $editurl
@return string HTML | [
"Displays",
"mode",
"mappings"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/renderer.php#L288-L316 |
214,653 | moodle/moodle | cache/renderer.php | core_cache_renderer.lock_summaries | public function lock_summaries(array $locks) {
$table = new html_table();
$table->colclasses = array(
'name',
'type',
'default',
'uses',
'actions'
);
$table->rowclasses = array(
'lock_name',
'lock_type',
... | php | public function lock_summaries(array $locks) {
$table = new html_table();
$table->colclasses = array(
'name',
'type',
'default',
'uses',
'actions'
);
$table->rowclasses = array(
'lock_name',
'lock_type',
... | [
"public",
"function",
"lock_summaries",
"(",
"array",
"$",
"locks",
")",
"{",
"$",
"table",
"=",
"new",
"html_table",
"(",
")",
";",
"$",
"table",
"->",
"colclasses",
"=",
"array",
"(",
"'name'",
",",
"'type'",
",",
"'default'",
",",
"'uses'",
",",
"'a... | Display basic information about lock instances.
@todo Add some actions so that people can configure lock instances.
@param array $locks
@return string | [
"Display",
"basic",
"information",
"about",
"lock",
"instances",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/renderer.php#L326-L376 |
214,654 | moodle/moodle | cache/renderer.php | core_cache_renderer.notifications | public function notifications(array $notifications = array()) {
if (count($notifications) === 0) {
// There are no notifications to render.
return '';
}
$html = html_writer::start_div('notifications');
foreach ($notifications as $notification) {
list($... | php | public function notifications(array $notifications = array()) {
if (count($notifications) === 0) {
// There are no notifications to render.
return '';
}
$html = html_writer::start_div('notifications');
foreach ($notifications as $notification) {
list($... | [
"public",
"function",
"notifications",
"(",
"array",
"$",
"notifications",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"notifications",
")",
"===",
"0",
")",
"{",
"// There are no notifications to render.",
"return",
"''",
";",
"}",
"$",
... | Renders an array of notifications for the cache configuration screen.
Takes an array of notifications with the form:
$notifications = array(
array('This is a success message', true),
array('This is a failure message', false),
);
@param array $notifications
@return string | [
"Renders",
"an",
"array",
"of",
"notifications",
"for",
"the",
"cache",
"configuration",
"screen",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/renderer.php#L390-L402 |
214,655 | moodle/moodle | auth/cas/CAS/CAS/ProxyChain.php | CAS_ProxyChain.matches | public function matches(array $list)
{
$list = array_values($list); // Ensure that we have an indexed array
if ($this->isSizeValid($list)) {
$mismatch = false;
foreach ($this->chain as $i => $search) {
$proxy_url = $list[$i];
if (preg_match('/... | php | public function matches(array $list)
{
$list = array_values($list); // Ensure that we have an indexed array
if ($this->isSizeValid($list)) {
$mismatch = false;
foreach ($this->chain as $i => $search) {
$proxy_url = $list[$i];
if (preg_match('/... | [
"public",
"function",
"matches",
"(",
"array",
"$",
"list",
")",
"{",
"$",
"list",
"=",
"array_values",
"(",
"$",
"list",
")",
";",
"// Ensure that we have an indexed array",
"if",
"(",
"$",
"this",
"->",
"isSizeValid",
"(",
"$",
"list",
")",
")",
"{",
"... | Match a list of proxies.
@param array $list The list of proxies in front of this service.
@return bool | [
"Match",
"a",
"list",
"of",
"proxies",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/auth/cas/CAS/CAS/ProxyChain.php#L73-L114 |
214,656 | moodle/moodle | admin/roles/classes/privacy/provider.php | provider.get_contexts_for_userid | public static function get_contexts_for_userid(int $userid) : contextlist {
global $DB;
$contextlist = new contextlist();
// The role_capabilities table contains user data.
$contexts = [
CONTEXT_SYSTEM,
CONTEXT_USER,
CONTEXT_COURSECAT,
CO... | php | public static function get_contexts_for_userid(int $userid) : contextlist {
global $DB;
$contextlist = new contextlist();
// The role_capabilities table contains user data.
$contexts = [
CONTEXT_SYSTEM,
CONTEXT_USER,
CONTEXT_COURSECAT,
CO... | [
"public",
"static",
"function",
"get_contexts_for_userid",
"(",
"int",
"$",
"userid",
")",
":",
"contextlist",
"{",
"global",
"$",
"DB",
";",
"$",
"contextlist",
"=",
"new",
"contextlist",
"(",
")",
";",
"// The role_capabilities table contains user data.",
"$",
"... | Return all contexts for this userid.
@param int $userid The user ID.
@return contextlist The list of context IDs. | [
"Return",
"all",
"contexts",
"for",
"this",
"userid",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/roles/classes/privacy/provider.php#L103-L159 |
214,657 | moodle/moodle | admin/roles/classes/privacy/provider.php | provider.export_user_role_to_cohort | public static function export_user_role_to_cohort(int $userid) {
global $DB;
$rolesnames = self::get_roles_name();
$sql = "SELECT ra.id, ra.contextid, ra.roleid, ra.userid, ra.timemodified, ra.modifierid, r.id as roleid
FROM {role_assignments} ra
JOIN {contex... | php | public static function export_user_role_to_cohort(int $userid) {
global $DB;
$rolesnames = self::get_roles_name();
$sql = "SELECT ra.id, ra.contextid, ra.roleid, ra.userid, ra.timemodified, ra.modifierid, r.id as roleid
FROM {role_assignments} ra
JOIN {contex... | [
"public",
"static",
"function",
"export_user_role_to_cohort",
"(",
"int",
"$",
"userid",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"rolesnames",
"=",
"self",
"::",
"get_roles_name",
"(",
")",
";",
"$",
"sql",
"=",
"\"SELECT ra.id, ra.contextid, ra.roleid, ra.userid... | Exports the data relating to tool_cohortroles component on role assignments by
Assign user roles to cohort feature.
@param int $userid The user ID. | [
"Exports",
"the",
"data",
"relating",
"to",
"tool_cohortroles",
"component",
"on",
"role",
"assignments",
"by",
"Assign",
"user",
"roles",
"to",
"cohort",
"feature",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/roles/classes/privacy/provider.php#L318-L352 |
214,658 | moodle/moodle | admin/roles/classes/privacy/provider.php | provider.delete_data_for_user | public static function delete_data_for_user(approved_contextlist $contextlist) {
global $DB;
// Don't remove data from role_capabilities.
// Because this data affects the whole Moodle, there are override capabilities.
// Don't belong to the modifier user.
// Remove data from ro... | php | public static function delete_data_for_user(approved_contextlist $contextlist) {
global $DB;
// Don't remove data from role_capabilities.
// Because this data affects the whole Moodle, there are override capabilities.
// Don't belong to the modifier user.
// Remove data from ro... | [
"public",
"static",
"function",
"delete_data_for_user",
"(",
"approved_contextlist",
"$",
"contextlist",
")",
"{",
"global",
"$",
"DB",
";",
"// Don't remove data from role_capabilities.",
"// Because this data affects the whole Moodle, there are override capabilities.",
"// Don't be... | Delete all user data for this user only.
@param approved_contextlist $contextlist The list of approved contexts for a user. | [
"Delete",
"all",
"user",
"data",
"for",
"this",
"user",
"only",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/roles/classes/privacy/provider.php#L399-L419 |
214,659 | moodle/moodle | admin/roles/classes/privacy/provider.php | provider.get_roles_name | protected static function get_roles_name() {
$roles = role_fix_names(get_all_roles(), \context_system::instance(), ROLENAME_ORIGINAL);
$rolesnames = array();
foreach ($roles as $role) {
$rolesnames[$role->id] = $role->localname;
}
return $rolesnames;
} | php | protected static function get_roles_name() {
$roles = role_fix_names(get_all_roles(), \context_system::instance(), ROLENAME_ORIGINAL);
$rolesnames = array();
foreach ($roles as $role) {
$rolesnames[$role->id] = $role->localname;
}
return $rolesnames;
} | [
"protected",
"static",
"function",
"get_roles_name",
"(",
")",
"{",
"$",
"roles",
"=",
"role_fix_names",
"(",
"get_all_roles",
"(",
")",
",",
"\\",
"context_system",
"::",
"instance",
"(",
")",
",",
"ROLENAME_ORIGINAL",
")",
";",
"$",
"rolesnames",
"=",
"arr... | Get all the localised roles name in a simple array.
@return array Array of name of the roles by roleid. | [
"Get",
"all",
"the",
"localised",
"roles",
"name",
"in",
"a",
"simple",
"array",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/roles/classes/privacy/provider.php#L437-L444 |
214,660 | moodle/moodle | admin/roles/classes/privacy/provider.php | provider.get_permissions_name | protected static function get_permissions_name() {
$strpermissions = array(
CAP_INHERIT => get_string('inherit', 'role'),
CAP_ALLOW => get_string('allow', 'role'),
CAP_PREVENT => get_string('prevent', 'role'),
CAP_PROHIBIT => get_string('prohibit', 'role')
... | php | protected static function get_permissions_name() {
$strpermissions = array(
CAP_INHERIT => get_string('inherit', 'role'),
CAP_ALLOW => get_string('allow', 'role'),
CAP_PREVENT => get_string('prevent', 'role'),
CAP_PROHIBIT => get_string('prohibit', 'role')
... | [
"protected",
"static",
"function",
"get_permissions_name",
"(",
")",
"{",
"$",
"strpermissions",
"=",
"array",
"(",
"CAP_INHERIT",
"=>",
"get_string",
"(",
"'inherit'",
",",
"'role'",
")",
",",
"CAP_ALLOW",
"=>",
"get_string",
"(",
"'allow'",
",",
"'role'",
")... | Get all the permissions name in a simple array.
@return array Array of permissions name. | [
"Get",
"all",
"the",
"permissions",
"name",
"in",
"a",
"simple",
"array",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/roles/classes/privacy/provider.php#L450-L458 |
214,661 | moodle/moodle | webservice/xmlrpc/locallib.php | webservice_xmlrpc_server.prepare_response | protected function prepare_response() {
try {
if (!empty($this->function->returns_desc)) {
$validatedvalues = external_api::clean_returnvalue($this->function->returns_desc, $this->returns);
$encodingoptions = array(
"encoding" => "UTF-8",
... | php | protected function prepare_response() {
try {
if (!empty($this->function->returns_desc)) {
$validatedvalues = external_api::clean_returnvalue($this->function->returns_desc, $this->returns);
$encodingoptions = array(
"encoding" => "UTF-8",
... | [
"protected",
"function",
"prepare_response",
"(",
")",
"{",
"try",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"function",
"->",
"returns_desc",
")",
")",
"{",
"$",
"validatedvalues",
"=",
"external_api",
"::",
"clean_returnvalue",
"(",
"$",
"thi... | Prepares the response. | [
"Prepares",
"the",
"response",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/webservice/xmlrpc/locallib.php#L103-L119 |
214,662 | moodle/moodle | webservice/xmlrpc/locallib.php | webservice_xmlrpc_server.send_error | protected function send_error($ex = null) {
$this->response = $this->generate_error($ex);
$this->send_headers();
echo $this->response;
} | php | protected function send_error($ex = null) {
$this->response = $this->generate_error($ex);
$this->send_headers();
echo $this->response;
} | [
"protected",
"function",
"send_error",
"(",
"$",
"ex",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"response",
"=",
"$",
"this",
"->",
"generate_error",
"(",
"$",
"ex",
")",
";",
"$",
"this",
"->",
"send_headers",
"(",
")",
";",
"echo",
"$",
"this",
... | Send the error information to the WS client.
@param Exception $ex | [
"Send",
"the",
"error",
"information",
"to",
"the",
"WS",
"client",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/webservice/xmlrpc/locallib.php#L135-L139 |
214,663 | moodle/moodle | webservice/xmlrpc/locallib.php | webservice_xmlrpc_server.generate_error | protected function generate_error($ex, $faultcode = 404) {
$error = $ex->getMessage();
if (!empty($ex->errorcode)) {
// The faultCode must be an int, so we obtain a hash of the errorcode then get an integer value of the hash.
$faultcode = base_convert(md5($ex->errorcode), 16, 10... | php | protected function generate_error($ex, $faultcode = 404) {
$error = $ex->getMessage();
if (!empty($ex->errorcode)) {
// The faultCode must be an int, so we obtain a hash of the errorcode then get an integer value of the hash.
$faultcode = base_convert(md5($ex->errorcode), 16, 10... | [
"protected",
"function",
"generate_error",
"(",
"$",
"ex",
",",
"$",
"faultcode",
"=",
"404",
")",
"{",
"$",
"error",
"=",
"$",
"ex",
"->",
"getMessage",
"(",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"ex",
"->",
"errorcode",
")",
")",
"{",
"/... | Generate the XML-RPC fault response.
@param Exception|Throwable $ex The exception.
@param int $faultcode The faultCode to be included in the fault response
@return string The XML-RPC fault response xml containing the faultCode and faultString. | [
"Generate",
"the",
"XML",
"-",
"RPC",
"fault",
"response",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/webservice/xmlrpc/locallib.php#L169-L202 |
214,664 | moodle/moodle | admin/tool/task/classes/edit_scheduled_task_form.php | tool_task_edit_scheduled_task_form.validate_fields | public static function validate_fields($field, $value) {
switch ($field) {
case 'minute' :
case 'hour' :
$regex = "/\A\*\z|\A[0-5]?[0-9]\z|\A\*\/[0-5]?[0-9]\z|\A[0-5]?[0-9](,[0-5]?[0-9])*\z|\A[0-5]?[0-9]-[0-5]?[0-9]\z/";
break;
case 'day':
... | php | public static function validate_fields($field, $value) {
switch ($field) {
case 'minute' :
case 'hour' :
$regex = "/\A\*\z|\A[0-5]?[0-9]\z|\A\*\/[0-5]?[0-9]\z|\A[0-5]?[0-9](,[0-5]?[0-9])*\z|\A[0-5]?[0-9]-[0-5]?[0-9]\z/";
break;
case 'day':
... | [
"public",
"static",
"function",
"validate_fields",
"(",
"$",
"field",
",",
"$",
"value",
")",
"{",
"switch",
"(",
"$",
"field",
")",
"{",
"case",
"'minute'",
":",
"case",
"'hour'",
":",
"$",
"regex",
"=",
"\"/\\A\\*\\z|\\A[0-5]?[0-9]\\z|\\A\\*\\/[0-5]?[0-9]\\z|\... | Helper function that validates the submitted data.
Explanation of the regex:-
\A\*\z - matches *
\A[0-5]?[0-9]\z - matches entries like 23
\A\*\/[0-5]?[0-9]\z - matches entries like * / 5
\A[0-5]?[0-9](,[0-5]?[0-9])*\z - matches entries like 1,2,3
\A[0-5]?[0-9]-[0-5]?[0-9]\z - matches entries like 2-10
@param string... | [
"Helper",
"function",
"that",
"validates",
"the",
"submitted",
"data",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/task/classes/edit_scheduled_task_form.php#L136-L157 |
214,665 | moodle/moodle | lib/classes/filetypes.php | core_filetypes.get_file_extension | public static function get_file_extension($mimetype) {
$types = self::get_types();
foreach ($types as $extension => $info) {
if ($info['type'] == $mimetype) {
return $extension;
}
}
return false;
} | php | public static function get_file_extension($mimetype) {
$types = self::get_types();
foreach ($types as $extension => $info) {
if ($info['type'] == $mimetype) {
return $extension;
}
}
return false;
} | [
"public",
"static",
"function",
"get_file_extension",
"(",
"$",
"mimetype",
")",
"{",
"$",
"types",
"=",
"self",
"::",
"get_types",
"(",
")",
";",
"foreach",
"(",
"$",
"types",
"as",
"$",
"extension",
"=>",
"$",
"info",
")",
"{",
"if",
"(",
"$",
"inf... | Given a mimetype - return a valid file extension for it.
@param $mimetype string
@return string|bool False if the mimetype was not known, a string indicating a valid file extension otherwise. It may not
be the only valid file extension - just the first one found. | [
"Given",
"a",
"mimetype",
"-",
"return",
"a",
"valid",
"file",
"extension",
"for",
"it",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/filetypes.php#L316-L324 |
214,666 | moodle/moodle | lib/classes/filetypes.php | core_filetypes.& | public static function &get_types() {
// If it was already done in this request, use cache.
if (self::$cachedtypes) {
return self::$cachedtypes;
}
// Get defaults.
$mimetypes = self::get_default_types();
// Get custom file types.
$custom = self::get_... | php | public static function &get_types() {
// If it was already done in this request, use cache.
if (self::$cachedtypes) {
return self::$cachedtypes;
}
// Get defaults.
$mimetypes = self::get_default_types();
// Get custom file types.
$custom = self::get_... | [
"public",
"static",
"function",
"&",
"get_types",
"(",
")",
"{",
"// If it was already done in this request, use cache.",
"if",
"(",
"self",
"::",
"$",
"cachedtypes",
")",
"{",
"return",
"self",
"::",
"$",
"cachedtypes",
";",
"}",
"// Get defaults.",
"$",
"mimetyp... | Gets all the current types.
@return array Associative array from extension to array of data about type | [
"Gets",
"all",
"the",
"current",
"types",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/filetypes.php#L331-L420 |
214,667 | moodle/moodle | lib/classes/filetypes.php | core_filetypes.get_custom_types | protected static function get_custom_types() {
global $CFG;
if (!empty($CFG->customfiletypes)) {
if (is_array($CFG->customfiletypes)) {
// You can define this as an array in config.php...
return $CFG->customfiletypes;
} else {
// Or... | php | protected static function get_custom_types() {
global $CFG;
if (!empty($CFG->customfiletypes)) {
if (is_array($CFG->customfiletypes)) {
// You can define this as an array in config.php...
return $CFG->customfiletypes;
} else {
// Or... | [
"protected",
"static",
"function",
"get_custom_types",
"(",
")",
"{",
"global",
"$",
"CFG",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"CFG",
"->",
"customfiletypes",
")",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"CFG",
"->",
"customfiletypes",
")",
")"... | Gets custom types from config variable, after decoding the JSON if required.
@return array Array of custom types (empty array if none) | [
"Gets",
"custom",
"types",
"from",
"config",
"variable",
"after",
"decoding",
"the",
"JSON",
"if",
"required",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/filetypes.php#L427-L440 |
214,668 | moodle/moodle | lib/classes/filetypes.php | core_filetypes.set_custom_types | protected static function set_custom_types(array $types) {
global $CFG;
// Check the setting hasn't been forced.
if (array_key_exists('customfiletypes', $CFG->config_php_settings)) {
throw new coding_exception('Cannot set custom filetypes because they ' .
'are def... | php | protected static function set_custom_types(array $types) {
global $CFG;
// Check the setting hasn't been forced.
if (array_key_exists('customfiletypes', $CFG->config_php_settings)) {
throw new coding_exception('Cannot set custom filetypes because they ' .
'are def... | [
"protected",
"static",
"function",
"set_custom_types",
"(",
"array",
"$",
"types",
")",
"{",
"global",
"$",
"CFG",
";",
"// Check the setting hasn't been forced.",
"if",
"(",
"array_key_exists",
"(",
"'customfiletypes'",
",",
"$",
"CFG",
"->",
"config_php_settings",
... | Sets the custom types into config variable, encoding into JSON.
@param array $types Array of custom types
@throws coding_exception If the custom types are fixed in config.php. | [
"Sets",
"the",
"custom",
"types",
"into",
"config",
"variable",
"encoding",
"into",
"JSON",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/filetypes.php#L448-L463 |
214,669 | moodle/moodle | lib/classes/filetypes.php | core_filetypes.get_deleted_types | public static function get_deleted_types() {
$defaults = self::get_default_types();
$deleted = array();
foreach (self::get_custom_types() as $customentry) {
if (!empty($customentry->deleted)) {
$deleted[$customentry->extension] = $defaults[$customentry->extension];
... | php | public static function get_deleted_types() {
$defaults = self::get_default_types();
$deleted = array();
foreach (self::get_custom_types() as $customentry) {
if (!empty($customentry->deleted)) {
$deleted[$customentry->extension] = $defaults[$customentry->extension];
... | [
"public",
"static",
"function",
"get_deleted_types",
"(",
")",
"{",
"$",
"defaults",
"=",
"self",
"::",
"get_default_types",
"(",
")",
";",
"$",
"deleted",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"self",
"::",
"get_custom_types",
"(",
")",
"as",
"$"... | Gets the default types that have been deleted. Returns an array containing
the defaults of all those types.
@return array Array (same format as get_mimetypes_array) | [
"Gets",
"the",
"default",
"types",
"that",
"have",
"been",
"deleted",
".",
"Returns",
"an",
"array",
"containing",
"the",
"defaults",
"of",
"all",
"those",
"types",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/filetypes.php#L480-L489 |
214,670 | moodle/moodle | lib/classes/filetypes.php | core_filetypes.add_type | public static function add_type($extension, $mimetype, $coreicon,
array $groups = array(), $corestring = '', $customdescription = '',
$defaulticon = false) {
// Check for blank extensions or incorrectly including the dot.
$extension = (string)$extension;
if ($extension ==... | php | public static function add_type($extension, $mimetype, $coreicon,
array $groups = array(), $corestring = '', $customdescription = '',
$defaulticon = false) {
// Check for blank extensions or incorrectly including the dot.
$extension = (string)$extension;
if ($extension ==... | [
"public",
"static",
"function",
"add_type",
"(",
"$",
"extension",
",",
"$",
"mimetype",
",",
"$",
"coreicon",
",",
"array",
"$",
"groups",
"=",
"array",
"(",
")",
",",
"$",
"corestring",
"=",
"''",
",",
"$",
"customdescription",
"=",
"''",
",",
"$",
... | Adds a new entry to the list of custom filetypes.
@param string $extension File extension without dot, e.g. 'doc'
@param string $mimetype MIME type e.g. 'application/msword'
@param string $coreicon Core icon to use e.g. 'document'
@param array $groups Array of group strings that this type belongs to
@param string $cor... | [
"Adds",
"a",
"new",
"entry",
"to",
"the",
"list",
"of",
"custom",
"filetypes",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/filetypes.php#L503-L564 |
214,671 | moodle/moodle | lib/classes/filetypes.php | core_filetypes.update_type | public static function update_type($extension, $newextension, $mimetype, $coreicon,
array $groups = array(), $corestring = '', $customdescription = '',
$defaulticon = false) {
// Extension must exist.
$extension = (string)$extension;
$mimetypes = get_mimetypes_array();
... | php | public static function update_type($extension, $newextension, $mimetype, $coreicon,
array $groups = array(), $corestring = '', $customdescription = '',
$defaulticon = false) {
// Extension must exist.
$extension = (string)$extension;
$mimetypes = get_mimetypes_array();
... | [
"public",
"static",
"function",
"update_type",
"(",
"$",
"extension",
",",
"$",
"newextension",
",",
"$",
"mimetype",
",",
"$",
"coreicon",
",",
"array",
"$",
"groups",
"=",
"array",
"(",
")",
",",
"$",
"corestring",
"=",
"''",
",",
"$",
"customdescripti... | Updates an entry in the list of filetypes in config.
@param string $extension File extension without dot, e.g. 'doc'
@param string $newextension New file extension (same if not changing)
@param string $mimetype MIME type e.g. 'application/msword'
@param string $coreicon Core icon to use e.g. 'document'
@param array $g... | [
"Updates",
"an",
"entry",
"in",
"the",
"list",
"of",
"filetypes",
"in",
"config",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/filetypes.php#L579-L618 |
214,672 | moodle/moodle | lib/classes/filetypes.php | core_filetypes.revert_type_to_default | public static function revert_type_to_default($extension) {
$extension = (string)$extension;
// Check it actually is a default type.
$defaults = self::get_default_types();
if (!array_key_exists($extension, $defaults)) {
throw new coding_exception('Extension ' . $extension . ... | php | public static function revert_type_to_default($extension) {
$extension = (string)$extension;
// Check it actually is a default type.
$defaults = self::get_default_types();
if (!array_key_exists($extension, $defaults)) {
throw new coding_exception('Extension ' . $extension . ... | [
"public",
"static",
"function",
"revert_type_to_default",
"(",
"$",
"extension",
")",
"{",
"$",
"extension",
"=",
"(",
"string",
")",
"$",
"extension",
";",
"// Check it actually is a default type.",
"$",
"defaults",
"=",
"self",
"::",
"get_default_types",
"(",
")... | Reverts a file type to the default. May only be called on types that have
default values. This will undelete the type if necessary or set its values.
If the type is already at default values, does nothing.
@param string $extension File extension without dot, e.g. 'doc'
@return bool True if anything was changed, false ... | [
"Reverts",
"a",
"file",
"type",
"to",
"the",
"default",
".",
"May",
"only",
"be",
"called",
"on",
"types",
"that",
"have",
"default",
"values",
".",
"This",
"will",
"undelete",
"the",
"type",
"if",
"necessary",
"or",
"set",
"its",
"values",
".",
"If",
... | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/filetypes.php#L663-L687 |
214,673 | moodle/moodle | lib/classes/filetypes.php | core_filetypes.create_config_record | protected static function create_config_record($extension, $mimetype,
$coreicon, array $groups, $corestring, $customdescription, $defaulticon) {
// Construct new entry.
$newentry = (object)array('extension' => (string)$extension, 'type' => (string)$mimetype,
'icon' => (string... | php | protected static function create_config_record($extension, $mimetype,
$coreicon, array $groups, $corestring, $customdescription, $defaulticon) {
// Construct new entry.
$newentry = (object)array('extension' => (string)$extension, 'type' => (string)$mimetype,
'icon' => (string... | [
"protected",
"static",
"function",
"create_config_record",
"(",
"$",
"extension",
",",
"$",
"mimetype",
",",
"$",
"coreicon",
",",
"array",
"$",
"groups",
",",
"$",
"corestring",
",",
"$",
"customdescription",
",",
"$",
"defaulticon",
")",
"{",
"// Construct n... | Converts function parameters into a record for storing in the JSON value.
@param string $extension File extension without dot, e.g. 'doc'
@param string $mimetype MIME type e.g. 'application/msword'
@param string $coreicon Core icon to use e.g. 'document'
@param array $groups Array of group strings that this type belon... | [
"Converts",
"function",
"parameters",
"into",
"a",
"record",
"for",
"storing",
"in",
"the",
"JSON",
"value",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/filetypes.php#L701-L727 |
214,674 | moodle/moodle | mod/quiz/renderer.php | mod_quiz_renderer.review_page | public function review_page(quiz_attempt $attemptobj, $slots, $page, $showall,
$lastpage, mod_quiz_display_options $displayoptions,
$summarydata) {
$output = '';
$output .= $this->header();
$output .= $this->review_summary_table($s... | php | public function review_page(quiz_attempt $attemptobj, $slots, $page, $showall,
$lastpage, mod_quiz_display_options $displayoptions,
$summarydata) {
$output = '';
$output .= $this->header();
$output .= $this->review_summary_table($s... | [
"public",
"function",
"review_page",
"(",
"quiz_attempt",
"$",
"attemptobj",
",",
"$",
"slots",
",",
"$",
"page",
",",
"$",
"showall",
",",
"$",
"lastpage",
",",
"mod_quiz_display_options",
"$",
"displayoptions",
",",
"$",
"summarydata",
")",
"{",
"$",
"outp... | Builds the review page
@param quiz_attempt $attemptobj an instance of quiz_attempt.
@param array $slots an array of intgers relating to questions.
@param int $page the current page number
@param bool $showall whether to show entire attempt on one page.
@param bool $lastpage if true the current page is the last page.
@... | [
"Builds",
"the",
"review",
"page"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/renderer.php#L48-L62 |
214,675 | moodle/moodle | mod/quiz/renderer.php | mod_quiz_renderer.filter_review_summary_table | protected function filter_review_summary_table($summarydata, $page) {
if ($page == 0) {
return $summarydata;
}
// Only show some of summary table on subsequent pages.
foreach ($summarydata as $key => $rowdata) {
if (!in_array($key, array('user', 'attemptlist'))) ... | php | protected function filter_review_summary_table($summarydata, $page) {
if ($page == 0) {
return $summarydata;
}
// Only show some of summary table on subsequent pages.
foreach ($summarydata as $key => $rowdata) {
if (!in_array($key, array('user', 'attemptlist'))) ... | [
"protected",
"function",
"filter_review_summary_table",
"(",
"$",
"summarydata",
",",
"$",
"page",
")",
"{",
"if",
"(",
"$",
"page",
"==",
"0",
")",
"{",
"return",
"$",
"summarydata",
";",
"}",
"// Only show some of summary table on subsequent pages.",
"foreach",
... | Filters the summarydata array.
@param array $summarydata contains row data for table
@param int $page the current page number
@return $summarydata containing filtered row data | [
"Filters",
"the",
"summarydata",
"array",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/renderer.php#L117-L130 |
214,676 | moodle/moodle | mod/quiz/renderer.php | mod_quiz_renderer.review_summary_table | public function review_summary_table($summarydata, $page) {
$summarydata = $this->filter_review_summary_table($summarydata, $page);
if (empty($summarydata)) {
return '';
}
$output = '';
$output .= html_writer::start_tag('table', array(
'class' => 'gen... | php | public function review_summary_table($summarydata, $page) {
$summarydata = $this->filter_review_summary_table($summarydata, $page);
if (empty($summarydata)) {
return '';
}
$output = '';
$output .= html_writer::start_tag('table', array(
'class' => 'gen... | [
"public",
"function",
"review_summary_table",
"(",
"$",
"summarydata",
",",
"$",
"page",
")",
"{",
"$",
"summarydata",
"=",
"$",
"this",
"->",
"filter_review_summary_table",
"(",
"$",
"summarydata",
",",
"$",
"page",
")",
";",
"if",
"(",
"empty",
"(",
"$",... | Outputs the table containing data from summary data array
@param array $summarydata contains row data for table
@param int $page contains the current page number | [
"Outputs",
"the",
"table",
"containing",
"data",
"from",
"summary",
"data",
"array"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/renderer.php#L138-L170 |
214,677 | moodle/moodle | mod/quiz/renderer.php | mod_quiz_renderer.questions | public function questions(quiz_attempt $attemptobj, $reviewing, $slots, $page, $showall,
mod_quiz_display_options $displayoptions) {
$output = '';
foreach ($slots as $slot) {
$output .= $attemptobj->render_question($slot, $reviewing, $this,
$... | php | public function questions(quiz_attempt $attemptobj, $reviewing, $slots, $page, $showall,
mod_quiz_display_options $displayoptions) {
$output = '';
foreach ($slots as $slot) {
$output .= $attemptobj->render_question($slot, $reviewing, $this,
$... | [
"public",
"function",
"questions",
"(",
"quiz_attempt",
"$",
"attemptobj",
",",
"$",
"reviewing",
",",
"$",
"slots",
",",
"$",
"page",
",",
"$",
"showall",
",",
"mod_quiz_display_options",
"$",
"displayoptions",
")",
"{",
"$",
"output",
"=",
"''",
";",
"fo... | Renders each question
@param quiz_attempt $attemptobj instance of quiz_attempt
@param bool $reviewing
@param array $slots array of intgers relating to questions
@param int $page current page number
@param bool $showall if true shows attempt on single page
@param mod_quiz_display_options $displayoptions instance of mod... | [
"Renders",
"each",
"question"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/renderer.php#L182-L190 |
214,678 | moodle/moodle | mod/quiz/renderer.php | mod_quiz_renderer.review_form | public function review_form($page, $showall, $displayoptions, $content, $attemptobj) {
if ($displayoptions->flags != question_display_options::EDITABLE) {
return $content;
}
$this->page->requires->js_init_call('M.mod_quiz.init_review_form', null, false,
quiz_get_js_m... | php | public function review_form($page, $showall, $displayoptions, $content, $attemptobj) {
if ($displayoptions->flags != question_display_options::EDITABLE) {
return $content;
}
$this->page->requires->js_init_call('M.mod_quiz.init_review_form', null, false,
quiz_get_js_m... | [
"public",
"function",
"review_form",
"(",
"$",
"page",
",",
"$",
"showall",
",",
"$",
"displayoptions",
",",
"$",
"content",
",",
"$",
"attemptobj",
")",
"{",
"if",
"(",
"$",
"displayoptions",
"->",
"flags",
"!=",
"question_display_options",
"::",
"EDITABLE"... | Renders the main bit of the review page.
@param array $summarydata contain row data for table
@param int $page current page number
@param mod_quiz_display_options $displayoptions instance of mod_quiz_display_options
@param $content contains each question
@param quiz_attempt $attemptobj instance of quiz_attempt
@param ... | [
"Renders",
"the",
"main",
"bit",
"of",
"the",
"review",
"page",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/renderer.php#L202-L226 |
214,679 | moodle/moodle | mod/quiz/renderer.php | mod_quiz_renderer.finish_review_link | public function finish_review_link(quiz_attempt $attemptobj) {
$url = $attemptobj->view_url();
if ($attemptobj->get_access_manager(time())->attempt_must_be_in_popup()) {
$this->page->requires->js_init_call('M.mod_quiz.secure_window.init_close_button',
array($url), false,... | php | public function finish_review_link(quiz_attempt $attemptobj) {
$url = $attemptobj->view_url();
if ($attemptobj->get_access_manager(time())->attempt_must_be_in_popup()) {
$this->page->requires->js_init_call('M.mod_quiz.secure_window.init_close_button',
array($url), false,... | [
"public",
"function",
"finish_review_link",
"(",
"quiz_attempt",
"$",
"attemptobj",
")",
"{",
"$",
"url",
"=",
"$",
"attemptobj",
"->",
"view_url",
"(",
")",
";",
"if",
"(",
"$",
"attemptobj",
"->",
"get_access_manager",
"(",
"time",
"(",
")",
")",
"->",
... | Returns either a liink or button
@param quiz_attempt $attemptobj instance of quiz_attempt | [
"Returns",
"either",
"a",
"liink",
"or",
"button"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/renderer.php#L233-L248 |
214,680 | moodle/moodle | mod/quiz/renderer.php | mod_quiz_renderer.countdown_timer | public function countdown_timer(quiz_attempt $attemptobj, $timenow) {
$timeleft = $attemptobj->get_time_left_display($timenow);
if ($timeleft !== false) {
$ispreview = $attemptobj->is_preview();
$timerstartvalue = $timeleft;
if (!$ispreview) {
// Make... | php | public function countdown_timer(quiz_attempt $attemptobj, $timenow) {
$timeleft = $attemptobj->get_time_left_display($timenow);
if ($timeleft !== false) {
$ispreview = $attemptobj->is_preview();
$timerstartvalue = $timeleft;
if (!$ispreview) {
// Make... | [
"public",
"function",
"countdown_timer",
"(",
"quiz_attempt",
"$",
"attemptobj",
",",
"$",
"timenow",
")",
"{",
"$",
"timeleft",
"=",
"$",
"attemptobj",
"->",
"get_time_left_display",
"(",
"$",
"timenow",
")",
";",
"if",
"(",
"$",
"timeleft",
"!==",
"false",... | Return the HTML of the quiz timer.
@return string HTML content. | [
"Return",
"the",
"HTML",
"of",
"the",
"quiz",
"timer",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/renderer.php#L283-L301 |
214,681 | moodle/moodle | mod/quiz/renderer.php | mod_quiz_renderer.navigation_panel | public function navigation_panel(quiz_nav_panel_base $panel) {
$output = '';
$userpicture = $panel->user_picture();
if ($userpicture) {
$fullname = fullname($userpicture->user);
if ($userpicture->size === true) {
$fullname = html_writer::div($fullname);
... | php | public function navigation_panel(quiz_nav_panel_base $panel) {
$output = '';
$userpicture = $panel->user_picture();
if ($userpicture) {
$fullname = fullname($userpicture->user);
if ($userpicture->size === true) {
$fullname = html_writer::div($fullname);
... | [
"public",
"function",
"navigation_panel",
"(",
"quiz_nav_panel_base",
"$",
"panel",
")",
"{",
"$",
"output",
"=",
"''",
";",
"$",
"userpicture",
"=",
"$",
"panel",
"->",
"user_picture",
"(",
")",
";",
"if",
"(",
"$",
"userpicture",
")",
"{",
"$",
"fullna... | Outputs the navigation block panel
@param quiz_nav_panel_base $panel instance of quiz_nav_panel_base | [
"Outputs",
"the",
"navigation",
"block",
"panel"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/renderer.php#L317-L345 |
214,682 | moodle/moodle | mod/quiz/renderer.php | mod_quiz_renderer.render_quiz_nav_question_button | protected function render_quiz_nav_question_button(quiz_nav_question_button $button) {
$classes = array('qnbutton', $button->stateclass, $button->navmethod, 'btn', 'btn-secondary');
$extrainfo = array();
if ($button->currentpage) {
$classes[] = 'thispage';
$extrainfo[] =... | php | protected function render_quiz_nav_question_button(quiz_nav_question_button $button) {
$classes = array('qnbutton', $button->stateclass, $button->navmethod, 'btn', 'btn-secondary');
$extrainfo = array();
if ($button->currentpage) {
$classes[] = 'thispage';
$extrainfo[] =... | [
"protected",
"function",
"render_quiz_nav_question_button",
"(",
"quiz_nav_question_button",
"$",
"button",
")",
"{",
"$",
"classes",
"=",
"array",
"(",
"'qnbutton'",
",",
"$",
"button",
"->",
"stateclass",
",",
"$",
"button",
"->",
"navmethod",
",",
"'btn'",
",... | Display a quiz navigation button.
@param quiz_nav_question_button $button
@return string HTML fragment. | [
"Display",
"a",
"quiz",
"navigation",
"button",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/renderer.php#L353-L391 |
214,683 | moodle/moodle | mod/quiz/renderer.php | mod_quiz_renderer.render_mod_quiz_links_to_other_attempts | protected function render_mod_quiz_links_to_other_attempts(
mod_quiz_links_to_other_attempts $links) {
$attemptlinks = array();
foreach ($links->links as $attempt => $url) {
if (!$url) {
$attemptlinks[] = html_writer::tag('strong', $attempt);
} else if... | php | protected function render_mod_quiz_links_to_other_attempts(
mod_quiz_links_to_other_attempts $links) {
$attemptlinks = array();
foreach ($links->links as $attempt => $url) {
if (!$url) {
$attemptlinks[] = html_writer::tag('strong', $attempt);
} else if... | [
"protected",
"function",
"render_mod_quiz_links_to_other_attempts",
"(",
"mod_quiz_links_to_other_attempts",
"$",
"links",
")",
"{",
"$",
"attemptlinks",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"links",
"->",
"links",
"as",
"$",
"attempt",
"=>",
"$",
"... | outputs the link the other attempts.
@param mod_quiz_links_to_other_attempts $links | [
"outputs",
"the",
"link",
"the",
"other",
"attempts",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/renderer.php#L408-L421 |
214,684 | moodle/moodle | mod/quiz/renderer.php | mod_quiz_renderer.quiz_notices | public function quiz_notices($messages) {
if (!$messages) {
return '';
}
return $this->box($this->heading(get_string('accessnoticesheader', 'quiz'), 3) .
$this->access_messages($messages), 'quizaccessnotices');
} | php | public function quiz_notices($messages) {
if (!$messages) {
return '';
}
return $this->box($this->heading(get_string('accessnoticesheader', 'quiz'), 3) .
$this->access_messages($messages), 'quizaccessnotices');
} | [
"public",
"function",
"quiz_notices",
"(",
"$",
"messages",
")",
"{",
"if",
"(",
"!",
"$",
"messages",
")",
"{",
"return",
"''",
";",
"}",
"return",
"$",
"this",
"->",
"box",
"(",
"$",
"this",
"->",
"heading",
"(",
"get_string",
"(",
"'accessnoticeshea... | Returns any notices.
@param array $messages | [
"Returns",
"any",
"notices",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/renderer.php#L460-L466 |
214,685 | moodle/moodle | mod/quiz/renderer.php | mod_quiz_renderer.attempt_form | public function attempt_form($attemptobj, $page, $slots, $id, $nextpage) {
$output = '';
// Start the form.
$output .= html_writer::start_tag('form',
array('action' => new moodle_url($attemptobj->processattempt_url(),
array('cmid' => $attemptobj->get_cmid())), 'm... | php | public function attempt_form($attemptobj, $page, $slots, $id, $nextpage) {
$output = '';
// Start the form.
$output .= html_writer::start_tag('form',
array('action' => new moodle_url($attemptobj->processattempt_url(),
array('cmid' => $attemptobj->get_cmid())), 'm... | [
"public",
"function",
"attempt_form",
"(",
"$",
"attemptobj",
",",
"$",
"page",
",",
"$",
"slots",
",",
"$",
"id",
",",
"$",
"nextpage",
")",
"{",
"$",
"output",
"=",
"''",
";",
"// Start the form.",
"$",
"output",
".=",
"html_writer",
"::",
"start_tag",... | Ouputs the form for making an attempt
@param quiz_attempt $attemptobj
@param int $page Current page number
@param array $slots Array of integers relating to questions
@param int $id ID of the attempt
@param int $nextpage Next page number | [
"Ouputs",
"the",
"form",
"for",
"making",
"an",
"attempt"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/renderer.php#L477-L524 |
214,686 | moodle/moodle | mod/quiz/renderer.php | mod_quiz_renderer.redo_question_button | public function redo_question_button($slot, $disabled) {
$attributes = array('type' => 'submit', 'name' => 'redoslot' . $slot,
'value' => get_string('redoquestion', 'quiz'), 'class' => 'mod_quiz-redo_question_button');
if ($disabled) {
$attributes['disabled'] = 'disabled';
... | php | public function redo_question_button($slot, $disabled) {
$attributes = array('type' => 'submit', 'name' => 'redoslot' . $slot,
'value' => get_string('redoquestion', 'quiz'), 'class' => 'mod_quiz-redo_question_button');
if ($disabled) {
$attributes['disabled'] = 'disabled';
... | [
"public",
"function",
"redo_question_button",
"(",
"$",
"slot",
",",
"$",
"disabled",
")",
"{",
"$",
"attributes",
"=",
"array",
"(",
"'type'",
"=>",
"'submit'",
",",
"'name'",
"=>",
"'redoslot'",
".",
"$",
"slot",
",",
"'value'",
"=>",
"get_string",
"(",
... | Render a button which allows students to redo a question in the attempt.
@param int $slot the number of the slot to generate the button for.
@param bool $disabled if true, output the button disabled.
@return string HTML fragment. | [
"Render",
"a",
"button",
"which",
"allows",
"students",
"to",
"redo",
"a",
"question",
"in",
"the",
"attempt",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/renderer.php#L561-L568 |
214,687 | moodle/moodle | mod/quiz/renderer.php | mod_quiz_renderer.initialise_timer | public function initialise_timer($timerstartvalue, $ispreview) {
$options = array($timerstartvalue, (bool)$ispreview);
$this->page->requires->js_init_call('M.mod_quiz.timer.init', $options, false, quiz_get_js_module());
} | php | public function initialise_timer($timerstartvalue, $ispreview) {
$options = array($timerstartvalue, (bool)$ispreview);
$this->page->requires->js_init_call('M.mod_quiz.timer.init', $options, false, quiz_get_js_module());
} | [
"public",
"function",
"initialise_timer",
"(",
"$",
"timerstartvalue",
",",
"$",
"ispreview",
")",
"{",
"$",
"options",
"=",
"array",
"(",
"$",
"timerstartvalue",
",",
"(",
"bool",
")",
"$",
"ispreview",
")",
";",
"$",
"this",
"->",
"page",
"->",
"requir... | Output the JavaScript required to initialise the countdown timer.
@param int $timerstartvalue time remaining, in seconds. | [
"Output",
"the",
"JavaScript",
"required",
"to",
"initialise",
"the",
"countdown",
"timer",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/renderer.php#L574-L577 |
214,688 | moodle/moodle | mod/quiz/renderer.php | mod_quiz_renderer.close_attempt_popup | public function close_attempt_popup($url, $message = '') {
$output = '';
$output .= $this->header();
$output .= $this->box_start();
if ($message) {
$output .= html_writer::tag('p', $message);
$output .= html_writer::tag('p', get_string('windowclosing', 'quiz'));
... | php | public function close_attempt_popup($url, $message = '') {
$output = '';
$output .= $this->header();
$output .= $this->box_start();
if ($message) {
$output .= html_writer::tag('p', $message);
$output .= html_writer::tag('p', get_string('windowclosing', 'quiz'));
... | [
"public",
"function",
"close_attempt_popup",
"(",
"$",
"url",
",",
"$",
"message",
"=",
"''",
")",
"{",
"$",
"output",
"=",
"''",
";",
"$",
"output",
".=",
"$",
"this",
"->",
"header",
"(",
")",
";",
"$",
"output",
".=",
"$",
"this",
"->",
"box_sta... | Output a page with an optional message, and JavaScript code to close the
current window and redirect the parent window to a new URL.
@param moodle_url $url the URL to redirect the parent window to.
@param string $message message to display before closing the window. (optional)
@return string HTML to output. | [
"Output",
"a",
"page",
"with",
"an",
"optional",
"message",
"and",
"JavaScript",
"code",
"to",
"close",
"the",
"current",
"window",
"and",
"redirect",
"the",
"parent",
"window",
"to",
"a",
"new",
"URL",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/renderer.php#L586-L605 |
214,689 | moodle/moodle | mod/quiz/renderer.php | mod_quiz_renderer.summary_page | public function summary_page($attemptobj, $displayoptions) {
$output = '';
$output .= $this->header();
$output .= $this->heading(format_string($attemptobj->get_quiz_name()));
$output .= $this->heading(get_string('summaryofattempt', 'quiz'), 3);
$output .= $this->summary_table($at... | php | public function summary_page($attemptobj, $displayoptions) {
$output = '';
$output .= $this->header();
$output .= $this->heading(format_string($attemptobj->get_quiz_name()));
$output .= $this->heading(get_string('summaryofattempt', 'quiz'), 3);
$output .= $this->summary_table($at... | [
"public",
"function",
"summary_page",
"(",
"$",
"attemptobj",
",",
"$",
"displayoptions",
")",
"{",
"$",
"output",
"=",
"''",
";",
"$",
"output",
".=",
"$",
"this",
"->",
"header",
"(",
")",
";",
"$",
"output",
".=",
"$",
"this",
"->",
"heading",
"("... | Create the summary page
@param quiz_attempt $attemptobj
@param mod_quiz_display_options $displayoptions | [
"Create",
"the",
"summary",
"page"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/renderer.php#L632-L641 |
214,690 | moodle/moodle | mod/quiz/renderer.php | mod_quiz_renderer.summary_table | public function summary_table($attemptobj, $displayoptions) {
// Prepare the summary table header.
$table = new html_table();
$table->attributes['class'] = 'generaltable quizsummaryofattempt boxaligncenter';
$table->head = array(get_string('question', 'quiz'), get_string('status', 'quiz'... | php | public function summary_table($attemptobj, $displayoptions) {
// Prepare the summary table header.
$table = new html_table();
$table->attributes['class'] = 'generaltable quizsummaryofattempt boxaligncenter';
$table->head = array(get_string('question', 'quiz'), get_string('status', 'quiz'... | [
"public",
"function",
"summary_table",
"(",
"$",
"attemptobj",
",",
"$",
"displayoptions",
")",
"{",
"// Prepare the summary table header.",
"$",
"table",
"=",
"new",
"html_table",
"(",
")",
";",
"$",
"table",
"->",
"attributes",
"[",
"'class'",
"]",
"=",
"'ge... | Generates the table of summarydata
@param quiz_attempt $attemptobj
@param mod_quiz_display_options $displayoptions | [
"Generates",
"the",
"table",
"of",
"summarydata"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/renderer.php#L649-L710 |
214,691 | moodle/moodle | mod/quiz/renderer.php | mod_quiz_renderer.summary_page_controls | public function summary_page_controls($attemptobj) {
$output = '';
// Return to place button.
if ($attemptobj->get_state() == quiz_attempt::IN_PROGRESS) {
$button = new single_button(
new moodle_url($attemptobj->attempt_url(null, $attemptobj->get_currentpage())),... | php | public function summary_page_controls($attemptobj) {
$output = '';
// Return to place button.
if ($attemptobj->get_state() == quiz_attempt::IN_PROGRESS) {
$button = new single_button(
new moodle_url($attemptobj->attempt_url(null, $attemptobj->get_currentpage())),... | [
"public",
"function",
"summary_page_controls",
"(",
"$",
"attemptobj",
")",
"{",
"$",
"output",
"=",
"''",
";",
"// Return to place button.",
"if",
"(",
"$",
"attemptobj",
"->",
"get_state",
"(",
")",
"==",
"quiz_attempt",
"::",
"IN_PROGRESS",
")",
"{",
"$",
... | Creates any controls a the page should have.
@param quiz_attempt $attemptobj | [
"Creates",
"any",
"controls",
"a",
"the",
"page",
"should",
"have",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/renderer.php#L717-L762 |
214,692 | moodle/moodle | mod/quiz/renderer.php | mod_quiz_renderer.view_page | public function view_page($course, $quiz, $cm, $context, $viewobj) {
$output = '';
$output .= $this->view_information($quiz, $cm, $context, $viewobj->infomessages);
$output .= $this->view_table($quiz, $context, $viewobj);
$output .= $this->view_result_info($quiz, $context, $cm, $viewobj)... | php | public function view_page($course, $quiz, $cm, $context, $viewobj) {
$output = '';
$output .= $this->view_information($quiz, $cm, $context, $viewobj->infomessages);
$output .= $this->view_table($quiz, $context, $viewobj);
$output .= $this->view_result_info($quiz, $context, $cm, $viewobj)... | [
"public",
"function",
"view_page",
"(",
"$",
"course",
",",
"$",
"quiz",
",",
"$",
"cm",
",",
"$",
"context",
",",
"$",
"viewobj",
")",
"{",
"$",
"output",
"=",
"''",
";",
"$",
"output",
".=",
"$",
"this",
"->",
"view_information",
"(",
"$",
"quiz"... | Generates the view page
@param int $course The id of the course
@param array $quiz Array conting quiz data
@param int $cm Course Module ID
@param int $context The page context ID
@param array $infomessages information about this quiz
@param mod_quiz_view_object $viewobj
@param string $buttontext text for the start/con... | [
"Generates",
"the",
"view",
"page"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/renderer.php#L781-L788 |
214,693 | moodle/moodle | mod/quiz/renderer.php | mod_quiz_renderer.view_page_buttons | public function view_page_buttons(mod_quiz_view_object $viewobj) {
global $CFG;
$output = '';
if (!$viewobj->quizhasquestions) {
$output .= $this->no_questions_message($viewobj->canedit, $viewobj->editurl);
}
$output .= $this->access_messages($viewobj->preventmessag... | php | public function view_page_buttons(mod_quiz_view_object $viewobj) {
global $CFG;
$output = '';
if (!$viewobj->quizhasquestions) {
$output .= $this->no_questions_message($viewobj->canedit, $viewobj->editurl);
}
$output .= $this->access_messages($viewobj->preventmessag... | [
"public",
"function",
"view_page_buttons",
"(",
"mod_quiz_view_object",
"$",
"viewobj",
")",
"{",
"global",
"$",
"CFG",
";",
"$",
"output",
"=",
"''",
";",
"if",
"(",
"!",
"$",
"viewobj",
"->",
"quizhasquestions",
")",
"{",
"$",
"output",
".=",
"$",
"thi... | Work out, and render, whatever buttons, and surrounding info, should appear
at the end of the review page.
@param mod_quiz_view_object $viewobj the information required to display
the view page.
@return string HTML to output. | [
"Work",
"out",
"and",
"render",
"whatever",
"buttons",
"and",
"surrounding",
"info",
"should",
"appear",
"at",
"the",
"end",
"of",
"the",
"review",
"page",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/renderer.php#L797-L820 |
214,694 | moodle/moodle | mod/quiz/renderer.php | mod_quiz_renderer.start_attempt_button | public function start_attempt_button($buttontext, moodle_url $url,
mod_quiz_preflight_check_form $preflightcheckform = null,
$popuprequired = false, $popupoptions = null) {
if (is_string($preflightcheckform)) {
// Calling code was not updated since the API change.
... | php | public function start_attempt_button($buttontext, moodle_url $url,
mod_quiz_preflight_check_form $preflightcheckform = null,
$popuprequired = false, $popupoptions = null) {
if (is_string($preflightcheckform)) {
// Calling code was not updated since the API change.
... | [
"public",
"function",
"start_attempt_button",
"(",
"$",
"buttontext",
",",
"moodle_url",
"$",
"url",
",",
"mod_quiz_preflight_check_form",
"$",
"preflightcheckform",
"=",
"null",
",",
"$",
"popuprequired",
"=",
"false",
",",
"$",
"popupoptions",
"=",
"null",
")",
... | Generates the view attempt button
@param string $buttontext the label to display on the button.
@param moodle_url $url The URL to POST to in order to start the attempt.
@param mod_quiz_preflight_check_form $preflightcheckform deprecated.
@param bool $popuprequired whether the attempt needs to be opened in a pop-up.
@p... | [
"Generates",
"the",
"view",
"attempt",
"button"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/renderer.php#L832-L866 |
214,695 | moodle/moodle | mod/quiz/renderer.php | mod_quiz_renderer.no_questions_message | public function no_questions_message($canedit, $editurl) {
$output = '';
$output .= $this->notification(get_string('noquestions', 'quiz'));
if ($canedit) {
$output .= $this->single_button($editurl, get_string('editquiz', 'quiz'), 'get');
}
return $output;
} | php | public function no_questions_message($canedit, $editurl) {
$output = '';
$output .= $this->notification(get_string('noquestions', 'quiz'));
if ($canedit) {
$output .= $this->single_button($editurl, get_string('editquiz', 'quiz'), 'get');
}
return $output;
} | [
"public",
"function",
"no_questions_message",
"(",
"$",
"canedit",
",",
"$",
"editurl",
")",
"{",
"$",
"output",
"=",
"''",
";",
"$",
"output",
".=",
"$",
"this",
"->",
"notification",
"(",
"get_string",
"(",
"'noquestions'",
",",
"'quiz'",
")",
")",
";"... | Generate a message saying that this quiz has no questions, with a button to
go to the edit page, if the user has the right capability.
@param object $quiz the quiz settings.
@param object $cm the course_module object.
@param object $context the quiz context.
@return string HTML to output. | [
"Generate",
"a",
"message",
"saying",
"that",
"this",
"quiz",
"has",
"no",
"questions",
"with",
"a",
"button",
"to",
"go",
"to",
"the",
"edit",
"page",
"if",
"the",
"user",
"has",
"the",
"right",
"capability",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/renderer.php#L876-L884 |
214,696 | moodle/moodle | mod/quiz/renderer.php | mod_quiz_renderer.view_page_guest | public function view_page_guest($course, $quiz, $cm, $context, $messages) {
$output = '';
$output .= $this->view_information($quiz, $cm, $context, $messages);
$guestno = html_writer::tag('p', get_string('guestsno', 'quiz'));
$liketologin = html_writer::tag('p', get_string('liketologin'))... | php | public function view_page_guest($course, $quiz, $cm, $context, $messages) {
$output = '';
$output .= $this->view_information($quiz, $cm, $context, $messages);
$guestno = html_writer::tag('p', get_string('guestsno', 'quiz'));
$liketologin = html_writer::tag('p', get_string('liketologin'))... | [
"public",
"function",
"view_page_guest",
"(",
"$",
"course",
",",
"$",
"quiz",
",",
"$",
"cm",
",",
"$",
"context",
",",
"$",
"messages",
")",
"{",
"$",
"output",
"=",
"''",
";",
"$",
"output",
".=",
"$",
"this",
"->",
"view_information",
"(",
"$",
... | Outputs an error message for any guests accessing the quiz
@param int $course The course ID
@param array $quiz Array contingin quiz data
@param int $cm Course Module ID
@param int $context The page contect ID
@param array $messages Array containing any messages | [
"Outputs",
"an",
"error",
"message",
"for",
"any",
"guests",
"accessing",
"the",
"quiz"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/renderer.php#L895-L903 |
214,697 | moodle/moodle | mod/quiz/renderer.php | mod_quiz_renderer.view_page_notenrolled | public function view_page_notenrolled($course, $quiz, $cm, $context, $messages) {
global $CFG;
$output = '';
$output .= $this->view_information($quiz, $cm, $context, $messages);
$youneedtoenrol = html_writer::tag('p', get_string('youneedtoenrol', 'quiz'));
$button = html_writer::... | php | public function view_page_notenrolled($course, $quiz, $cm, $context, $messages) {
global $CFG;
$output = '';
$output .= $this->view_information($quiz, $cm, $context, $messages);
$youneedtoenrol = html_writer::tag('p', get_string('youneedtoenrol', 'quiz'));
$button = html_writer::... | [
"public",
"function",
"view_page_notenrolled",
"(",
"$",
"course",
",",
"$",
"quiz",
",",
"$",
"cm",
",",
"$",
"context",
",",
"$",
"messages",
")",
"{",
"global",
"$",
"CFG",
";",
"$",
"output",
"=",
"''",
";",
"$",
"output",
".=",
"$",
"this",
"-... | Outputs and error message for anyone who is not enrolle don the course
@param int $course The course ID
@param array $quiz Array contingin quiz data
@param int $cm Course Module ID
@param int $context The page contect ID
@param array $messages Array containing any messages | [
"Outputs",
"and",
"error",
"message",
"for",
"anyone",
"who",
"is",
"not",
"enrolle",
"don",
"the",
"course"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/renderer.php#L914-L923 |
214,698 | moodle/moodle | mod/quiz/renderer.php | mod_quiz_renderer.view_information | public function view_information($quiz, $cm, $context, $messages) {
global $CFG;
$output = '';
// Print quiz name and description.
$output .= $this->heading(format_string($quiz->name));
$output .= $this->quiz_intro($quiz, $cm);
// Output any access messages.
if... | php | public function view_information($quiz, $cm, $context, $messages) {
global $CFG;
$output = '';
// Print quiz name and description.
$output .= $this->heading(format_string($quiz->name));
$output .= $this->quiz_intro($quiz, $cm);
// Output any access messages.
if... | [
"public",
"function",
"view_information",
"(",
"$",
"quiz",
",",
"$",
"cm",
",",
"$",
"context",
",",
"$",
"messages",
")",
"{",
"global",
"$",
"CFG",
";",
"$",
"output",
"=",
"''",
";",
"// Print quiz name and description.",
"$",
"output",
".=",
"$",
"t... | Output the page information
@param object $quiz the quiz settings.
@param object $cm the course_module object.
@param object $context the quiz context.
@param array $messages any access messages that should be described.
@return string HTML to output. | [
"Output",
"the",
"page",
"information"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/renderer.php#L934-L957 |
214,699 | moodle/moodle | mod/quiz/renderer.php | mod_quiz_renderer.quiz_intro | public function quiz_intro($quiz, $cm) {
if (html_is_blank($quiz->intro)) {
return '';
}
return $this->box(format_module_intro('quiz', $quiz, $cm->id), 'generalbox', 'intro');
} | php | public function quiz_intro($quiz, $cm) {
if (html_is_blank($quiz->intro)) {
return '';
}
return $this->box(format_module_intro('quiz', $quiz, $cm->id), 'generalbox', 'intro');
} | [
"public",
"function",
"quiz_intro",
"(",
"$",
"quiz",
",",
"$",
"cm",
")",
"{",
"if",
"(",
"html_is_blank",
"(",
"$",
"quiz",
"->",
"intro",
")",
")",
"{",
"return",
"''",
";",
"}",
"return",
"$",
"this",
"->",
"box",
"(",
"format_module_intro",
"(",... | Output the quiz intro.
@param object $quiz the quiz settings.
@param object $cm the course_module object.
@return string HTML to output. | [
"Output",
"the",
"quiz",
"intro",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/renderer.php#L965-L971 |
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.