id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
216,400 | moodle/moodle | mod/quiz/classes/output/edit_renderer.php | edit_renderer.quiz_information | public function quiz_information(structure $structure) {
list($currentstatus, $explanation) = $structure->get_dates_summary();
$output = html_writer::span(
get_string('numquestionsx', 'quiz', $structure->get_question_count()),
'numberofquestions') . ' | ' .
... | php | public function quiz_information(structure $structure) {
list($currentstatus, $explanation) = $structure->get_dates_summary();
$output = html_writer::span(
get_string('numquestionsx', 'quiz', $structure->get_question_count()),
'numberofquestions') . ' | ' .
... | [
"public",
"function",
"quiz_information",
"(",
"structure",
"$",
"structure",
")",
"{",
"list",
"(",
"$",
"currentstatus",
",",
"$",
"explanation",
")",
"=",
"$",
"structure",
"->",
"get_dates_summary",
"(",
")",
";",
"$",
"output",
"=",
"html_writer",
"::",... | Render the status bar.
@param structure $structure the quiz structure.
@return string HTML to output. | [
"Render",
"the",
"status",
"bar",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/classes/output/edit_renderer.php#L148-L158 |
216,401 | moodle/moodle | mod/quiz/classes/output/edit_renderer.php | edit_renderer.maximum_grade_input | public function maximum_grade_input($structure, \moodle_url $pageurl) {
$output = '';
$output .= html_writer::start_div('maxgrade');
$output .= html_writer::start_tag('form', array('method' => 'post', 'action' => 'edit.php',
'class' => 'quizsavegradesform form-inline'));
... | php | public function maximum_grade_input($structure, \moodle_url $pageurl) {
$output = '';
$output .= html_writer::start_div('maxgrade');
$output .= html_writer::start_tag('form', array('method' => 'post', 'action' => 'edit.php',
'class' => 'quizsavegradesform form-inline'));
... | [
"public",
"function",
"maximum_grade_input",
"(",
"$",
"structure",
",",
"\\",
"moodle_url",
"$",
"pageurl",
")",
"{",
"$",
"output",
"=",
"''",
";",
"$",
"output",
".=",
"html_writer",
"::",
"start_div",
"(",
"'maxgrade'",
")",
";",
"$",
"output",
".=",
... | Render the form for setting a quiz' overall grade
@param structure $structure the quiz structure.
@param \moodle_url $pageurl the canonical URL of this page.
@return string HTML to output. | [
"Render",
"the",
"form",
"for",
"setting",
"a",
"quiz",
"overall",
"grade"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/classes/output/edit_renderer.php#L167-L187 |
216,402 | moodle/moodle | mod/quiz/classes/output/edit_renderer.php | edit_renderer.repaginate_button | protected function repaginate_button(structure $structure, \moodle_url $pageurl) {
$header = html_writer::tag('span', get_string('repaginatecommand', 'quiz'), array('class' => 'repaginatecommand'));
$form = $this->repaginate_form($structure, $pageurl);
$buttonoptions = array(
'type'... | php | protected function repaginate_button(structure $structure, \moodle_url $pageurl) {
$header = html_writer::tag('span', get_string('repaginatecommand', 'quiz'), array('class' => 'repaginatecommand'));
$form = $this->repaginate_form($structure, $pageurl);
$buttonoptions = array(
'type'... | [
"protected",
"function",
"repaginate_button",
"(",
"structure",
"$",
"structure",
",",
"\\",
"moodle_url",
"$",
"pageurl",
")",
"{",
"$",
"header",
"=",
"html_writer",
"::",
"tag",
"(",
"'span'",
",",
"get_string",
"(",
"'repaginatecommand'",
",",
"'quiz'",
")... | Return the repaginate button
@param structure $structure the structure of the quiz being edited.
@param \moodle_url $pageurl the canonical URL of this page.
@return string HTML to output. | [
"Return",
"the",
"repaginate",
"button"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/classes/output/edit_renderer.php#L195-L215 |
216,403 | moodle/moodle | mod/quiz/classes/output/edit_renderer.php | edit_renderer.selectmultiple_button | protected function selectmultiple_button(structure $structure) {
$buttonoptions = array(
'type' => 'button',
'name' => 'selectmultiple',
'id' => 'selectmultiplecommand',
'value' => get_string('selectmultipleitems', 'quiz'),
'class' => 'btn btn-sec... | php | protected function selectmultiple_button(structure $structure) {
$buttonoptions = array(
'type' => 'button',
'name' => 'selectmultiple',
'id' => 'selectmultiplecommand',
'value' => get_string('selectmultipleitems', 'quiz'),
'class' => 'btn btn-sec... | [
"protected",
"function",
"selectmultiple_button",
"(",
"structure",
"$",
"structure",
")",
"{",
"$",
"buttonoptions",
"=",
"array",
"(",
"'type'",
"=>",
"'button'",
",",
"'name'",
"=>",
"'selectmultiple'",
",",
"'id'",
"=>",
"'selectmultiplecommand'",
",",
"'value... | Generate the bulk action button.
@param structure $structure the structure of the quiz being edited.
@return string HTML to output. | [
"Generate",
"the",
"bulk",
"action",
"button",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/classes/output/edit_renderer.php#L223-L236 |
216,404 | moodle/moodle | mod/quiz/classes/output/edit_renderer.php | edit_renderer.selectmultiple_controls | protected function selectmultiple_controls(structure $structure) {
$output = '';
// Bulk action button delete and bulk action button cancel.
$buttondeleteoptions = array(
'type' => 'button',
'id' => 'selectmultipledeletecommand',
'value' => get_string('delete... | php | protected function selectmultiple_controls(structure $structure) {
$output = '';
// Bulk action button delete and bulk action button cancel.
$buttondeleteoptions = array(
'type' => 'button',
'id' => 'selectmultipledeletecommand',
'value' => get_string('delete... | [
"protected",
"function",
"selectmultiple_controls",
"(",
"structure",
"$",
"structure",
")",
"{",
"$",
"output",
"=",
"''",
";",
"// Bulk action button delete and bulk action button cancel.",
"$",
"buttondeleteoptions",
"=",
"array",
"(",
"'type'",
"=>",
"'button'",
","... | Generate the controls that appear when the bulk action button is pressed.
@param structure $structure the structure of the quiz being edited.
@return string HTML to output. | [
"Generate",
"the",
"controls",
"that",
"appear",
"when",
"the",
"bulk",
"action",
"button",
"is",
"pressed",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/classes/output/edit_renderer.php#L244-L297 |
216,405 | moodle/moodle | mod/quiz/classes/output/edit_renderer.php | edit_renderer.repaginate_form | protected function repaginate_form(structure $structure, \moodle_url $pageurl) {
$perpage = array();
$perpage[0] = get_string('allinone', 'quiz');
for ($i = 1; $i <= 50; ++$i) {
$perpage[$i] = $i;
}
$hiddenurl = clone($pageurl);
$hiddenurl->param('sesskey', s... | php | protected function repaginate_form(structure $structure, \moodle_url $pageurl) {
$perpage = array();
$perpage[0] = get_string('allinone', 'quiz');
for ($i = 1; $i <= 50; ++$i) {
$perpage[$i] = $i;
}
$hiddenurl = clone($pageurl);
$hiddenurl->param('sesskey', s... | [
"protected",
"function",
"repaginate_form",
"(",
"structure",
"$",
"structure",
",",
"\\",
"moodle_url",
"$",
"pageurl",
")",
"{",
"$",
"perpage",
"=",
"array",
"(",
")",
";",
"$",
"perpage",
"[",
"0",
"]",
"=",
"get_string",
"(",
"'allinone'",
",",
"'qu... | Return the repaginate form
@param structure $structure the structure of the quiz being edited.
@param \moodle_url $pageurl the canonical URL of this page.
@return string HTML to output. | [
"Return",
"the",
"repaginate",
"form"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/classes/output/edit_renderer.php#L305-L332 |
216,406 | moodle/moodle | mod/quiz/classes/output/edit_renderer.php | edit_renderer.total_marks | public function total_marks($quiz) {
$totalmark = html_writer::span(quiz_format_grade($quiz, $quiz->sumgrades), 'mod_quiz_summarks');
return html_writer::tag('span',
get_string('totalmarksx', 'quiz', $totalmark),
array('class' => 'totalpoints'));
} | php | public function total_marks($quiz) {
$totalmark = html_writer::span(quiz_format_grade($quiz, $quiz->sumgrades), 'mod_quiz_summarks');
return html_writer::tag('span',
get_string('totalmarksx', 'quiz', $totalmark),
array('class' => 'totalpoints'));
} | [
"public",
"function",
"total_marks",
"(",
"$",
"quiz",
")",
"{",
"$",
"totalmark",
"=",
"html_writer",
"::",
"span",
"(",
"quiz_format_grade",
"(",
"$",
"quiz",
",",
"$",
"quiz",
"->",
"sumgrades",
")",
",",
"'mod_quiz_summarks'",
")",
";",
"return",
"html... | Render the total marks available for the quiz.
@param \stdClass $quiz the quiz settings from the database.
@return string HTML to output. | [
"Render",
"the",
"total",
"marks",
"available",
"for",
"the",
"quiz",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/classes/output/edit_renderer.php#L340-L345 |
216,407 | moodle/moodle | mod/quiz/classes/output/edit_renderer.php | edit_renderer.start_section | protected function start_section($structure, $section) {
$output = '';
$sectionstyle = '';
if ($structure->is_only_one_slot_in_section($section)) {
$sectionstyle = ' only-has-one-slot';
}
$output .= html_writer::start_tag('li', array('id' => 'section-'.$section->id... | php | protected function start_section($structure, $section) {
$output = '';
$sectionstyle = '';
if ($structure->is_only_one_slot_in_section($section)) {
$sectionstyle = ' only-has-one-slot';
}
$output .= html_writer::start_tag('li', array('id' => 'section-'.$section->id... | [
"protected",
"function",
"start_section",
"(",
"$",
"structure",
",",
"$",
"section",
")",
"{",
"$",
"output",
"=",
"''",
";",
"$",
"sectionstyle",
"=",
"''",
";",
"if",
"(",
"$",
"structure",
"->",
"is_only_one_slot_in_section",
"(",
"$",
"section",
")",
... | Display the start of a section, before the questions.
@param structure $structure the structure of the quiz being edited.
@param \stdClass $section The quiz_section entry from DB
@return string HTML to output. | [
"Display",
"the",
"start",
"of",
"a",
"section",
"before",
"the",
"questions",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/classes/output/edit_renderer.php#L375-L413 |
216,408 | moodle/moodle | mod/quiz/classes/output/edit_renderer.php | edit_renderer.section_shuffle_questions | public function section_shuffle_questions(structure $structure, $section) {
$checkboxattributes = array(
'type' => 'checkbox',
'id' => 'shuffle-' . $section->id,
'value' => 1,
'data-action' => 'shuffle_questions',
'class' => 'cm-edit-action',
)... | php | public function section_shuffle_questions(structure $structure, $section) {
$checkboxattributes = array(
'type' => 'checkbox',
'id' => 'shuffle-' . $section->id,
'value' => 1,
'data-action' => 'shuffle_questions',
'class' => 'cm-edit-action',
)... | [
"public",
"function",
"section_shuffle_questions",
"(",
"structure",
"$",
"structure",
",",
"$",
"section",
")",
"{",
"$",
"checkboxattributes",
"=",
"array",
"(",
"'type'",
"=>",
"'checkbox'",
",",
"'id'",
"=>",
"'shuffle-'",
".",
"$",
"section",
"->",
"id",
... | Display a checkbox for shuffling question within a section.
@param structure $structure object containing the structure of the quiz.
@param \stdClass $section data from the quiz_section table.
@return string HTML to output. | [
"Display",
"a",
"checkbox",
"for",
"shuffling",
"question",
"within",
"a",
"section",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/classes/output/edit_renderer.php#L422-L451 |
216,409 | moodle/moodle | mod/quiz/classes/output/edit_renderer.php | edit_renderer.section_remove_icon | public function section_remove_icon($section) {
$title = get_string('sectionheadingremove', 'quiz', $section->heading);
$url = new \moodle_url('/mod/quiz/edit.php',
array('sesskey' => sesskey(), 'removesection' => '1', 'sectionid' => $section->id));
$image = $this->pix_icon('t/de... | php | public function section_remove_icon($section) {
$title = get_string('sectionheadingremove', 'quiz', $section->heading);
$url = new \moodle_url('/mod/quiz/edit.php',
array('sesskey' => sesskey(), 'removesection' => '1', 'sectionid' => $section->id));
$image = $this->pix_icon('t/de... | [
"public",
"function",
"section_remove_icon",
"(",
"$",
"section",
")",
"{",
"$",
"title",
"=",
"get_string",
"(",
"'sectionheadingremove'",
",",
"'quiz'",
",",
"$",
"section",
"->",
"heading",
")",
";",
"$",
"url",
"=",
"new",
"\\",
"moodle_url",
"(",
"'/m... | Render an icon to remove a section from the quiz.
@param object $section the section to be removed.
@return string HTML to output. | [
"Render",
"an",
"icon",
"to",
"remove",
"a",
"section",
"from",
"the",
"quiz",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/classes/output/edit_renderer.php#L471-L478 |
216,410 | moodle/moodle | mod/quiz/classes/output/edit_renderer.php | edit_renderer.questions_in_section | public function questions_in_section(structure $structure, $section,
$contexts, $pagevars, $pageurl) {
$output = '';
foreach ($structure->get_slots_in_section($section->id) as $slot) {
$output .= $this->question_row($structure, $slot, $contexts, $pagevars, $pageurl);
}
... | php | public function questions_in_section(structure $structure, $section,
$contexts, $pagevars, $pageurl) {
$output = '';
foreach ($structure->get_slots_in_section($section->id) as $slot) {
$output .= $this->question_row($structure, $slot, $contexts, $pagevars, $pageurl);
}
... | [
"public",
"function",
"questions_in_section",
"(",
"structure",
"$",
"structure",
",",
"$",
"section",
",",
"$",
"contexts",
",",
"$",
"pagevars",
",",
"$",
"pageurl",
")",
"{",
"$",
"output",
"=",
"''",
";",
"foreach",
"(",
"$",
"structure",
"->",
"get_... | Renders HTML to display the questions in a section of the quiz.
This function calls {@link core_course_renderer::quiz_section_question()}
@param structure $structure object containing the structure of the quiz.
@param \stdClass $section information about the section.
@param \question_edit_contexts $contexts the relev... | [
"Renders",
"HTML",
"to",
"display",
"the",
"questions",
"in",
"a",
"section",
"of",
"the",
"quiz",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/classes/output/edit_renderer.php#L492-L500 |
216,411 | moodle/moodle | mod/quiz/classes/output/edit_renderer.php | edit_renderer.add_menu_actions | public function add_menu_actions(structure $structure, $page, \moodle_url $pageurl,
\question_edit_contexts $contexts, array $pagevars) {
$actions = $this->edit_menu_actions($structure, $page, $pageurl, $pagevars);
if (empty($actions)) {
return '';
}
$menu = new ... | php | public function add_menu_actions(structure $structure, $page, \moodle_url $pageurl,
\question_edit_contexts $contexts, array $pagevars) {
$actions = $this->edit_menu_actions($structure, $page, $pageurl, $pagevars);
if (empty($actions)) {
return '';
}
$menu = new ... | [
"public",
"function",
"add_menu_actions",
"(",
"structure",
"$",
"structure",
",",
"$",
"page",
",",
"\\",
"moodle_url",
"$",
"pageurl",
",",
"\\",
"question_edit_contexts",
"$",
"contexts",
",",
"array",
"$",
"pagevars",
")",
"{",
"$",
"actions",
"=",
"$",
... | Returns the add menu that is output once per page.
@param structure $structure object containing the structure of the quiz.
@param int $page the page number that this menu will add to.
@param \moodle_url $pageurl the canonical URL of this page.
@param \question_edit_contexts $contexts the relevant question bank context... | [
"Returns",
"the",
"add",
"menu",
"that",
"is",
"output",
"once",
"per",
"page",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/classes/output/edit_renderer.php#L578-L611 |
216,412 | moodle/moodle | mod/quiz/classes/output/edit_renderer.php | edit_renderer.add_question_form | protected function add_question_form(structure $structure, $page, \moodle_url $pageurl, array $pagevars) {
$questioncategoryid = question_get_category_id_from_pagevars($pagevars);
$output = html_writer::tag('input', null,
array('type' => 'hidden', 'name' => 'returnurl',
... | php | protected function add_question_form(structure $structure, $page, \moodle_url $pageurl, array $pagevars) {
$questioncategoryid = question_get_category_id_from_pagevars($pagevars);
$output = html_writer::tag('input', null,
array('type' => 'hidden', 'name' => 'returnurl',
... | [
"protected",
"function",
"add_question_form",
"(",
"structure",
"$",
"structure",
",",
"$",
"page",
",",
"\\",
"moodle_url",
"$",
"pageurl",
",",
"array",
"$",
"pagevars",
")",
"{",
"$",
"questioncategoryid",
"=",
"question_get_category_id_from_pagevars",
"(",
"$"... | Render the form that contains the data for adding a new question to the quiz.
@param structure $structure object containing the structure of the quiz.
@param int $page the page number that this menu will add to.
@param \moodle_url $pageurl the canonical URL of this page.
@param array $pagevars the variables from {@lin... | [
"Render",
"the",
"form",
"that",
"contains",
"the",
"data",
"for",
"adding",
"a",
"new",
"question",
"to",
"the",
"quiz",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/classes/output/edit_renderer.php#L693-L710 |
216,413 | moodle/moodle | mod/quiz/classes/output/edit_renderer.php | edit_renderer.question | public function question(structure $structure, $slot, \moodle_url $pageurl) {
$output = '';
$output .= html_writer::start_tag('div');
if ($structure->can_be_edited()) {
$output .= $this->question_move_icon($structure, $slot);
}
$output .= html_writer::start_div('mod... | php | public function question(structure $structure, $slot, \moodle_url $pageurl) {
$output = '';
$output .= html_writer::start_tag('div');
if ($structure->can_be_edited()) {
$output .= $this->question_move_icon($structure, $slot);
}
$output .= html_writer::start_div('mod... | [
"public",
"function",
"question",
"(",
"structure",
"$",
"structure",
",",
"$",
"slot",
",",
"\\",
"moodle_url",
"$",
"pageurl",
")",
"{",
"$",
"output",
"=",
"''",
";",
"$",
"output",
".=",
"html_writer",
"::",
"start_tag",
"(",
"'div'",
")",
";",
"if... | Display a question.
@param structure $structure object containing the structure of the quiz.
@param int $slot the first slot on the page we are outputting.
@param \moodle_url $pageurl the canonical URL of this page.
@return string HTML to output. | [
"Display",
"a",
"question",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/classes/output/edit_renderer.php#L720-L769 |
216,414 | moodle/moodle | mod/quiz/classes/output/edit_renderer.php | edit_renderer.question_move_icon | public function question_move_icon(structure $structure, $slot) {
return html_writer::link(new \moodle_url('#'),
$this->pix_icon('i/dragdrop', get_string('move'), 'moodle', array('class' => 'iconsmall', 'title' => '')),
array('class' => 'editing_move', 'data-action' => 'move')
);... | php | public function question_move_icon(structure $structure, $slot) {
return html_writer::link(new \moodle_url('#'),
$this->pix_icon('i/dragdrop', get_string('move'), 'moodle', array('class' => 'iconsmall', 'title' => '')),
array('class' => 'editing_move', 'data-action' => 'move')
);... | [
"public",
"function",
"question_move_icon",
"(",
"structure",
"$",
"structure",
",",
"$",
"slot",
")",
"{",
"return",
"html_writer",
"::",
"link",
"(",
"new",
"\\",
"moodle_url",
"(",
"'#'",
")",
",",
"$",
"this",
"->",
"pix_icon",
"(",
"'i/dragdrop'",
","... | Render the move icon.
@param structure $structure object containing the structure of the quiz.
@param int $slot the first slot on the page we are outputting.
@return string The markup for the move action. | [
"Render",
"the",
"move",
"icon",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/classes/output/edit_renderer.php#L778-L783 |
216,415 | moodle/moodle | mod/quiz/classes/output/edit_renderer.php | edit_renderer.question_number | public function question_number($number) {
if (is_numeric($number)) {
$number = html_writer::span(get_string('question'), 'accesshide') . ' ' . $number;
}
return html_writer::tag('span', $number, array('class' => 'slotnumber'));
} | php | public function question_number($number) {
if (is_numeric($number)) {
$number = html_writer::span(get_string('question'), 'accesshide') . ' ' . $number;
}
return html_writer::tag('span', $number, array('class' => 'slotnumber'));
} | [
"public",
"function",
"question_number",
"(",
"$",
"number",
")",
"{",
"if",
"(",
"is_numeric",
"(",
"$",
"number",
")",
")",
"{",
"$",
"number",
"=",
"html_writer",
"::",
"span",
"(",
"get_string",
"(",
"'question'",
")",
",",
"'accesshide'",
")",
".",
... | Output the question number.
@param string $number The number, or 'i'.
@return string HTML to output. | [
"Output",
"the",
"question",
"number",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/classes/output/edit_renderer.php#L790-L795 |
216,416 | moodle/moodle | mod/quiz/classes/output/edit_renderer.php | edit_renderer.question_preview_icon | public function question_preview_icon($quiz, $question, $label = null, $variant = null) {
$url = quiz_question_preview_url($quiz, $question, $variant);
// Do we want a label?
$strpreviewlabel = '';
if ($label) {
$strpreviewlabel = ' ' . get_string('preview', 'quiz');
... | php | public function question_preview_icon($quiz, $question, $label = null, $variant = null) {
$url = quiz_question_preview_url($quiz, $question, $variant);
// Do we want a label?
$strpreviewlabel = '';
if ($label) {
$strpreviewlabel = ' ' . get_string('preview', 'quiz');
... | [
"public",
"function",
"question_preview_icon",
"(",
"$",
"quiz",
",",
"$",
"question",
",",
"$",
"label",
"=",
"null",
",",
"$",
"variant",
"=",
"null",
")",
"{",
"$",
"url",
"=",
"quiz_question_preview_url",
"(",
"$",
"quiz",
",",
"$",
"question",
",",
... | Render the preview icon.
@param \stdClass $quiz the quiz settings from the database.
@param \stdClass $question data from the question and quiz_slots tables.
@param bool $label if true, show the preview question label after the icon
@param int $variant which question variant to preview (optional).
@return string HTML ... | [
"Render",
"the",
"preview",
"icon",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/classes/output/edit_renderer.php#L806-L824 |
216,417 | moodle/moodle | mod/quiz/classes/output/edit_renderer.php | edit_renderer.question_remove_icon | public function question_remove_icon(structure $structure, $slot, $pageurl) {
$url = new \moodle_url($pageurl, array('sesskey' => sesskey(), 'remove' => $slot));
$strdelete = get_string('delete');
$image = $this->pix_icon('t/delete', $strdelete);
return $this->action_link($url, $image,... | php | public function question_remove_icon(structure $structure, $slot, $pageurl) {
$url = new \moodle_url($pageurl, array('sesskey' => sesskey(), 'remove' => $slot));
$strdelete = get_string('delete');
$image = $this->pix_icon('t/delete', $strdelete);
return $this->action_link($url, $image,... | [
"public",
"function",
"question_remove_icon",
"(",
"structure",
"$",
"structure",
",",
"$",
"slot",
",",
"$",
"pageurl",
")",
"{",
"$",
"url",
"=",
"new",
"\\",
"moodle_url",
"(",
"$",
"pageurl",
",",
"array",
"(",
"'sesskey'",
"=>",
"sesskey",
"(",
")",... | Render an icon to remove a question from the quiz.
@param structure $structure object containing the structure of the quiz.
@param int $slot the first slot on the page we are outputting.
@param \moodle_url $pageurl the canonical URL of the edit page.
@return string HTML to output. | [
"Render",
"an",
"icon",
"to",
"remove",
"a",
"question",
"from",
"the",
"quiz",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/classes/output/edit_renderer.php#L834-L842 |
216,418 | moodle/moodle | mod/quiz/classes/output/edit_renderer.php | edit_renderer.page_split_join_button | public function page_split_join_button($structure, $slot) {
$insertpagebreak = !$structure->is_last_slot_on_page($slot);
$url = new \moodle_url('repaginate.php', array('quizid' => $structure->get_quizid(),
'slot' => $slot, 'repag' => $insertpagebreak ? 2 : 1, 'sesskey' => sesskey()));
... | php | public function page_split_join_button($structure, $slot) {
$insertpagebreak = !$structure->is_last_slot_on_page($slot);
$url = new \moodle_url('repaginate.php', array('quizid' => $structure->get_quizid(),
'slot' => $slot, 'repag' => $insertpagebreak ? 2 : 1, 'sesskey' => sesskey()));
... | [
"public",
"function",
"page_split_join_button",
"(",
"$",
"structure",
",",
"$",
"slot",
")",
"{",
"$",
"insertpagebreak",
"=",
"!",
"$",
"structure",
"->",
"is_last_slot_on_page",
"(",
"$",
"slot",
")",
";",
"$",
"url",
"=",
"new",
"\\",
"moodle_url",
"("... | Display an icon to split or join two pages of the quiz.
@param structure $structure object containing the structure of the quiz.
@param int $slot the first slot on the page we are outputting.
@return string HTML to output. | [
"Display",
"an",
"icon",
"to",
"split",
"or",
"join",
"two",
"pages",
"of",
"the",
"quiz",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/classes/output/edit_renderer.php#L851-L874 |
216,419 | moodle/moodle | mod/quiz/classes/output/edit_renderer.php | edit_renderer.question_dependency_icon | public function question_dependency_icon($structure, $slot) {
$a = array(
'thisq' => $structure->get_displayed_number_for_slot($slot),
'previousq' => $structure->get_displayed_number_for_slot(max($slot - 1, 1)),
);
if ($structure->is_question_dependent_on_previous_slot($s... | php | public function question_dependency_icon($structure, $slot) {
$a = array(
'thisq' => $structure->get_displayed_number_for_slot($slot),
'previousq' => $structure->get_displayed_number_for_slot(max($slot - 1, 1)),
);
if ($structure->is_question_dependent_on_previous_slot($s... | [
"public",
"function",
"question_dependency_icon",
"(",
"$",
"structure",
",",
"$",
"slot",
")",
"{",
"$",
"a",
"=",
"array",
"(",
"'thisq'",
"=>",
"$",
"structure",
"->",
"get_displayed_number_for_slot",
"(",
"$",
"slot",
")",
",",
"'previousq'",
"=>",
"$",
... | Display the icon for whether this question can only be seen if the previous
one has been answered.
@param structure $structure object containing the structure of the quiz.
@param int $slot the first slot on the page we are outputting.
@return string HTML to output. | [
"Display",
"the",
"icon",
"for",
"whether",
"this",
"question",
"can",
"only",
"be",
"seen",
"if",
"the",
"previous",
"one",
"has",
"been",
"answered",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/classes/output/edit_renderer.php#L884-L913 |
216,420 | moodle/moodle | mod/quiz/classes/output/edit_renderer.php | edit_renderer.question_name | public function question_name(structure $structure, $slot, $pageurl) {
$output = '';
$question = $structure->get_question_in_slot($slot);
$editurl = new \moodle_url('/question/question.php', array(
'returnurl' => $pageurl->out_as_local_url(),
'cmid' => $structure... | php | public function question_name(structure $structure, $slot, $pageurl) {
$output = '';
$question = $structure->get_question_in_slot($slot);
$editurl = new \moodle_url('/question/question.php', array(
'returnurl' => $pageurl->out_as_local_url(),
'cmid' => $structure... | [
"public",
"function",
"question_name",
"(",
"structure",
"$",
"structure",
",",
"$",
"slot",
",",
"$",
"pageurl",
")",
"{",
"$",
"output",
"=",
"''",
";",
"$",
"question",
"=",
"$",
"structure",
"->",
"get_question_in_slot",
"(",
"$",
"slot",
")",
";",
... | Renders html to display a name with the link to the question on a quiz edit page
If the user does not have permission to edi the question, it is rendered
without a link
@param structure $structure object containing the structure of the quiz.
@param int $slot which slot we are outputting.
@param \moodle_url $pageurl t... | [
"Renders",
"html",
"to",
"display",
"a",
"name",
"with",
"the",
"link",
"to",
"the",
"question",
"on",
"a",
"quiz",
"edit",
"page"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/classes/output/edit_renderer.php#L926-L953 |
216,421 | moodle/moodle | mod/quiz/classes/output/edit_renderer.php | edit_renderer.random_question | public function random_question(structure $structure, $slotnumber, $pageurl) {
$question = $structure->get_question_in_slot($slotnumber);
$slot = $structure->get_slot_by_number($slotnumber);
$slottags = $structure->get_slot_tags_for_slot_id($slot->id);
$editurl = new \moodle_url('/mod/q... | php | public function random_question(structure $structure, $slotnumber, $pageurl) {
$question = $structure->get_question_in_slot($slotnumber);
$slot = $structure->get_slot_by_number($slotnumber);
$slottags = $structure->get_slot_tags_for_slot_id($slot->id);
$editurl = new \moodle_url('/mod/q... | [
"public",
"function",
"random_question",
"(",
"structure",
"$",
"structure",
",",
"$",
"slotnumber",
",",
"$",
"pageurl",
")",
"{",
"$",
"question",
"=",
"$",
"structure",
"->",
"get_question_in_slot",
"(",
"$",
"slotnumber",
")",
";",
"$",
"slot",
"=",
"$... | Renders html to display a random question the link to edit the configuration
and also to see that category in the question bank.
@param structure $structure object containing the structure of the quiz.
@param int $slotnumber which slot we are outputting.
@param \moodle_url $pageurl the canonical URL of this page.
@ret... | [
"Renders",
"html",
"to",
"display",
"a",
"random",
"question",
"the",
"link",
"to",
"edit",
"the",
"configuration",
"and",
"also",
"to",
"see",
"that",
"category",
"in",
"the",
"question",
"bank",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/classes/output/edit_renderer.php#L964-L1001 |
216,422 | moodle/moodle | mod/quiz/classes/output/edit_renderer.php | edit_renderer.marked_out_of_field | public function marked_out_of_field(structure $structure, $slot) {
if (!$structure->is_real_question($slot)) {
$output = html_writer::span('',
'instancemaxmark decimalplaces_' . $structure->get_decimal_places_for_question_marks());
$output .= html_writer::span(
... | php | public function marked_out_of_field(structure $structure, $slot) {
if (!$structure->is_real_question($slot)) {
$output = html_writer::span('',
'instancemaxmark decimalplaces_' . $structure->get_decimal_places_for_question_marks());
$output .= html_writer::span(
... | [
"public",
"function",
"marked_out_of_field",
"(",
"structure",
"$",
"structure",
",",
"$",
"slot",
")",
"{",
"if",
"(",
"!",
"$",
"structure",
"->",
"is_real_question",
"(",
"$",
"slot",
")",
")",
"{",
"$",
"output",
"=",
"html_writer",
"::",
"span",
"("... | Display the 'marked out of' information for a question.
Along with the regrade action.
@param structure $structure object containing the structure of the quiz.
@param int $slot which slot we are outputting.
@return string HTML to output. | [
"Display",
"the",
"marked",
"out",
"of",
"information",
"for",
"a",
"question",
".",
"Along",
"with",
"the",
"regrade",
"action",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/classes/output/edit_renderer.php#L1010-L1037 |
216,423 | moodle/moodle | mod/quiz/classes/output/edit_renderer.php | edit_renderer.question_chooser | public function question_chooser() {
$chooser = \mod_quiz\output\question_chooser::get($this->page->course, [], null);
$container = html_writer::div($this->render($chooser), '', array('id' => 'qtypechoicecontainer'));
return html_writer::div($container, 'createnewquestion');
} | php | public function question_chooser() {
$chooser = \mod_quiz\output\question_chooser::get($this->page->course, [], null);
$container = html_writer::div($this->render($chooser), '', array('id' => 'qtypechoicecontainer'));
return html_writer::div($container, 'createnewquestion');
} | [
"public",
"function",
"question_chooser",
"(",
")",
"{",
"$",
"chooser",
"=",
"\\",
"mod_quiz",
"\\",
"output",
"\\",
"question_chooser",
"::",
"get",
"(",
"$",
"this",
"->",
"page",
"->",
"course",
",",
"[",
"]",
",",
"null",
")",
";",
"$",
"container... | Render the question type chooser dialogue.
@return string HTML to output. | [
"Render",
"the",
"question",
"type",
"chooser",
"dialogue",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/classes/output/edit_renderer.php#L1053-L1057 |
216,424 | moodle/moodle | mod/quiz/classes/output/edit_renderer.php | edit_renderer.question_bank_contents | public function question_bank_contents(\mod_quiz\question\bank\custom_view $questionbank, array $pagevars) {
$qbank = $questionbank->render('editq', $pagevars['qpage'], $pagevars['qperpage'],
$pagevars['cat'], $pagevars['recurse'], $pagevars['showhidden'], $pagevars['qbshowtext'],
... | php | public function question_bank_contents(\mod_quiz\question\bank\custom_view $questionbank, array $pagevars) {
$qbank = $questionbank->render('editq', $pagevars['qpage'], $pagevars['qperpage'],
$pagevars['cat'], $pagevars['recurse'], $pagevars['showhidden'], $pagevars['qbshowtext'],
... | [
"public",
"function",
"question_bank_contents",
"(",
"\\",
"mod_quiz",
"\\",
"question",
"\\",
"bank",
"\\",
"custom_view",
"$",
"questionbank",
",",
"array",
"$",
"pagevars",
")",
"{",
"$",
"qbank",
"=",
"$",
"questionbank",
"->",
"render",
"(",
"'editq'",
... | Return the contents of the question bank, to be displayed in the question-bank pop-up.
@param \mod_quiz\question\bank\custom_view $questionbank the question bank view object.
@param array $pagevars the variables from {@link \question_edit_setup()}.
@return string HTML to output / send back in response to an AJAX reque... | [
"Return",
"the",
"contents",
"of",
"the",
"question",
"bank",
"to",
"be",
"displayed",
"in",
"the",
"question",
"-",
"bank",
"pop",
"-",
"up",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/quiz/classes/output/edit_renderer.php#L1232-L1238 |
216,425 | moodle/moodle | mod/forum/classes/privacy/provider.php | provider.export_discussion_data | protected static function export_discussion_data(int $userid, array $mappings) {
global $DB;
// Find all of the discussions, and discussion subscriptions for this forum.
list($foruminsql, $forumparams) = $DB->get_in_or_equal(array_keys($mappings), SQL_PARAMS_NAMED);
$sql = "SELECT
... | php | protected static function export_discussion_data(int $userid, array $mappings) {
global $DB;
// Find all of the discussions, and discussion subscriptions for this forum.
list($foruminsql, $forumparams) = $DB->get_in_or_equal(array_keys($mappings), SQL_PARAMS_NAMED);
$sql = "SELECT
... | [
"protected",
"static",
"function",
"export_discussion_data",
"(",
"int",
"$",
"userid",
",",
"array",
"$",
"mappings",
")",
"{",
"global",
"$",
"DB",
";",
"// Find all of the discussions, and discussion subscriptions for this forum.",
"list",
"(",
"$",
"foruminsql",
","... | Store all information about all discussions that we have detected this user to have access to.
@param int $userid The userid of the user whose data is to be exported.
@param array $mappings A list of mappings from forumid => contextid.
@return array Which forums had data written for them. | [
"Store",
"all",
"information",
"about",
"all",
"discussions",
"that",
"we",
"have",
"detected",
"this",
"user",
"to",
"have",
"access",
"to",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/privacy/provider.php#L572-L632 |
216,426 | moodle/moodle | mod/forum/classes/privacy/provider.php | provider.export_posts_in_structure | protected static function export_posts_in_structure(int $userid, \context $context, $parentarea, \stdClass $structure) {
foreach ($structure->children as $post) {
if (!$post->hasdata) {
// This tree has no content belonging to the user. Skip it and all children.
conti... | php | protected static function export_posts_in_structure(int $userid, \context $context, $parentarea, \stdClass $structure) {
foreach ($structure->children as $post) {
if (!$post->hasdata) {
// This tree has no content belonging to the user. Skip it and all children.
conti... | [
"protected",
"static",
"function",
"export_posts_in_structure",
"(",
"int",
"$",
"userid",
",",
"\\",
"context",
"$",
"context",
",",
"$",
"parentarea",
",",
"\\",
"stdClass",
"$",
"structure",
")",
"{",
"foreach",
"(",
"$",
"structure",
"->",
"children",
"a... | Export all posts in the provided structure.
@param int $userid The userid of the user whose data is to be exported.
@param \context $context The instance of the forum context.
@param array $parentarea The subcontext of the parent.
@param \stdClass $structure The post structure and all of its... | [
"Export",
"all",
"posts",
"in",
"the",
"provided",
"structure",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/privacy/provider.php#L768-L785 |
216,427 | moodle/moodle | mod/forum/classes/privacy/provider.php | provider.export_post_data | protected static function export_post_data(int $userid, \context $context, $postarea, $post) {
// Store related metadata.
static::export_read_data($userid, $context, $postarea, $post);
$postdata = (object) [
'subject' => format_string($post->subject, true),
'created' => ... | php | protected static function export_post_data(int $userid, \context $context, $postarea, $post) {
// Store related metadata.
static::export_read_data($userid, $context, $postarea, $post);
$postdata = (object) [
'subject' => format_string($post->subject, true),
'created' => ... | [
"protected",
"static",
"function",
"export_post_data",
"(",
"int",
"$",
"userid",
",",
"\\",
"context",
"$",
"context",
",",
"$",
"postarea",
",",
"$",
"post",
")",
"{",
"// Store related metadata.",
"static",
"::",
"export_read_data",
"(",
"$",
"userid",
",",... | Export all data in the post.
@param int $userid The userid of the user whose data is to be exported.
@param \context $context The instance of the forum context.
@param array $postarea The subcontext of the parent.
@param \stdClass $post The post structure and all of its children | [
"Export",
"all",
"data",
"in",
"the",
"post",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/privacy/provider.php#L795-L854 |
216,428 | moodle/moodle | mod/forum/classes/privacy/provider.php | provider.export_digest_data | protected static function export_digest_data(int $userid, \stdClass $forum, int $maildigest) {
if (null !== $maildigest) {
// The user has a specific maildigest preference for this forum.
$a = (object) [
'forum' => format_string($forum->name, true),
];
... | php | protected static function export_digest_data(int $userid, \stdClass $forum, int $maildigest) {
if (null !== $maildigest) {
// The user has a specific maildigest preference for this forum.
$a = (object) [
'forum' => format_string($forum->name, true),
];
... | [
"protected",
"static",
"function",
"export_digest_data",
"(",
"int",
"$",
"userid",
",",
"\\",
"stdClass",
"$",
"forum",
",",
"int",
"$",
"maildigest",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"maildigest",
")",
"{",
"// The user has a specific maildigest prefer... | Store data about daily digest preferences
@param int $userid The userid of the user whose data is to be exported.
@param \stdClass $forum The forum whose data is being exported.
@param int $maildigest The mail digest setting for this forum.
@return bool Whether any data was stored. | [
"Store",
"data",
"about",
"daily",
"digest",
"preferences"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/privacy/provider.php#L864-L891 |
216,429 | moodle/moodle | mod/forum/classes/privacy/provider.php | provider.export_subscription_data | protected static function export_subscription_data(int $userid, \stdClass $forum, int $subscribed) {
if (null !== $subscribed) {
// The user is subscribed to this forum.
writer::with_context(\context_module::instance($forum->cmid))
->export_metadata([], 'subscriptionprefe... | php | protected static function export_subscription_data(int $userid, \stdClass $forum, int $subscribed) {
if (null !== $subscribed) {
// The user is subscribed to this forum.
writer::with_context(\context_module::instance($forum->cmid))
->export_metadata([], 'subscriptionprefe... | [
"protected",
"static",
"function",
"export_subscription_data",
"(",
"int",
"$",
"userid",
",",
"\\",
"stdClass",
"$",
"forum",
",",
"int",
"$",
"subscribed",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"subscribed",
")",
"{",
"// The user is subscribed to this foru... | Store data about whether the user subscribes to forum.
@param int $userid The userid of the user whose data is to be exported.
@param \stdClass $forum The forum whose data is being exported.
@param int $subscribed if the user is subscribed
@return bool Whether any data was stored. | [
"Store",
"data",
"about",
"whether",
"the",
"user",
"subscribes",
"to",
"forum",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/privacy/provider.php#L901-L911 |
216,430 | moodle/moodle | mod/forum/classes/privacy/provider.php | provider.export_discussion_subscription_data | protected static function export_discussion_subscription_data(int $userid, \context_module $context, \stdClass $discussion) {
$area = static::get_discussion_area($discussion);
if (null !== $discussion->preference) {
// The user has a specific subscription preference for this discussion.
... | php | protected static function export_discussion_subscription_data(int $userid, \context_module $context, \stdClass $discussion) {
$area = static::get_discussion_area($discussion);
if (null !== $discussion->preference) {
// The user has a specific subscription preference for this discussion.
... | [
"protected",
"static",
"function",
"export_discussion_subscription_data",
"(",
"int",
"$",
"userid",
",",
"\\",
"context_module",
"$",
"context",
",",
"\\",
"stdClass",
"$",
"discussion",
")",
"{",
"$",
"area",
"=",
"static",
"::",
"get_discussion_area",
"(",
"$... | Store data about whether the user subscribes to this particular discussion.
@param int $userid The userid of the user whose data is to be exported.
@param \context_module $context The instance of the forum context.
@param \stdClass $discussion The discussion whose data is being exported.
@return bool ... | [
"Store",
"data",
"about",
"whether",
"the",
"user",
"subscribes",
"to",
"this",
"particular",
"discussion",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/privacy/provider.php#L921-L948 |
216,431 | moodle/moodle | mod/forum/classes/privacy/provider.php | provider.export_tracking_data | protected static function export_tracking_data(int $userid, \stdClass $forum, int $tracked) {
if (null !== $tracked) {
// The user has a main preference to track all forums, but has opted out of this one.
writer::with_context(\context_module::instance($forum->cmid))
->exp... | php | protected static function export_tracking_data(int $userid, \stdClass $forum, int $tracked) {
if (null !== $tracked) {
// The user has a main preference to track all forums, but has opted out of this one.
writer::with_context(\context_module::instance($forum->cmid))
->exp... | [
"protected",
"static",
"function",
"export_tracking_data",
"(",
"int",
"$",
"userid",
",",
"\\",
"stdClass",
"$",
"forum",
",",
"int",
"$",
"tracked",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"tracked",
")",
"{",
"// The user has a main preference to track all f... | Store forum read-tracking data about a particular forum.
This is whether a forum has read-tracking enabled or not.
@param int $userid The userid of the user whose data is to be exported.
@param \stdClass $forum The forum whose data is being exported.
@param int $tracke if the user is subscribe... | [
"Store",
"forum",
"read",
"-",
"tracking",
"data",
"about",
"a",
"particular",
"forum",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/privacy/provider.php#L960-L970 |
216,432 | moodle/moodle | mod/forum/classes/privacy/provider.php | provider.export_read_data | protected static function export_read_data(int $userid, \context_module $context, array $postarea, \stdClass $post) {
if (null !== $post->firstread) {
$a = (object) [
'firstread' => $post->firstread,
'lastread' => $post->lastread,
];
writer::... | php | protected static function export_read_data(int $userid, \context_module $context, array $postarea, \stdClass $post) {
if (null !== $post->firstread) {
$a = (object) [
'firstread' => $post->firstread,
'lastread' => $post->lastread,
];
writer::... | [
"protected",
"static",
"function",
"export_read_data",
"(",
"int",
"$",
"userid",
",",
"\\",
"context_module",
"$",
"context",
",",
"array",
"$",
"postarea",
",",
"\\",
"stdClass",
"$",
"post",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"post",
"->",
"firs... | Store read-tracking information about a particular forum post.
@param int $userid The userid of the user whose data is to be exported.
@param \context_module $context The instance of the forum context.
@param array $postarea The subcontext for this post.
@param \stdClass $post The post whose da... | [
"Store",
"read",
"-",
"tracking",
"information",
"about",
"a",
"particular",
"forum",
"post",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/privacy/provider.php#L981-L1003 |
216,433 | moodle/moodle | grade/report/history/classes/output/tablelog.php | tablelog.define_table_columns | protected function define_table_columns() {
$extrafields = get_extra_user_fields($this->context);
// Define headers and columns.
$cols = array(
'timemodified' => get_string('datetime', 'gradereport_history'),
'fullname' => get_string('name')
);
// Add he... | php | protected function define_table_columns() {
$extrafields = get_extra_user_fields($this->context);
// Define headers and columns.
$cols = array(
'timemodified' => get_string('datetime', 'gradereport_history'),
'fullname' => get_string('name')
);
// Add he... | [
"protected",
"function",
"define_table_columns",
"(",
")",
"{",
"$",
"extrafields",
"=",
"get_extra_user_fields",
"(",
"$",
"this",
"->",
"context",
")",
";",
"// Define headers and columns.",
"$",
"cols",
"=",
"array",
"(",
"'timemodified'",
"=>",
"get_string",
"... | Setup the headers for the html table. | [
"Setup",
"the",
"headers",
"for",
"the",
"html",
"table",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/report/history/classes/output/tablelog.php#L142-L176 |
216,434 | moodle/moodle | grade/report/history/classes/output/tablelog.php | tablelog.col_finalgrade | public function col_finalgrade(\stdClass $history) {
if (!empty($this->gradeitems[$history->itemid])) {
$decimalpoints = $this->gradeitems[$history->itemid]->get_decimals();
} else {
$decimalpoints = $this->defaultdecimalpoints;
}
return format_float($history->fi... | php | public function col_finalgrade(\stdClass $history) {
if (!empty($this->gradeitems[$history->itemid])) {
$decimalpoints = $this->gradeitems[$history->itemid]->get_decimals();
} else {
$decimalpoints = $this->defaultdecimalpoints;
}
return format_float($history->fi... | [
"public",
"function",
"col_finalgrade",
"(",
"\\",
"stdClass",
"$",
"history",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"gradeitems",
"[",
"$",
"history",
"->",
"itemid",
"]",
")",
")",
"{",
"$",
"decimalpoints",
"=",
"$",
"this",
"... | Method to display the final grade.
@param \stdClass $history an entry of history record.
@return string HTML to display | [
"Method",
"to",
"display",
"the",
"final",
"grade",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/report/history/classes/output/tablelog.php#L185-L193 |
216,435 | moodle/moodle | grade/report/history/classes/output/tablelog.php | tablelog.col_prevgrade | public function col_prevgrade(\stdClass $history) {
if (!empty($this->gradeitems[$history->itemid])) {
$decimalpoints = $this->gradeitems[$history->itemid]->get_decimals();
} else {
$decimalpoints = $this->defaultdecimalpoints;
}
return format_float($history->pre... | php | public function col_prevgrade(\stdClass $history) {
if (!empty($this->gradeitems[$history->itemid])) {
$decimalpoints = $this->gradeitems[$history->itemid]->get_decimals();
} else {
$decimalpoints = $this->defaultdecimalpoints;
}
return format_float($history->pre... | [
"public",
"function",
"col_prevgrade",
"(",
"\\",
"stdClass",
"$",
"history",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"gradeitems",
"[",
"$",
"history",
"->",
"itemid",
"]",
")",
")",
"{",
"$",
"decimalpoints",
"=",
"$",
"this",
"-... | Method to display the previous grade.
@param \stdClass $history an entry of history record.
@return string HTML to display | [
"Method",
"to",
"display",
"the",
"previous",
"grade",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/report/history/classes/output/tablelog.php#L202-L210 |
216,436 | moodle/moodle | grade/report/history/classes/output/tablelog.php | tablelog.col_itemname | public function col_itemname(\stdClass $history) {
// Make sure grade item is still present and link it to the module if possible.
$itemid = $history->itemid;
if (!empty($this->gradeitems[$itemid])) {
if ($history->itemtype === 'mod' && !$this->is_downloading()) {
if ... | php | public function col_itemname(\stdClass $history) {
// Make sure grade item is still present and link it to the module if possible.
$itemid = $history->itemid;
if (!empty($this->gradeitems[$itemid])) {
if ($history->itemtype === 'mod' && !$this->is_downloading()) {
if ... | [
"public",
"function",
"col_itemname",
"(",
"\\",
"stdClass",
"$",
"history",
")",
"{",
"// Make sure grade item is still present and link it to the module if possible.",
"$",
"itemid",
"=",
"$",
"history",
"->",
"itemid",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"thi... | Method to display column itemname.
@param \stdClass $history an entry of history record.
@return string HTML to display | [
"Method",
"to",
"display",
"column",
"itemname",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/report/history/classes/output/tablelog.php#L230-L244 |
216,437 | moodle/moodle | grade/report/history/classes/output/tablelog.php | tablelog.col_grader | public function col_grader(\stdClass $history) {
if (empty($history->usermodified)) {
// Not every row has a valid usermodified.
return '';
}
$grader = new \stdClass();
$grader = username_load_fields_from_object($grader, $history, 'grader');
$name = fulln... | php | public function col_grader(\stdClass $history) {
if (empty($history->usermodified)) {
// Not every row has a valid usermodified.
return '';
}
$grader = new \stdClass();
$grader = username_load_fields_from_object($grader, $history, 'grader');
$name = fulln... | [
"public",
"function",
"col_grader",
"(",
"\\",
"stdClass",
"$",
"history",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"history",
"->",
"usermodified",
")",
")",
"{",
"// Not every row has a valid usermodified.",
"return",
"''",
";",
"}",
"$",
"grader",
"=",
"ne... | Method to display column grader.
@param \stdClass $history an entry of history record.
@return string HTML to display | [
"Method",
"to",
"display",
"column",
"grader",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/report/history/classes/output/tablelog.php#L253-L271 |
216,438 | moodle/moodle | grade/report/history/classes/output/tablelog.php | tablelog.col_feedback | public function col_feedback(\stdClass $history) {
if ($this->is_downloading()) {
return $history->feedback;
} else {
// We need the activity context, not the course context.
$gradeitem = $this->gradeitems[$history->itemid];
$context = $gradeitem->get_cont... | php | public function col_feedback(\stdClass $history) {
if ($this->is_downloading()) {
return $history->feedback;
} else {
// We need the activity context, not the course context.
$gradeitem = $this->gradeitems[$history->itemid];
$context = $gradeitem->get_cont... | [
"public",
"function",
"col_feedback",
"(",
"\\",
"stdClass",
"$",
"history",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"is_downloading",
"(",
")",
")",
"{",
"return",
"$",
"history",
"->",
"feedback",
";",
"}",
"else",
"{",
"// We need the activity context, no... | Method to display column feedback.
@param \stdClass $history an entry of history record.
@return string HTML to display | [
"Method",
"to",
"display",
"column",
"feedback",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/report/history/classes/output/tablelog.php#L313-L332 |
216,439 | moodle/moodle | grade/report/history/classes/output/tablelog.php | tablelog.get_filters_sql_and_params | protected function get_filters_sql_and_params() {
global $DB;
$coursecontext = $this->context;
$filter = 'gi.courseid = :courseid';
$params = array(
'courseid' => $coursecontext->instanceid,
);
if (!empty($this->filters->itemid)) {
$filter .= ' A... | php | protected function get_filters_sql_and_params() {
global $DB;
$coursecontext = $this->context;
$filter = 'gi.courseid = :courseid';
$params = array(
'courseid' => $coursecontext->instanceid,
);
if (!empty($this->filters->itemid)) {
$filter .= ' A... | [
"protected",
"function",
"get_filters_sql_and_params",
"(",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"coursecontext",
"=",
"$",
"this",
"->",
"context",
";",
"$",
"filter",
"=",
"'gi.courseid = :courseid'",
";",
"$",
"params",
"=",
"array",
"(",
"'courseid'",
... | Builds the sql and param list needed, based on the user selected filters.
@return array containing sql to use and an array of params. | [
"Builds",
"the",
"sql",
"and",
"param",
"list",
"needed",
"based",
"on",
"the",
"user",
"selected",
"filters",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/report/history/classes/output/tablelog.php#L339-L372 |
216,440 | moodle/moodle | grade/report/history/classes/output/tablelog.php | tablelog.get_sql_and_params | protected function get_sql_and_params($count = false) {
$fields = 'ggh.id, ggh.timemodified, ggh.itemid, ggh.userid, ggh.finalgrade, ggh.usermodified,
ggh.source, ggh.overridden, ggh.locked, ggh.excluded, ggh.feedback, ggh.feedbackformat,
gi.itemtype, gi.itemmodule, gi.item... | php | protected function get_sql_and_params($count = false) {
$fields = 'ggh.id, ggh.timemodified, ggh.itemid, ggh.userid, ggh.finalgrade, ggh.usermodified,
ggh.source, ggh.overridden, ggh.locked, ggh.excluded, ggh.feedback, ggh.feedbackformat,
gi.itemtype, gi.itemmodule, gi.item... | [
"protected",
"function",
"get_sql_and_params",
"(",
"$",
"count",
"=",
"false",
")",
"{",
"$",
"fields",
"=",
"'ggh.id, ggh.timemodified, ggh.itemid, ggh.userid, ggh.finalgrade, ggh.usermodified,\n ggh.source, ggh.overridden, ggh.locked, ggh.excluded, ggh.feedback, ggh.fe... | Builds the complete sql with all the joins to get the grade history data.
@param bool $count setting this to true, returns an sql to get count only instead of the complete data records.
@return array containing sql to use and an array of params. | [
"Builds",
"the",
"complete",
"sql",
"with",
"all",
"the",
"joins",
"to",
"get",
"the",
"grade",
"history",
"data",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/report/history/classes/output/tablelog.php#L381-L450 |
216,441 | moodle/moodle | grade/report/history/classes/output/tablelog.php | tablelog.get_sql_sort | public function get_sql_sort() {
$columns = $this->get_sort_columns();
if (count($columns) == 1 && isset($columns['timemodified']) && $columns['timemodified'] == SORT_DESC) {
// Add the 'id' column when we are using the default sorting.
$columns['id'] = SORT_DESC;
ret... | php | public function get_sql_sort() {
$columns = $this->get_sort_columns();
if (count($columns) == 1 && isset($columns['timemodified']) && $columns['timemodified'] == SORT_DESC) {
// Add the 'id' column when we are using the default sorting.
$columns['id'] = SORT_DESC;
ret... | [
"public",
"function",
"get_sql_sort",
"(",
")",
"{",
"$",
"columns",
"=",
"$",
"this",
"->",
"get_sort_columns",
"(",
")",
";",
"if",
"(",
"count",
"(",
"$",
"columns",
")",
"==",
"1",
"&&",
"isset",
"(",
"$",
"columns",
"[",
"'timemodified'",
"]",
"... | Get the SQL fragment to sort by.
This is overridden to sort by timemodified and ID by default. Many items happen at the same time
and a second sorting by ID is valuable to distinguish the order in which the history happened.
@return string SQL fragment. | [
"Get",
"the",
"SQL",
"fragment",
"to",
"sort",
"by",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/report/history/classes/output/tablelog.php#L460-L468 |
216,442 | moodle/moodle | grade/report/history/classes/output/tablelog.php | tablelog.get_selected_users | public function get_selected_users() {
global $DB;
$idlist = array();
if (!empty($this->filters->userids)) {
$idlist = explode(',', $this->filters->userids);
list($where, $params) = $DB->get_in_or_equal($idlist);
return $DB->get_records_select('user', "id $wh... | php | public function get_selected_users() {
global $DB;
$idlist = array();
if (!empty($this->filters->userids)) {
$idlist = explode(',', $this->filters->userids);
list($where, $params) = $DB->get_in_or_equal($idlist);
return $DB->get_records_select('user', "id $wh... | [
"public",
"function",
"get_selected_users",
"(",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"idlist",
"=",
"array",
"(",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"filters",
"->",
"userids",
")",
")",
"{",
"$",
"idlist",
"=",
"explod... | Returns a list of selected users.
@return array returns an array in the format $userid => $userid | [
"Returns",
"a",
"list",
"of",
"selected",
"users",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/report/history/classes/output/tablelog.php#L502-L513 |
216,443 | moodle/moodle | lib/dml/oci_native_moodle_temptables.php | oci_native_moodle_temptables.add_temptable | public function add_temptable($tablename) {
// TODO: throw exception if exists: if ($this->is_temptable...
$this->temptables[$tablename] = $this->prefix . $this->unique_session_id . $this->counter;
$this->counter++;
} | php | public function add_temptable($tablename) {
// TODO: throw exception if exists: if ($this->is_temptable...
$this->temptables[$tablename] = $this->prefix . $this->unique_session_id . $this->counter;
$this->counter++;
} | [
"public",
"function",
"add_temptable",
"(",
"$",
"tablename",
")",
"{",
"// TODO: throw exception if exists: if ($this->is_temptable...",
"$",
"this",
"->",
"temptables",
"[",
"$",
"tablename",
"]",
"=",
"$",
"this",
"->",
"prefix",
".",
"$",
"this",
"->",
"unique... | Add one temptable to the store.
Overridden because OCI only support global temptables, so we need to change completely the name, based
in unique session identifier, to get local-like temp tables support
tables before the prefix.
Given one moodle temptable name (without prefix), add it to the store, with the
key being... | [
"Add",
"one",
"temptable",
"to",
"the",
"store",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/dml/oci_native_moodle_temptables.php#L65-L69 |
216,444 | moodle/moodle | mod/forum/classes/local/data_mappers/legacy/discussion.php | discussion.to_legacy_objects | public function to_legacy_objects(array $discussions) : array {
return array_map(function(discussion_entity $discussion) {
return (object) [
'id' => $discussion->get_id(),
'course' => $discussion->get_course_id(),
'forum' => $discussion->get_forum_id()... | php | public function to_legacy_objects(array $discussions) : array {
return array_map(function(discussion_entity $discussion) {
return (object) [
'id' => $discussion->get_id(),
'course' => $discussion->get_course_id(),
'forum' => $discussion->get_forum_id()... | [
"public",
"function",
"to_legacy_objects",
"(",
"array",
"$",
"discussions",
")",
":",
"array",
"{",
"return",
"array_map",
"(",
"function",
"(",
"discussion_entity",
"$",
"discussion",
")",
"{",
"return",
"(",
"object",
")",
"[",
"'id'",
"=>",
"$",
"discuss... | Convert a list of discussion entities into stdClasses.
@param discussion_entity[] $authors The authors to convert.
@return stdClass[] | [
"Convert",
"a",
"list",
"of",
"discussion",
"entities",
"into",
"stdClasses",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/local/data_mappers/legacy/discussion.php#L45-L64 |
216,445 | moodle/moodle | my/lib.php | my_syspage_block_manager.load_blocks | public function load_blocks($includeinvisible = null) {
$origcontext = $this->page->context;
$this->page->context = context_system::instance();
parent::load_blocks($includeinvisible);
$this->page->context = $origcontext;
} | php | public function load_blocks($includeinvisible = null) {
$origcontext = $this->page->context;
$this->page->context = context_system::instance();
parent::load_blocks($includeinvisible);
$this->page->context = $origcontext;
} | [
"public",
"function",
"load_blocks",
"(",
"$",
"includeinvisible",
"=",
"null",
")",
"{",
"$",
"origcontext",
"=",
"$",
"this",
"->",
"page",
"->",
"context",
";",
"$",
"this",
"->",
"page",
"->",
"context",
"=",
"context_system",
"::",
"instance",
"(",
... | Load blocks using the system context, rather than the user's context.
This is needed because the My Moodle pages set the page context to the
user's context for access control, etc. But the blocks for the system
pages are stored in the system context. | [
"Load",
"blocks",
"using",
"the",
"system",
"context",
"rather",
"than",
"the",
"user",
"s",
"context",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/my/lib.php#L226-L231 |
216,446 | moodle/moodle | lib/componentlib.class.php | component_installer.check_requisites | function check_requisites() {
global $CFG;
$this->requisitesok = false;
/// Check that everything we need is present
if (empty($this->sourcebase) || empty($this->zipfilename)) {
$this->errorstring='missingrequiredfield';
return false;
}
/// Check for cor... | php | function check_requisites() {
global $CFG;
$this->requisitesok = false;
/// Check that everything we need is present
if (empty($this->sourcebase) || empty($this->zipfilename)) {
$this->errorstring='missingrequiredfield';
return false;
}
/// Check for cor... | [
"function",
"check_requisites",
"(",
")",
"{",
"global",
"$",
"CFG",
";",
"$",
"this",
"->",
"requisitesok",
"=",
"false",
";",
"/// Check that everything we need is present",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"sourcebase",
")",
"||",
"empty",
"(",
... | This function will check if everything is properly set to begin
one installation. Also, it will check for required settings
and will fill everything as needed.
@global object
@return boolean true/false (plus detailed error in errorstring) | [
"This",
"function",
"will",
"check",
"if",
"everything",
"is",
"properly",
"set",
"to",
"begin",
"one",
"installation",
".",
"Also",
"it",
"will",
"check",
"for",
"required",
"settings",
"and",
"will",
"fill",
"everything",
"as",
"needed",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/componentlib.class.php#L227-L264 |
216,447 | moodle/moodle | lib/componentlib.class.php | component_installer.need_upgrade | function need_upgrade() {
/// Check requisites are passed
if (!$this->requisitesok) {
return COMPONENT_ERROR;
}
/// Get local md5
$local_md5 = $this->get_local_md5();
/// Get remote md5
if (!$remote_md5 = $this->get_component_md5()) {
return COMPONENT... | php | function need_upgrade() {
/// Check requisites are passed
if (!$this->requisitesok) {
return COMPONENT_ERROR;
}
/// Get local md5
$local_md5 = $this->get_local_md5();
/// Get remote md5
if (!$remote_md5 = $this->get_component_md5()) {
return COMPONENT... | [
"function",
"need_upgrade",
"(",
")",
"{",
"/// Check requisites are passed",
"if",
"(",
"!",
"$",
"this",
"->",
"requisitesok",
")",
"{",
"return",
"COMPONENT_ERROR",
";",
"}",
"/// Get local md5",
"$",
"local_md5",
"=",
"$",
"this",
"->",
"get_local_md5",
"(",... | This function will detect if remote component needs to be installed
because it's different from the local one
@uses COMPONENT_ERROR
@uses COMPONENT_UPTODATE
@uses COMPONENT_NEEDUPDATE
@return int COMPONENT_(ERROR | UPTODATE | NEEDUPDATE) | [
"This",
"function",
"will",
"detect",
"if",
"remote",
"component",
"needs",
"to",
"be",
"installed",
"because",
"it",
"s",
"different",
"from",
"the",
"local",
"one"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/componentlib.class.php#L381-L399 |
216,448 | moodle/moodle | lib/componentlib.class.php | component_installer.get_local_md5 | function get_local_md5() {
global $CFG;
/// Check requisites are passed
if (!$this->requisitesok) {
return false;
}
$return_value = 'needtobeinstalled'; /// Fake value to force new installation
/// Calculate source to read
$source = $CFG->dataroot.'/'.$thi... | php | function get_local_md5() {
global $CFG;
/// Check requisites are passed
if (!$this->requisitesok) {
return false;
}
$return_value = 'needtobeinstalled'; /// Fake value to force new installation
/// Calculate source to read
$source = $CFG->dataroot.'/'.$thi... | [
"function",
"get_local_md5",
"(",
")",
"{",
"global",
"$",
"CFG",
";",
"/// Check requisites are passed",
"if",
"(",
"!",
"$",
"this",
"->",
"requisitesok",
")",
"{",
"return",
"false",
";",
"}",
"$",
"return_value",
"=",
"'needtobeinstalled'",
";",
"/// Fake ... | This function will get the local md5 value of the installed
component.
@global object
@return bool|string md5 of the local component (false on error) | [
"This",
"function",
"will",
"get",
"the",
"local",
"md5",
"value",
"of",
"the",
"installed",
"component",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/componentlib.class.php#L422-L441 |
216,449 | moodle/moodle | lib/componentlib.class.php | component_installer.get_component_md5 | function get_component_md5() {
/// Check requisites are passed
if (!$this->requisitesok) {
return false;
}
/// Get all components of md5 file
if (!$comp_arr = $this->get_all_components_md5()) {
if (empty($this->errorstring)) {
$this->errorstring='... | php | function get_component_md5() {
/// Check requisites are passed
if (!$this->requisitesok) {
return false;
}
/// Get all components of md5 file
if (!$comp_arr = $this->get_all_components_md5()) {
if (empty($this->errorstring)) {
$this->errorstring='... | [
"function",
"get_component_md5",
"(",
")",
"{",
"/// Check requisites are passed",
"if",
"(",
"!",
"$",
"this",
"->",
"requisitesok",
")",
"{",
"return",
"false",
";",
"}",
"/// Get all components of md5 file",
"if",
"(",
"!",
"$",
"comp_arr",
"=",
"$",
"this",
... | This function will download the specified md5 file, looking for the
current componentname, returning its md5 field and storing extramd5info
if present. Also it caches results to cachedmd5components for better
performance in the same request.
@return mixed md5 present in server (or false if error) | [
"This",
"function",
"will",
"download",
"the",
"specified",
"md5",
"file",
"looking",
"for",
"the",
"current",
"componentname",
"returning",
"its",
"md5",
"field",
"and",
"storing",
"extramd5info",
"if",
"present",
".",
"Also",
"it",
"caches",
"results",
"to",
... | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/componentlib.class.php#L451-L479 |
216,450 | moodle/moodle | lib/componentlib.class.php | component_installer.get_all_components_md5 | function get_all_components_md5() {
/// Check requisites are passed
if (!$this->requisitesok) {
return false;
}
/// Initialize components array
$comp_arr = array();
/// Define and retrieve the full md5 file
if ($this->zippath) {
$source = $this->sou... | php | function get_all_components_md5() {
/// Check requisites are passed
if (!$this->requisitesok) {
return false;
}
/// Initialize components array
$comp_arr = array();
/// Define and retrieve the full md5 file
if ($this->zippath) {
$source = $this->sou... | [
"function",
"get_all_components_md5",
"(",
")",
"{",
"/// Check requisites are passed",
"if",
"(",
"!",
"$",
"this",
"->",
"requisitesok",
")",
"{",
"return",
"false",
";",
"}",
"/// Initialize components array",
"$",
"comp_arr",
"=",
"array",
"(",
")",
";",
"//... | This function allows you to retrieve the complete array of components found in
the md5filename
@return bool|array array of components in md5 file or false if error | [
"This",
"function",
"allows",
"you",
"to",
"retrieve",
"the",
"complete",
"array",
"of",
"components",
"found",
"in",
"the",
"md5filename"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/componentlib.class.php#L487-L557 |
216,451 | moodle/moodle | lib/componentlib.class.php | lang_installer.set_queue | public function set_queue($langcodes) {
if (is_array($langcodes)) {
$this->queue = $langcodes;
} else if (!empty($langcodes)) {
$this->queue = array($langcodes);
}
} | php | public function set_queue($langcodes) {
if (is_array($langcodes)) {
$this->queue = $langcodes;
} else if (!empty($langcodes)) {
$this->queue = array($langcodes);
}
} | [
"public",
"function",
"set_queue",
"(",
"$",
"langcodes",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"langcodes",
")",
")",
"{",
"$",
"this",
"->",
"queue",
"=",
"$",
"langcodes",
";",
"}",
"else",
"if",
"(",
"!",
"empty",
"(",
"$",
"langcodes",
")... | Sets the queue of language packs to be installed
@param string|array $langcodes language code like 'cs' or a list of them | [
"Sets",
"the",
"queue",
"of",
"language",
"packs",
"to",
"be",
"installed"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/componentlib.class.php#L633-L639 |
216,452 | moodle/moodle | lib/componentlib.class.php | lang_installer.get_remote_list_of_languages | public function get_remote_list_of_languages() {
$source = 'https://download.moodle.org/langpack/' . $this->version . '/languages.md5';
$availablelangs = array();
if ($content = download_file_content($source)) {
$alllines = explode("\n", $content);
foreach($alllines as $... | php | public function get_remote_list_of_languages() {
$source = 'https://download.moodle.org/langpack/' . $this->version . '/languages.md5';
$availablelangs = array();
if ($content = download_file_content($source)) {
$alllines = explode("\n", $content);
foreach($alllines as $... | [
"public",
"function",
"get_remote_list_of_languages",
"(",
")",
"{",
"$",
"source",
"=",
"'https://download.moodle.org/langpack/'",
".",
"$",
"this",
"->",
"version",
".",
"'/languages.md5'",
";",
"$",
"availablelangs",
"=",
"array",
"(",
")",
";",
"if",
"(",
"$... | Returns the list of available language packs from download.moodle.org
@return array|bool false if can not download | [
"Returns",
"the",
"list",
"of",
"available",
"language",
"packs",
"from",
"download",
".",
"moodle",
".",
"org"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/componentlib.class.php#L704-L720 |
216,453 | moodle/moodle | lib/componentlib.class.php | lang_installer.is_queued | protected function is_queued($langcode = '') {
if (empty($langcode)) {
return !empty($this->queue);
} else {
return in_array($langcode, $this->queue);
}
} | php | protected function is_queued($langcode = '') {
if (empty($langcode)) {
return !empty($this->queue);
} else {
return in_array($langcode, $this->queue);
}
} | [
"protected",
"function",
"is_queued",
"(",
"$",
"langcode",
"=",
"''",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"langcode",
")",
")",
"{",
"return",
"!",
"empty",
"(",
"$",
"this",
"->",
"queue",
")",
";",
"}",
"else",
"{",
"return",
"in_array",
"("... | Checks if the given language is queued or if the queue is empty
@example $installer->is_queued('es'); // is Spanish going to be installed?
@example $installer->is_queued(); // is there a language queued?
@param string $langcode language code or empty string for "any"
@return boolean | [
"Checks",
"if",
"the",
"given",
"language",
"is",
"queued",
"or",
"if",
"the",
"queue",
"is",
"empty"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/componentlib.class.php#L746-L754 |
216,454 | moodle/moodle | lib/componentlib.class.php | lang_installer.install_language_pack | protected function install_language_pack($langcode) {
// initialise new component installer to process this language
$installer = new component_installer('https://download.moodle.org', 'download.php/direct/langpack/' . $this->version,
$langcode . '.zip', 'languages.md5', 'lang');
i... | php | protected function install_language_pack($langcode) {
// initialise new component installer to process this language
$installer = new component_installer('https://download.moodle.org', 'download.php/direct/langpack/' . $this->version,
$langcode . '.zip', 'languages.md5', 'lang');
i... | [
"protected",
"function",
"install_language_pack",
"(",
"$",
"langcode",
")",
"{",
"// initialise new component installer to process this language",
"$",
"installer",
"=",
"new",
"component_installer",
"(",
"'https://download.moodle.org'",
",",
"'download.php/direct/langpack/'",
"... | Perform the actual language pack installation
@uses component_installer
@param string $langcode
@return int return status | [
"Perform",
"the",
"actual",
"language",
"pack",
"installation"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/componentlib.class.php#L794-L822 |
216,455 | moodle/moodle | auth/cas/CAS/CAS/PGTStorage/Db.php | CAS_PGTStorage_Db.init | public function init()
{
phpCAS::traceBegin();
// if the storage has already been initialized, return immediatly
if ($this->isInitialized()) {
return;
}
// initialize the base object
parent::init();
// create the PDO object if it doesn't exist al... | php | public function init()
{
phpCAS::traceBegin();
// if the storage has already been initialized, return immediatly
if ($this->isInitialized()) {
return;
}
// initialize the base object
parent::init();
// create the PDO object if it doesn't exist al... | [
"public",
"function",
"init",
"(",
")",
"{",
"phpCAS",
"::",
"traceBegin",
"(",
")",
";",
"// if the storage has already been initialized, return immediatly",
"if",
"(",
"$",
"this",
"->",
"isInitialized",
"(",
")",
")",
"{",
"return",
";",
"}",
"// initialize the... | This method is used to initialize the storage. Halts on error.
@return void | [
"This",
"method",
"is",
"used",
"to",
"initialize",
"the",
"storage",
".",
"Halts",
"on",
"error",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/auth/cas/CAS/CAS/PGTStorage/Db.php#L179-L204 |
216,456 | moodle/moodle | auth/cas/CAS/CAS/PGTStorage/Db.php | CAS_PGTStorage_Db._setErrorMode | private function _setErrorMode()
{
// get PDO object and enable exception error mode
$pdo = $this->_getPdo();
$this->_errMode = $pdo->getAttribute(PDO::ATTR_ERRMODE);
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} | php | private function _setErrorMode()
{
// get PDO object and enable exception error mode
$pdo = $this->_getPdo();
$this->_errMode = $pdo->getAttribute(PDO::ATTR_ERRMODE);
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} | [
"private",
"function",
"_setErrorMode",
"(",
")",
"{",
"// get PDO object and enable exception error mode",
"$",
"pdo",
"=",
"$",
"this",
"->",
"_getPdo",
"(",
")",
";",
"$",
"this",
"->",
"_errMode",
"=",
"$",
"pdo",
"->",
"getAttribute",
"(",
"PDO",
"::",
... | This method will enable the Exception error mode on the PDO object
@return void | [
"This",
"method",
"will",
"enable",
"the",
"Exception",
"error",
"mode",
"on",
"the",
"PDO",
"object"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/auth/cas/CAS/CAS/PGTStorage/Db.php#L221-L227 |
216,457 | moodle/moodle | auth/cas/CAS/CAS/PGTStorage/Db.php | CAS_PGTStorage_Db._resetErrorMode | private function _resetErrorMode()
{
// get PDO object and reset the error mode to what it was originally
$pdo = $this->_getPdo();
$pdo->setAttribute(PDO::ATTR_ERRMODE, $this->_errMode);
} | php | private function _resetErrorMode()
{
// get PDO object and reset the error mode to what it was originally
$pdo = $this->_getPdo();
$pdo->setAttribute(PDO::ATTR_ERRMODE, $this->_errMode);
} | [
"private",
"function",
"_resetErrorMode",
"(",
")",
"{",
"// get PDO object and reset the error mode to what it was originally",
"$",
"pdo",
"=",
"$",
"this",
"->",
"_getPdo",
"(",
")",
";",
"$",
"pdo",
"->",
"setAttribute",
"(",
"PDO",
"::",
"ATTR_ERRMODE",
",",
... | this method will reset the error mode on the PDO object
@return void | [
"this",
"method",
"will",
"reset",
"the",
"error",
"mode",
"on",
"the",
"PDO",
"object"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/auth/cas/CAS/CAS/PGTStorage/Db.php#L234-L239 |
216,458 | moodle/moodle | auth/cas/CAS/CAS/PGTStorage/Db.php | CAS_PGTStorage_Db.createTable | public function createTable()
{
phpCAS::traceBegin();
// initialize this PGTStorage object if it hasn't been initialized yet
if ( !$this->isInitialized() ) {
$this->init();
}
// initialize the PDO object for this method
$pdo = $this->_getPdo();
$... | php | public function createTable()
{
phpCAS::traceBegin();
// initialize this PGTStorage object if it hasn't been initialized yet
if ( !$this->isInitialized() ) {
$this->init();
}
// initialize the PDO object for this method
$pdo = $this->_getPdo();
$... | [
"public",
"function",
"createTable",
"(",
")",
"{",
"phpCAS",
"::",
"traceBegin",
"(",
")",
";",
"// initialize this PGTStorage object if it hasn't been initialized yet",
"if",
"(",
"!",
"$",
"this",
"->",
"isInitialized",
"(",
")",
")",
"{",
"$",
"this",
"->",
... | This method creates the database table used to store pgt's and pgtiou's
@return void | [
"This",
"method",
"creates",
"the",
"database",
"table",
"used",
"to",
"store",
"pgt",
"s",
"and",
"pgtiou",
"s"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/auth/cas/CAS/CAS/PGTStorage/Db.php#L303-L338 |
216,459 | moodle/moodle | auth/cas/CAS/CAS/PGTStorage/Db.php | CAS_PGTStorage_Db.write | public function write($pgt, $pgt_iou)
{
phpCAS::traceBegin();
// initialize the PDO object for this method
$pdo = $this->_getPdo();
$this->_setErrorMode();
try {
$pdo->beginTransaction();
$query = $pdo->prepare($this->storePgtSql());
$qu... | php | public function write($pgt, $pgt_iou)
{
phpCAS::traceBegin();
// initialize the PDO object for this method
$pdo = $this->_getPdo();
$this->_setErrorMode();
try {
$pdo->beginTransaction();
$query = $pdo->prepare($this->storePgtSql());
$qu... | [
"public",
"function",
"write",
"(",
"$",
"pgt",
",",
"$",
"pgt_iou",
")",
"{",
"phpCAS",
"::",
"traceBegin",
"(",
")",
";",
"// initialize the PDO object for this method",
"$",
"pdo",
"=",
"$",
"this",
"->",
"_getPdo",
"(",
")",
";",
"$",
"this",
"->",
"... | This method stores a PGT and its corresponding PGT Iou in the database.
Echoes a warning on error.
@param string $pgt the PGT
@param string $pgt_iou the PGT iou
@return void | [
"This",
"method",
"stores",
"a",
"PGT",
"and",
"its",
"corresponding",
"PGT",
"Iou",
"in",
"the",
"database",
".",
"Echoes",
"a",
"warning",
"on",
"error",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/auth/cas/CAS/CAS/PGTStorage/Db.php#L349-L382 |
216,460 | moodle/moodle | auth/cas/CAS/CAS/PGTStorage/Db.php | CAS_PGTStorage_Db.read | public function read($pgt_iou)
{
phpCAS::traceBegin();
$pgt = false;
// initialize the PDO object for this method
$pdo = $this->_getPdo();
$this->_setErrorMode();
try {
$pdo->beginTransaction();
// fetch the pgt for the specified pgt_iou
... | php | public function read($pgt_iou)
{
phpCAS::traceBegin();
$pgt = false;
// initialize the PDO object for this method
$pdo = $this->_getPdo();
$this->_setErrorMode();
try {
$pdo->beginTransaction();
// fetch the pgt for the specified pgt_iou
... | [
"public",
"function",
"read",
"(",
"$",
"pgt_iou",
")",
"{",
"phpCAS",
"::",
"traceBegin",
"(",
")",
";",
"$",
"pgt",
"=",
"false",
";",
"// initialize the PDO object for this method",
"$",
"pdo",
"=",
"$",
"this",
"->",
"_getPdo",
"(",
")",
";",
"$",
"t... | This method reads a PGT corresponding to a PGT Iou and deletes the
corresponding db entry.
@param string $pgt_iou the PGT iou
@return the corresponding PGT, or FALSE on error | [
"This",
"method",
"reads",
"a",
"PGT",
"corresponding",
"to",
"a",
"PGT",
"Iou",
"and",
"deletes",
"the",
"corresponding",
"db",
"entry",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/auth/cas/CAS/CAS/PGTStorage/Db.php#L392-L434 |
216,461 | moodle/moodle | mod/feedback/classes/external.php | mod_feedback_external.get_feedbacks_by_courses | public static function get_feedbacks_by_courses($courseids = array()) {
global $PAGE;
$warnings = array();
$returnedfeedbacks = array();
$params = array(
'courseids' => $courseids,
);
$params = self::validate_parameters(self::get_feedbacks_by_courses_paramet... | php | public static function get_feedbacks_by_courses($courseids = array()) {
global $PAGE;
$warnings = array();
$returnedfeedbacks = array();
$params = array(
'courseids' => $courseids,
);
$params = self::validate_parameters(self::get_feedbacks_by_courses_paramet... | [
"public",
"static",
"function",
"get_feedbacks_by_courses",
"(",
"$",
"courseids",
"=",
"array",
"(",
")",
")",
"{",
"global",
"$",
"PAGE",
";",
"$",
"warnings",
"=",
"array",
"(",
")",
";",
"$",
"returnedfeedbacks",
"=",
"array",
"(",
")",
";",
"$",
"... | Returns a list of feedbacks in a provided list of courses.
If no list is provided all feedbacks that the user can view will be returned.
@param array $courseids course ids
@return array of warnings and feedbacks
@since Moodle 3.3 | [
"Returns",
"a",
"list",
"of",
"feedbacks",
"in",
"a",
"provided",
"list",
"of",
"courses",
".",
"If",
"no",
"list",
"is",
"provided",
"all",
"feedbacks",
"that",
"the",
"user",
"can",
"view",
"will",
"be",
"returned",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/feedback/classes/external.php#L73-L127 |
216,462 | moodle/moodle | mod/feedback/classes/external.php | mod_feedback_external.validate_feedback | protected static function validate_feedback($feedbackid, $courseid = 0) {
global $DB, $USER;
// Request and permission validation.
$feedback = $DB->get_record('feedback', array('id' => $feedbackid), '*', MUST_EXIST);
list($feedbackcourse, $cm) = get_course_and_cm_from_instance($feedback... | php | protected static function validate_feedback($feedbackid, $courseid = 0) {
global $DB, $USER;
// Request and permission validation.
$feedback = $DB->get_record('feedback', array('id' => $feedbackid), '*', MUST_EXIST);
list($feedbackcourse, $cm) = get_course_and_cm_from_instance($feedback... | [
"protected",
"static",
"function",
"validate_feedback",
"(",
"$",
"feedbackid",
",",
"$",
"courseid",
"=",
"0",
")",
"{",
"global",
"$",
"DB",
",",
"$",
"USER",
";",
"// Request and permission validation.",
"$",
"feedback",
"=",
"$",
"DB",
"->",
"get_record",
... | Utility function for validating a feedback.
@param int $feedbackid feedback instance id
@param int $courseid courseid course where user completes the feedback (for site feedbacks only)
@return array containing the feedback, feedback course, context, course module and the course where is being completed.
@throws moodle... | [
"Utility",
"function",
"for",
"validating",
"a",
"feedback",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/feedback/classes/external.php#L155-L178 |
216,463 | moodle/moodle | mod/feedback/classes/external.php | mod_feedback_external.validate_feedback_access | protected static function validate_feedback_access($feedback, $course, $cm, $context, $checksubmit = false) {
$feedbackcompletion = new mod_feedback_completion($feedback, $cm, $course->id);
if (!$feedbackcompletion->can_complete()) {
throw new required_capability_exception($context, 'mod/fe... | php | protected static function validate_feedback_access($feedback, $course, $cm, $context, $checksubmit = false) {
$feedbackcompletion = new mod_feedback_completion($feedback, $cm, $course->id);
if (!$feedbackcompletion->can_complete()) {
throw new required_capability_exception($context, 'mod/fe... | [
"protected",
"static",
"function",
"validate_feedback_access",
"(",
"$",
"feedback",
",",
"$",
"course",
",",
"$",
"cm",
",",
"$",
"context",
",",
"$",
"checksubmit",
"=",
"false",
")",
"{",
"$",
"feedbackcompletion",
"=",
"new",
"mod_feedback_completion",
"("... | Utility function for validating access to feedback.
@param stdClass $feedback feedback object
@param stdClass $course course where user completes the feedback (for site feedbacks only)
@param stdClass $cm course module
@param stdClass $context context object
@throws moodle_exception
@return mod_fe... | [
"Utility",
"function",
"for",
"validating",
"access",
"to",
"feedback",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/feedback/classes/external.php#L191-L210 |
216,464 | moodle/moodle | mod/feedback/classes/external.php | mod_feedback_external.get_feedback_access_information | public static function get_feedback_access_information($feedbackid, $courseid = 0) {
global $PAGE;
$params = array(
'feedbackid' => $feedbackid,
'courseid' => $courseid,
);
$params = self::validate_parameters(self::get_feedback_access_information_parameters(), $p... | php | public static function get_feedback_access_information($feedbackid, $courseid = 0) {
global $PAGE;
$params = array(
'feedbackid' => $feedbackid,
'courseid' => $courseid,
);
$params = self::validate_parameters(self::get_feedback_access_information_parameters(), $p... | [
"public",
"static",
"function",
"get_feedback_access_information",
"(",
"$",
"feedbackid",
",",
"$",
"courseid",
"=",
"0",
")",
"{",
"global",
"$",
"PAGE",
";",
"$",
"params",
"=",
"array",
"(",
"'feedbackid'",
"=>",
"$",
"feedbackid",
",",
"'courseid'",
"=>... | Return access information for a given feedback.
@param int $feedbackid feedback instance id
@param int $courseid course where user completes the feedback (for site feedbacks only)
@return array of warnings and the access information
@since Moodle 3.3
@throws moodle_exception | [
"Return",
"access",
"information",
"for",
"a",
"given",
"feedback",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/feedback/classes/external.php#L237-L268 |
216,465 | moodle/moodle | mod/feedback/classes/external.php | mod_feedback_external.get_feedback_access_information_returns | public static function get_feedback_access_information_returns() {
return new external_single_structure(
array(
'canviewanalysis' => new external_value(PARAM_BOOL, 'Whether the user can view the analysis or not.'),
'cancomplete' => new external_value(PARAM_BOOL, 'Whet... | php | public static function get_feedback_access_information_returns() {
return new external_single_structure(
array(
'canviewanalysis' => new external_value(PARAM_BOOL, 'Whether the user can view the analysis or not.'),
'cancomplete' => new external_value(PARAM_BOOL, 'Whet... | [
"public",
"static",
"function",
"get_feedback_access_information_returns",
"(",
")",
"{",
"return",
"new",
"external_single_structure",
"(",
"array",
"(",
"'canviewanalysis'",
"=>",
"new",
"external_value",
"(",
"PARAM_BOOL",
",",
"'Whether the user can view the analysis or n... | Describes the get_feedback_access_information return value.
@return external_single_structure
@since Moodle 3.3 | [
"Describes",
"the",
"get_feedback_access_information",
"return",
"value",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/feedback/classes/external.php#L276-L292 |
216,466 | moodle/moodle | mod/feedback/classes/external.php | mod_feedback_external.view_feedback_parameters | public static function view_feedback_parameters() {
return new external_function_parameters (
array(
'feedbackid' => new external_value(PARAM_INT, 'Feedback instance id'),
'moduleviewed' => new external_value(PARAM_BOOL, 'If we need to mark the module as viewed for co... | php | public static function view_feedback_parameters() {
return new external_function_parameters (
array(
'feedbackid' => new external_value(PARAM_INT, 'Feedback instance id'),
'moduleviewed' => new external_value(PARAM_BOOL, 'If we need to mark the module as viewed for co... | [
"public",
"static",
"function",
"view_feedback_parameters",
"(",
")",
"{",
"return",
"new",
"external_function_parameters",
"(",
"array",
"(",
"'feedbackid'",
"=>",
"new",
"external_value",
"(",
"PARAM_INT",
",",
"'Feedback instance id'",
")",
",",
"'moduleviewed'",
"... | Describes the parameters for view_feedback.
@return external_function_parameters
@since Moodle 3.3 | [
"Describes",
"the",
"parameters",
"for",
"view_feedback",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/feedback/classes/external.php#L300-L310 |
216,467 | moodle/moodle | mod/feedback/classes/external.php | mod_feedback_external.get_current_completed_tmp | public static function get_current_completed_tmp($feedbackid, $courseid = 0) {
global $PAGE;
$params = array('feedbackid' => $feedbackid, 'courseid' => $courseid);
$params = self::validate_parameters(self::get_current_completed_tmp_parameters(), $params);
$warnings = array();
l... | php | public static function get_current_completed_tmp($feedbackid, $courseid = 0) {
global $PAGE;
$params = array('feedbackid' => $feedbackid, 'courseid' => $courseid);
$params = self::validate_parameters(self::get_current_completed_tmp_parameters(), $params);
$warnings = array();
l... | [
"public",
"static",
"function",
"get_current_completed_tmp",
"(",
"$",
"feedbackid",
",",
"$",
"courseid",
"=",
"0",
")",
"{",
"global",
"$",
"PAGE",
";",
"$",
"params",
"=",
"array",
"(",
"'feedbackid'",
"=>",
"$",
"feedbackid",
",",
"'courseid'",
"=>",
"... | Returns the temporary completion record for the current user.
@param int $feedbackid feedback instance id
@param int $courseid course where user completes the feedback (for site feedbacks only)
@return array of warnings and status result
@since Moodle 3.3
@throws moodle_exception | [
"Returns",
"the",
"temporary",
"completion",
"record",
"for",
"the",
"current",
"user",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/feedback/classes/external.php#L389-L408 |
216,468 | moodle/moodle | mod/feedback/classes/external.php | mod_feedback_external.launch_feedback | public static function launch_feedback($feedbackid, $courseid = 0) {
global $PAGE;
$params = array('feedbackid' => $feedbackid, 'courseid' => $courseid);
$params = self::validate_parameters(self::launch_feedback_parameters(), $params);
$warnings = array();
list($feedback, $cour... | php | public static function launch_feedback($feedbackid, $courseid = 0) {
global $PAGE;
$params = array('feedbackid' => $feedbackid, 'courseid' => $courseid);
$params = self::validate_parameters(self::launch_feedback_parameters(), $params);
$warnings = array();
list($feedback, $cour... | [
"public",
"static",
"function",
"launch_feedback",
"(",
"$",
"feedbackid",
",",
"$",
"courseid",
"=",
"0",
")",
"{",
"global",
"$",
"PAGE",
";",
"$",
"params",
"=",
"array",
"(",
"'feedbackid'",
"=>",
"$",
"feedbackid",
",",
"'courseid'",
"=>",
"$",
"cou... | Starts or continues a feedback submission
@param array $feedbackid feedback instance id
@param int $courseid course where user completes a feedback (for site feedbacks only).
@return array of warnings and launch information
@since Moodle 3.3 | [
"Starts",
"or",
"continues",
"a",
"feedback",
"submission"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/feedback/classes/external.php#L518-L540 |
216,469 | moodle/moodle | mod/feedback/classes/external.php | mod_feedback_external.get_page_items | public static function get_page_items($feedbackid, $page, $courseid = 0) {
global $PAGE;
$params = array('feedbackid' => $feedbackid, 'page' => $page, 'courseid' => $courseid);
$params = self::validate_parameters(self::get_page_items_parameters(), $params);
$warnings = array();
... | php | public static function get_page_items($feedbackid, $page, $courseid = 0) {
global $PAGE;
$params = array('feedbackid' => $feedbackid, 'page' => $page, 'courseid' => $courseid);
$params = self::validate_parameters(self::get_page_items_parameters(), $params);
$warnings = array();
... | [
"public",
"static",
"function",
"get_page_items",
"(",
"$",
"feedbackid",
",",
"$",
"page",
",",
"$",
"courseid",
"=",
"0",
")",
"{",
"global",
"$",
"PAGE",
";",
"$",
"params",
"=",
"array",
"(",
"'feedbackid'",
"=>",
"$",
"feedbackid",
",",
"'page'",
... | Get a single feedback page items.
@param int $feedbackid feedback instance id
@param int $page the page to get starting by 0
@param int $courseid course where user completes the feedback (for site feedbacks only)
@return array of warnings and launch information
@since Moodle 3.3 | [
"Get",
"a",
"single",
"feedback",
"page",
"items",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/feedback/classes/external.php#L583-L616 |
216,470 | moodle/moodle | mod/feedback/classes/external.php | mod_feedback_external.get_page_items_returns | public static function get_page_items_returns() {
return new external_single_structure(
array(
'items' => new external_multiple_structure(
feedback_item_exporter::get_read_structure()
),
'hasprevpage' => new external_value(PARAM_BOO... | php | public static function get_page_items_returns() {
return new external_single_structure(
array(
'items' => new external_multiple_structure(
feedback_item_exporter::get_read_structure()
),
'hasprevpage' => new external_value(PARAM_BOO... | [
"public",
"static",
"function",
"get_page_items_returns",
"(",
")",
"{",
"return",
"new",
"external_single_structure",
"(",
"array",
"(",
"'items'",
"=>",
"new",
"external_multiple_structure",
"(",
"feedback_item_exporter",
"::",
"get_read_structure",
"(",
")",
")",
"... | Describes the get_page_items return value.
@return external_single_structure
@since Moodle 3.3 | [
"Describes",
"the",
"get_page_items",
"return",
"value",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/feedback/classes/external.php#L624-L635 |
216,471 | moodle/moodle | mod/feedback/classes/external.php | mod_feedback_external.process_page | public static function process_page($feedbackid, $page, $responses = [], $goprevious = false, $courseid = 0) {
global $USER, $SESSION;
$params = array('feedbackid' => $feedbackid, 'page' => $page, 'responses' => $responses, 'goprevious' => $goprevious,
'courseid' => $courseid);
$par... | php | public static function process_page($feedbackid, $page, $responses = [], $goprevious = false, $courseid = 0) {
global $USER, $SESSION;
$params = array('feedbackid' => $feedbackid, 'page' => $page, 'responses' => $responses, 'goprevious' => $goprevious,
'courseid' => $courseid);
$par... | [
"public",
"static",
"function",
"process_page",
"(",
"$",
"feedbackid",
",",
"$",
"page",
",",
"$",
"responses",
"=",
"[",
"]",
",",
"$",
"goprevious",
"=",
"false",
",",
"$",
"courseid",
"=",
"0",
")",
"{",
"global",
"$",
"USER",
",",
"$",
"SESSION"... | Process a jump between pages.
@param array $feedbackid feedback instance id
@param array $page the page being processed
@param array $responses the responses to be processed
@param bool $goprevious whether we want to jump to previous page
@param int $courseid course where user completes the feedback (for site feedback... | [
"Process",
"a",
"jump",
"between",
"pages",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/feedback/classes/external.php#L674-L740 |
216,472 | moodle/moodle | mod/feedback/classes/external.php | mod_feedback_external.get_analysis_parameters | public static function get_analysis_parameters() {
return new external_function_parameters (
array(
'feedbackid' => new external_value(PARAM_INT, 'Feedback instance id'),
'groupid' => new external_value(PARAM_INT, 'Group id, 0 means that the function will determine th... | php | public static function get_analysis_parameters() {
return new external_function_parameters (
array(
'feedbackid' => new external_value(PARAM_INT, 'Feedback instance id'),
'groupid' => new external_value(PARAM_INT, 'Group id, 0 means that the function will determine th... | [
"public",
"static",
"function",
"get_analysis_parameters",
"(",
")",
"{",
"return",
"new",
"external_function_parameters",
"(",
"array",
"(",
"'feedbackid'",
"=>",
"new",
"external_value",
"(",
"PARAM_INT",
",",
"'Feedback instance id'",
")",
",",
"'groupid'",
"=>",
... | Describes the parameters for get_analysis.
@return external_function_parameters
@since Moodle 3.3 | [
"Describes",
"the",
"parameters",
"for",
"get_analysis",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/feedback/classes/external.php#L766-L776 |
216,473 | moodle/moodle | mod/feedback/classes/external.php | mod_feedback_external.get_analysis_returns | public static function get_analysis_returns() {
return new external_single_structure(
array(
'completedcount' => new external_value(PARAM_INT, 'Number of completed submissions.'),
'itemscount' => new external_value(PARAM_INT, 'Number of items (questions).'),
'item... | php | public static function get_analysis_returns() {
return new external_single_structure(
array(
'completedcount' => new external_value(PARAM_INT, 'Number of completed submissions.'),
'itemscount' => new external_value(PARAM_INT, 'Number of items (questions).'),
'item... | [
"public",
"static",
"function",
"get_analysis_returns",
"(",
")",
"{",
"return",
"new",
"external_single_structure",
"(",
"array",
"(",
"'completedcount'",
"=>",
"new",
"external_value",
"(",
"PARAM_INT",
",",
"'Number of completed submissions.'",
")",
",",
"'itemscount... | Describes the get_analysis return value.
@return external_single_structure
@since Moodle 3.3 | [
"Describes",
"the",
"get_analysis",
"return",
"value",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/feedback/classes/external.php#L872-L890 |
216,474 | moodle/moodle | mod/feedback/classes/external.php | mod_feedback_external.get_unfinished_responses | public static function get_unfinished_responses($feedbackid, $courseid = 0) {
global $PAGE;
$params = array('feedbackid' => $feedbackid, 'courseid' => $courseid);
$params = self::validate_parameters(self::get_unfinished_responses_parameters(), $params);
$warnings = $itemsdata = array();... | php | public static function get_unfinished_responses($feedbackid, $courseid = 0) {
global $PAGE;
$params = array('feedbackid' => $feedbackid, 'courseid' => $courseid);
$params = self::validate_parameters(self::get_unfinished_responses_parameters(), $params);
$warnings = $itemsdata = array();... | [
"public",
"static",
"function",
"get_unfinished_responses",
"(",
"$",
"feedbackid",
",",
"$",
"courseid",
"=",
"0",
")",
"{",
"global",
"$",
"PAGE",
";",
"$",
"params",
"=",
"array",
"(",
"'feedbackid'",
"=>",
"$",
"feedbackid",
",",
"'courseid'",
"=>",
"$... | Retrieves responses from the current unfinished attempt.
@param array $feedbackid feedback instance id
@param int $courseid course where user completes the feedback (for site feedbacks only)
@return array of warnings and launch information
@since Moodle 3.3 | [
"Retrieves",
"responses",
"from",
"the",
"current",
"unfinished",
"attempt",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/feedback/classes/external.php#L916-L939 |
216,475 | moodle/moodle | mod/feedback/classes/external.php | mod_feedback_external.get_finished_responses | public static function get_finished_responses($feedbackid, $courseid = 0) {
global $PAGE;
$params = array('feedbackid' => $feedbackid, 'courseid' => $courseid);
$params = self::validate_parameters(self::get_finished_responses_parameters(), $params);
$warnings = $itemsdata = array();
... | php | public static function get_finished_responses($feedbackid, $courseid = 0) {
global $PAGE;
$params = array('feedbackid' => $feedbackid, 'courseid' => $courseid);
$params = self::validate_parameters(self::get_finished_responses_parameters(), $params);
$warnings = $itemsdata = array();
... | [
"public",
"static",
"function",
"get_finished_responses",
"(",
"$",
"feedbackid",
",",
"$",
"courseid",
"=",
"0",
")",
"{",
"global",
"$",
"PAGE",
";",
"$",
"params",
"=",
"array",
"(",
"'feedbackid'",
"=>",
"$",
"feedbackid",
",",
"'courseid'",
"=>",
"$",... | Retrieves responses from the last finished attempt.
@param array $feedbackid feedback instance id
@param int $courseid course where user completes the feedback (for site feedbacks only)
@return array of warnings and the responses
@since Moodle 3.3 | [
"Retrieves",
"responses",
"from",
"the",
"last",
"finished",
"attempt",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/feedback/classes/external.php#L982-L1007 |
216,476 | moodle/moodle | mod/feedback/classes/external.php | mod_feedback_external.get_non_respondents_parameters | public static function get_non_respondents_parameters() {
return new external_function_parameters (
array(
'feedbackid' => new external_value(PARAM_INT, 'Feedback instance id'),
'groupid' => new external_value(PARAM_INT, 'Group id, 0 means that the function will deter... | php | public static function get_non_respondents_parameters() {
return new external_function_parameters (
array(
'feedbackid' => new external_value(PARAM_INT, 'Feedback instance id'),
'groupid' => new external_value(PARAM_INT, 'Group id, 0 means that the function will deter... | [
"public",
"static",
"function",
"get_non_respondents_parameters",
"(",
")",
"{",
"return",
"new",
"external_function_parameters",
"(",
"array",
"(",
"'feedbackid'",
"=>",
"new",
"external_value",
"(",
"PARAM_INT",
",",
"'Feedback instance id'",
")",
",",
"'groupid'",
... | Describes the parameters for get_non_respondents.
@return external_function_parameters
@since Moodle 3.3 | [
"Describes",
"the",
"parameters",
"for",
"get_non_respondents",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/feedback/classes/external.php#L1032-L1046 |
216,477 | moodle/moodle | mod/feedback/classes/external.php | mod_feedback_external.get_non_respondents | public static function get_non_respondents($feedbackid, $groupid = 0, $sort = 'lastaccess', $page = 0, $perpage = 0,
$courseid = 0) {
global $CFG;
require_once($CFG->dirroot . '/mod/feedback/lib.php');
$params = array('feedbackid' => $feedbackid, 'groupid' => $groupid, 'sort' => $s... | php | public static function get_non_respondents($feedbackid, $groupid = 0, $sort = 'lastaccess', $page = 0, $perpage = 0,
$courseid = 0) {
global $CFG;
require_once($CFG->dirroot . '/mod/feedback/lib.php');
$params = array('feedbackid' => $feedbackid, 'groupid' => $groupid, 'sort' => $s... | [
"public",
"static",
"function",
"get_non_respondents",
"(",
"$",
"feedbackid",
",",
"$",
"groupid",
"=",
"0",
",",
"$",
"sort",
"=",
"'lastaccess'",
",",
"$",
"page",
"=",
"0",
",",
"$",
"perpage",
"=",
"0",
",",
"$",
"courseid",
"=",
"0",
")",
"{",
... | Retrieves a list of students who didn't submit the feedback.
@param int $feedbackid feedback instance id
@param int $groupid Group id, 0 means that the function will determine the user group'
@param str $sort sort param, must be firstname, lastname or lastaccess (default)
@param int $page the page of records to return... | [
"Retrieves",
"a",
"list",
"of",
"students",
"who",
"didn",
"t",
"submit",
"the",
"feedback",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/feedback/classes/external.php#L1060-L1130 |
216,478 | moodle/moodle | mod/feedback/classes/external.php | mod_feedback_external.get_non_respondents_returns | public static function get_non_respondents_returns() {
return new external_single_structure(
array(
'users' => new external_multiple_structure(
new external_single_structure(
array(
'courseid' => new external_val... | php | public static function get_non_respondents_returns() {
return new external_single_structure(
array(
'users' => new external_multiple_structure(
new external_single_structure(
array(
'courseid' => new external_val... | [
"public",
"static",
"function",
"get_non_respondents_returns",
"(",
")",
"{",
"return",
"new",
"external_single_structure",
"(",
"array",
"(",
"'users'",
"=>",
"new",
"external_multiple_structure",
"(",
"new",
"external_single_structure",
"(",
"array",
"(",
"'courseid'"... | Describes the get_non_respondents return value.
@return external_single_structure
@since Moodle 3.3 | [
"Describes",
"the",
"get_non_respondents",
"return",
"value",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/feedback/classes/external.php#L1138-L1155 |
216,479 | moodle/moodle | mod/feedback/classes/external.php | mod_feedback_external.get_responses_analysis_parameters | public static function get_responses_analysis_parameters() {
return new external_function_parameters (
array(
'feedbackid' => new external_value(PARAM_INT, 'Feedback instance id'),
'groupid' => new external_value(PARAM_INT, 'Group id, 0 means that the function will de... | php | public static function get_responses_analysis_parameters() {
return new external_function_parameters (
array(
'feedbackid' => new external_value(PARAM_INT, 'Feedback instance id'),
'groupid' => new external_value(PARAM_INT, 'Group id, 0 means that the function will de... | [
"public",
"static",
"function",
"get_responses_analysis_parameters",
"(",
")",
"{",
"return",
"new",
"external_function_parameters",
"(",
"array",
"(",
"'feedbackid'",
"=>",
"new",
"external_value",
"(",
"PARAM_INT",
",",
"'Feedback instance id'",
")",
",",
"'groupid'",... | Describes the parameters for get_responses_analysis.
@return external_function_parameters
@since Moodle 3.3 | [
"Describes",
"the",
"parameters",
"for",
"get_responses_analysis",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/feedback/classes/external.php#L1163-L1175 |
216,480 | moodle/moodle | mod/feedback/classes/external.php | mod_feedback_external.get_responses_analysis | public static function get_responses_analysis($feedbackid, $groupid = 0, $page = 0, $perpage = 0, $courseid = 0) {
$params = array('feedbackid' => $feedbackid, 'groupid' => $groupid, 'page' => $page, 'perpage' => $perpage,
'courseid' => $courseid);
$params = self::validate_parameters(self::... | php | public static function get_responses_analysis($feedbackid, $groupid = 0, $page = 0, $perpage = 0, $courseid = 0) {
$params = array('feedbackid' => $feedbackid, 'groupid' => $groupid, 'page' => $page, 'perpage' => $perpage,
'courseid' => $courseid);
$params = self::validate_parameters(self::... | [
"public",
"static",
"function",
"get_responses_analysis",
"(",
"$",
"feedbackid",
",",
"$",
"groupid",
"=",
"0",
",",
"$",
"page",
"=",
"0",
",",
"$",
"perpage",
"=",
"0",
",",
"$",
"courseid",
"=",
"0",
")",
"{",
"$",
"params",
"=",
"array",
"(",
... | Return the feedback user responses.
@param int $feedbackid feedback instance id
@param int $groupid Group id, 0 means that the function will determine the user group
@param int $page the page of records to return
@param int $perpage the number of records to return per page
@param int $courseid course where user comple... | [
"Return",
"the",
"feedback",
"user",
"responses",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/feedback/classes/external.php#L1189-L1235 |
216,481 | moodle/moodle | mod/feedback/classes/external.php | mod_feedback_external.get_responses_analysis_returns | public static function get_responses_analysis_returns() {
$responsestructure = new external_multiple_structure(
new external_single_structure(
array(
'id' => new external_value(PARAM_INT, 'Response id'),
'name' => new external_value(PARAM_RAW, ... | php | public static function get_responses_analysis_returns() {
$responsestructure = new external_multiple_structure(
new external_single_structure(
array(
'id' => new external_value(PARAM_INT, 'Response id'),
'name' => new external_value(PARAM_RAW, ... | [
"public",
"static",
"function",
"get_responses_analysis_returns",
"(",
")",
"{",
"$",
"responsestructure",
"=",
"new",
"external_multiple_structure",
"(",
"new",
"external_single_structure",
"(",
"array",
"(",
"'id'",
"=>",
"new",
"external_value",
"(",
"PARAM_INT",
"... | Describes the get_responses_analysis return value.
@return external_single_structure
@since Moodle 3.3 | [
"Describes",
"the",
"get_responses_analysis",
"return",
"value",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/feedback/classes/external.php#L1243-L1284 |
216,482 | moodle/moodle | mod/feedback/classes/external.php | mod_feedback_external.get_last_completed | public static function get_last_completed($feedbackid, $courseid = 0) {
global $PAGE;
$params = array('feedbackid' => $feedbackid, 'courseid' => $courseid);
$params = self::validate_parameters(self::get_last_completed_parameters(), $params);
$warnings = array();
list($feedback,... | php | public static function get_last_completed($feedbackid, $courseid = 0) {
global $PAGE;
$params = array('feedbackid' => $feedbackid, 'courseid' => $courseid);
$params = self::validate_parameters(self::get_last_completed_parameters(), $params);
$warnings = array();
list($feedback,... | [
"public",
"static",
"function",
"get_last_completed",
"(",
"$",
"feedbackid",
",",
"$",
"courseid",
"=",
"0",
")",
"{",
"global",
"$",
"PAGE",
";",
"$",
"params",
"=",
"array",
"(",
"'feedbackid'",
"=>",
"$",
"feedbackid",
",",
"'courseid'",
"=>",
"$",
"... | Retrieves the last completion record for the current user.
@param int $feedbackid feedback instance id
@return array of warnings and the last completed record
@since Moodle 3.3
@throws moodle_exception | [
"Retrieves",
"the",
"last",
"completion",
"record",
"for",
"the",
"current",
"user",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/feedback/classes/external.php#L1310-L1332 |
216,483 | moodle/moodle | lib/ltiprovider/src/ToolProvider/ContentItem.php | ContentItem.setTitle | public function setTitle($title)
{
if (!empty($title)) {
$this->title = $title;
} else if (isset($this->title)) {
unset($this->title);
}
} | php | public function setTitle($title)
{
if (!empty($title)) {
$this->title = $title;
} else if (isset($this->title)) {
unset($this->title);
}
} | [
"public",
"function",
"setTitle",
"(",
"$",
"title",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"title",
")",
")",
"{",
"$",
"this",
"->",
"title",
"=",
"$",
"title",
";",
"}",
"else",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"title",
")",... | Set a title value for the content-item.
@param string $title Title value | [
"Set",
"a",
"title",
"value",
"for",
"the",
"content",
"-",
"item",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/ltiprovider/src/ToolProvider/ContentItem.php#L79-L88 |
216,484 | moodle/moodle | lib/ltiprovider/src/ToolProvider/ContentItem.php | ContentItem.setText | public function setText($text)
{
if (!empty($text)) {
$this->text = $text;
} else if (isset($this->text)) {
unset($this->text);
}
} | php | public function setText($text)
{
if (!empty($text)) {
$this->text = $text;
} else if (isset($this->text)) {
unset($this->text);
}
} | [
"public",
"function",
"setText",
"(",
"$",
"text",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"text",
")",
")",
"{",
"$",
"this",
"->",
"text",
"=",
"$",
"text",
";",
"}",
"else",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"text",
")",
")"... | Set a link text value for the content-item.
@param string $text Link text value | [
"Set",
"a",
"link",
"text",
"value",
"for",
"the",
"content",
"-",
"item",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/ltiprovider/src/ToolProvider/ContentItem.php#L95-L104 |
216,485 | moodle/moodle | cache/stores/mongodb/MongoDB/Operation/Distinct.php | Distinct.createCommandDocument | private function createCommandDocument()
{
$cmd = [
'distinct' => $this->collectionName,
'key' => $this->fieldName,
];
if ( ! empty($this->filter)) {
$cmd['query'] = (object) $this->filter;
}
if (isset($this->options['collation'])) {
... | php | private function createCommandDocument()
{
$cmd = [
'distinct' => $this->collectionName,
'key' => $this->fieldName,
];
if ( ! empty($this->filter)) {
$cmd['query'] = (object) $this->filter;
}
if (isset($this->options['collation'])) {
... | [
"private",
"function",
"createCommandDocument",
"(",
")",
"{",
"$",
"cmd",
"=",
"[",
"'distinct'",
"=>",
"$",
"this",
"->",
"collectionName",
",",
"'key'",
"=>",
"$",
"this",
"->",
"fieldName",
",",
"]",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
... | Create the distinct command document.
@return array | [
"Create",
"the",
"distinct",
"command",
"document",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/stores/mongodb/MongoDB/Operation/Distinct.php#L156-L176 |
216,486 | moodle/moodle | analytics/classes/local/time_splitting/equal_parts.php | equal_parts.define_ranges | protected function define_ranges() {
$nparts = $this->get_number_parts();
$rangeduration = ($this->analysable->get_end() - $this->analysable->get_start()) / $nparts;
if ($rangeduration < $nparts) {
// It is interesting to avoid having a single timestamp belonging to multiple time ... | php | protected function define_ranges() {
$nparts = $this->get_number_parts();
$rangeduration = ($this->analysable->get_end() - $this->analysable->get_start()) / $nparts;
if ($rangeduration < $nparts) {
// It is interesting to avoid having a single timestamp belonging to multiple time ... | [
"protected",
"function",
"define_ranges",
"(",
")",
"{",
"$",
"nparts",
"=",
"$",
"this",
"->",
"get_number_parts",
"(",
")",
";",
"$",
"rangeduration",
"=",
"(",
"$",
"this",
"->",
"analysable",
"->",
"get_end",
"(",
")",
"-",
"$",
"this",
"->",
"anal... | Splits the analysable duration in X equal parts from the start to the end.
@return array | [
"Splits",
"the",
"analysable",
"duration",
"in",
"X",
"equal",
"parts",
"from",
"the",
"start",
"to",
"the",
"end",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/analytics/classes/local/time_splitting/equal_parts.php#L50-L87 |
216,487 | moodle/moodle | cache/classes/factory.php | cache_factory.instance | public static function instance($forcereload = false) {
global $CFG;
if ($forcereload || self::$instance === null) {
// Initialise a new factory to facilitate our needs.
if (defined('CACHE_DISABLE_ALL') && CACHE_DISABLE_ALL !== false) {
// The cache has been disab... | php | public static function instance($forcereload = false) {
global $CFG;
if ($forcereload || self::$instance === null) {
// Initialise a new factory to facilitate our needs.
if (defined('CACHE_DISABLE_ALL') && CACHE_DISABLE_ALL !== false) {
// The cache has been disab... | [
"public",
"static",
"function",
"instance",
"(",
"$",
"forcereload",
"=",
"false",
")",
"{",
"global",
"$",
"CFG",
";",
"if",
"(",
"$",
"forcereload",
"||",
"self",
"::",
"$",
"instance",
"===",
"null",
")",
"{",
"// Initialise a new factory to facilitate our ... | Returns an instance of the cache_factor method.
@param bool $forcereload If set to true a new cache_factory instance will be created and used.
@return cache_factory | [
"Returns",
"an",
"instance",
"of",
"the",
"cache_factor",
"method",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/classes/factory.php#L120-L147 |
216,488 | moodle/moodle | cache/classes/factory.php | cache_factory.reset | public static function reset() {
$factory = self::instance();
$factory->reset_cache_instances();
$factory->configs = array();
$factory->definitions = array();
$factory->definitionstores = array();
$factory->lockplugins = array(); // MUST be null in order to force its rege... | php | public static function reset() {
$factory = self::instance();
$factory->reset_cache_instances();
$factory->configs = array();
$factory->definitions = array();
$factory->definitionstores = array();
$factory->lockplugins = array(); // MUST be null in order to force its rege... | [
"public",
"static",
"function",
"reset",
"(",
")",
"{",
"$",
"factory",
"=",
"self",
"::",
"instance",
"(",
")",
";",
"$",
"factory",
"->",
"reset_cache_instances",
"(",
")",
";",
"$",
"factory",
"->",
"configs",
"=",
"array",
"(",
")",
";",
"$",
"fa... | Resets the arrays containing instantiated caches, stores, and config instances. | [
"Resets",
"the",
"arrays",
"containing",
"instantiated",
"caches",
"stores",
"and",
"config",
"instances",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/classes/factory.php#L159-L168 |
216,489 | moodle/moodle | cache/classes/factory.php | cache_factory.create_cache | public function create_cache(cache_definition $definition) {
$class = $definition->get_cache_class();
$stores = cache_helper::get_stores_suitable_for_definition($definition);
foreach ($stores as $key => $store) {
if (!$store::are_requirements_met()) {
unset($stores[$k... | php | public function create_cache(cache_definition $definition) {
$class = $definition->get_cache_class();
$stores = cache_helper::get_stores_suitable_for_definition($definition);
foreach ($stores as $key => $store) {
if (!$store::are_requirements_met()) {
unset($stores[$k... | [
"public",
"function",
"create_cache",
"(",
"cache_definition",
"$",
"definition",
")",
"{",
"$",
"class",
"=",
"$",
"definition",
"->",
"get_cache_class",
"(",
")",
";",
"$",
"stores",
"=",
"cache_helper",
"::",
"get_stores_suitable_for_definition",
"(",
"$",
"d... | Common public method to create a cache instance given a definition.
This is used by the static make methods.
@param cache_definition $definition
@return cache_application|cache_session|cache_store
@throws coding_exception | [
"Common",
"public",
"method",
"to",
"create",
"a",
"cache",
"instance",
"given",
"a",
"definition",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/classes/factory.php#L252-L272 |
216,490 | moodle/moodle | cache/classes/factory.php | cache_factory.create_store_from_config | public function create_store_from_config($name, array $details, cache_definition $definition) {
if (!array_key_exists($name, $this->stores)) {
// Properties: name, plugin, configuration, class.
$class = $details['class'];
if (!$class::are_requirements_met()) {
... | php | public function create_store_from_config($name, array $details, cache_definition $definition) {
if (!array_key_exists($name, $this->stores)) {
// Properties: name, plugin, configuration, class.
$class = $details['class'];
if (!$class::are_requirements_met()) {
... | [
"public",
"function",
"create_store_from_config",
"(",
"$",
"name",
",",
"array",
"$",
"details",
",",
"cache_definition",
"$",
"definition",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"stores",
")",
")",
"{",
... | Creates a store instance given its name and configuration.
If the store has already been instantiated then the original object will be returned. (reused)
@param string $name The name of the store (must be unique remember)
@param array $details
@param cache_definition $definition The definition to instantiate it for.
... | [
"Creates",
"a",
"store",
"instance",
"given",
"its",
"name",
"and",
"configuration",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/classes/factory.php#L284-L314 |
216,491 | moodle/moodle | cache/classes/factory.php | cache_factory.get_store_instances_in_use | public function get_store_instances_in_use(cache_definition $definition) {
$id = $definition->get_id();
if (!isset($this->definitionstores[$id])) {
return array();
}
return $this->definitionstores[$id];
} | php | public function get_store_instances_in_use(cache_definition $definition) {
$id = $definition->get_id();
if (!isset($this->definitionstores[$id])) {
return array();
}
return $this->definitionstores[$id];
} | [
"public",
"function",
"get_store_instances_in_use",
"(",
"cache_definition",
"$",
"definition",
")",
"{",
"$",
"id",
"=",
"$",
"definition",
"->",
"get_id",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"definitionstores",
"[",
"$",
"id",... | Returns an array of cache stores that have been initialised for use in definitions.
@param cache_definition $definition
@return array | [
"Returns",
"an",
"array",
"of",
"cache",
"stores",
"that",
"have",
"been",
"initialised",
"for",
"use",
"in",
"definitions",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/classes/factory.php#L321-L327 |
216,492 | moodle/moodle | cache/classes/factory.php | cache_factory.create_dummy_store | protected function create_dummy_store(cache_definition $definition) {
global $CFG;
require_once($CFG->dirroot.'/cache/classes/dummystore.php');
$store = new cachestore_dummy();
$store->initialise($definition);
return $store;
} | php | protected function create_dummy_store(cache_definition $definition) {
global $CFG;
require_once($CFG->dirroot.'/cache/classes/dummystore.php');
$store = new cachestore_dummy();
$store->initialise($definition);
return $store;
} | [
"protected",
"function",
"create_dummy_store",
"(",
"cache_definition",
"$",
"definition",
")",
"{",
"global",
"$",
"CFG",
";",
"require_once",
"(",
"$",
"CFG",
"->",
"dirroot",
".",
"'/cache/classes/dummystore.php'",
")",
";",
"$",
"store",
"=",
"new",
"cachest... | Creates a dummy store object for use when a loader has no potential stores to use.
@param cache_definition $definition
@return cachestore_dummy | [
"Creates",
"a",
"dummy",
"store",
"object",
"for",
"use",
"when",
"a",
"loader",
"has",
"no",
"potential",
"stores",
"to",
"use",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/classes/factory.php#L473-L479 |
216,493 | moodle/moodle | cache/classes/factory.php | cache_factory.create_lock_instance | public function create_lock_instance(array $config) {
global $CFG;
if (!array_key_exists('name', $config) || !array_key_exists('type', $config)) {
throw new coding_exception('Invalid cache lock instance provided');
}
$name = $config['name'];
$type = $config['type'];
... | php | public function create_lock_instance(array $config) {
global $CFG;
if (!array_key_exists('name', $config) || !array_key_exists('type', $config)) {
throw new coding_exception('Invalid cache lock instance provided');
}
$name = $config['name'];
$type = $config['type'];
... | [
"public",
"function",
"create_lock_instance",
"(",
"array",
"$",
"config",
")",
"{",
"global",
"$",
"CFG",
";",
"if",
"(",
"!",
"array_key_exists",
"(",
"'name'",
",",
"$",
"config",
")",
"||",
"!",
"array_key_exists",
"(",
"'type'",
",",
"$",
"config",
... | Returns a lock instance ready for use.
@param array $config
@return cache_lock_interface | [
"Returns",
"a",
"lock",
"instance",
"ready",
"for",
"use",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/classes/factory.php#L487-L513 |
216,494 | moodle/moodle | cache/classes/factory.php | cache_factory.set_state | public function set_state($state) {
if ($state <= $this->state) {
return false;
}
$this->state = $state;
return true;
} | php | public function set_state($state) {
if ($state <= $this->state) {
return false;
}
$this->state = $state;
return true;
} | [
"public",
"function",
"set_state",
"(",
"$",
"state",
")",
"{",
"if",
"(",
"$",
"state",
"<=",
"$",
"this",
"->",
"state",
")",
"{",
"return",
"false",
";",
"}",
"$",
"this",
"->",
"state",
"=",
"$",
"state",
";",
"return",
"true",
";",
"}"
] | Updates the state fo the cache API.
@param int $state
@return bool | [
"Updates",
"the",
"state",
"fo",
"the",
"cache",
"API",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/classes/factory.php#L530-L536 |
216,495 | moodle/moodle | cache/classes/factory.php | cache_factory.updating_started | public function updating_started() {
if ($this->state !== self::STATE_READY) {
return false;
}
$this->state = self::STATE_UPDATING;
return true;
} | php | public function updating_started() {
if ($this->state !== self::STATE_READY) {
return false;
}
$this->state = self::STATE_UPDATING;
return true;
} | [
"public",
"function",
"updating_started",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"state",
"!==",
"self",
"::",
"STATE_READY",
")",
"{",
"return",
"false",
";",
"}",
"$",
"this",
"->",
"state",
"=",
"self",
"::",
"STATE_UPDATING",
";",
"return",
"... | Informs the factory that the cache is currently updating itself.
This forces the state to upgrading and can only be called once the cache is ready to use.
Calling it ensure we don't try to reinstantite things when requesting cache definitions that don't exist yet. | [
"Informs",
"the",
"factory",
"that",
"the",
"cache",
"is",
"currently",
"updating",
"itself",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/classes/factory.php#L544-L550 |
216,496 | moodle/moodle | cache/classes/factory.php | cache_factory.disable_stores | public static function disable_stores() {
// First reset to clear any static acceleration array.
$factory = self::instance();
$factory->reset_cache_instances();
$factory->set_state(self::STATE_STORES_DISABLED);
} | php | public static function disable_stores() {
// First reset to clear any static acceleration array.
$factory = self::instance();
$factory->reset_cache_instances();
$factory->set_state(self::STATE_STORES_DISABLED);
} | [
"public",
"static",
"function",
"disable_stores",
"(",
")",
"{",
"// First reset to clear any static acceleration array.",
"$",
"factory",
"=",
"self",
"::",
"instance",
"(",
")",
";",
"$",
"factory",
"->",
"reset_cache_instances",
"(",
")",
";",
"$",
"factory",
"... | Disables cache stores.
The cache API will continue to function however none of the actual stores will be used.
Instead the dummy store will be provided for all cache requests.
This is useful in situations where you cannot be sure any stores are working.
In order to re-enable the cache you must call the cache factorie... | [
"Disables",
"cache",
"stores",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/cache/classes/factory.php#L632-L637 |
216,497 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Cache/Backend/Hashtable.php | Horde_Imap_Client_Cache_Backend_Hashtable._loadMailbox | protected function _loadMailbox($mailbox, $uidvalid = null)
{
if (!isset($this->_mbox[$mailbox]) &&
($ob = $this->_hash->get($this->_getCid($mailbox)))) {
try {
$this->_mbox[$mailbox] = $this->_pack->unpack($ob);
} catch (Horde_Pack_Exception $e) {}
... | php | protected function _loadMailbox($mailbox, $uidvalid = null)
{
if (!isset($this->_mbox[$mailbox]) &&
($ob = $this->_hash->get($this->_getCid($mailbox)))) {
try {
$this->_mbox[$mailbox] = $this->_pack->unpack($ob);
} catch (Horde_Pack_Exception $e) {}
... | [
"protected",
"function",
"_loadMailbox",
"(",
"$",
"mailbox",
",",
"$",
"uidvalid",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"_mbox",
"[",
"$",
"mailbox",
"]",
")",
"&&",
"(",
"$",
"ob",
"=",
"$",
"this",
"->",
"_ha... | Loads basic mailbox information.
@param string $mailbox The mailbox to load.
@param integer $uidvalid The IMAP uidvalidity value of the mailbox. | [
"Loads",
"basic",
"mailbox",
"information",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Cache/Backend/Hashtable.php#L321-L345 |
216,498 | moodle/moodle | lib/horde/framework/Horde/Imap/Client/Cache/Backend/Hashtable.php | Horde_Imap_Client_Cache_Backend_Hashtable._getCid | protected function _getCid($mailbox)
{
return implode(self::CID_SEPARATOR, array(
'horde_imap_client',
$this->_params['username'],
$mailbox,
$this->_params['hostspec'],
$this->_params['port']
));
} | php | protected function _getCid($mailbox)
{
return implode(self::CID_SEPARATOR, array(
'horde_imap_client',
$this->_params['username'],
$mailbox,
$this->_params['hostspec'],
$this->_params['port']
));
} | [
"protected",
"function",
"_getCid",
"(",
"$",
"mailbox",
")",
"{",
"return",
"implode",
"(",
"self",
"::",
"CID_SEPARATOR",
",",
"array",
"(",
"'horde_imap_client'",
",",
"$",
"this",
"->",
"_params",
"[",
"'username'",
"]",
",",
"$",
"mailbox",
",",
"$",
... | Create the unique ID used to store the mailbox data in the cache.
@param string $mailbox The mailbox to cache.
@return string The cache ID. | [
"Create",
"the",
"unique",
"ID",
"used",
"to",
"store",
"the",
"mailbox",
"data",
"in",
"the",
"cache",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Imap/Client/Cache/Backend/Hashtable.php#L390-L399 |
216,499 | moodle/moodle | repository/filesystem/lib.php | repository_filesystem.get_listing | public function get_listing($fullpath = '', $page = '') {
global $OUTPUT;
$list = array(
'list' => array(),
'manage' => false,
'dynload' => true,
'nologin' => true,
'path' => array()
);
// We analyse the path to extract what t... | php | public function get_listing($fullpath = '', $page = '') {
global $OUTPUT;
$list = array(
'list' => array(),
'manage' => false,
'dynload' => true,
'nologin' => true,
'path' => array()
);
// We analyse the path to extract what t... | [
"public",
"function",
"get_listing",
"(",
"$",
"fullpath",
"=",
"''",
",",
"$",
"page",
"=",
"''",
")",
"{",
"global",
"$",
"OUTPUT",
";",
"$",
"list",
"=",
"array",
"(",
"'list'",
"=>",
"array",
"(",
")",
",",
"'manage'",
"=>",
"false",
",",
"'dyn... | Get the list of files and directories in that repository.
@param string $fullpath Path to explore. This is assembled by {@link self::build_node_path()}.
@param string $page Page number.
@return array List of files and folders. | [
"Get",
"the",
"list",
"of",
"files",
"and",
"directories",
"in",
"that",
"repository",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/repository/filesystem/lib.php#L67-L127 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.