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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
219,300 | moodle/moodle | admin/tool/dataprivacy/classes/output/renderer.php | renderer.render_summary_page | public function render_summary_page(summary_page $page) {
$data = $page->export_for_template($this);
return parent::render_from_template('tool_dataprivacy/summary', $data);
} | php | public function render_summary_page(summary_page $page) {
$data = $page->export_for_template($this);
return parent::render_from_template('tool_dataprivacy/summary', $data);
} | [
"public",
"function",
"render_summary_page",
"(",
"summary_page",
"$",
"page",
")",
"{",
"$",
"data",
"=",
"$",
"page",
"->",
"export_for_template",
"(",
"$",
"this",
")",
";",
"return",
"parent",
"::",
"render_from_template",
"(",
"'tool_dataprivacy/summary'",
... | Render the user data retention summary page.
@param summary_page $page
@return string html for the page. | [
"Render",
"the",
"user",
"data",
"retention",
"summary",
"page",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/dataprivacy/classes/output/renderer.php#L149-L152 |
219,301 | moodle/moodle | lib/tcpdf/include/tcpdf_colors.php | TCPDF_COLORS.getSpotColor | public static function getSpotColor($name, &$spotc) {
if (isset($spotc[$name])) {
return $spotc[$name];
}
$color = preg_replace('/[\s]*/', '', $name); // remove extra spaces
$color = strtolower($color);
if (isset(self::$spotcolor[$color])) {
if (!isset($spotc[$name])) {
$i = (1 + count($spotc));
... | php | public static function getSpotColor($name, &$spotc) {
if (isset($spotc[$name])) {
return $spotc[$name];
}
$color = preg_replace('/[\s]*/', '', $name); // remove extra spaces
$color = strtolower($color);
if (isset(self::$spotcolor[$color])) {
if (!isset($spotc[$name])) {
$i = (1 + count($spotc));
... | [
"public",
"static",
"function",
"getSpotColor",
"(",
"$",
"name",
",",
"&",
"$",
"spotc",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"spotc",
"[",
"$",
"name",
"]",
")",
")",
"{",
"return",
"$",
"spotc",
"[",
"$",
"name",
"]",
";",
"}",
"$",
"colo... | Return the Spot color array.
@param $name (string) Name of the spot color.
@param $spotc (array) Reference to an array of spot colors.
@return (array) Spot color array or false if not defined.
@since 5.9.125 (2011-10-03)
@public static | [
"Return",
"the",
"Spot",
"color",
"array",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/tcpdf/include/tcpdf_colors.php#L249-L263 |
219,302 | moodle/moodle | lib/horde/framework/Horde/Socket/Client.php | Client.startTls | public function startTls()
{
if ($this->connected && !$this->secure) {
if (defined('STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT')) {
$mode = STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT
| STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT
| STREAM_CRYPTO_METHOD_TLSv1_2_CL... | php | public function startTls()
{
if ($this->connected && !$this->secure) {
if (defined('STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT')) {
$mode = STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT
| STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT
| STREAM_CRYPTO_METHOD_TLSv1_2_CL... | [
"public",
"function",
"startTls",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"connected",
"&&",
"!",
"$",
"this",
"->",
"secure",
")",
"{",
"if",
"(",
"defined",
"(",
"'STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT'",
")",
")",
"{",
"$",
"mode",
"=",
"STREAM_CRY... | Start a TLS connection.
@return boolean Whether TLS was successfully started. | [
"Start",
"a",
"TLS",
"connection",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Socket/Client.php#L143-L160 |
219,303 | moodle/moodle | lib/horde/framework/Horde/Socket/Client.php | Client.close | public function close()
{
if ($this->connected) {
@fclose($this->_stream);
$this->_connected = $this->_secure = false;
$this->_stream = null;
}
} | php | public function close()
{
if ($this->connected) {
@fclose($this->_stream);
$this->_connected = $this->_secure = false;
$this->_stream = null;
}
} | [
"public",
"function",
"close",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"connected",
")",
"{",
"@",
"fclose",
"(",
"$",
"this",
"->",
"_stream",
")",
";",
"$",
"this",
"->",
"_connected",
"=",
"$",
"this",
"->",
"_secure",
"=",
"false",
";",
... | Close the connection. | [
"Close",
"the",
"connection",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Socket/Client.php#L165-L172 |
219,304 | moodle/moodle | lib/horde/framework/Horde/Socket/Client.php | Client.gets | public function gets($size)
{
$this->_checkStream();
$data = @fgets($this->_stream, $size);
if ($data === false) {
throw new Client\Exception('Error reading data from socket');
}
return $data;
} | php | public function gets($size)
{
$this->_checkStream();
$data = @fgets($this->_stream, $size);
if ($data === false) {
throw new Client\Exception('Error reading data from socket');
}
return $data;
} | [
"public",
"function",
"gets",
"(",
"$",
"size",
")",
"{",
"$",
"this",
"->",
"_checkStream",
"(",
")",
";",
"$",
"data",
"=",
"@",
"fgets",
"(",
"$",
"this",
"->",
"_stream",
",",
"$",
"size",
")",
";",
"if",
"(",
"$",
"data",
"===",
"false",
"... | Returns a line of data.
@param int $size Reading ends when $size - 1 bytes have been read,
or a newline or an EOF (whichever comes first).
@throws Horde\Socket\Client\Exception
@return string $size bytes of data from the socket | [
"Returns",
"a",
"line",
"of",
"data",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Socket/Client.php#L201-L209 |
219,305 | moodle/moodle | lib/horde/framework/Horde/Socket/Client.php | Client.read | public function read($size)
{
$this->_checkStream();
$data = @fread($this->_stream, $size);
if ($data === false) {
throw new Client\Exception('Error reading data from socket');
}
return $data;
} | php | public function read($size)
{
$this->_checkStream();
$data = @fread($this->_stream, $size);
if ($data === false) {
throw new Client\Exception('Error reading data from socket');
}
return $data;
} | [
"public",
"function",
"read",
"(",
"$",
"size",
")",
"{",
"$",
"this",
"->",
"_checkStream",
"(",
")",
";",
"$",
"data",
"=",
"@",
"fread",
"(",
"$",
"this",
"->",
"_stream",
",",
"$",
"size",
")",
";",
"if",
"(",
"$",
"data",
"===",
"false",
"... | Returns a specified amount of data.
@param integer $size The number of bytes to read from the socket.
@throws Horde\Socket\Client\Exception
@return string $size bytes of data from the socket. | [
"Returns",
"a",
"specified",
"amount",
"of",
"data",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Socket/Client.php#L219-L227 |
219,306 | moodle/moodle | lib/horde/framework/Horde/Socket/Client.php | Client._connect | protected function _connect(
$host, $port, $timeout, $secure, $context, $retries = 0
)
{
$conn = '';
if (!strpos($host, '://')) {
switch (strval($secure)) {
case 'ssl':
case 'sslv2':
case 'sslv3':
$conn = $secure . '://';
... | php | protected function _connect(
$host, $port, $timeout, $secure, $context, $retries = 0
)
{
$conn = '';
if (!strpos($host, '://')) {
switch (strval($secure)) {
case 'ssl':
case 'sslv2':
case 'sslv3':
$conn = $secure . '://';
... | [
"protected",
"function",
"_connect",
"(",
"$",
"host",
",",
"$",
"port",
",",
"$",
"timeout",
",",
"$",
"secure",
",",
"$",
"context",
",",
"$",
"retries",
"=",
"0",
")",
"{",
"$",
"conn",
"=",
"''",
";",
"if",
"(",
"!",
"strpos",
"(",
"$",
"ho... | Connect to the remote server.
@see __construct()
@throws Horde\Socket\Client\Exception | [
"Connect",
"to",
"the",
"remote",
"server",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Socket/Client.php#L257-L322 |
219,307 | moodle/moodle | mod/forum/classes/local/renderers/discussion.php | discussion.render | public function render(
stdClass $user,
post_entity $firstpost,
array $replies
) : string {
global $CFG;
$displaymode = $this->displaymode;
$capabilitymanager = $this->capabilitymanager;
// Make sure we can render.
if (!$capabilitymanager->can_view_d... | php | public function render(
stdClass $user,
post_entity $firstpost,
array $replies
) : string {
global $CFG;
$displaymode = $this->displaymode;
$capabilitymanager = $this->capabilitymanager;
// Make sure we can render.
if (!$capabilitymanager->can_view_d... | [
"public",
"function",
"render",
"(",
"stdClass",
"$",
"user",
",",
"post_entity",
"$",
"firstpost",
",",
"array",
"$",
"replies",
")",
":",
"string",
"{",
"global",
"$",
"CFG",
";",
"$",
"displaymode",
"=",
"$",
"this",
"->",
"displaymode",
";",
"$",
"... | Render the discussion for the given user in the specified display mode.
@param stdClass $user The user viewing the discussion
@param post_entity $firstpost The first post in the discussion
@param array $replies List of replies to the first post
@return string HTML for the discussion | [
"Render",
"the",
"discussion",
"for",
"the",
"given",
"user",
"in",
"the",
"specified",
"display",
"mode",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/local/renderers/discussion.php#L163-L210 |
219,308 | moodle/moodle | mod/forum/classes/local/renderers/discussion.php | discussion.get_groups_available_in_forum | private function get_groups_available_in_forum() : array {
$course = $this->forum->get_course_record();
$coursemodule = $this->forum->get_course_module_record();
return groups_get_all_groups($course->id, 0, $coursemodule->groupingid);
} | php | private function get_groups_available_in_forum() : array {
$course = $this->forum->get_course_record();
$coursemodule = $this->forum->get_course_module_record();
return groups_get_all_groups($course->id, 0, $coursemodule->groupingid);
} | [
"private",
"function",
"get_groups_available_in_forum",
"(",
")",
":",
"array",
"{",
"$",
"course",
"=",
"$",
"this",
"->",
"forum",
"->",
"get_course_record",
"(",
")",
";",
"$",
"coursemodule",
"=",
"$",
"this",
"->",
"forum",
"->",
"get_course_module_record... | Get the groups details for all groups available to the forum.
@return stdClass[] | [
"Get",
"the",
"groups",
"details",
"for",
"all",
"groups",
"available",
"to",
"the",
"forum",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/local/renderers/discussion.php#L217-L222 |
219,309 | moodle/moodle | mod/forum/classes/local/renderers/discussion.php | discussion.get_exported_discussion | private function get_exported_discussion(stdClass $user) : array {
$discussionexporter = $this->exporterfactory->get_discussion_exporter(
$user,
$this->forum,
$this->discussion,
$this->get_groups_available_in_forum()
);
return (array) $discussione... | php | private function get_exported_discussion(stdClass $user) : array {
$discussionexporter = $this->exporterfactory->get_discussion_exporter(
$user,
$this->forum,
$this->discussion,
$this->get_groups_available_in_forum()
);
return (array) $discussione... | [
"private",
"function",
"get_exported_discussion",
"(",
"stdClass",
"$",
"user",
")",
":",
"array",
"{",
"$",
"discussionexporter",
"=",
"$",
"this",
"->",
"exporterfactory",
"->",
"get_discussion_exporter",
"(",
"$",
"user",
",",
"$",
"this",
"->",
"forum",
",... | Get the exported discussion.
@param stdClass $user The user viewing the discussion
@return array | [
"Get",
"the",
"exported",
"discussion",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/local/renderers/discussion.php#L230-L239 |
219,310 | moodle/moodle | mod/forum/classes/local/renderers/discussion.php | discussion.get_display_mode_selector_html | private function get_display_mode_selector_html(int $displaymode) : string {
$baseurl = $this->baseurl;
$select = new single_select(
$baseurl,
'mode',
forum_get_layout_modes(),
$displaymode,
null,
'mode'
);
$select->... | php | private function get_display_mode_selector_html(int $displaymode) : string {
$baseurl = $this->baseurl;
$select = new single_select(
$baseurl,
'mode',
forum_get_layout_modes(),
$displaymode,
null,
'mode'
);
$select->... | [
"private",
"function",
"get_display_mode_selector_html",
"(",
"int",
"$",
"displaymode",
")",
":",
"string",
"{",
"$",
"baseurl",
"=",
"$",
"this",
"->",
"baseurl",
";",
"$",
"select",
"=",
"new",
"single_select",
"(",
"$",
"baseurl",
",",
"'mode'",
",",
"... | Get the HTML for the display mode selector.
@param int $displaymode The current display mode
@return string | [
"Get",
"the",
"HTML",
"for",
"the",
"display",
"mode",
"selector",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/local/renderers/discussion.php#L247-L260 |
219,311 | moodle/moodle | mod/forum/classes/local/renderers/discussion.php | discussion.get_subscription_button_html | private function get_subscription_button_html() : string {
global $PAGE;
$forumrecord = $this->forumrecord;
$discussion = $this->discussion;
$html = html_writer::div(
forum_get_discussion_subscription_icon($forumrecord, $discussion->get_id(), null, true),
'discus... | php | private function get_subscription_button_html() : string {
global $PAGE;
$forumrecord = $this->forumrecord;
$discussion = $this->discussion;
$html = html_writer::div(
forum_get_discussion_subscription_icon($forumrecord, $discussion->get_id(), null, true),
'discus... | [
"private",
"function",
"get_subscription_button_html",
"(",
")",
":",
"string",
"{",
"global",
"$",
"PAGE",
";",
"$",
"forumrecord",
"=",
"$",
"this",
"->",
"forumrecord",
";",
"$",
"discussion",
"=",
"$",
"this",
"->",
"discussion",
";",
"$",
"html",
"=",... | Get the HTML to render the subscription button.
@return string | [
"Get",
"the",
"HTML",
"to",
"render",
"the",
"subscription",
"button",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/local/renderers/discussion.php#L267-L280 |
219,312 | moodle/moodle | mod/forum/classes/local/renderers/discussion.php | discussion.get_move_discussion_html | private function get_move_discussion_html() : ?string {
global $DB;
$forum = $this->forum;
$discussion = $this->discussion;
$courseid = $forum->get_course_id();
// Popup menu to move discussions to other forums. The discussion in a
// single discussion forum can't be mo... | php | private function get_move_discussion_html() : ?string {
global $DB;
$forum = $this->forum;
$discussion = $this->discussion;
$courseid = $forum->get_course_id();
// Popup menu to move discussions to other forums. The discussion in a
// single discussion forum can't be mo... | [
"private",
"function",
"get_move_discussion_html",
"(",
")",
":",
"?",
"string",
"{",
"global",
"$",
"DB",
";",
"$",
"forum",
"=",
"$",
"this",
"->",
"forum",
";",
"$",
"discussion",
"=",
"$",
"this",
"->",
"discussion",
";",
"$",
"courseid",
"=",
"$",... | Get the HTML to render the move discussion selector and button.
@return string | [
"Get",
"the",
"HTML",
"to",
"render",
"the",
"move",
"discussion",
"selector",
"and",
"button",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/local/renderers/discussion.php#L287-L331 |
219,313 | moodle/moodle | mod/forum/classes/local/renderers/discussion.php | discussion.get_export_discussion_html | private function get_export_discussion_html() : ?string {
global $CFG;
require_once($CFG->libdir . '/portfoliolib.php');
$discussion = $this->discussion;
$button = new \portfolio_add_button();
$button->set_callback_options('forum_portfolio_caller', ['discussionid' => $discussion... | php | private function get_export_discussion_html() : ?string {
global $CFG;
require_once($CFG->libdir . '/portfoliolib.php');
$discussion = $this->discussion;
$button = new \portfolio_add_button();
$button->set_callback_options('forum_portfolio_caller', ['discussionid' => $discussion... | [
"private",
"function",
"get_export_discussion_html",
"(",
")",
":",
"?",
"string",
"{",
"global",
"$",
"CFG",
";",
"require_once",
"(",
"$",
"CFG",
"->",
"libdir",
".",
"'/portfoliolib.php'",
")",
";",
"$",
"discussion",
"=",
"$",
"this",
"->",
"discussion",... | Get the HTML to render the export discussion button.
@return string|null | [
"Get",
"the",
"HTML",
"to",
"render",
"the",
"export",
"discussion",
"button",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/local/renderers/discussion.php#L338-L347 |
219,314 | moodle/moodle | mod/forum/classes/local/renderers/discussion.php | discussion.get_notifications | private function get_notifications($user) : array {
$notifications = $this->notifications;
$discussion = $this->discussion;
$forum = $this->forum;
$renderer = $this->renderer;
if ($forum->is_cutoff_date_reached()) {
$notifications[] = (new notification(
... | php | private function get_notifications($user) : array {
$notifications = $this->notifications;
$discussion = $this->discussion;
$forum = $this->forum;
$renderer = $this->renderer;
if ($forum->is_cutoff_date_reached()) {
$notifications[] = (new notification(
... | [
"private",
"function",
"get_notifications",
"(",
"$",
"user",
")",
":",
"array",
"{",
"$",
"notifications",
"=",
"$",
"this",
"->",
"notifications",
";",
"$",
"discussion",
"=",
"$",
"this",
"->",
"discussion",
";",
"$",
"forum",
"=",
"$",
"this",
"->",
... | Get a list of notification HTML to render in the page.
@param stdClass $user The user viewing the discussion
@return string[] | [
"Get",
"a",
"list",
"of",
"notification",
"HTML",
"to",
"render",
"in",
"the",
"page",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/local/renderers/discussion.php#L355-L407 |
219,315 | moodle/moodle | mod/forum/classes/local/renderers/discussion.php | discussion.get_neighbour_links_html | private function get_neighbour_links_html() : string {
$forum = $this->forum;
$coursemodule = $forum->get_course_module_record();
$neighbours = forum_get_discussion_neighbours($coursemodule, $this->discussionrecord, $this->forumrecord);
return $this->renderer->neighbouring_discussion_nav... | php | private function get_neighbour_links_html() : string {
$forum = $this->forum;
$coursemodule = $forum->get_course_module_record();
$neighbours = forum_get_discussion_neighbours($coursemodule, $this->discussionrecord, $this->forumrecord);
return $this->renderer->neighbouring_discussion_nav... | [
"private",
"function",
"get_neighbour_links_html",
"(",
")",
":",
"string",
"{",
"$",
"forum",
"=",
"$",
"this",
"->",
"forum",
";",
"$",
"coursemodule",
"=",
"$",
"forum",
"->",
"get_course_module_record",
"(",
")",
";",
"$",
"neighbours",
"=",
"forum_get_d... | Get HTML to display the neighbour links.
@return string | [
"Get",
"HTML",
"to",
"display",
"the",
"neighbour",
"links",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/forum/classes/local/renderers/discussion.php#L414-L419 |
219,316 | moodle/moodle | admin/tool/messageinbound/classes/manager.php | manager.get_imap_client | protected function get_imap_client() {
global $CFG;
if (!\core\message\inbound\manager::is_enabled()) {
// E-mail processing not set up.
mtrace("Inbound Message not fully configured - exiting early.");
return false;
}
mtrace("Connecting to {$CFG->mes... | php | protected function get_imap_client() {
global $CFG;
if (!\core\message\inbound\manager::is_enabled()) {
// E-mail processing not set up.
mtrace("Inbound Message not fully configured - exiting early.");
return false;
}
mtrace("Connecting to {$CFG->mes... | [
"protected",
"function",
"get_imap_client",
"(",
")",
"{",
"global",
"$",
"CFG",
";",
"if",
"(",
"!",
"\\",
"core",
"\\",
"message",
"\\",
"inbound",
"\\",
"manager",
"::",
"is_enabled",
"(",
")",
")",
"{",
"// E-mail processing not set up.",
"mtrace",
"(",
... | Retrieve the connection to the IMAP client.
@return bool Whether a connection was successfully established. | [
"Retrieve",
"the",
"connection",
"to",
"the",
"IMAP",
"client",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/messageinbound/classes/manager.php#L87-L130 |
219,317 | moodle/moodle | admin/tool/messageinbound/classes/manager.php | manager.get_confirmation_folder | protected function get_confirmation_folder() {
if ($this->imapnamespace === null) {
if ($this->client->queryCapability('NAMESPACE')) {
$namespaces = $this->client->getNamespaces(array(), array('ob_return' => true));
$this->imapnamespace = $namespaces->getNamespace('I... | php | protected function get_confirmation_folder() {
if ($this->imapnamespace === null) {
if ($this->client->queryCapability('NAMESPACE')) {
$namespaces = $this->client->getNamespaces(array(), array('ob_return' => true));
$this->imapnamespace = $namespaces->getNamespace('I... | [
"protected",
"function",
"get_confirmation_folder",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"imapnamespace",
"===",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"client",
"->",
"queryCapability",
"(",
"'NAMESPACE'",
")",
")",
"{",
"$",
"namespaces"... | Get the confirmation folder imap name
@return string | [
"Get",
"the",
"confirmation",
"folder",
"imap",
"name"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/messageinbound/classes/manager.php#L147-L159 |
219,318 | moodle/moodle | admin/tool/messageinbound/classes/manager.php | manager.get_mailbox | protected function get_mailbox() {
// Get the current mailbox.
$mailbox = $this->client->currentMailbox();
if (isset($mailbox['mailbox'])) {
return $mailbox['mailbox'];
} else {
throw new \core\message\inbound\processing_failed_exception('couldnotopenmailbox', 't... | php | protected function get_mailbox() {
// Get the current mailbox.
$mailbox = $this->client->currentMailbox();
if (isset($mailbox['mailbox'])) {
return $mailbox['mailbox'];
} else {
throw new \core\message\inbound\processing_failed_exception('couldnotopenmailbox', 't... | [
"protected",
"function",
"get_mailbox",
"(",
")",
"{",
"// Get the current mailbox.",
"$",
"mailbox",
"=",
"$",
"this",
"->",
"client",
"->",
"currentMailbox",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"mailbox",
"[",
"'mailbox'",
"]",
")",
")",
"{",
... | Get the current mailbox information.
@return \Horde_Imap_Client_Mailbox
@throws \core\message\inbound\processing_failed_exception if the mailbox could not be opened. | [
"Get",
"the",
"current",
"mailbox",
"information",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/messageinbound/classes/manager.php#L167-L176 |
219,319 | moodle/moodle | admin/tool/messageinbound/classes/manager.php | manager.pickup_messages | public function pickup_messages() {
if (!$this->get_imap_client()) {
return false;
}
// Restrict results to messages which are unseen, and have not been flagged.
$search = new \Horde_Imap_Client_Search_Query();
$search->flag(self::MESSAGE_SEEN, false);
$searc... | php | public function pickup_messages() {
if (!$this->get_imap_client()) {
return false;
}
// Restrict results to messages which are unseen, and have not been flagged.
$search = new \Horde_Imap_Client_Search_Query();
$search->flag(self::MESSAGE_SEEN, false);
$searc... | [
"public",
"function",
"pickup_messages",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"get_imap_client",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"// Restrict results to messages which are unseen, and have not been flagged.",
"$",
"search",
"=",
"new",
... | Execute the main Inbound Message pickup task.
@return bool | [
"Execute",
"the",
"main",
"Inbound",
"Message",
"pickup",
"task",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/messageinbound/classes/manager.php#L183-L213 |
219,320 | moodle/moodle | admin/tool/messageinbound/classes/manager.php | manager.tidy_old_messages | public function tidy_old_messages() {
// Grab the new IMAP client.
if (!$this->get_imap_client()) {
return false;
}
// Open the mailbox.
mtrace("Searching for messages older than 24 hours in the '" .
$this->get_confirmation_folder() . "' folder.");
... | php | public function tidy_old_messages() {
// Grab the new IMAP client.
if (!$this->get_imap_client()) {
return false;
}
// Open the mailbox.
mtrace("Searching for messages older than 24 hours in the '" .
$this->get_confirmation_folder() . "' folder.");
... | [
"public",
"function",
"tidy_old_messages",
"(",
")",
"{",
"// Grab the new IMAP client.",
"if",
"(",
"!",
"$",
"this",
"->",
"get_imap_client",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"// Open the mailbox.",
"mtrace",
"(",
"\"Searching for messages older th... | Tidy up old messages in the confirmation folder.
@return bool Whether tidying occurred successfully. | [
"Tidy",
"up",
"old",
"messages",
"in",
"the",
"confirmation",
"folder",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/messageinbound/classes/manager.php#L275-L311 |
219,321 | moodle/moodle | admin/tool/messageinbound/classes/manager.php | manager.process_message_data | private function process_message_data(
\Horde_Imap_Client_Data_Envelope $envelope,
\Horde_Imap_Client_Data_Fetch $basemessagedata,
$messageid) {
// Get the current mailbox.
$mailbox = $this->get_mailbox();
// We need the structure at various points below.
... | php | private function process_message_data(
\Horde_Imap_Client_Data_Envelope $envelope,
\Horde_Imap_Client_Data_Fetch $basemessagedata,
$messageid) {
// Get the current mailbox.
$mailbox = $this->get_mailbox();
// We need the structure at various points below.
... | [
"private",
"function",
"process_message_data",
"(",
"\\",
"Horde_Imap_Client_Data_Envelope",
"$",
"envelope",
",",
"\\",
"Horde_Imap_Client_Data_Fetch",
"$",
"basemessagedata",
",",
"$",
"messageid",
")",
"{",
"// Get the current mailbox.",
"$",
"mailbox",
"=",
"$",
"th... | Process a message to retrieve it's header data without body and attachemnts.
@param \Horde_Imap_Client_Data_Envelope $envelope The Envelope of the message
@param \Horde_Imap_Client_Data_Fetch $basemessagedata The structure and part of the message body
@param string|\Horde_Imap_Client_Ids $messageid The Hore message Ui... | [
"Process",
"a",
"message",
"to",
"retrieve",
"it",
"s",
"header",
"data",
"without",
"body",
"and",
"attachemnts",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/messageinbound/classes/manager.php#L503-L541 |
219,322 | moodle/moodle | admin/tool/messageinbound/classes/manager.php | manager.process_message_part_body | private function process_message_part_body($messagedata, $partdata, $part) {
// This is a content section for the main body.
// Get the string version of it.
$content = $messagedata->getBodyPart($part);
if (!$messagedata->getBodyPartDecode($part)) {
// Decode the content.
... | php | private function process_message_part_body($messagedata, $partdata, $part) {
// This is a content section for the main body.
// Get the string version of it.
$content = $messagedata->getBodyPart($part);
if (!$messagedata->getBodyPartDecode($part)) {
// Decode the content.
... | [
"private",
"function",
"process_message_part_body",
"(",
"$",
"messagedata",
",",
"$",
"partdata",
",",
"$",
"part",
")",
"{",
"// This is a content section for the main body.",
"// Get the string version of it.",
"$",
"content",
"=",
"$",
"messagedata",
"->",
"getBodyPar... | Process the messagedata and part data to extract the content of this part.
@param \Horde_Imap_Client_Data_Fetch $messagedata The structure and part of the message body
@param \Horde_Mime_Part $partdata The part data
@param string $part The part ID
@return string | [
"Process",
"the",
"messagedata",
"and",
"part",
"data",
"to",
"extract",
"the",
"content",
"of",
"this",
"part",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/messageinbound/classes/manager.php#L632-L652 |
219,323 | moodle/moodle | admin/tool/messageinbound/classes/manager.php | manager.passes_key_validation | private function passes_key_validation($status, $messageid) {
// The validation result is tested in a bitwise operation.
if ((
$status & ~ \core\message\inbound\address_manager::VALIDATION_SUCCESS
& ~ \core\message\inbound\address_manager::VALIDATION_UNKNOWN_DATAKEY
... | php | private function passes_key_validation($status, $messageid) {
// The validation result is tested in a bitwise operation.
if ((
$status & ~ \core\message\inbound\address_manager::VALIDATION_SUCCESS
& ~ \core\message\inbound\address_manager::VALIDATION_UNKNOWN_DATAKEY
... | [
"private",
"function",
"passes_key_validation",
"(",
"$",
"status",
",",
"$",
"messageid",
")",
"{",
"// The validation result is tested in a bitwise operation.",
"if",
"(",
"(",
"$",
"status",
"&",
"~",
"\\",
"core",
"\\",
"message",
"\\",
"inbound",
"\\",
"addre... | Check whether the key provided is valid.
@param bool $status
@param mixed $messageid The Hore message Uid
@return bool | [
"Check",
"whether",
"the",
"key",
"provided",
"is",
"valid",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/messageinbound/classes/manager.php#L699-L712 |
219,324 | moodle/moodle | admin/tool/messageinbound/classes/manager.php | manager.add_flag_to_message | private function add_flag_to_message($messageid, $flag) {
// Get the current mailbox.
$mailbox = $this->get_mailbox();
// Mark it as read to lock the message.
$this->client->store($mailbox, array(
'ids' => new \Horde_Imap_Client_Ids($messageid),
'add' => $flag,
... | php | private function add_flag_to_message($messageid, $flag) {
// Get the current mailbox.
$mailbox = $this->get_mailbox();
// Mark it as read to lock the message.
$this->client->store($mailbox, array(
'ids' => new \Horde_Imap_Client_Ids($messageid),
'add' => $flag,
... | [
"private",
"function",
"add_flag_to_message",
"(",
"$",
"messageid",
",",
"$",
"flag",
")",
"{",
"// Get the current mailbox.",
"$",
"mailbox",
"=",
"$",
"this",
"->",
"get_mailbox",
"(",
")",
";",
"// Mark it as read to lock the message.",
"$",
"this",
"->",
"cli... | Add the specified flag to the message.
@param mixed $messageid
@param string $flag The flag to add | [
"Add",
"the",
"specified",
"flag",
"to",
"the",
"message",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/messageinbound/classes/manager.php#L720-L729 |
219,325 | moodle/moodle | admin/tool/messageinbound/classes/manager.php | manager.remove_flag_from_message | private function remove_flag_from_message($messageid, $flag) {
// Get the current mailbox.
$mailbox = $this->get_mailbox();
// Mark it as read to lock the message.
$this->client->store($mailbox, array(
'ids' => $messageid,
'delete' => $flag,
));
} | php | private function remove_flag_from_message($messageid, $flag) {
// Get the current mailbox.
$mailbox = $this->get_mailbox();
// Mark it as read to lock the message.
$this->client->store($mailbox, array(
'ids' => $messageid,
'delete' => $flag,
));
} | [
"private",
"function",
"remove_flag_from_message",
"(",
"$",
"messageid",
",",
"$",
"flag",
")",
"{",
"// Get the current mailbox.",
"$",
"mailbox",
"=",
"$",
"this",
"->",
"get_mailbox",
"(",
")",
";",
"// Mark it as read to lock the message.",
"$",
"this",
"->",
... | Remove the specified flag from the message.
@param mixed $messageid
@param string $flag The flag to remove | [
"Remove",
"the",
"specified",
"flag",
"from",
"the",
"message",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/messageinbound/classes/manager.php#L737-L746 |
219,326 | moodle/moodle | admin/tool/messageinbound/classes/manager.php | manager.message_has_flag | private function message_has_flag($messageid, $flag) {
// Get the current mailbox.
$mailbox = $this->get_mailbox();
// Grab messagedata including flags.
$query = new \Horde_Imap_Client_Fetch_Query();
$query->flags();
$query->structure();
$messagedata = $this->cli... | php | private function message_has_flag($messageid, $flag) {
// Get the current mailbox.
$mailbox = $this->get_mailbox();
// Grab messagedata including flags.
$query = new \Horde_Imap_Client_Fetch_Query();
$query->flags();
$query->structure();
$messagedata = $this->cli... | [
"private",
"function",
"message_has_flag",
"(",
"$",
"messageid",
",",
"$",
"flag",
")",
"{",
"// Get the current mailbox.",
"$",
"mailbox",
"=",
"$",
"this",
"->",
"get_mailbox",
"(",
")",
";",
"// Grab messagedata including flags.",
"$",
"query",
"=",
"new",
"... | Check whether the message has the specified flag
@param mixed $messageid
@param string $flag The flag to check
@return bool | [
"Check",
"whether",
"the",
"message",
"has",
"the",
"specified",
"flag"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/messageinbound/classes/manager.php#L755-L769 |
219,327 | moodle/moodle | admin/tool/messageinbound/classes/manager.php | manager.ensure_mailboxes_exist | private function ensure_mailboxes_exist() {
$requiredmailboxes = array(
self::MAILBOX,
$this->get_confirmation_folder(),
);
$existingmailboxes = $this->client->listMailboxes($requiredmailboxes);
foreach ($requiredmailboxes as $mailbox) {
if (isset($e... | php | private function ensure_mailboxes_exist() {
$requiredmailboxes = array(
self::MAILBOX,
$this->get_confirmation_folder(),
);
$existingmailboxes = $this->client->listMailboxes($requiredmailboxes);
foreach ($requiredmailboxes as $mailbox) {
if (isset($e... | [
"private",
"function",
"ensure_mailboxes_exist",
"(",
")",
"{",
"$",
"requiredmailboxes",
"=",
"array",
"(",
"self",
"::",
"MAILBOX",
",",
"$",
"this",
"->",
"get_confirmation_folder",
"(",
")",
",",
")",
";",
"$",
"existingmailboxes",
"=",
"$",
"this",
"->"... | Ensure that all mailboxes exist. | [
"Ensure",
"that",
"all",
"mailboxes",
"exist",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/messageinbound/classes/manager.php#L774-L791 |
219,328 | moodle/moodle | admin/tool/messageinbound/classes/manager.php | manager.send_to_handler | private function send_to_handler() {
try {
mtrace("--> Passing to Inbound Message handler {$this->addressmanager->get_handler()->classname}");
if ($result = $this->addressmanager->handle_message($this->currentmessagedata)) {
$this->inform_user_of_success($this->currentmes... | php | private function send_to_handler() {
try {
mtrace("--> Passing to Inbound Message handler {$this->addressmanager->get_handler()->classname}");
if ($result = $this->addressmanager->handle_message($this->currentmessagedata)) {
$this->inform_user_of_success($this->currentmes... | [
"private",
"function",
"send_to_handler",
"(",
")",
"{",
"try",
"{",
"mtrace",
"(",
"\"--> Passing to Inbound Message handler {$this->addressmanager->get_handler()->classname}\"",
")",
";",
"if",
"(",
"$",
"result",
"=",
"$",
"this",
"->",
"addressmanager",
"->",
"handl... | Send the message to the appropriate handler.
@return bool
@throws \core\message\inbound\processing_failed_exception if anything goes wrong. | [
"Send",
"the",
"message",
"to",
"the",
"appropriate",
"handler",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/messageinbound/classes/manager.php#L836-L872 |
219,329 | moodle/moodle | admin/tool/messageinbound/classes/manager.php | manager.handle_verification_failure | private function handle_verification_failure(
\Horde_Imap_Client_Ids $messageids,
$recipient) {
global $DB, $USER;
if (!$messageid = $this->currentmessagedata->messageid) {
mtrace("---> Warning: Unable to determine the Message-ID of the message.");
return... | php | private function handle_verification_failure(
\Horde_Imap_Client_Ids $messageids,
$recipient) {
global $DB, $USER;
if (!$messageid = $this->currentmessagedata->messageid) {
mtrace("---> Warning: Unable to determine the Message-ID of the message.");
return... | [
"private",
"function",
"handle_verification_failure",
"(",
"\\",
"Horde_Imap_Client_Ids",
"$",
"messageids",
",",
"$",
"recipient",
")",
"{",
"global",
"$",
"DB",
",",
"$",
"USER",
";",
"if",
"(",
"!",
"$",
"messageid",
"=",
"$",
"this",
"->",
"currentmessag... | Handle failure of sender verification.
This will send a notification to the user identified in the Inbound Message address informing them that a message has been
stored. The message includes a verification link and reply-to address which is handled by the
invalid_recipient_handler.
@param \Horde_Imap_Client_Ids $mess... | [
"Handle",
"failure",
"of",
"sender",
"verification",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/messageinbound/classes/manager.php#L885-L943 |
219,330 | moodle/moodle | admin/tool/messageinbound/classes/manager.php | manager.inform_user_of_error | private function inform_user_of_error($error) {
global $USER;
// The message will be sent from the intended user.
$userfrom = clone $USER;
$userfrom->customheaders = array();
if ($messageid = $this->currentmessagedata->messageid) {
// Adding the In-Reply-To header e... | php | private function inform_user_of_error($error) {
global $USER;
// The message will be sent from the intended user.
$userfrom = clone $USER;
$userfrom->customheaders = array();
if ($messageid = $this->currentmessagedata->messageid) {
// Adding the In-Reply-To header e... | [
"private",
"function",
"inform_user_of_error",
"(",
"$",
"error",
")",
"{",
"global",
"$",
"USER",
";",
"// The message will be sent from the intended user.",
"$",
"userfrom",
"=",
"clone",
"$",
"USER",
";",
"$",
"userfrom",
"->",
"customheaders",
"=",
"array",
"(... | Inform the identified sender of a processing error.
@param string $error The error message | [
"Inform",
"the",
"identified",
"sender",
"of",
"a",
"processing",
"error",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/messageinbound/classes/manager.php#L950-L984 |
219,331 | moodle/moodle | admin/tool/messageinbound/classes/manager.php | manager.inform_user_of_success | private function inform_user_of_success(\stdClass $messagedata, $handlerresult) {
global $USER;
// Check whether the handler has a success notification.
$handler = $this->addressmanager->get_handler();
$message = $handler->get_success_message($messagedata, $handlerresult);
if (... | php | private function inform_user_of_success(\stdClass $messagedata, $handlerresult) {
global $USER;
// Check whether the handler has a success notification.
$handler = $this->addressmanager->get_handler();
$message = $handler->get_success_message($messagedata, $handlerresult);
if (... | [
"private",
"function",
"inform_user_of_success",
"(",
"\\",
"stdClass",
"$",
"messagedata",
",",
"$",
"handlerresult",
")",
"{",
"global",
"$",
"USER",
";",
"// Check whether the handler has a success notification.",
"$",
"handler",
"=",
"$",
"this",
"->",
"addressman... | Inform the identified sender that message processing was successful.
@param \stdClass $messagedata The data for the current message being processed.
@param mixed $handlerresult The result returned by the handler.
@return bool | [
"Inform",
"the",
"identified",
"sender",
"that",
"message",
"processing",
"was",
"successful",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/messageinbound/classes/manager.php#L993-L1045 |
219,332 | moodle/moodle | admin/tool/messageinbound/classes/manager.php | manager.get_reply_subject | private function get_reply_subject($subject) {
$prefix = get_string('replysubjectprefix', 'tool_messageinbound');
if (!(substr($subject, 0, strlen($prefix)) == $prefix)) {
$subject = $prefix . ' ' . $subject;
}
return $subject;
} | php | private function get_reply_subject($subject) {
$prefix = get_string('replysubjectprefix', 'tool_messageinbound');
if (!(substr($subject, 0, strlen($prefix)) == $prefix)) {
$subject = $prefix . ' ' . $subject;
}
return $subject;
} | [
"private",
"function",
"get_reply_subject",
"(",
"$",
"subject",
")",
"{",
"$",
"prefix",
"=",
"get_string",
"(",
"'replysubjectprefix'",
",",
"'tool_messageinbound'",
")",
";",
"if",
"(",
"!",
"(",
"substr",
"(",
"$",
"subject",
",",
"0",
",",
"strlen",
"... | Return a formatted subject line for replies.
@param string $subject The subject string
@return string The formatted reply subject | [
"Return",
"a",
"formatted",
"subject",
"line",
"for",
"replies",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/messageinbound/classes/manager.php#L1053-L1060 |
219,333 | moodle/moodle | question/classes/bank/tags_action_column.php | tags_action_column.display_content | protected function display_content($question, $rowclasses) {
if (\core_tag_tag::is_enabled('core_question', 'question') &&
question_has_capability_on($question, 'view')) {
$cantag = question_has_capability_on($question, 'tag');
$qbank = $this->qbank;
$url = n... | php | protected function display_content($question, $rowclasses) {
if (\core_tag_tag::is_enabled('core_question', 'question') &&
question_has_capability_on($question, 'view')) {
$cantag = question_has_capability_on($question, 'tag');
$qbank = $this->qbank;
$url = n... | [
"protected",
"function",
"display_content",
"(",
"$",
"question",
",",
"$",
"rowclasses",
")",
"{",
"if",
"(",
"\\",
"core_tag_tag",
"::",
"is_enabled",
"(",
"'core_question'",
",",
"'question'",
")",
"&&",
"question_has_capability_on",
"(",
"$",
"question",
","... | Display tags column content.
@param object $question The question database record.
@param string $rowclasses | [
"Display",
"tags",
"column",
"content",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/classes/bank/tags_action_column.php#L52-L63 |
219,334 | moodle/moodle | question/classes/bank/tags_action_column.php | tags_action_column.print_tag_icon | protected function print_tag_icon($id, \moodle_url $url, $cantag, $contextid) {
global $OUTPUT;
$params = [
'data-action' => 'edittags',
'data-cantag' => $cantag,
'data-contextid' => $contextid,
'data-questionid' => $id
];
echo \html_writ... | php | protected function print_tag_icon($id, \moodle_url $url, $cantag, $contextid) {
global $OUTPUT;
$params = [
'data-action' => 'edittags',
'data-cantag' => $cantag,
'data-contextid' => $contextid,
'data-questionid' => $id
];
echo \html_writ... | [
"protected",
"function",
"print_tag_icon",
"(",
"$",
"id",
",",
"\\",
"moodle_url",
"$",
"url",
",",
"$",
"cantag",
",",
"$",
"contextid",
")",
"{",
"global",
"$",
"OUTPUT",
";",
"$",
"params",
"=",
"[",
"'data-action'",
"=>",
"'edittags'",
",",
"'data-c... | Build and print the tags icon.
@param int $id The question ID.
@param \moodle_url $url Editing question url.
@param bool $cantag Whether the user can tag questions or not.
@param int $contextid Question category context ID. | [
"Build",
"and",
"print",
"the",
"tags",
"icon",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/question/classes/bank/tags_action_column.php#L73-L84 |
219,335 | moodle/moodle | mod/workshop/form/rubric/backup/moodle2/restore_workshopform_rubric_subplugin.class.php | restore_workshopform_rubric_subplugin.process_workshopform_rubric_config | public function process_workshopform_rubric_config($data) {
global $DB;
$data = (object)$data;
$data->workshopid = $this->get_new_parentid('workshop');
$DB->insert_record('workshopform_rubric_config', $data);
} | php | public function process_workshopform_rubric_config($data) {
global $DB;
$data = (object)$data;
$data->workshopid = $this->get_new_parentid('workshop');
$DB->insert_record('workshopform_rubric_config', $data);
} | [
"public",
"function",
"process_workshopform_rubric_config",
"(",
"$",
"data",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"data",
"=",
"(",
"object",
")",
"$",
"data",
";",
"$",
"data",
"->",
"workshopid",
"=",
"$",
"this",
"->",
"get_new_parentid",
"(",
"'... | Processes the workshopform_rubric_map element | [
"Processes",
"the",
"workshopform_rubric_map",
"element"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/form/rubric/backup/moodle2/restore_workshopform_rubric_subplugin.class.php#L107-L113 |
219,336 | moodle/moodle | mod/workshop/form/rubric/backup/moodle2/restore_workshopform_rubric_subplugin.class.php | restore_workshopform_rubric_subplugin.process_workshopform_rubric_dimension | public function process_workshopform_rubric_dimension($data) {
global $DB;
$data = (object)$data;
$oldid = $data->id;
$data->workshopid = $this->get_new_parentid('workshop');
$newitemid = $DB->insert_record('workshopform_rubric', $data);
$this->set_mapping($this->get_n... | php | public function process_workshopform_rubric_dimension($data) {
global $DB;
$data = (object)$data;
$oldid = $data->id;
$data->workshopid = $this->get_new_parentid('workshop');
$newitemid = $DB->insert_record('workshopform_rubric', $data);
$this->set_mapping($this->get_n... | [
"public",
"function",
"process_workshopform_rubric_dimension",
"(",
"$",
"data",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"data",
"=",
"(",
"object",
")",
"$",
"data",
";",
"$",
"oldid",
"=",
"$",
"data",
"->",
"id",
";",
"$",
"data",
"->",
"workshopid... | Processes the workshopform_rubric_dimension element | [
"Processes",
"the",
"workshopform_rubric_dimension",
"element"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/form/rubric/backup/moodle2/restore_workshopform_rubric_subplugin.class.php#L118-L131 |
219,337 | moodle/moodle | mod/workshop/form/rubric/backup/moodle2/restore_workshopform_rubric_subplugin.class.php | restore_workshopform_rubric_subplugin.process_workshopform_rubric_level | public function process_workshopform_rubric_level($data) {
global $DB;
$data = (object)$data;
$data->dimensionid = $this->get_new_parentid($this->get_namefor('dimension'));
$DB->insert_record('workshopform_rubric_levels', $data);
} | php | public function process_workshopform_rubric_level($data) {
global $DB;
$data = (object)$data;
$data->dimensionid = $this->get_new_parentid($this->get_namefor('dimension'));
$DB->insert_record('workshopform_rubric_levels', $data);
} | [
"public",
"function",
"process_workshopform_rubric_level",
"(",
"$",
"data",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"data",
"=",
"(",
"object",
")",
"$",
"data",
";",
"$",
"data",
"->",
"dimensionid",
"=",
"$",
"this",
"->",
"get_new_parentid",
"(",
"$... | Processes the workshopform_rubric_level element | [
"Processes",
"the",
"workshopform_rubric_level",
"element"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/workshop/form/rubric/backup/moodle2/restore_workshopform_rubric_subplugin.class.php#L136-L142 |
219,338 | moodle/moodle | lib/google/src/Google/IO/Exception.php | Google_IO_Exception.allowedRetries | public function allowedRetries()
{
if (isset($this->retryMap[$this->code])) {
return $this->retryMap[$this->code];
}
return 0;
} | php | public function allowedRetries()
{
if (isset($this->retryMap[$this->code])) {
return $this->retryMap[$this->code];
}
return 0;
} | [
"public",
"function",
"allowedRetries",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"retryMap",
"[",
"$",
"this",
"->",
"code",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"retryMap",
"[",
"$",
"this",
"->",
"code",
"]",
";",
... | Gets the number of times the associated task can be retried.
NOTE: -1 is returned if the task can be retried indefinitely
@return integer | [
"Gets",
"the",
"number",
"of",
"times",
"the",
"associated",
"task",
"can",
"be",
"retried",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/google/src/Google/IO/Exception.php#L61-L68 |
219,339 | moodle/moodle | lib/htmlpurifier/HTMLPurifier/HTMLModule/Tidy.php | HTMLPurifier_HTMLModule_Tidy.getFixesForLevel | public function getFixesForLevel($level)
{
if ($level == $this->levels[0]) {
return array();
}
$activated_levels = array();
for ($i = 1, $c = count($this->levels); $i < $c; $i++) {
$activated_levels[] = $this->levels[$i];
if ($this->levels[$i] == $... | php | public function getFixesForLevel($level)
{
if ($level == $this->levels[0]) {
return array();
}
$activated_levels = array();
for ($i = 1, $c = count($this->levels); $i < $c; $i++) {
$activated_levels[] = $this->levels[$i];
if ($this->levels[$i] == $... | [
"public",
"function",
"getFixesForLevel",
"(",
"$",
"level",
")",
"{",
"if",
"(",
"$",
"level",
"==",
"$",
"this",
"->",
"levels",
"[",
"0",
"]",
")",
"{",
"return",
"array",
"(",
")",
";",
"}",
"$",
"activated_levels",
"=",
"array",
"(",
")",
";",... | Retrieves all fixes per a level, returning fixes for that specific
level as well as all levels below it.
@param string $level level identifier, see $levels for valid values
@return array Lookup up table of fixes | [
"Retrieves",
"all",
"fixes",
"per",
"a",
"level",
"returning",
"fixes",
"for",
"that",
"specific",
"level",
"as",
"well",
"as",
"all",
"levels",
"below",
"it",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/htmlpurifier/HTMLPurifier/HTMLModule/Tidy.php#L75-L101 |
219,340 | moodle/moodle | lib/simplepie/library/SimplePie/Decode/HTML/Entities.php | SimplePie_Decode_HTML_Entities.consume | public function consume()
{
if (isset($this->data[$this->position]))
{
$this->consumed .= $this->data[$this->position];
return $this->data[$this->position++];
}
else
{
return false;
}
} | php | public function consume()
{
if (isset($this->data[$this->position]))
{
$this->consumed .= $this->data[$this->position];
return $this->data[$this->position++];
}
else
{
return false;
}
} | [
"public",
"function",
"consume",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"data",
"[",
"$",
"this",
"->",
"position",
"]",
")",
")",
"{",
"$",
"this",
"->",
"consumed",
".=",
"$",
"this",
"->",
"data",
"[",
"$",
"this",
"->",
... | Consume the next byte
@access private
@return mixed The next byte, or false, if there is no more data | [
"Consume",
"the",
"next",
"byte"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/simplepie/library/SimplePie/Decode/HTML/Entities.php#L113-L124 |
219,341 | moodle/moodle | lib/simplepie/library/SimplePie/Decode/HTML/Entities.php | SimplePie_Decode_HTML_Entities.consume_range | public function consume_range($chars)
{
if ($len = strspn($this->data, $chars, $this->position))
{
$data = substr($this->data, $this->position, $len);
$this->consumed .= $data;
$this->position += $len;
return $data;
}
else
{
return false;
}
} | php | public function consume_range($chars)
{
if ($len = strspn($this->data, $chars, $this->position))
{
$data = substr($this->data, $this->position, $len);
$this->consumed .= $data;
$this->position += $len;
return $data;
}
else
{
return false;
}
} | [
"public",
"function",
"consume_range",
"(",
"$",
"chars",
")",
"{",
"if",
"(",
"$",
"len",
"=",
"strspn",
"(",
"$",
"this",
"->",
"data",
",",
"$",
"chars",
",",
"$",
"this",
"->",
"position",
")",
")",
"{",
"$",
"data",
"=",
"substr",
"(",
"$",
... | Consume a range of characters
@access private
@param string $chars Characters to consume
@return mixed A series of characters that match the range, or false | [
"Consume",
"a",
"range",
"of",
"characters"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/simplepie/library/SimplePie/Decode/HTML/Entities.php#L133-L146 |
219,342 | moodle/moodle | analytics/classes/analysis.php | analysis.run | public function run() {
$options = $this->analyser->get_options();
// Time limit control.
$modeltimelimit = intval(get_config('analytics', 'modeltimelimit'));
if ($this->includetarget) {
$action = 'training';
} else {
$action = 'prediction';
}
... | php | public function run() {
$options = $this->analyser->get_options();
// Time limit control.
$modeltimelimit = intval(get_config('analytics', 'modeltimelimit'));
if ($this->includetarget) {
$action = 'training';
} else {
$action = 'prediction';
}
... | [
"public",
"function",
"run",
"(",
")",
"{",
"$",
"options",
"=",
"$",
"this",
"->",
"analyser",
"->",
"get_options",
"(",
")",
";",
"// Time limit control.",
"$",
"modeltimelimit",
"=",
"intval",
"(",
"get_config",
"(",
"'analytics'",
",",
"'modeltimelimit'",
... | Runs the analysis.
@return null | [
"Runs",
"the",
"analysis",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/analytics/classes/analysis.php#L80-L141 |
219,343 | moodle/moodle | analytics/classes/analysis.php | analysis.get_processed_analysables | protected function get_processed_analysables(): array {
global $DB;
$params = array('modelid' => $this->analyser->get_modelid());
$params['action'] = ($this->includetarget) ? 'training' : 'prediction';
$select = 'modelid = :modelid and action = :action';
// Weird select fields ... | php | protected function get_processed_analysables(): array {
global $DB;
$params = array('modelid' => $this->analyser->get_modelid());
$params['action'] = ($this->includetarget) ? 'training' : 'prediction';
$select = 'modelid = :modelid and action = :action';
// Weird select fields ... | [
"protected",
"function",
"get_processed_analysables",
"(",
")",
":",
"array",
"{",
"global",
"$",
"DB",
";",
"$",
"params",
"=",
"array",
"(",
"'modelid'",
"=>",
"$",
"this",
"->",
"analyser",
"->",
"get_modelid",
"(",
")",
")",
";",
"$",
"params",
"[",
... | Get analysables that have been already processed.
@return \stdClass[] | [
"Get",
"analysables",
"that",
"have",
"been",
"already",
"processed",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/analytics/classes/analysis.php#L148-L158 |
219,344 | moodle/moodle | analytics/classes/analysis.php | analysis.process_analysable | public function process_analysable(\core_analytics\analysable $analysable): array {
// Target instances scope is per-analysable (it can't be lower as calculations run once per
// analysable, not time splitting method nor time range).
$target = call_user_func(array($this->analyser->get_target(),... | php | public function process_analysable(\core_analytics\analysable $analysable): array {
// Target instances scope is per-analysable (it can't be lower as calculations run once per
// analysable, not time splitting method nor time range).
$target = call_user_func(array($this->analyser->get_target(),... | [
"public",
"function",
"process_analysable",
"(",
"\\",
"core_analytics",
"\\",
"analysable",
"$",
"analysable",
")",
":",
"array",
"{",
"// Target instances scope is per-analysable (it can't be lower as calculations run once per",
"// analysable, not time splitting method nor time rang... | Processes an analysable
This method returns the general analysable status, an array of files by time splitting method and
an error message if there is any problem.
@param \core_analytics\analysable $analysable
@return \stdClass[] Results objects by time splitting method | [
"Processes",
"an",
"analysable"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/analytics/classes/analysis.php#L169-L202 |
219,345 | moodle/moodle | analytics/classes/analysis.php | analysis.calculate | public function calculate(\core_analytics\local\time_splitting\base $timesplitting, array &$sampleids,
array $ranges, \core_analytics\local\target\base $target): ?array {
$calculatedtarget = null;
if ($this->includetarget) {
// We first calculate the target because analysable da... | php | public function calculate(\core_analytics\local\time_splitting\base $timesplitting, array &$sampleids,
array $ranges, \core_analytics\local\target\base $target): ?array {
$calculatedtarget = null;
if ($this->includetarget) {
// We first calculate the target because analysable da... | [
"public",
"function",
"calculate",
"(",
"\\",
"core_analytics",
"\\",
"local",
"\\",
"time_splitting",
"\\",
"base",
"$",
"timesplitting",
",",
"array",
"&",
"$",
"sampleids",
",",
"array",
"$",
"ranges",
",",
"\\",
"core_analytics",
"\\",
"local",
"\\",
"ta... | Calculates indicators and targets.
@param \core_analytics\local\time_splitting\base $timesplitting
@param array $sampleids
@param array $ranges
@param \core_analytics\local\target\base $target
@return array|null | [
"Calculates",
"indicators",
"and",
"targets",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/analytics/classes/analysis.php#L383-L422 |
219,346 | moodle/moodle | analytics/classes/analysis.php | analysis.fill_dataset | protected function fill_dataset(\core_analytics\local\time_splitting\base $timesplitting,
array &$dataset, ?array $calculatedtarget = null) {
$nranges = count($timesplitting->get_distinct_ranges());
foreach ($dataset as $uniquesampleid => $unmodified) {
list($analysersampleid,... | php | protected function fill_dataset(\core_analytics\local\time_splitting\base $timesplitting,
array &$dataset, ?array $calculatedtarget = null) {
$nranges = count($timesplitting->get_distinct_ranges());
foreach ($dataset as $uniquesampleid => $unmodified) {
list($analysersampleid,... | [
"protected",
"function",
"fill_dataset",
"(",
"\\",
"core_analytics",
"\\",
"local",
"\\",
"time_splitting",
"\\",
"base",
"$",
"timesplitting",
",",
"array",
"&",
"$",
"dataset",
",",
"?",
"array",
"$",
"calculatedtarget",
"=",
"null",
")",
"{",
"$",
"nrang... | Adds time range indicators and the target to each sample.
This will identify the sample as belonging to a specific range.
@param \core_analytics\local\time_splitting\base $timesplitting
@param array $dataset
@param array|null $calculatedtarget
@return null | [
"Adds",
"time",
"range",
"indicators",
"and",
"the",
"target",
"to",
"each",
"sample",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/analytics/classes/analysis.php#L555-L585 |
219,347 | moodle/moodle | analytics/classes/analysis.php | analysis.update_analysable_analysed_time | protected function update_analysable_analysed_time(array $processedanalysables, int $analysableid) {
global $DB;
$now = time();
if (!empty($processedanalysables[$analysableid])) {
$obj = $processedanalysables[$analysableid];
$obj->id = $obj->primarykey;
uns... | php | protected function update_analysable_analysed_time(array $processedanalysables, int $analysableid) {
global $DB;
$now = time();
if (!empty($processedanalysables[$analysableid])) {
$obj = $processedanalysables[$analysableid];
$obj->id = $obj->primarykey;
uns... | [
"protected",
"function",
"update_analysable_analysed_time",
"(",
"array",
"$",
"processedanalysables",
",",
"int",
"$",
"analysableid",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"now",
"=",
"time",
"(",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"processe... | Updates the analysable analysis time.
@param array $processedanalysables
@param int $analysableid
@return null | [
"Updates",
"the",
"analysable",
"analysis",
"time",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/analytics/classes/analysis.php#L594-L625 |
219,348 | moodle/moodle | analytics/classes/analysis.php | analysis.fill_firstanalyses_cache | public static function fill_firstanalyses_cache(int $modelid, ?int $analysableid = null) {
global $DB;
// Using composed keys instead of cache $identifiers because of MDL-65358.
$primarykey = $DB->sql_concat($modelid, "'_'", 'analysableid');
$sql = "SELECT $primarykey AS id, MIN(firstan... | php | public static function fill_firstanalyses_cache(int $modelid, ?int $analysableid = null) {
global $DB;
// Using composed keys instead of cache $identifiers because of MDL-65358.
$primarykey = $DB->sql_concat($modelid, "'_'", 'analysableid');
$sql = "SELECT $primarykey AS id, MIN(firstan... | [
"public",
"static",
"function",
"fill_firstanalyses_cache",
"(",
"int",
"$",
"modelid",
",",
"?",
"int",
"$",
"analysableid",
"=",
"null",
")",
"{",
"global",
"$",
"DB",
";",
"// Using composed keys instead of cache $identifiers because of MDL-65358.",
"$",
"primarykey"... | Fills a cache containing the first time each analysable in the provided model was analysed.
@param int $modelid
@param int|null $analysableid
@return null | [
"Fills",
"a",
"cache",
"containing",
"the",
"first",
"time",
"each",
"analysable",
"in",
"the",
"provided",
"model",
"was",
"analysed",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/analytics/classes/analysis.php#L634-L663 |
219,349 | moodle/moodle | analytics/classes/analysis.php | analysis.add_context_metadata | protected function add_context_metadata(\core_analytics\local\time_splitting\base $timesplitting, array &$dataset,
\core_analytics\local\target\base $target) {
$headers = $this->get_headers($timesplitting, $target);
// This will also reset samples' dataset keys.
array_unshift($datas... | php | protected function add_context_metadata(\core_analytics\local\time_splitting\base $timesplitting, array &$dataset,
\core_analytics\local\target\base $target) {
$headers = $this->get_headers($timesplitting, $target);
// This will also reset samples' dataset keys.
array_unshift($datas... | [
"protected",
"function",
"add_context_metadata",
"(",
"\\",
"core_analytics",
"\\",
"local",
"\\",
"time_splitting",
"\\",
"base",
"$",
"timesplitting",
",",
"array",
"&",
"$",
"dataset",
",",
"\\",
"core_analytics",
"\\",
"local",
"\\",
"target",
"\\",
"base",
... | Adds dataset context info.
The final dataset document will look like this:
----------------------------------------------------
metadata1,metadata2,metadata3,.....
value1, value2, value3,.....
header1,header2,header3,header4,.....
stud1value1,stud1value2,stud1value3,stud1value4,.....
stud2value1,stud2value2,stud2valu... | [
"Adds",
"dataset",
"context",
"info",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/analytics/classes/analysis.php#L684-L690 |
219,350 | moodle/moodle | analytics/classes/analysis.php | analysis.get_headers | public function get_headers(\core_analytics\local\time_splitting\base $timesplitting,
\core_analytics\local\target\base $target): array {
// 3rd column will contain the indicator ids.
$headers = array();
if (!$this->includetarget) {
// The first column is the sampleid.
... | php | public function get_headers(\core_analytics\local\time_splitting\base $timesplitting,
\core_analytics\local\target\base $target): array {
// 3rd column will contain the indicator ids.
$headers = array();
if (!$this->includetarget) {
// The first column is the sampleid.
... | [
"public",
"function",
"get_headers",
"(",
"\\",
"core_analytics",
"\\",
"local",
"\\",
"time_splitting",
"\\",
"base",
"$",
"timesplitting",
",",
"\\",
"core_analytics",
"\\",
"local",
"\\",
"target",
"\\",
"base",
"$",
"target",
")",
":",
"array",
"{",
"// ... | Returns the headers for the csv file based on the indicators and the target.
@param \core_analytics\local\time_splitting\base $timesplitting
@param \core_analytics\local\target\base $target
@return string[] | [
"Returns",
"the",
"headers",
"for",
"the",
"csv",
"file",
"based",
"on",
"the",
"indicators",
"and",
"the",
"target",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/analytics/classes/analysis.php#L699-L729 |
219,351 | moodle/moodle | analytics/classes/analysis.php | analysis.filter_out_train_samples | protected function filter_out_train_samples(array &$sampleids, \core_analytics\local\time_splitting\base $timesplitting) {
global $DB;
$params = array('modelid' => $this->analyser->get_modelid(), 'analysableid' => $timesplitting->get_analysable()->get_id(),
'timesplitting' => $timesplitting... | php | protected function filter_out_train_samples(array &$sampleids, \core_analytics\local\time_splitting\base $timesplitting) {
global $DB;
$params = array('modelid' => $this->analyser->get_modelid(), 'analysableid' => $timesplitting->get_analysable()->get_id(),
'timesplitting' => $timesplitting... | [
"protected",
"function",
"filter_out_train_samples",
"(",
"array",
"&",
"$",
"sampleids",
",",
"\\",
"core_analytics",
"\\",
"local",
"\\",
"time_splitting",
"\\",
"base",
"$",
"timesplitting",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"params",
"=",
"array",
... | Filters out samples that have already been used for training.
@param int[] $sampleids
@param \core_analytics\local\time_splitting\base $timesplitting
@return null | [
"Filters",
"out",
"samples",
"that",
"have",
"already",
"been",
"used",
"for",
"training",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/analytics/classes/analysis.php#L738-L756 |
219,352 | moodle/moodle | analytics/classes/analysis.php | analysis.filter_out_prediction_samples_and_ranges | protected function filter_out_prediction_samples_and_ranges(array &$sampleids, array &$ranges,
\core_analytics\local\time_splitting\base $timesplitting) {
if (count($ranges) > 1) {
throw new \coding_exception('$ranges argument should only contain one range');
}
$rangein... | php | protected function filter_out_prediction_samples_and_ranges(array &$sampleids, array &$ranges,
\core_analytics\local\time_splitting\base $timesplitting) {
if (count($ranges) > 1) {
throw new \coding_exception('$ranges argument should only contain one range');
}
$rangein... | [
"protected",
"function",
"filter_out_prediction_samples_and_ranges",
"(",
"array",
"&",
"$",
"sampleids",
",",
"array",
"&",
"$",
"ranges",
",",
"\\",
"core_analytics",
"\\",
"local",
"\\",
"time_splitting",
"\\",
"base",
"$",
"timesplitting",
")",
"{",
"if",
"(... | Filters out samples that have already been used for prediction.
@param int[] $sampleids
@param array $ranges
@param \core_analytics\local\time_splitting\base $timesplitting
@return \stdClass|null The analytics_predict_samples record or null | [
"Filters",
"out",
"samples",
"that",
"have",
"already",
"been",
"used",
"for",
"prediction",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/analytics/classes/analysis.php#L766-L793 |
219,353 | moodle/moodle | analytics/classes/analysis.php | analysis.get_predict_samples_record | private function get_predict_samples_record(\core_analytics\local\time_splitting\base $timesplitting, int $rangeindex) {
global $DB;
$params = array('modelid' => $this->analyser->get_modelid(), 'analysableid' => $timesplitting->get_analysable()->get_id(),
'timesplitting' => $timesplitting->... | php | private function get_predict_samples_record(\core_analytics\local\time_splitting\base $timesplitting, int $rangeindex) {
global $DB;
$params = array('modelid' => $this->analyser->get_modelid(), 'analysableid' => $timesplitting->get_analysable()->get_id(),
'timesplitting' => $timesplitting->... | [
"private",
"function",
"get_predict_samples_record",
"(",
"\\",
"core_analytics",
"\\",
"local",
"\\",
"time_splitting",
"\\",
"base",
"$",
"timesplitting",
",",
"int",
"$",
"rangeindex",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"params",
"=",
"array",
"(",
... | Returns a predict samples record.
@param \core_analytics\local\time_splitting\base $timesplitting
@param int $rangeindex
@return \stdClass|false | [
"Returns",
"a",
"predict",
"samples",
"record",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/analytics/classes/analysis.php#L802-L810 |
219,354 | moodle/moodle | analytics/classes/analysis.php | analysis.save_train_samples | protected function save_train_samples(array $sampleids, \core_analytics\local\time_splitting\base $timesplitting) {
global $DB;
$trainingsamples = new \stdClass();
$trainingsamples->modelid = $this->analyser->get_modelid();
$trainingsamples->analysableid = $timesplitting->get_analysable... | php | protected function save_train_samples(array $sampleids, \core_analytics\local\time_splitting\base $timesplitting) {
global $DB;
$trainingsamples = new \stdClass();
$trainingsamples->modelid = $this->analyser->get_modelid();
$trainingsamples->analysableid = $timesplitting->get_analysable... | [
"protected",
"function",
"save_train_samples",
"(",
"array",
"$",
"sampleids",
",",
"\\",
"core_analytics",
"\\",
"local",
"\\",
"time_splitting",
"\\",
"base",
"$",
"timesplitting",
")",
"{",
"global",
"$",
"DB",
";",
"$",
"trainingsamples",
"=",
"new",
"\\",... | Saves samples that have just been used for training.
@param int[] $sampleids
@param \core_analytics\local\time_splitting\base $timesplitting
@return null | [
"Saves",
"samples",
"that",
"have",
"just",
"been",
"used",
"for",
"training",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/analytics/classes/analysis.php#L819-L831 |
219,355 | moodle/moodle | analytics/classes/analysis.php | analysis.save_prediction_samples | protected function save_prediction_samples(array $sampleids, array $ranges,
\core_analytics\local\time_splitting\base $timesplitting, ?\stdClass $predictsamplesrecord = null) {
global $DB;
if (count($ranges) > 1) {
throw new \coding_exception('$ranges argument should only contai... | php | protected function save_prediction_samples(array $sampleids, array $ranges,
\core_analytics\local\time_splitting\base $timesplitting, ?\stdClass $predictsamplesrecord = null) {
global $DB;
if (count($ranges) > 1) {
throw new \coding_exception('$ranges argument should only contai... | [
"protected",
"function",
"save_prediction_samples",
"(",
"array",
"$",
"sampleids",
",",
"array",
"$",
"ranges",
",",
"\\",
"core_analytics",
"\\",
"local",
"\\",
"time_splitting",
"\\",
"base",
"$",
"timesplitting",
",",
"?",
"\\",
"stdClass",
"$",
"predictsamp... | Saves samples that have just been used for prediction.
@param int[] $sampleids
@param array $ranges
@param \core_analytics\local\time_splitting\base $timesplitting
@param \stdClass|null $predictsamplesrecord The existing record or null if there is no record yet.
@return null | [
"Saves",
"samples",
"that",
"have",
"just",
"been",
"used",
"for",
"prediction",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/analytics/classes/analysis.php#L842-L868 |
219,356 | moodle/moodle | analytics/classes/analysis.php | analysis.init_analysable_analysis | private function init_analysable_analysis(string $timesplittingid, int $analysableid) {
// Do not include $this->includetarget as we don't want the same analysable to be analysed for training
// and prediction at the same time.
$lockkey = 'modelid:' . $this->analyser->get_modelid() . '-analysab... | php | private function init_analysable_analysis(string $timesplittingid, int $analysableid) {
// Do not include $this->includetarget as we don't want the same analysable to be analysed for training
// and prediction at the same time.
$lockkey = 'modelid:' . $this->analyser->get_modelid() . '-analysab... | [
"private",
"function",
"init_analysable_analysis",
"(",
"string",
"$",
"timesplittingid",
",",
"int",
"$",
"analysableid",
")",
"{",
"// Do not include $this->includetarget as we don't want the same analysable to be analysed for training",
"// and prediction at the same time.",
"$",
... | Flags the analysable element as in-analysis and stores a lock for it.
@param string $timesplittingid
@param int $analysableid
@return bool Success or not | [
"Flags",
"the",
"analysable",
"element",
"as",
"in",
"-",
"analysis",
"and",
"stores",
"a",
"lock",
"for",
"it",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/analytics/classes/analysis.php#L877-L893 |
219,357 | moodle/moodle | analytics/classes/analysis.php | analysis.get_insert_batch_size | private static function get_insert_batch_size(): int {
global $DB;
$dbconfig = $DB->export_dbconfig();
// 500 is pgsql default so using 1000 is fine, no other db driver uses a hardcoded value.
if (empty($dbconfig) || empty($dbconfig->dboptions) || empty($dbconfig->dboptions['bulkinsert... | php | private static function get_insert_batch_size(): int {
global $DB;
$dbconfig = $DB->export_dbconfig();
// 500 is pgsql default so using 1000 is fine, no other db driver uses a hardcoded value.
if (empty($dbconfig) || empty($dbconfig->dboptions) || empty($dbconfig->dboptions['bulkinsert... | [
"private",
"static",
"function",
"get_insert_batch_size",
"(",
")",
":",
"int",
"{",
"global",
"$",
"DB",
";",
"$",
"dbconfig",
"=",
"$",
"DB",
"->",
"export_dbconfig",
"(",
")",
";",
"// 500 is pgsql default so using 1000 is fine, no other db driver uses a hardcoded va... | Returns the batch size used for insert_records.
This method tries to find the best batch size without getting
into dml internals. Maximum 1000 records to save memory.
@return int | [
"Returns",
"the",
"batch",
"size",
"used",
"for",
"insert_records",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/analytics/classes/analysis.php#L924-L944 |
219,358 | moodle/moodle | grade/export/lib.php | grade_export.deprecated_constructor | protected function deprecated_constructor($course,
$groupid=0,
$itemlist='',
$export_feedback=false,
$updatedgradesonly = false,
... | php | protected function deprecated_constructor($course,
$groupid=0,
$itemlist='',
$export_feedback=false,
$updatedgradesonly = false,
... | [
"protected",
"function",
"deprecated_constructor",
"(",
"$",
"course",
",",
"$",
"groupid",
"=",
"0",
",",
"$",
"itemlist",
"=",
"''",
",",
"$",
"export_feedback",
"=",
"false",
",",
"$",
"updatedgradesonly",
"=",
"false",
",",
"$",
"displaytype",
"=",
"GR... | Old deprecated constructor.
This deprecated constructor accepts the individual parameters as separate arguments, in
2.8 this was simplified to just accept the data from the moodle form.
@deprecated since 2.8 MDL-46548. Instead call the shortened constructor which accepts the data
directly from the grade_export_form. | [
"Old",
"deprecated",
"constructor",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/export/lib.php#L94-L141 |
219,359 | moodle/moodle | grade/export/lib.php | grade_export.process_form | function process_form($formdata) {
global $USER;
$this->columns = array();
if (!empty($formdata->itemids)) {
if ($formdata->itemids=='-1') {
//user deselected all items
} else {
foreach ($formdata->itemids as $itemid=>$selected) {
... | php | function process_form($formdata) {
global $USER;
$this->columns = array();
if (!empty($formdata->itemids)) {
if ($formdata->itemids=='-1') {
//user deselected all items
} else {
foreach ($formdata->itemids as $itemid=>$selected) {
... | [
"function",
"process_form",
"(",
"$",
"formdata",
")",
"{",
"global",
"$",
"USER",
";",
"$",
"this",
"->",
"columns",
"=",
"array",
"(",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"formdata",
"->",
"itemids",
")",
")",
"{",
"if",
"(",
"$",
"for... | Init object based using data from form
@param object $formdata | [
"Init",
"object",
"based",
"using",
"data",
"from",
"form"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/export/lib.php#L147-L208 |
219,360 | moodle/moodle | grade/export/lib.php | grade_export.track_exports | public function track_exports() {
global $CFG;
/// Whether this plugin is entitled to update export time
if ($expplugins = explode(",", $CFG->gradeexport)) {
if (in_array($this->plugin, $expplugins)) {
return true;
} else {
return false;
... | php | public function track_exports() {
global $CFG;
/// Whether this plugin is entitled to update export time
if ($expplugins = explode(",", $CFG->gradeexport)) {
if (in_array($this->plugin, $expplugins)) {
return true;
} else {
return false;
... | [
"public",
"function",
"track_exports",
"(",
")",
"{",
"global",
"$",
"CFG",
";",
"/// Whether this plugin is entitled to update export time",
"if",
"(",
"$",
"expplugins",
"=",
"explode",
"(",
"\",\"",
",",
"$",
"CFG",
"->",
"gradeexport",
")",
")",
"{",
"if",
... | Update exported field in grade_grades table
@return boolean | [
"Update",
"exported",
"field",
"in",
"grade_grades",
"table"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/export/lib.php#L214-L227 |
219,361 | moodle/moodle | grade/export/lib.php | grade_export.format_grade | public function format_grade($grade, $gradedisplayconst = null) {
$displaytype = $this->displaytype;
if (is_array($this->displaytype) && !is_null($gradedisplayconst)) {
$displaytype = $gradedisplayconst;
}
$gradeitem = $this->grade_items[$grade->itemid];
// We are g... | php | public function format_grade($grade, $gradedisplayconst = null) {
$displaytype = $this->displaytype;
if (is_array($this->displaytype) && !is_null($gradedisplayconst)) {
$displaytype = $gradedisplayconst;
}
$gradeitem = $this->grade_items[$grade->itemid];
// We are g... | [
"public",
"function",
"format_grade",
"(",
"$",
"grade",
",",
"$",
"gradedisplayconst",
"=",
"null",
")",
"{",
"$",
"displaytype",
"=",
"$",
"this",
"->",
"displaytype",
";",
"if",
"(",
"is_array",
"(",
"$",
"this",
"->",
"displaytype",
")",
"&&",
"!",
... | Returns string representation of final grade
@param object $grade instance of grade_grade class
@param integer $gradedisplayconst grade display type constant.
@return string | [
"Returns",
"string",
"representation",
"of",
"final",
"grade"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/export/lib.php#L235-L258 |
219,362 | moodle/moodle | grade/export/lib.php | grade_export.format_column_name | public function format_column_name($grade_item, $feedback=false, $gradedisplayname = null) {
$column = new stdClass();
if ($grade_item->itemtype == 'mod') {
$column->name = get_string('modulename', $grade_item->itemmodule).get_string('labelsep', 'langconfig').$grade_item->get_name();
... | php | public function format_column_name($grade_item, $feedback=false, $gradedisplayname = null) {
$column = new stdClass();
if ($grade_item->itemtype == 'mod') {
$column->name = get_string('modulename', $grade_item->itemmodule).get_string('labelsep', 'langconfig').$grade_item->get_name();
... | [
"public",
"function",
"format_column_name",
"(",
"$",
"grade_item",
",",
"$",
"feedback",
"=",
"false",
",",
"$",
"gradedisplayname",
"=",
"null",
")",
"{",
"$",
"column",
"=",
"new",
"stdClass",
"(",
")",
";",
"if",
"(",
"$",
"grade_item",
"->",
"itemty... | Returns the name of column in export
@param object $grade_item
@param boolean $feedback feedback colum
@param string $gradedisplayname grade display name.
@return string | [
"Returns",
"the",
"name",
"of",
"column",
"in",
"export"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/export/lib.php#L267-L280 |
219,363 | moodle/moodle | grade/export/lib.php | grade_export.format_feedback | public function format_feedback($feedback, $grade = null) {
$string = $feedback->feedback;
if (!empty($grade)) {
// Rewrite links to get the export working for 36, refer MDL-63488.
$string = file_rewrite_pluginfile_urls(
$feedback->feedback,
'plugi... | php | public function format_feedback($feedback, $grade = null) {
$string = $feedback->feedback;
if (!empty($grade)) {
// Rewrite links to get the export working for 36, refer MDL-63488.
$string = file_rewrite_pluginfile_urls(
$feedback->feedback,
'plugi... | [
"public",
"function",
"format_feedback",
"(",
"$",
"feedback",
",",
"$",
"grade",
"=",
"null",
")",
"{",
"$",
"string",
"=",
"$",
"feedback",
"->",
"feedback",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"grade",
")",
")",
"{",
"// Rewrite links to get the e... | Returns formatted grade feedback
@param object $feedback object with properties feedback and feedbackformat
@param object $grade Grade object with grade properties
@return string | [
"Returns",
"formatted",
"grade",
"feedback"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/export/lib.php#L288-L303 |
219,364 | moodle/moodle | grade/export/lib.php | grade_export.get_export_params | public function get_export_params() {
$itemids = array_keys($this->columns);
$itemidsparam = implode(',', $itemids);
if (empty($itemidsparam)) {
$itemidsparam = '-1';
}
// We have a single grade display type constant.
if (!is_array($this->displaytype)) {
... | php | public function get_export_params() {
$itemids = array_keys($this->columns);
$itemidsparam = implode(',', $itemids);
if (empty($itemidsparam)) {
$itemidsparam = '-1';
}
// We have a single grade display type constant.
if (!is_array($this->displaytype)) {
... | [
"public",
"function",
"get_export_params",
"(",
")",
"{",
"$",
"itemids",
"=",
"array_keys",
"(",
"$",
"this",
"->",
"columns",
")",
";",
"$",
"itemidsparam",
"=",
"implode",
"(",
"','",
",",
"$",
"itemids",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"i... | Returns array of parameters used by dump.php and export.php.
@return array | [
"Returns",
"array",
"of",
"parameters",
"used",
"by",
"dump",
".",
"php",
"and",
"export",
".",
"php",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/export/lib.php#L410-L443 |
219,365 | moodle/moodle | grade/export/lib.php | grade_export.print_continue | public function print_continue() {
global $CFG, $OUTPUT;
debugging('function grade_export::print_continue is deprecated.', DEBUG_DEVELOPER);
$params = $this->get_export_params();
echo $OUTPUT->heading(get_string('export', 'grades'));
echo $OUTPUT->container_start('gradeexportl... | php | public function print_continue() {
global $CFG, $OUTPUT;
debugging('function grade_export::print_continue is deprecated.', DEBUG_DEVELOPER);
$params = $this->get_export_params();
echo $OUTPUT->heading(get_string('export', 'grades'));
echo $OUTPUT->container_start('gradeexportl... | [
"public",
"function",
"print_continue",
"(",
")",
"{",
"global",
"$",
"CFG",
",",
"$",
"OUTPUT",
";",
"debugging",
"(",
"'function grade_export::print_continue is deprecated.'",
",",
"DEBUG_DEVELOPER",
")",
";",
"$",
"params",
"=",
"$",
"this",
"->",
"get_export_p... | Either prints a "Export" box, which will redirect the user to the download page,
or prints the URL for the published data.
@deprecated since 2.8 MDL-46548. Call get_export_url and set the
action of the grade_export_form instead.
@return void | [
"Either",
"prints",
"a",
"Export",
"box",
"which",
"will",
"redirect",
"the",
"user",
"to",
"the",
"download",
"page",
"or",
"prints",
"the",
"URL",
"for",
"the",
"published",
"data",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/export/lib.php#L453-L483 |
219,366 | moodle/moodle | grade/export/lib.php | grade_export.convert_flat_displaytypes_to_array | public static function convert_flat_displaytypes_to_array($displaytypes) {
$types = array();
// We have a single grade display type constant.
if (is_int($displaytypes)) {
$displaytype = clean_param($displaytypes, PARAM_INT);
// Let's set a default value, will be replace... | php | public static function convert_flat_displaytypes_to_array($displaytypes) {
$types = array();
// We have a single grade display type constant.
if (is_int($displaytypes)) {
$displaytype = clean_param($displaytypes, PARAM_INT);
// Let's set a default value, will be replace... | [
"public",
"static",
"function",
"convert_flat_displaytypes_to_array",
"(",
"$",
"displaytypes",
")",
"{",
"$",
"types",
"=",
"array",
"(",
")",
";",
"// We have a single grade display type constant.",
"if",
"(",
"is_int",
"(",
"$",
"displaytypes",
")",
")",
"{",
"... | Convert the grade display types parameter into the required array to grade exporting class.
In order to export, the array key must be the display type name and the value must be the grade display type
constant.
Note: Added support for combined display types constants like the (GRADE_DISPLAY_TYPE_PERCENTAGE_REAL) as
t... | [
"Convert",
"the",
"grade",
"display",
"types",
"parameter",
"into",
"the",
"required",
"array",
"to",
"grade",
"exporting",
"class",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/export/lib.php#L509-L553 |
219,367 | moodle/moodle | grade/export/lib.php | grade_export.convert_flat_itemids_to_array | public static function convert_flat_itemids_to_array($itemids) {
$items = array();
// We just have one single item id.
if (is_int($itemids)) {
$itemid = clean_param($itemids, PARAM_INT);
$items[$itemid] = 1;
} else {
// Few grade items.
$i... | php | public static function convert_flat_itemids_to_array($itemids) {
$items = array();
// We just have one single item id.
if (is_int($itemids)) {
$itemid = clean_param($itemids, PARAM_INT);
$items[$itemid] = 1;
} else {
// Few grade items.
$i... | [
"public",
"static",
"function",
"convert_flat_itemids_to_array",
"(",
"$",
"itemids",
")",
"{",
"$",
"items",
"=",
"array",
"(",
")",
";",
"// We just have one single item id.",
"if",
"(",
"is_int",
"(",
"$",
"itemids",
")",
")",
"{",
"$",
"itemid",
"=",
"cl... | Convert the item ids parameter into the required array to grade exporting class.
In order to export, the array key must be the grade item id and all values must be one.
@param string $itemids can be a single item id or many item ids comma separated.
@return array $items correctly formatted array. | [
"Convert",
"the",
"item",
"ids",
"parameter",
"into",
"the",
"required",
"array",
"to",
"grade",
"exporting",
"class",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/export/lib.php#L563-L579 |
219,368 | moodle/moodle | grade/export/lib.php | grade_export.get_grade_publishing_url | public function get_grade_publishing_url() {
$url = $this->get_export_url();
$output = html_writer::start_div();
$output .= html_writer::tag('p', get_string('gradepublishinglink', 'grades', html_writer::link($url, $url)));
$output .= html_writer::end_div();
return $output;
... | php | public function get_grade_publishing_url() {
$url = $this->get_export_url();
$output = html_writer::start_div();
$output .= html_writer::tag('p', get_string('gradepublishinglink', 'grades', html_writer::link($url, $url)));
$output .= html_writer::end_div();
return $output;
... | [
"public",
"function",
"get_grade_publishing_url",
"(",
")",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"get_export_url",
"(",
")",
";",
"$",
"output",
"=",
"html_writer",
"::",
"start_div",
"(",
")",
";",
"$",
"output",
".=",
"html_writer",
"::",
"tag",
"(... | Create the html code of the grade publishing feature.
@return string $output html code of the grade publishing. | [
"Create",
"the",
"html",
"code",
"of",
"the",
"grade",
"publishing",
"feature",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/export/lib.php#L586-L592 |
219,369 | moodle/moodle | grade/export/lib.php | grade_export.export_bulk_export_data | public static function export_bulk_export_data($id, $itemids, $exportfeedback, $onlyactive, $displaytype,
$decimalpoints, $updatedgradesonly = null, $separator = null) {
$formdata = new \stdClass();
$formdata->id = $id;
$formdata->itemids = sel... | php | public static function export_bulk_export_data($id, $itemids, $exportfeedback, $onlyactive, $displaytype,
$decimalpoints, $updatedgradesonly = null, $separator = null) {
$formdata = new \stdClass();
$formdata->id = $id;
$formdata->itemids = sel... | [
"public",
"static",
"function",
"export_bulk_export_data",
"(",
"$",
"id",
",",
"$",
"itemids",
",",
"$",
"exportfeedback",
",",
"$",
"onlyactive",
",",
"$",
"displaytype",
",",
"$",
"decimalpoints",
",",
"$",
"updatedgradesonly",
"=",
"null",
",",
"$",
"sep... | Create a stdClass object from URL parameters to be used by grade_export class.
@param int $id course id.
@param string $itemids grade items comma separated.
@param bool $exportfeedback export feedback option.
@param bool $onlyactive only enrolled active students.
@param string $displaytype grade display type constants... | [
"Create",
"a",
"stdClass",
"object",
"from",
"URL",
"parameters",
"to",
"be",
"used",
"by",
"grade_export",
"class",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/export/lib.php#L608-L628 |
219,370 | moodle/moodle | grade/export/lib.php | grade_export_update_buffer.track | public function track($grade_grade) {
if (empty($grade_grade->exported) or empty($grade_grade->timemodified)) {
if (is_null($grade_grade->finalgrade)) {
// grade does not exist yet
$status = 'unknown';
} else {
$status = 'new';
... | php | public function track($grade_grade) {
if (empty($grade_grade->exported) or empty($grade_grade->timemodified)) {
if (is_null($grade_grade->finalgrade)) {
// grade does not exist yet
$status = 'unknown';
} else {
$status = 'new';
... | [
"public",
"function",
"track",
"(",
"$",
"grade_grade",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"grade_grade",
"->",
"exported",
")",
"or",
"empty",
"(",
"$",
"grade_grade",
"->",
"timemodified",
")",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"grade_gr... | Track grade export status
@param object $grade_grade
@return string $status (unknow, new, regrade, nochange) | [
"Track",
"grade",
"export",
"status"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/export/lib.php#L675-L701 |
219,371 | moodle/moodle | lib/horde/framework/Horde/Domhtml.php | Horde_Domhtml.getHead | public function getHead()
{
$head = $this->dom->getElementsByTagName('head');
if ($head->length) {
return $head->item(0);
}
$headelt = $this->dom->createElement('head');
$this->dom->documentElement->insertBefore($headelt, $this->dom->documentElement->firstChild);... | php | public function getHead()
{
$head = $this->dom->getElementsByTagName('head');
if ($head->length) {
return $head->item(0);
}
$headelt = $this->dom->createElement('head');
$this->dom->documentElement->insertBefore($headelt, $this->dom->documentElement->firstChild);... | [
"public",
"function",
"getHead",
"(",
")",
"{",
"$",
"head",
"=",
"$",
"this",
"->",
"dom",
"->",
"getElementsByTagName",
"(",
"'head'",
")",
";",
"if",
"(",
"$",
"head",
"->",
"length",
")",
"{",
"return",
"$",
"head",
"->",
"item",
"(",
"0",
")",... | Returns the HEAD element, or creates one if it doesn't exist.
@return DOMElement HEAD element. | [
"Returns",
"the",
"HEAD",
"element",
"or",
"creates",
"one",
"if",
"it",
"doesn",
"t",
"exist",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Domhtml.php#L124-L135 |
219,372 | moodle/moodle | lib/horde/framework/Horde/Domhtml.php | Horde_Domhtml.getBody | public function getBody()
{
$body = $this->dom->getElementsByTagName('body');
if ($body->length) {
return $body->item(0);
}
$bodyelt = $this->dom->createElement('body');
$this->dom->documentElement->appendChild($bodyelt);
return $bodyelt;
} | php | public function getBody()
{
$body = $this->dom->getElementsByTagName('body');
if ($body->length) {
return $body->item(0);
}
$bodyelt = $this->dom->createElement('body');
$this->dom->documentElement->appendChild($bodyelt);
return $bodyelt;
} | [
"public",
"function",
"getBody",
"(",
")",
"{",
"$",
"body",
"=",
"$",
"this",
"->",
"dom",
"->",
"getElementsByTagName",
"(",
"'body'",
")",
";",
"if",
"(",
"$",
"body",
"->",
"length",
")",
"{",
"return",
"$",
"body",
"->",
"item",
"(",
"0",
")",... | Returns the BODY element, or creates one if it doesn't exist.
@since 2.2.0
@return DOMElement BODY element. | [
"Returns",
"the",
"BODY",
"element",
"or",
"creates",
"one",
"if",
"it",
"doesn",
"t",
"exist",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Domhtml.php#L144-L155 |
219,373 | moodle/moodle | lib/horde/framework/Horde/Domhtml.php | Horde_Domhtml.returnHtml | public function returnHtml(array $opts = array())
{
$curr_charset = $this->getCharset();
if (strcasecmp($curr_charset, 'US-ASCII') === 0) {
$curr_charset = 'UTF-8';
}
$charset = array_key_exists('charset', $opts)
? (empty($opts['charset']) ? $curr_charset : $o... | php | public function returnHtml(array $opts = array())
{
$curr_charset = $this->getCharset();
if (strcasecmp($curr_charset, 'US-ASCII') === 0) {
$curr_charset = 'UTF-8';
}
$charset = array_key_exists('charset', $opts)
? (empty($opts['charset']) ? $curr_charset : $o... | [
"public",
"function",
"returnHtml",
"(",
"array",
"$",
"opts",
"=",
"array",
"(",
")",
")",
"{",
"$",
"curr_charset",
"=",
"$",
"this",
"->",
"getCharset",
"(",
")",
";",
"if",
"(",
"strcasecmp",
"(",
"$",
"curr_charset",
",",
"'US-ASCII'",
")",
"===",... | Returns the full HTML text in the original charset.
@param array $opts Additional options: (since 2.1.0)
- charset: (string) Return using this charset. If set but empty, will
return as currently stored in the DOM object.
- metacharset: (boolean) If true, will add a META tag containing the
charset information.
@retur... | [
"Returns",
"the",
"full",
"HTML",
"text",
"in",
"the",
"original",
"charset",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Domhtml.php#L168-L209 |
219,374 | moodle/moodle | lib/horde/framework/Horde/Domhtml.php | Horde_Domhtml.returnBody | public function returnBody()
{
$body = $this->getBody();
$text = '';
if ($body->hasChildNodes()) {
foreach ($body->childNodes as $child) {
$text .= $this->dom->saveXML($child);
}
}
return Horde_String::convertCharset($text, 'UTF-8', $... | php | public function returnBody()
{
$body = $this->getBody();
$text = '';
if ($body->hasChildNodes()) {
foreach ($body->childNodes as $child) {
$text .= $this->dom->saveXML($child);
}
}
return Horde_String::convertCharset($text, 'UTF-8', $... | [
"public",
"function",
"returnBody",
"(",
")",
"{",
"$",
"body",
"=",
"$",
"this",
"->",
"getBody",
"(",
")",
";",
"$",
"text",
"=",
"''",
";",
"if",
"(",
"$",
"body",
"->",
"hasChildNodes",
"(",
")",
")",
"{",
"foreach",
"(",
"$",
"body",
"->",
... | Returns the body text in the original charset.
@return string HTML text. | [
"Returns",
"the",
"body",
"text",
"in",
"the",
"original",
"charset",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Domhtml.php#L216-L228 |
219,375 | moodle/moodle | lib/horde/framework/Horde/Domhtml.php | Horde_Domhtml.getCharset | public function getCharset()
{
return $this->dom->encoding
? $this->dom->encoding
: ($this->_xmlencoding ? 'UTF-8' : $this->_origCharset);
} | php | public function getCharset()
{
return $this->dom->encoding
? $this->dom->encoding
: ($this->_xmlencoding ? 'UTF-8' : $this->_origCharset);
} | [
"public",
"function",
"getCharset",
"(",
")",
"{",
"return",
"$",
"this",
"->",
"dom",
"->",
"encoding",
"?",
"$",
"this",
"->",
"dom",
"->",
"encoding",
":",
"(",
"$",
"this",
"->",
"_xmlencoding",
"?",
"'UTF-8'",
":",
"$",
"this",
"->",
"_origCharset... | Get the charset of the DOM data.
@since 2.1.0
@return string Charset of DOM data. | [
"Get",
"the",
"charset",
"of",
"the",
"DOM",
"data",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Domhtml.php#L237-L242 |
219,376 | moodle/moodle | lib/horde/framework/Horde/Domhtml.php | Horde_Domhtml._loadHTML | protected function _loadHTML($html)
{
if (version_compare(PHP_VERSION, '5.4', '>=')) {
$mask = defined('LIBXML_PARSEHUGE')
? LIBXML_PARSEHUGE
: 0;
$mask |= defined('LIBXML_COMPACT')
? LIBXML_COMPACT
: 0;
$thi... | php | protected function _loadHTML($html)
{
if (version_compare(PHP_VERSION, '5.4', '>=')) {
$mask = defined('LIBXML_PARSEHUGE')
? LIBXML_PARSEHUGE
: 0;
$mask |= defined('LIBXML_COMPACT')
? LIBXML_COMPACT
: 0;
$thi... | [
"protected",
"function",
"_loadHTML",
"(",
"$",
"html",
")",
"{",
"if",
"(",
"version_compare",
"(",
"PHP_VERSION",
",",
"'5.4'",
",",
"'>='",
")",
")",
"{",
"$",
"mask",
"=",
"defined",
"(",
"'LIBXML_PARSEHUGE'",
")",
"?",
"LIBXML_PARSEHUGE",
":",
"0",
... | Loads the HTML data.
@param string $html HTML data. | [
"Loads",
"the",
"HTML",
"data",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Domhtml.php#L249-L262 |
219,377 | moodle/moodle | lib/moodlelib.php | emoticon_manager.get_emoticons | public function get_emoticons($selectable = false) {
global $CFG;
$notselectable = ['martin', 'egg'];
if (empty($CFG->emoticons)) {
return array();
}
$emoticons = $this->decode_stored_config($CFG->emoticons);
if (!is_array($emoticons)) {
// Some... | php | public function get_emoticons($selectable = false) {
global $CFG;
$notselectable = ['martin', 'egg'];
if (empty($CFG->emoticons)) {
return array();
}
$emoticons = $this->decode_stored_config($CFG->emoticons);
if (!is_array($emoticons)) {
// Some... | [
"public",
"function",
"get_emoticons",
"(",
"$",
"selectable",
"=",
"false",
")",
"{",
"global",
"$",
"CFG",
";",
"$",
"notselectable",
"=",
"[",
"'martin'",
",",
"'egg'",
"]",
";",
"if",
"(",
"empty",
"(",
"$",
"CFG",
"->",
"emoticons",
")",
")",
"{... | Returns the currently enabled emoticons
@param boolean $selectable - If true, only return emoticons that should be selectable from a list.
@return array of emoticon objects | [
"Returns",
"the",
"currently",
"enabled",
"emoticons"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/moodlelib.php#L7392-L7417 |
219,378 | moodle/moodle | lib/moodlelib.php | emoticon_manager.prepare_renderable_emoticon | public function prepare_renderable_emoticon(stdClass $emoticon, array $attributes = array()) {
$stringmanager = get_string_manager();
if ($stringmanager->string_exists($emoticon->altidentifier, $emoticon->altcomponent)) {
$alt = get_string($emoticon->altidentifier, $emoticon->altcomponent);
... | php | public function prepare_renderable_emoticon(stdClass $emoticon, array $attributes = array()) {
$stringmanager = get_string_manager();
if ($stringmanager->string_exists($emoticon->altidentifier, $emoticon->altcomponent)) {
$alt = get_string($emoticon->altidentifier, $emoticon->altcomponent);
... | [
"public",
"function",
"prepare_renderable_emoticon",
"(",
"stdClass",
"$",
"emoticon",
",",
"array",
"$",
"attributes",
"=",
"array",
"(",
")",
")",
"{",
"$",
"stringmanager",
"=",
"get_string_manager",
"(",
")",
";",
"if",
"(",
"$",
"stringmanager",
"->",
"... | Converts emoticon object into renderable pix_emoticon object
@param stdClass $emoticon emoticon object
@param array $attributes explicit HTML attributes to set
@return pix_emoticon | [
"Converts",
"emoticon",
"object",
"into",
"renderable",
"pix_emoticon",
"object"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/moodlelib.php#L7426-L7434 |
219,379 | moodle/moodle | lib/moodlelib.php | emoticon_manager.default_emoticons | public function default_emoticons() {
return array(
$this->prepare_emoticon_object(":-)", 's/smiley', 'smiley'),
$this->prepare_emoticon_object(":)", 's/smiley', 'smiley'),
$this->prepare_emoticon_object(":-D", 's/biggrin', 'biggrin'),
$this->prepare_emoticon_obje... | php | public function default_emoticons() {
return array(
$this->prepare_emoticon_object(":-)", 's/smiley', 'smiley'),
$this->prepare_emoticon_object(":)", 's/smiley', 'smiley'),
$this->prepare_emoticon_object(":-D", 's/biggrin', 'biggrin'),
$this->prepare_emoticon_obje... | [
"public",
"function",
"default_emoticons",
"(",
")",
"{",
"return",
"array",
"(",
"$",
"this",
"->",
"prepare_emoticon_object",
"(",
"\":-)\"",
",",
"'s/smiley'",
",",
"'smiley'",
")",
",",
"$",
"this",
"->",
"prepare_emoticon_object",
"(",
"\":)\"",
",",
"'s/... | Returns default set of emoticons supported by Moodle
@return array of sdtClasses | [
"Returns",
"default",
"set",
"of",
"emoticons",
"supported",
"by",
"Moodle"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/moodlelib.php#L7467-L7500 |
219,380 | moodle/moodle | lib/moodlelib.php | emoticon_manager.prepare_emoticon_object | protected function prepare_emoticon_object($text, $imagename, $altidentifier = null,
$altcomponent = 'core_pix', $imagecomponent = 'core') {
return (object)array(
'text' => $text,
'imagename' => $imagename,
'imagec... | php | protected function prepare_emoticon_object($text, $imagename, $altidentifier = null,
$altcomponent = 'core_pix', $imagecomponent = 'core') {
return (object)array(
'text' => $text,
'imagename' => $imagename,
'imagec... | [
"protected",
"function",
"prepare_emoticon_object",
"(",
"$",
"text",
",",
"$",
"imagename",
",",
"$",
"altidentifier",
"=",
"null",
",",
"$",
"altcomponent",
"=",
"'core_pix'",
",",
"$",
"imagecomponent",
"=",
"'core'",
")",
"{",
"return",
"(",
"object",
")... | Helper method preparing the stdClass with the emoticon properties
@param string|array $text or array of strings
@param string $imagename to be used by {@link pix_emoticon}
@param string $altidentifier alternative string identifier, null for no alt
@param string $altcomponent where the alternative string is defined
@pa... | [
"Helper",
"method",
"preparing",
"the",
"stdClass",
"with",
"the",
"emoticon",
"properties"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/moodlelib.php#L7512-L7521 |
219,381 | moodle/moodle | lib/moodlelib.php | lang_string.get_string | protected function get_string() {
global $CFG;
// Check if we need to process the string.
if ($this->string === null) {
// Check the quality of the identifier.
if ($CFG->debugdeveloper && clean_param($this->identifier, PARAM_STRINGID) === '') {
throw new ... | php | protected function get_string() {
global $CFG;
// Check if we need to process the string.
if ($this->string === null) {
// Check the quality of the identifier.
if ($CFG->debugdeveloper && clean_param($this->identifier, PARAM_STRINGID) === '') {
throw new ... | [
"protected",
"function",
"get_string",
"(",
")",
"{",
"global",
"$",
"CFG",
";",
"// Check if we need to process the string.",
"if",
"(",
"$",
"this",
"->",
"string",
"===",
"null",
")",
"{",
"// Check the quality of the identifier.",
"if",
"(",
"$",
"CFG",
"->",
... | Processes the string.
This function actually processes the string, stores it in the string property
and then returns it.
You will notice that this function is VERY similar to the get_string method.
That is because it is pretty much doing the same thing.
However as this function is an upgrade it isn't as tolerant to ba... | [
"Processes",
"the",
"string",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/moodlelib.php#L10227-L10246 |
219,382 | moodle/moodle | lib/moodlelib.php | lang_string.out | public function out($lang = null) {
if ($lang !== null && $lang != $this->lang && ($this->lang == null && $lang != current_language())) {
if ($this->forcedstring) {
debugging('lang_string objects that have been used cannot be printed in another language. ('.$this->lang.' used)', DEBU... | php | public function out($lang = null) {
if ($lang !== null && $lang != $this->lang && ($this->lang == null && $lang != current_language())) {
if ($this->forcedstring) {
debugging('lang_string objects that have been used cannot be printed in another language. ('.$this->lang.' used)', DEBU... | [
"public",
"function",
"out",
"(",
"$",
"lang",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"lang",
"!==",
"null",
"&&",
"$",
"lang",
"!=",
"$",
"this",
"->",
"lang",
"&&",
"(",
"$",
"this",
"->",
"lang",
"==",
"null",
"&&",
"$",
"lang",
"!=",
"curre... | Returns the string
@param string $lang The langauge to use when processing the string
@return string | [
"Returns",
"the",
"string"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/moodlelib.php#L10254-L10264 |
219,383 | moodle/moodle | admin/tool/monitor/classes/eventobservers.php | eventobservers.course_deleted | public static function course_deleted(\core\event\course_deleted $event) {
// Delete rules defined inside this course and associated subscriptions.
$rules = rule_manager::get_rules_by_courseid($event->courseid, 0, 0, false);
foreach ($rules as $rule) {
rule_manager::delete_rule($rule... | php | public static function course_deleted(\core\event\course_deleted $event) {
// Delete rules defined inside this course and associated subscriptions.
$rules = rule_manager::get_rules_by_courseid($event->courseid, 0, 0, false);
foreach ($rules as $rule) {
rule_manager::delete_rule($rule... | [
"public",
"static",
"function",
"course_deleted",
"(",
"\\",
"core",
"\\",
"event",
"\\",
"course_deleted",
"$",
"event",
")",
"{",
"// Delete rules defined inside this course and associated subscriptions.",
"$",
"rules",
"=",
"rule_manager",
"::",
"get_rules_by_courseid",
... | Course delete event observer.
This observer monitors course delete event, and when a course is deleted it deletes any rules and subscriptions associated
with it, so no orphan data is left behind.
@param \core\event\course_deleted $event The course deleted event. | [
"Course",
"delete",
"event",
"observer",
".",
"This",
"observer",
"monitors",
"course",
"delete",
"event",
"and",
"when",
"a",
"course",
"is",
"deleted",
"it",
"deletes",
"any",
"rules",
"and",
"subscriptions",
"associated",
"with",
"it",
"so",
"no",
"orphan",... | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/monitor/classes/eventobservers.php#L55-L63 |
219,384 | moodle/moodle | admin/tool/monitor/classes/eventobservers.php | eventobservers.process_event | public static function process_event(\core\event\base $event) {
if (!get_config('tool_monitor', 'enablemonitor')) {
return; // The tool is disabled. Nothing to do.
}
if (empty(self::$instance)) {
self::$instance = new static();
// Register shutdown handler - ... | php | public static function process_event(\core\event\base $event) {
if (!get_config('tool_monitor', 'enablemonitor')) {
return; // The tool is disabled. Nothing to do.
}
if (empty(self::$instance)) {
self::$instance = new static();
// Register shutdown handler - ... | [
"public",
"static",
"function",
"process_event",
"(",
"\\",
"core",
"\\",
"event",
"\\",
"base",
"$",
"event",
")",
"{",
"if",
"(",
"!",
"get_config",
"(",
"'tool_monitor'",
",",
"'enablemonitor'",
")",
")",
"{",
"return",
";",
"// The tool is disabled. Nothin... | The observer monitoring all the events.
This observers puts small event objects in buffer for later writing to the database. At the end of the request the buffer
is cleaned up and all data dumped into the tool_monitor_events table.
@param \core\event\base $event event object | [
"The",
"observer",
"monitoring",
"all",
"the",
"events",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/monitor/classes/eventobservers.php#L73-L91 |
219,385 | moodle/moodle | admin/tool/monitor/classes/eventobservers.php | eventobservers.buffer_event | protected function buffer_event(\core\event\base $event) {
// If there are no subscriptions for this event do not buffer it.
if (!\tool_monitor\subscription_manager::event_has_subscriptions($event->eventname, $event->courseid)) {
return;
}
$eventdata = $event->get_data();
... | php | protected function buffer_event(\core\event\base $event) {
// If there are no subscriptions for this event do not buffer it.
if (!\tool_monitor\subscription_manager::event_has_subscriptions($event->eventname, $event->courseid)) {
return;
}
$eventdata = $event->get_data();
... | [
"protected",
"function",
"buffer_event",
"(",
"\\",
"core",
"\\",
"event",
"\\",
"base",
"$",
"event",
")",
"{",
"// If there are no subscriptions for this event do not buffer it.",
"if",
"(",
"!",
"\\",
"tool_monitor",
"\\",
"subscription_manager",
"::",
"event_has_sub... | Api to buffer events to store, to reduce db queries.
@param \core\event\base $event | [
"Api",
"to",
"buffer",
"events",
"to",
"store",
"to",
"reduce",
"db",
"queries",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/monitor/classes/eventobservers.php#L98-L122 |
219,386 | moodle/moodle | admin/tool/monitor/classes/eventobservers.php | eventobservers.flush | protected function flush() {
global $DB;
// Flush the buffer to the db.
$events = $this->buffer;
$DB->insert_records('tool_monitor_events', $events); // Insert the whole chunk into the database.
$this->buffer = array();
$this->count = 0;
return $events;
} | php | protected function flush() {
global $DB;
// Flush the buffer to the db.
$events = $this->buffer;
$DB->insert_records('tool_monitor_events', $events); // Insert the whole chunk into the database.
$this->buffer = array();
$this->count = 0;
return $events;
} | [
"protected",
"function",
"flush",
"(",
")",
"{",
"global",
"$",
"DB",
";",
"// Flush the buffer to the db.",
"$",
"events",
"=",
"$",
"this",
"->",
"buffer",
";",
"$",
"DB",
"->",
"insert_records",
"(",
"'tool_monitor_events'",
",",
"$",
"events",
")",
";",
... | Protected method that flushes the buffer of events and writes them to the database.
@return array a copy of the events buffer. | [
"Protected",
"method",
"that",
"flushes",
"the",
"buffer",
"of",
"events",
"and",
"writes",
"them",
"to",
"the",
"database",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/monitor/classes/eventobservers.php#L230-L239 |
219,387 | moodle/moodle | admin/tool/monitor/classes/eventobservers.php | eventobservers.user_deleted | public static function user_deleted(\core\event\user_deleted $event) {
$userid = $event->objectid;
subscription_manager::delete_user_subscriptions($userid);
} | php | public static function user_deleted(\core\event\user_deleted $event) {
$userid = $event->objectid;
subscription_manager::delete_user_subscriptions($userid);
} | [
"public",
"static",
"function",
"user_deleted",
"(",
"\\",
"core",
"\\",
"event",
"\\",
"user_deleted",
"$",
"event",
")",
"{",
"$",
"userid",
"=",
"$",
"event",
"->",
"objectid",
";",
"subscription_manager",
"::",
"delete_user_subscriptions",
"(",
"$",
"useri... | Observer that monitors user deleted event and delete user subscriptions.
@param \core\event\user_deleted $event the event object. | [
"Observer",
"that",
"monitors",
"user",
"deleted",
"event",
"and",
"delete",
"user",
"subscriptions",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/monitor/classes/eventobservers.php#L246-L249 |
219,388 | moodle/moodle | admin/tool/monitor/classes/eventobservers.php | eventobservers.course_module_deleted | public static function course_module_deleted(\core\event\course_module_deleted $event) {
$cmid = $event->contextinstanceid;
subscription_manager::delete_cm_subscriptions($cmid);
} | php | public static function course_module_deleted(\core\event\course_module_deleted $event) {
$cmid = $event->contextinstanceid;
subscription_manager::delete_cm_subscriptions($cmid);
} | [
"public",
"static",
"function",
"course_module_deleted",
"(",
"\\",
"core",
"\\",
"event",
"\\",
"course_module_deleted",
"$",
"event",
")",
"{",
"$",
"cmid",
"=",
"$",
"event",
"->",
"contextinstanceid",
";",
"subscription_manager",
"::",
"delete_cm_subscriptions",... | Observer that monitors course module deleted event and delete user subscriptions.
@param \core\event\course_module_deleted $event the event object. | [
"Observer",
"that",
"monitors",
"course",
"module",
"deleted",
"event",
"and",
"delete",
"user",
"subscriptions",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/admin/tool/monitor/classes/eventobservers.php#L256-L259 |
219,389 | moodle/moodle | grade/grading/form/guide/lib.php | gradingform_guide_controller.extend_settings_navigation | public function extend_settings_navigation(settings_navigation $settingsnav, navigation_node $node=null) {
$node->add(get_string('definemarkingguide', 'gradingform_guide'),
$this->get_editor_url(), settings_navigation::TYPE_CUSTOM,
null, null, new pix_icon('icon', '', 'gradingform_guide'... | php | public function extend_settings_navigation(settings_navigation $settingsnav, navigation_node $node=null) {
$node->add(get_string('definemarkingguide', 'gradingform_guide'),
$this->get_editor_url(), settings_navigation::TYPE_CUSTOM,
null, null, new pix_icon('icon', '', 'gradingform_guide'... | [
"public",
"function",
"extend_settings_navigation",
"(",
"settings_navigation",
"$",
"settingsnav",
",",
"navigation_node",
"$",
"node",
"=",
"null",
")",
"{",
"$",
"node",
"->",
"add",
"(",
"get_string",
"(",
"'definemarkingguide'",
",",
"'gradingform_guide'",
")",... | Extends the module settings navigation with the guide grading settings
This function is called when the context for the page is an activity module with the
FEATURE_ADVANCED_GRADING, the user has the permission moodle/grade:managegradingforms
and there is an area with the active grading method set to 'guide'.
@param s... | [
"Extends",
"the",
"module",
"settings",
"navigation",
"with",
"the",
"guide",
"grading",
"settings"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/grading/form/guide/lib.php#L68-L72 |
219,390 | moodle/moodle | grade/grading/form/guide/lib.php | gradingform_guide_controller.extend_navigation | public function extend_navigation(global_navigation $navigation, navigation_node $node=null) {
if (has_capability('moodle/grade:managegradingforms', $this->get_context())) {
// No need for preview if user can manage forms, he will have link to manage.php in settings instead.
return;
... | php | public function extend_navigation(global_navigation $navigation, navigation_node $node=null) {
if (has_capability('moodle/grade:managegradingforms', $this->get_context())) {
// No need for preview if user can manage forms, he will have link to manage.php in settings instead.
return;
... | [
"public",
"function",
"extend_navigation",
"(",
"global_navigation",
"$",
"navigation",
",",
"navigation_node",
"$",
"node",
"=",
"null",
")",
"{",
"if",
"(",
"has_capability",
"(",
"'moodle/grade:managegradingforms'",
",",
"$",
"this",
"->",
"get_context",
"(",
"... | Extends the module navigation
This function is called when the context for the page is an activity module with the
FEATURE_ADVANCED_GRADING and there is an area with the active grading method set to the given plugin.
@param global_navigation $navigation {@link global_navigation}
@param navigation_node $node {@link na... | [
"Extends",
"the",
"module",
"navigation"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/grading/form/guide/lib.php#L84-L94 |
219,391 | moodle/moodle | grade/grading/form/guide/lib.php | gradingform_guide_controller.update_definition | public function update_definition(stdClass $newdefinition, $usermodified = null) {
$this->update_or_check_guide($newdefinition, $usermodified, true);
if (isset($newdefinition->guide['regrade']) && $newdefinition->guide['regrade']) {
$this->mark_for_regrade();
}
} | php | public function update_definition(stdClass $newdefinition, $usermodified = null) {
$this->update_or_check_guide($newdefinition, $usermodified, true);
if (isset($newdefinition->guide['regrade']) && $newdefinition->guide['regrade']) {
$this->mark_for_regrade();
}
} | [
"public",
"function",
"update_definition",
"(",
"stdClass",
"$",
"newdefinition",
",",
"$",
"usermodified",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"update_or_check_guide",
"(",
"$",
"newdefinition",
",",
"$",
"usermodified",
",",
"true",
")",
";",
"if",
"... | Saves the guide definition into the database
@see parent::update_definition()
@param stdClass $newdefinition guide definition data as coming from gradingform_guide_editguide::get_data()
@param int $usermodified optional userid of the author of the definition, defaults to the current user | [
"Saves",
"the",
"guide",
"definition",
"into",
"the",
"database"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/grading/form/guide/lib.php#L103-L108 |
219,392 | moodle/moodle | grade/grading/form/guide/lib.php | gradingform_guide_controller.mark_for_regrade | public function mark_for_regrade() {
global $DB;
if ($this->has_active_instances()) {
$conditions = array('definitionid' => $this->definition->id,
'status' => gradingform_instance::INSTANCE_STATUS_ACTIVE);
$DB->set_field('grading_instances', 'status', gr... | php | public function mark_for_regrade() {
global $DB;
if ($this->has_active_instances()) {
$conditions = array('definitionid' => $this->definition->id,
'status' => gradingform_instance::INSTANCE_STATUS_ACTIVE);
$DB->set_field('grading_instances', 'status', gr... | [
"public",
"function",
"mark_for_regrade",
"(",
")",
"{",
"global",
"$",
"DB",
";",
"if",
"(",
"$",
"this",
"->",
"has_active_instances",
"(",
")",
")",
"{",
"$",
"conditions",
"=",
"array",
"(",
"'definitionid'",
"=>",
"$",
"this",
"->",
"definition",
"-... | Marks all instances filled with this guide with the status INSTANCE_STATUS_NEEDUPDATE | [
"Marks",
"all",
"instances",
"filled",
"with",
"this",
"guide",
"with",
"the",
"status",
"INSTANCE_STATUS_NEEDUPDATE"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/grading/form/guide/lib.php#L282-L289 |
219,393 | moodle/moodle | grade/grading/form/guide/lib.php | gradingform_guide_controller.load_definition | protected function load_definition() {
global $DB;
// Check to see if the user prefs have changed - putting here as this function is called on post even when
// validation on the page fails. - hard to find a better place to locate this as it is specific to the guide.
$showdesc = optiona... | php | protected function load_definition() {
global $DB;
// Check to see if the user prefs have changed - putting here as this function is called on post even when
// validation on the page fails. - hard to find a better place to locate this as it is specific to the guide.
$showdesc = optiona... | [
"protected",
"function",
"load_definition",
"(",
")",
"{",
"global",
"$",
"DB",
";",
"// Check to see if the user prefs have changed - putting here as this function is called on post even when",
"// validation on the page fails. - hard to find a better place to locate this as it is specific to... | Loads the guide form definition if it exists
There is a new array called 'guide_criteria' appended to the list of parent's definition properties. | [
"Loads",
"the",
"guide",
"form",
"definition",
"if",
"it",
"exists"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/grading/form/guide/lib.php#L296-L358 |
219,394 | moodle/moodle | grade/grading/form/guide/lib.php | gradingform_guide_controller.delete_plugin_definition | protected function delete_plugin_definition() {
global $DB;
// Get the list of instances.
$instances = array_keys($DB->get_records('grading_instances', array('definitionid' => $this->definition->id), '', 'id'));
// Delete all fillings.
$DB->delete_records_list('gradingform_guide... | php | protected function delete_plugin_definition() {
global $DB;
// Get the list of instances.
$instances = array_keys($DB->get_records('grading_instances', array('definitionid' => $this->definition->id), '', 'id'));
// Delete all fillings.
$DB->delete_records_list('gradingform_guide... | [
"protected",
"function",
"delete_plugin_definition",
"(",
")",
"{",
"global",
"$",
"DB",
";",
"// Get the list of instances.",
"$",
"instances",
"=",
"array_keys",
"(",
"$",
"DB",
"->",
"get_records",
"(",
"'grading_instances'",
",",
"array",
"(",
"'definitionid'",
... | Deletes the guide definition and all the associated information | [
"Deletes",
"the",
"guide",
"definition",
"and",
"all",
"the",
"associated",
"information"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/grading/form/guide/lib.php#L539-L555 |
219,395 | moodle/moodle | grade/grading/form/guide/lib.php | gradingform_guide_controller.render_grade | public function render_grade($page, $itemid, $gradinginfo, $defaultcontent, $cangrade) {
return $this->get_renderer($page)->display_instances($this->get_active_instances($itemid), $defaultcontent, $cangrade);
} | php | public function render_grade($page, $itemid, $gradinginfo, $defaultcontent, $cangrade) {
return $this->get_renderer($page)->display_instances($this->get_active_instances($itemid), $defaultcontent, $cangrade);
} | [
"public",
"function",
"render_grade",
"(",
"$",
"page",
",",
"$",
"itemid",
",",
"$",
"gradinginfo",
",",
"$",
"defaultcontent",
",",
"$",
"cangrade",
")",
"{",
"return",
"$",
"this",
"->",
"get_renderer",
"(",
"$",
"page",
")",
"->",
"display_instances",
... | Returns html code to be included in student's feedback.
@param moodle_page $page
@param int $itemid
@param array $gradinginfo result of function grade_get_grades
@param string $defaultcontent default string to be returned if no active grading is found
@param bool $cangrade whether current user has capability to grade ... | [
"Returns",
"html",
"code",
"to",
"be",
"included",
"in",
"student",
"s",
"feedback",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/grading/form/guide/lib.php#L600-L602 |
219,396 | moodle/moodle | grade/grading/form/guide/lib.php | gradingform_guide_instance.validate_grading_element | public function validate_grading_element($elementvalue) {
$criteria = $this->get_controller()->get_definition()->guide_criteria;
if (!isset($elementvalue['criteria']) || !is_array($elementvalue['criteria']) ||
count($elementvalue['criteria']) < count($criteria)) {
return false;
... | php | public function validate_grading_element($elementvalue) {
$criteria = $this->get_controller()->get_definition()->guide_criteria;
if (!isset($elementvalue['criteria']) || !is_array($elementvalue['criteria']) ||
count($elementvalue['criteria']) < count($criteria)) {
return false;
... | [
"public",
"function",
"validate_grading_element",
"(",
"$",
"elementvalue",
")",
"{",
"$",
"criteria",
"=",
"$",
"this",
"->",
"get_controller",
"(",
")",
"->",
"get_definition",
"(",
")",
"->",
"guide_criteria",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"el... | Validates that guide is fully completed and contains valid grade on each criterion
@param array $elementvalue value of element as came in form submit
@return boolean true if the form data is validated and contains no errors | [
"Validates",
"that",
"guide",
"is",
"fully",
"completed",
"and",
"contains",
"valid",
"grade",
"on",
"each",
"criterion"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/grading/form/guide/lib.php#L795-L815 |
219,397 | moodle/moodle | grade/grading/form/guide/lib.php | gradingform_guide_instance.get_guide_filling | public function get_guide_filling($force = false) {
global $DB;
if ($this->guide === null || $force) {
$records = $DB->get_records('gradingform_guide_fillings', array('instanceid' => $this->get_id()));
$this->guide = array('criteria' => array());
foreach ($records as ... | php | public function get_guide_filling($force = false) {
global $DB;
if ($this->guide === null || $force) {
$records = $DB->get_records('gradingform_guide_fillings', array('instanceid' => $this->get_id()));
$this->guide = array('criteria' => array());
foreach ($records as ... | [
"public",
"function",
"get_guide_filling",
"(",
"$",
"force",
"=",
"false",
")",
"{",
"global",
"$",
"DB",
";",
"if",
"(",
"$",
"this",
"->",
"guide",
"===",
"null",
"||",
"$",
"force",
")",
"{",
"$",
"records",
"=",
"$",
"DB",
"->",
"get_records",
... | Retrieves from DB and returns the data how this guide was filled
@param bool $force whether to force DB query even if the data is cached
@return array | [
"Retrieves",
"from",
"DB",
"and",
"returns",
"the",
"data",
"how",
"this",
"guide",
"was",
"filled"
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/grade/grading/form/guide/lib.php#L823-L834 |
219,398 | moodle/moodle | message/output/airnotifier/classes/privacy/provider.php | provider.delete_data | protected static function delete_data(int $userid) {
global $DB;
foreach (static::get_records($userid) as $record) {
$DB->delete_records('message_airnotifier_devices', ['id' => $record->id]);
}
} | php | protected static function delete_data(int $userid) {
global $DB;
foreach (static::get_records($userid) as $record) {
$DB->delete_records('message_airnotifier_devices', ['id' => $record->id]);
}
} | [
"protected",
"static",
"function",
"delete_data",
"(",
"int",
"$",
"userid",
")",
"{",
"global",
"$",
"DB",
";",
"foreach",
"(",
"static",
"::",
"get_records",
"(",
"$",
"userid",
")",
"as",
"$",
"record",
")",
"{",
"$",
"DB",
"->",
"delete_records",
"... | Delete data related to a userid.
@param int $userid The user ID | [
"Delete",
"data",
"related",
"to",
"a",
"userid",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/message/output/airnotifier/classes/privacy/provider.php#L184-L190 |
219,399 | moodle/moodle | lib/form/float.php | MoodleQuickForm_float.getValue | public function getValue() {
$value = parent::getValue();
if ($value) {
$value = unformat_float($value, true);
}
return $value;
} | php | public function getValue() {
$value = parent::getValue();
if ($value) {
$value = unformat_float($value, true);
}
return $value;
} | [
"public",
"function",
"getValue",
"(",
")",
"{",
"$",
"value",
"=",
"parent",
"::",
"getValue",
"(",
")",
";",
"if",
"(",
"$",
"value",
")",
"{",
"$",
"value",
"=",
"unformat_float",
"(",
"$",
"value",
",",
"true",
")",
";",
"}",
"return",
"$",
"... | Returns the value of the form element.
@return false|float | [
"Returns",
"the",
"value",
"of",
"the",
"form",
"element",
"."
] | a411b499b98afc9901c24a9466c7e322946a04aa | https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/form/float.php#L119-L125 |
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.