id
int32
0
241k
repo
stringlengths
6
63
path
stringlengths
5
140
func_name
stringlengths
3
151
original_string
stringlengths
84
13k
language
stringclasses
1 value
code
stringlengths
84
13k
code_tokens
list
docstring
stringlengths
3
47.2k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
91
247
214,900
moodle/moodle
lib/horde/framework/Horde/Secret.php
Horde_Secret.clearKey
public function clearKey($keyname = self::DEFAULT_KEY) { if (isset($_COOKIE[$this->_params['session_name']]) && isset($_COOKIE[$keyname . '_key'])) { $this->_setCookie($keyname, false); return true; } return false; }
php
public function clearKey($keyname = self::DEFAULT_KEY) { if (isset($_COOKIE[$this->_params['session_name']]) && isset($_COOKIE[$keyname . '_key'])) { $this->_setCookie($keyname, false); return true; } return false; }
[ "public", "function", "clearKey", "(", "$", "keyname", "=", "self", "::", "DEFAULT_KEY", ")", "{", "if", "(", "isset", "(", "$", "_COOKIE", "[", "$", "this", "->", "_params", "[", "'session_name'", "]", "]", ")", "&&", "isset", "(", "$", "_COOKIE", "...
Clears a secret key entry from the current cookie. @param string $keyname The name of the key to clear. @return boolean True if key existed, false if not.
[ "Clears", "a", "secret", "key", "entry", "from", "the", "current", "cookie", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/horde/framework/Horde/Secret.php#L188-L197
214,901
moodle/moodle
comment/classes/privacy/provider.php
provider.delete_comments_for_users
public static function delete_comments_for_users(\core_privacy\local\request\approved_userlist $userlist, string $component, string $commentarea = null, int $itemid = null) { global $DB; $context = $userlist->get_context(); $params = [ 'contextid' => $context->id, ...
php
public static function delete_comments_for_users(\core_privacy\local\request\approved_userlist $userlist, string $component, string $commentarea = null, int $itemid = null) { global $DB; $context = $userlist->get_context(); $params = [ 'contextid' => $context->id, ...
[ "public", "static", "function", "delete_comments_for_users", "(", "\\", "core_privacy", "\\", "local", "\\", "request", "\\", "approved_userlist", "$", "userlist", ",", "string", "$", "component", ",", "string", "$", "commentarea", "=", "null", ",", "int", "$", ...
Deletes all records for a context from a list of approved users. @param \core_privacy\local\request\approved_userlist $userlist Contains the list of users and a context to be deleted from. @param string $component Component to delete from. @param string $commentarea Area to delete from. @param int $itemid The item...
[ "Deletes", "all", "records", "for", "a", "context", "from", "a", "list", "of", "approved", "users", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/comment/classes/privacy/provider.php#L209-L233
214,902
moodle/moodle
comment/classes/privacy/provider.php
provider.get_users_in_context_from_sql
public static function get_users_in_context_from_sql( userlist $userlist, string $alias, string $component, string $area, int $contextid = null, string $insql = '', array $params = []) { if ($insql != '') { $insql = "AND {$alias}.itemid {$insql}"; } $...
php
public static function get_users_in_context_from_sql( userlist $userlist, string $alias, string $component, string $area, int $contextid = null, string $insql = '', array $params = []) { if ($insql != '') { $insql = "AND {$alias}.itemid {$insql}"; } $...
[ "public", "static", "function", "get_users_in_context_from_sql", "(", "userlist", "$", "userlist", ",", "string", "$", "alias", ",", "string", "$", "component", ",", "string", "$", "area", ",", "int", "$", "contextid", "=", "null", ",", "string", "$", "insql...
Add the list of users who have commented in the specified constraints. @param userlist $userlist The userlist to add the users to. @param string $alias An alias prefix to use for comment selects to avoid interference with your own sql. @param string $component The component to check. @param string...
[ "Add", "the", "list", "of", "users", "who", "have", "commented", "in", "the", "specified", "constraints", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/comment/classes/privacy/provider.php#L246-L270
214,903
moodle/moodle
report/insights/classes/output/insight.php
insight.get_calculation_display
public static function get_calculation_display(\core_analytics\calculable $calculable, $value, $output, $subtype = false) { $outcome = $calculable->get_calculation_outcome($value, $subtype); switch ($outcome) { case \core_analytics\calculable::OUTCOME_NEUTRAL: $style = ''; ...
php
public static function get_calculation_display(\core_analytics\calculable $calculable, $value, $output, $subtype = false) { $outcome = $calculable->get_calculation_outcome($value, $subtype); switch ($outcome) { case \core_analytics\calculable::OUTCOME_NEUTRAL: $style = ''; ...
[ "public", "static", "function", "get_calculation_display", "(", "\\", "core_analytics", "\\", "calculable", "$", "calculable", ",", "$", "value", ",", "$", "output", ",", "$", "subtype", "=", "false", ")", "{", "$", "outcome", "=", "$", "calculable", "->", ...
Returns display info for the calculated value outcome. @param \core_analytics\calculable $calculable @param float $value @param \renderer_base $output @param string|false $subtype @return array The style as 'success', 'info', 'warning' or 'danger' and pix_icon
[ "Returns", "display", "info", "for", "the", "calculated", "value", "outcome", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/report/insights/classes/output/insight.php#L177-L213
214,904
moodle/moodle
blog/edit_form.php
blog_edit_form.validation
public function validation($data, $files) { global $CFG, $DB, $USER; $errors = parent::validation($data, $files); // Validate course association. if (!empty($data['courseassoc'])) { $coursecontext = context::instance_by_id($data['courseassoc']); if ($coursecont...
php
public function validation($data, $files) { global $CFG, $DB, $USER; $errors = parent::validation($data, $files); // Validate course association. if (!empty($data['courseassoc'])) { $coursecontext = context::instance_by_id($data['courseassoc']); if ($coursecont...
[ "public", "function", "validation", "(", "$", "data", ",", "$", "files", ")", "{", "global", "$", "CFG", ",", "$", "DB", ",", "$", "USER", ";", "$", "errors", "=", "parent", "::", "validation", "(", "$", "data", ",", "$", "files", ")", ";", "// V...
Validate the blog form data. @param array $data Data to be validated @param array $files unused @return array|bool
[ "Validate", "the", "blog", "form", "data", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/blog/edit_form.php#L152-L192
214,905
moodle/moodle
lib/dml/moodle_transaction.php
moodle_transaction.rollback
public function rollback($e) { if ($this->is_disposed()) { throw new dml_transaction_exception('Transactions already disposed', $this); } $this->database->rollback_delegated_transaction($this, $e); }
php
public function rollback($e) { if ($this->is_disposed()) { throw new dml_transaction_exception('Transactions already disposed', $this); } $this->database->rollback_delegated_transaction($this, $e); }
[ "public", "function", "rollback", "(", "$", "e", ")", "{", "if", "(", "$", "this", "->", "is_disposed", "(", ")", ")", "{", "throw", "new", "dml_transaction_exception", "(", "'Transactions already disposed'", ",", "$", "this", ")", ";", "}", "$", "this", ...
Rollback all current delegated transactions. @param Exception|Throwable $e mandatory exception/throwable @return void
[ "Rollback", "all", "current", "delegated", "transactions", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/dml/moodle_transaction.php#L101-L106
214,906
moodle/moodle
lib/classes/event/course_restored.php
course_restored.get_description
public function get_description() { $retstring = "The user with id '$this->userid' restored the course with id '$this->courseid'."; if (isset($this->other['originalcourseid'])) { $originalcourseid = $this->other['originalcourseid']; $retstring = "The user with id '$this->userid'...
php
public function get_description() { $retstring = "The user with id '$this->userid' restored the course with id '$this->courseid'."; if (isset($this->other['originalcourseid'])) { $originalcourseid = $this->other['originalcourseid']; $retstring = "The user with id '$this->userid'...
[ "public", "function", "get_description", "(", ")", "{", "$", "retstring", "=", "\"The user with id '$this->userid' restored the course with id '$this->courseid'.\"", ";", "if", "(", "isset", "(", "$", "this", "->", "other", "[", "'originalcourseid'", "]", ")", ")", "{...
Returns non-localised description of what happened. @return string
[ "Returns", "non", "-", "localised", "description", "of", "what", "happened", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/classes/event/course_restored.php#L73-L83
214,907
moodle/moodle
lib/adodb/perf/perf-oci8.inc.php
perf_oci8.SuspiciousSQL
function SuspiciousSQL($numsql=10) { $sql = " select substr(to_char(s.pct, '99.00'), 2) || '%' load, s.executions executes, p.sql_text from ( select address, buffer_gets, executions, pct, rank() over (order by buffer_gets desc) ranking from ( select address,...
php
function SuspiciousSQL($numsql=10) { $sql = " select substr(to_char(s.pct, '99.00'), 2) || '%' load, s.executions executes, p.sql_text from ( select address, buffer_gets, executions, pct, rank() over (order by buffer_gets desc) ranking from ( select address,...
[ "function", "SuspiciousSQL", "(", "$", "numsql", "=", "10", ")", "{", "$", "sql", "=", "\"\nselect\n substr(to_char(s.pct, '99.00'), 2) || '%' load,\n s.executions executes,\n p.sql_text\nfrom\n (\n select\n address,\n buffer_gets,\n executions,\n pct,\n ran...
requires oracle 8.1.7 or later
[ "requires", "oracle", "8", ".", "1", ".", "7", "or", "later" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/lib/adodb/perf/perf-oci8.inc.php#L532-L601
214,908
moodle/moodle
blocks/moodleblock.class.php
block_base.name
function name() { // Returns the block name, as present in the class name, // the database, the block directory, etc etc. static $myname; if ($myname === NULL) { $myname = strtolower(get_class($this)); $myname = substr($myname, strpos($myname, '_') + 1); }...
php
function name() { // Returns the block name, as present in the class name, // the database, the block directory, etc etc. static $myname; if ($myname === NULL) { $myname = strtolower(get_class($this)); $myname = substr($myname, strpos($myname, '_') + 1); }...
[ "function", "name", "(", ")", "{", "// Returns the block name, as present in the class name,", "// the database, the block directory, etc etc.", "static", "$", "myname", ";", "if", "(", "$", "myname", "===", "NULL", ")", "{", "$", "myname", "=", "strtolower", "(", "ge...
Returns the block name, as present in the class name, the database, the block directory, etc etc. @return string
[ "Returns", "the", "block", "name", "as", "present", "in", "the", "class", "name", "the", "database", "the", "block", "directory", "etc", "etc", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/blocks/moodleblock.class.php#L132-L141
214,909
moodle/moodle
blocks/moodleblock.class.php
block_base.is_empty
function is_empty() { if ( !has_capability('moodle/block:view', $this->context) ) { return true; } $this->get_content(); return(empty($this->content->text) && empty($this->content->footer)); }
php
function is_empty() { if ( !has_capability('moodle/block:view', $this->context) ) { return true; } $this->get_content(); return(empty($this->content->text) && empty($this->content->footer)); }
[ "function", "is_empty", "(", ")", "{", "if", "(", "!", "has_capability", "(", "'moodle/block:view'", ",", "$", "this", "->", "context", ")", ")", "{", "return", "true", ";", "}", "$", "this", "->", "get_content", "(", ")", ";", "return", "(", "empty", ...
Returns true or false, depending on whether this block has any content to display and whether the user has permission to view the block @return boolean
[ "Returns", "true", "or", "false", "depending", "on", "whether", "this", "block", "has", "any", "content", "to", "display", "and", "whether", "the", "user", "has", "permission", "to", "view", "the", "block" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/blocks/moodleblock.class.php#L187-L194
214,910
moodle/moodle
blocks/moodleblock.class.php
block_base.get_content_for_output
public function get_content_for_output($output) { global $CFG; $bc = new block_contents($this->html_attributes()); $bc->attributes['data-block'] = $this->name(); $bc->blockinstanceid = $this->instance->id; $bc->blockpositionid = $this->instance->blockpositionid; if ($th...
php
public function get_content_for_output($output) { global $CFG; $bc = new block_contents($this->html_attributes()); $bc->attributes['data-block'] = $this->name(); $bc->blockinstanceid = $this->instance->id; $bc->blockpositionid = $this->instance->blockpositionid; if ($th...
[ "public", "function", "get_content_for_output", "(", "$", "output", ")", "{", "global", "$", "CFG", ";", "$", "bc", "=", "new", "block_contents", "(", "$", "this", "->", "html_attributes", "(", ")", ")", ";", "$", "bc", "->", "attributes", "[", "'data-bl...
Return a block_contents object representing the full contents of this block. This internally calls ->get_content(), and then adds the editing controls etc. You probably should not override this method, but instead override {@link html_attributes()}, {@link formatted_contents()} or {@link get_content()}, {@link hide_h...
[ "Return", "a", "block_contents", "object", "representing", "the", "full", "contents", "of", "this", "block", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/blocks/moodleblock.class.php#L221-L273
214,911
moodle/moodle
blocks/moodleblock.class.php
block_base.get_content_for_external
public function get_content_for_external($output) { $bc = new stdClass; $bc->title = null; $bc->content = null; $bc->contentformat = FORMAT_HTML; $bc->footer = null; $bc->files = []; if ($this->instance->visible) { $bc->content = $this->formatted_cont...
php
public function get_content_for_external($output) { $bc = new stdClass; $bc->title = null; $bc->content = null; $bc->contentformat = FORMAT_HTML; $bc->footer = null; $bc->files = []; if ($this->instance->visible) { $bc->content = $this->formatted_cont...
[ "public", "function", "get_content_for_external", "(", "$", "output", ")", "{", "$", "bc", "=", "new", "stdClass", ";", "$", "bc", "->", "title", "=", "null", ";", "$", "bc", "->", "content", "=", "null", ";", "$", "bc", "->", "contentformat", "=", "...
Return an object containing all the block content to be returned by external functions. If your block is returning formatted content or provide files for download, you should override this method to use the external_format_text, external_format_string functions for formatting or external_util::get_area_files for files...
[ "Return", "an", "object", "containing", "all", "the", "block", "content", "to", "be", "returned", "by", "external", "functions", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/blocks/moodleblock.class.php#L286-L306
214,912
moodle/moodle
blocks/moodleblock.class.php
block_base.formatted_contents
protected function formatted_contents($output) { $this->get_content(); $this->get_required_javascript(); if (!empty($this->content->text)) { return $this->content->text; } else { return ''; } }
php
protected function formatted_contents($output) { $this->get_content(); $this->get_required_javascript(); if (!empty($this->content->text)) { return $this->content->text; } else { return ''; } }
[ "protected", "function", "formatted_contents", "(", "$", "output", ")", "{", "$", "this", "->", "get_content", "(", ")", ";", "$", "this", "->", "get_required_javascript", "(", ")", ";", "if", "(", "!", "empty", "(", "$", "this", "->", "content", "->", ...
Convert the contents of the block to HTML. This is used by block base classes like block_list to convert the structured $this->content->list and $this->content->icons arrays to HTML. So, in most blocks, you probaby want to override the {@link get_contents()} method, which generates that structured representation of th...
[ "Convert", "the", "contents", "of", "the", "block", "to", "HTML", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/blocks/moodleblock.class.php#L320-L328
214,913
moodle/moodle
blocks/moodleblock.class.php
block_base.has_add_block_capability
private function has_add_block_capability($page, $capability) { // Check if the capability exists. if (!get_capability_info($capability)) { // Debug warning that the capability does not exist, but no more than once per page. static $warned = array(); if (!isset($warne...
php
private function has_add_block_capability($page, $capability) { // Check if the capability exists. if (!get_capability_info($capability)) { // Debug warning that the capability does not exist, but no more than once per page. static $warned = array(); if (!isset($warne...
[ "private", "function", "has_add_block_capability", "(", "$", "page", ",", "$", "capability", ")", "{", "// Check if the capability exists.", "if", "(", "!", "get_capability_info", "(", "$", "capability", ")", ")", "{", "// Debug warning that the capability does not exist,...
Returns true if the user can add a block to a page. @param moodle_page $page @param string $capability the capability to check @return boolean true if user can add a block, false otherwise.
[ "Returns", "true", "if", "the", "user", "can", "add", "a", "block", "to", "a", "page", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/blocks/moodleblock.class.php#L628-L643
214,914
moodle/moodle
blocks/moodleblock.class.php
block_tree.formatted_contents
protected function formatted_contents($output) { // based of code in admin_tree global $PAGE; // TODO change this when there is a proper way for blocks to get stuff into head. static $eventattached; if ($eventattached===null) { $eventattached = true; } if (!$t...
php
protected function formatted_contents($output) { // based of code in admin_tree global $PAGE; // TODO change this when there is a proper way for blocks to get stuff into head. static $eventattached; if ($eventattached===null) { $eventattached = true; } if (!$t...
[ "protected", "function", "formatted_contents", "(", "$", "output", ")", "{", "// based of code in admin_tree", "global", "$", "PAGE", ";", "// TODO change this when there is a proper way for blocks to get stuff into head.", "static", "$", "eventattached", ";", "if", "(", "$",...
Make the formatted HTML ouput. Also adds the required javascript call to the page output. @param core_renderer $output @return string HTML
[ "Make", "the", "formatted", "HTML", "ouput", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/blocks/moodleblock.class.php#L800-L818
214,915
moodle/moodle
report/insights/classes/external.php
external.validate_prediction
protected static function validate_prediction($predictionid) { list($model, $prediction, $context) = \core_analytics\manager::get_prediction($predictionid); self::validate_context($context); return array($model, $prediction, $context); }
php
protected static function validate_prediction($predictionid) { list($model, $prediction, $context) = \core_analytics\manager::get_prediction($predictionid); self::validate_context($context); return array($model, $prediction, $context); }
[ "protected", "static", "function", "validate_prediction", "(", "$", "predictionid", ")", "{", "list", "(", "$", "model", ",", "$", "prediction", ",", "$", "context", ")", "=", "\\", "core_analytics", "\\", "manager", "::", "get_prediction", "(", "$", "predic...
Validates access to the prediction and returns it. @param int $predictionid @return array array($model, $prediction, $context)
[ "Validates", "access", "to", "the", "prediction", "and", "returns", "it", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/report/insights/classes/external.php#L147-L154
214,916
moodle/moodle
availability/classes/info.php
info.get_availability_tree
public function get_availability_tree() { if (is_null($this->availabilitytree)) { if (is_null($this->availability)) { throw new \coding_exception( 'Cannot call get_availability_tree with null availability'); } $this->availabilitytree = ...
php
public function get_availability_tree() { if (is_null($this->availabilitytree)) { if (is_null($this->availability)) { throw new \coding_exception( 'Cannot call get_availability_tree with null availability'); } $this->availabilitytree = ...
[ "public", "function", "get_availability_tree", "(", ")", "{", "if", "(", "is_null", "(", "$", "this", "->", "availabilitytree", ")", ")", "{", "if", "(", "is_null", "(", "$", "this", "->", "availability", ")", ")", "{", "throw", "new", "\\", "coding_exce...
Gets the availability tree, decoding it if not already done. @return tree Availability tree
[ "Gets", "the", "availability", "tree", "decoding", "it", "if", "not", "already", "done", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/availability/classes/info.php#L108-L117
214,917
moodle/moodle
availability/classes/info.php
info.decode_availability
protected function decode_availability($availability, $lax) { // Decode JSON data. $structure = json_decode($availability); if (is_null($structure)) { throw new \coding_exception('Invalid availability text', $availability); } // Recursively decode tree. retur...
php
protected function decode_availability($availability, $lax) { // Decode JSON data. $structure = json_decode($availability); if (is_null($structure)) { throw new \coding_exception('Invalid availability text', $availability); } // Recursively decode tree. retur...
[ "protected", "function", "decode_availability", "(", "$", "availability", ",", "$", "lax", ")", "{", "// Decode JSON data.", "$", "structure", "=", "json_decode", "(", "$", "availability", ")", ";", "if", "(", "is_null", "(", "$", "structure", ")", ")", "{",...
Decodes availability data from JSON format. This function also validates the retrieved data as follows: 1. Data that does not meet the API-defined structure causes a coding_exception (this should be impossible unless there is a system bug or somebody manually hacks the database). 2. Data that meets the structure but c...
[ "Decodes", "availability", "data", "from", "JSON", "format", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/availability/classes/info.php#L136-L145
214,918
moodle/moodle
availability/classes/info.php
info.is_available
public function is_available(&$information, $grabthelot = false, $userid = 0, \course_modinfo $modinfo = null) { global $USER; // Default to no information. $information = ''; // Do nothing if there are no availability restrictions. if (is_null($this->availability))...
php
public function is_available(&$information, $grabthelot = false, $userid = 0, \course_modinfo $modinfo = null) { global $USER; // Default to no information. $information = ''; // Do nothing if there are no availability restrictions. if (is_null($this->availability))...
[ "public", "function", "is_available", "(", "&", "$", "information", ",", "$", "grabthelot", "=", "false", ",", "$", "userid", "=", "0", ",", "\\", "course_modinfo", "$", "modinfo", "=", "null", ")", "{", "global", "$", "USER", ";", "// Default to no inform...
Determines whether this particular item is currently available according to the availability criteria. - This does not include the 'visible' setting (i.e. this might return true even if visible is false); visible is handled independently. - This does not take account of the viewhiddenactivities capability. That should...
[ "Determines", "whether", "this", "particular", "item", "is", "currently", "available", "according", "to", "the", "availability", "criteria", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/availability/classes/info.php#L173-L222
214,919
moodle/moodle
availability/classes/info.php
info.is_available_for_all
public function is_available_for_all() { if (is_null($this->availability)) { return true; } else { try { return $this->get_availability_tree()->is_available_for_all(); } catch (\coding_exception $e) { $this->warn_about_invalid_availabil...
php
public function is_available_for_all() { if (is_null($this->availability)) { return true; } else { try { return $this->get_availability_tree()->is_available_for_all(); } catch (\coding_exception $e) { $this->warn_about_invalid_availabil...
[ "public", "function", "is_available_for_all", "(", ")", "{", "if", "(", "is_null", "(", "$", "this", "->", "availability", ")", ")", "{", "return", "true", ";", "}", "else", "{", "try", "{", "return", "$", "this", "->", "get_availability_tree", "(", ")",...
Checks whether this activity is going to be available for all users. Normally, if there are any conditions, then it may be hidden depending on the user. However in the case of date conditions there are some conditions which will definitely not result in it being hidden for anyone. @return bool True if activity is ava...
[ "Checks", "whether", "this", "activity", "is", "going", "to", "be", "available", "for", "all", "users", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/availability/classes/info.php#L234-L245
214,920
moodle/moodle
availability/classes/info.php
info.warn_about_invalid_availability
protected function warn_about_invalid_availability(\coding_exception $e) { $name = $this->get_thing_name(); // If it occurs while building modinfo based on somebody calling $cm->name, // we can't get $cm->name, and this line will cause a warning. $htmlname = @$this->format_info($name, $t...
php
protected function warn_about_invalid_availability(\coding_exception $e) { $name = $this->get_thing_name(); // If it occurs while building modinfo based on somebody calling $cm->name, // we can't get $cm->name, and this line will cause a warning. $htmlname = @$this->format_info($name, $t...
[ "protected", "function", "warn_about_invalid_availability", "(", "\\", "coding_exception", "$", "e", ")", "{", "$", "name", "=", "$", "this", "->", "get_thing_name", "(", ")", ";", "// If it occurs while building modinfo based on somebody calling $cm->name,", "// we can't g...
In some places we catch coding_exception because if a bug happens, it would be fatal for the course page GUI; instead we just show a developer debug message. @param \coding_exception $e Exception that occurred
[ "In", "some", "places", "we", "catch", "coding_exception", "because", "if", "a", "bug", "happens", "it", "would", "be", "fatal", "for", "the", "course", "page", "GUI", ";", "instead", "we", "just", "show", "a", "developer", "debug", "message", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/availability/classes/info.php#L291-L303
214,921
moodle/moodle
availability/classes/info.php
info.update_dependency_id
protected function update_dependency_id($table, $oldid, $newid) { // Do nothing if there are no availability restrictions. if (is_null($this->availability)) { return false; } // Pass requirement on to tree object. $tree = $this->get_availability_tree(); $chang...
php
protected function update_dependency_id($table, $oldid, $newid) { // Do nothing if there are no availability restrictions. if (is_null($this->availability)) { return false; } // Pass requirement on to tree object. $tree = $this->get_availability_tree(); $chang...
[ "protected", "function", "update_dependency_id", "(", "$", "table", ",", "$", "oldid", ",", "$", "newid", ")", "{", "// Do nothing if there are no availability restrictions.", "if", "(", "is_null", "(", "$", "this", "->", "availability", ")", ")", "{", "return", ...
Called on a single item. If necessary, updates availability data where it has a dependency on an item with a particular id. @param string $table Table name e.g. 'course_modules' @param int $oldid Previous ID @param int $newid New ID @return bool True if it changed, otherwise false
[ "Called", "on", "a", "single", "item", ".", "If", "necessary", "updates", "availability", "data", "where", "it", "has", "a", "dependency", "on", "an", "item", "with", "a", "particular", "id", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/availability/classes/info.php#L433-L447
214,922
moodle/moodle
availability/classes/info.php
info.add_legacy_availability_condition
public static function add_legacy_availability_condition($availability, $rec, $show) { if (!empty($rec->sourcecmid)) { // Completion condition. $condition = '{"type":"completion","cm":' . $rec->sourcecmid . ',"e":' . $rec->requiredcompletion . '}'; } else { ...
php
public static function add_legacy_availability_condition($availability, $rec, $show) { if (!empty($rec->sourcecmid)) { // Completion condition. $condition = '{"type":"completion","cm":' . $rec->sourcecmid . ',"e":' . $rec->requiredcompletion . '}'; } else { ...
[ "public", "static", "function", "add_legacy_availability_condition", "(", "$", "availability", ",", "$", "rec", ",", "$", "show", ")", "{", "if", "(", "!", "empty", "(", "$", "rec", "->", "sourcecmid", ")", ")", "{", "// Completion condition.", "$", "conditi...
Adds a condition from the legacy availability condition. (For use during restore only.) This function assumes that the activity either has no conditions, or that it has an AND tree with one or more conditions. @param string|null $availability Current availability conditions @param \stdClass $rec Object containing in...
[ "Adds", "a", "condition", "from", "the", "legacy", "availability", "condition", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/availability/classes/info.php#L525-L543
214,923
moodle/moodle
availability/classes/info.php
info.add_legacy_availability_field_condition
public static function add_legacy_availability_field_condition($availability, $rec, $show) { if (isset($rec->userfield)) { // Standard field. $fieldbit = ',"sf":' . json_encode($rec->userfield); } else { // Custom field. $fieldbit = ',"cf":' . json_encode(...
php
public static function add_legacy_availability_field_condition($availability, $rec, $show) { if (isset($rec->userfield)) { // Standard field. $fieldbit = ',"sf":' . json_encode($rec->userfield); } else { // Custom field. $fieldbit = ',"cf":' . json_encode(...
[ "public", "static", "function", "add_legacy_availability_field_condition", "(", "$", "availability", ",", "$", "rec", ",", "$", "show", ")", "{", "if", "(", "isset", "(", "$", "rec", "->", "userfield", ")", ")", "{", "// Standard field.", "$", "fieldbit", "=...
Adds a condition from the legacy availability field condition. (For use during restore only.) This function assumes that the activity either has no conditions, or that it has an AND tree with one or more conditions. @param string|null $availability Current availability conditions @param \stdClass $rec Object contain...
[ "Adds", "a", "condition", "from", "the", "legacy", "availability", "field", "condition", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/availability/classes/info.php#L558-L581
214,924
moodle/moodle
availability/classes/info.php
info.add_legacy_condition
protected static function add_legacy_condition($availability, $condition, $show) { $showtext = ($show ? 'true' : 'false'); if (is_null($availability)) { $availability = '{"op":"&","showc":[' . $showtext . '],"c":[' . $condition . ']}'; } else { $matche...
php
protected static function add_legacy_condition($availability, $condition, $show) { $showtext = ($show ? 'true' : 'false'); if (is_null($availability)) { $availability = '{"op":"&","showc":[' . $showtext . '],"c":[' . $condition . ']}'; } else { $matche...
[ "protected", "static", "function", "add_legacy_condition", "(", "$", "availability", ",", "$", "condition", ",", "$", "show", ")", "{", "$", "showtext", "=", "(", "$", "show", "?", "'true'", ":", "'false'", ")", ";", "if", "(", "is_null", "(", "$", "av...
Adds a condition to an AND group. (For use during restore only.) This function assumes that the activity either has no conditions, or that it has only conditions added by this function. @param string|null $availability Current availability conditions @param string $condition Condition text '{...}' @param bool $show ...
[ "Adds", "a", "condition", "to", "an", "AND", "group", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/availability/classes/info.php#L596-L611
214,925
moodle/moodle
mod/assign/locallib.php
assign.register_return_link
public function register_return_link($action, $params) { global $PAGE; $params['action'] = $action; $cm = $this->get_course_module(); if ($cm) { $currenturl = new moodle_url('/mod/assign/view.php', array('id' => $cm->id)); } else { $currenturl = new moodle...
php
public function register_return_link($action, $params) { global $PAGE; $params['action'] = $action; $cm = $this->get_course_module(); if ($cm) { $currenturl = new moodle_url('/mod/assign/view.php', array('id' => $cm->id)); } else { $currenturl = new moodle...
[ "public", "function", "register_return_link", "(", "$", "action", ",", "$", "params", ")", "{", "global", "$", "PAGE", ";", "$", "params", "[", "'action'", "]", "=", "$", "action", ";", "$", "cm", "=", "$", "this", "->", "get_course_module", "(", ")", ...
Set the action and parameters that can be used to return to the current page. @param string $action The action for the current page @param array $params An array of name value pairs which form the parameters to return to the current page. @return void
[ "Set", "the", "action", "and", "parameters", "that", "can", "be", "used", "to", "return", "to", "the", "current", "page", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L224-L236
214,926
moodle/moodle
mod/assign/locallib.php
assign.get_return_action
public function get_return_action() { global $PAGE; // Web services don't set a URL, we should avoid debugging when ussing the url object. if (!WS_SERVER) { $params = $PAGE->url->params(); } if (!empty($params['action'])) { return $params['action']; ...
php
public function get_return_action() { global $PAGE; // Web services don't set a URL, we should avoid debugging when ussing the url object. if (!WS_SERVER) { $params = $PAGE->url->params(); } if (!empty($params['action'])) { return $params['action']; ...
[ "public", "function", "get_return_action", "(", ")", "{", "global", "$", "PAGE", ";", "// Web services don't set a URL, we should avoid debugging when ussing the url object.", "if", "(", "!", "WS_SERVER", ")", "{", "$", "params", "=", "$", "PAGE", "->", "url", "->", ...
Return an action that can be used to get back to the current page. @return string action
[ "Return", "an", "action", "that", "can", "be", "used", "to", "get", "back", "to", "the", "current", "page", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L243-L255
214,927
moodle/moodle
mod/assign/locallib.php
assign.show_intro
public function show_intro() { if ($this->get_instance()->alwaysshowdescription || time() > $this->get_instance()->allowsubmissionsfromdate) { return true; } return false; }
php
public function show_intro() { if ($this->get_instance()->alwaysshowdescription || time() > $this->get_instance()->allowsubmissionsfromdate) { return true; } return false; }
[ "public", "function", "show_intro", "(", ")", "{", "if", "(", "$", "this", "->", "get_instance", "(", ")", "->", "alwaysshowdescription", "||", "time", "(", ")", ">", "$", "this", "->", "get_instance", "(", ")", "->", "allowsubmissionsfromdate", ")", "{", ...
Based on the current assignment settings should we display the intro. @return bool showintro
[ "Based", "on", "the", "current", "assignment", "settings", "should", "we", "display", "the", "intro", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L262-L268
214,928
moodle/moodle
mod/assign/locallib.php
assign.get_return_params
public function get_return_params() { global $PAGE; $params = array(); if (!WS_SERVER) { $params = $PAGE->url->params(); } unset($params['id']); unset($params['action']); return $params; }
php
public function get_return_params() { global $PAGE; $params = array(); if (!WS_SERVER) { $params = $PAGE->url->params(); } unset($params['id']); unset($params['action']); return $params; }
[ "public", "function", "get_return_params", "(", ")", "{", "global", "$", "PAGE", ";", "$", "params", "=", "array", "(", ")", ";", "if", "(", "!", "WS_SERVER", ")", "{", "$", "params", "=", "$", "PAGE", "->", "url", "->", "params", "(", ")", ";", ...
Return a list of parameters that can be used to get back to the current page. @return array params
[ "Return", "a", "list", "of", "parameters", "that", "can", "be", "used", "to", "get", "back", "to", "the", "current", "page", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L275-L285
214,929
moodle/moodle
mod/assign/locallib.php
assign.get_plugin_by_type
public function get_plugin_by_type($subtype, $type) { $shortsubtype = substr($subtype, strlen('assign')); $name = $shortsubtype . 'plugins'; if ($name != 'feedbackplugins' && $name != 'submissionplugins') { return null; } $pluginlist = $this->$name; foreach ($...
php
public function get_plugin_by_type($subtype, $type) { $shortsubtype = substr($subtype, strlen('assign')); $name = $shortsubtype . 'plugins'; if ($name != 'feedbackplugins' && $name != 'submissionplugins') { return null; } $pluginlist = $this->$name; foreach ($...
[ "public", "function", "get_plugin_by_type", "(", "$", "subtype", ",", "$", "type", ")", "{", "$", "shortsubtype", "=", "substr", "(", "$", "subtype", ",", "strlen", "(", "'assign'", ")", ")", ";", "$", "name", "=", "$", "shortsubtype", ".", "'plugins'", ...
Get a specific submission plugin by its type. @param string $subtype assignsubmission | assignfeedback @param string $type @return mixed assign_plugin|null
[ "Get", "a", "specific", "submission", "plugin", "by", "its", "type", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L374-L387
214,930
moodle/moodle
mod/assign/locallib.php
assign.load_plugins
public function load_plugins($subtype) { global $CFG; $result = array(); $names = core_component::get_plugin_list($subtype); foreach ($names as $name => $path) { if (file_exists($path . '/locallib.php')) { require_once($path . '/locallib.php'); ...
php
public function load_plugins($subtype) { global $CFG; $result = array(); $names = core_component::get_plugin_list($subtype); foreach ($names as $name => $path) { if (file_exists($path . '/locallib.php')) { require_once($path . '/locallib.php'); ...
[ "public", "function", "load_plugins", "(", "$", "subtype", ")", "{", "global", "$", "CFG", ";", "$", "result", "=", "array", "(", ")", ";", "$", "names", "=", "core_component", "::", "get_plugin_list", "(", "$", "subtype", ")", ";", "foreach", "(", "$"...
Load the plugins from the sub folders under subtype. @param string $subtype - either submission or feedback @return array - The sorted list of plugins
[ "Load", "the", "plugins", "from", "the", "sub", "folders", "under", "subtype", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L415-L441
214,931
moodle/moodle
mod/assign/locallib.php
assign.delete_grades
protected function delete_grades() { global $CFG; $result = grade_update('mod/assign', $this->get_course()->id, 'mod', 'assign', $this->get_instance()->id, ...
php
protected function delete_grades() { global $CFG; $result = grade_update('mod/assign', $this->get_course()->id, 'mod', 'assign', $this->get_instance()->id, ...
[ "protected", "function", "delete_grades", "(", ")", "{", "global", "$", "CFG", ";", "$", "result", "=", "grade_update", "(", "'mod/assign'", ",", "$", "this", "->", "get_course", "(", ")", "->", "id", ",", "'mod'", ",", "'assign'", ",", "$", "this", "-...
Delete all grades from the gradebook for this assignment. @return bool
[ "Delete", "all", "grades", "from", "the", "gradebook", "for", "this", "assignment", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L759-L771
214,932
moodle/moodle
mod/assign/locallib.php
assign.update_effective_access
public function update_effective_access($userid) { $override = $this->override_exists($userid); // Merge with assign defaults. $keys = array('duedate', 'cutoffdate', 'allowsubmissionsfromdate'); foreach ($keys as $key) { if (isset($override->{$key})) { $this...
php
public function update_effective_access($userid) { $override = $this->override_exists($userid); // Merge with assign defaults. $keys = array('duedate', 'cutoffdate', 'allowsubmissionsfromdate'); foreach ($keys as $key) { if (isset($override->{$key})) { $this...
[ "public", "function", "update_effective_access", "(", "$", "userid", ")", "{", "$", "override", "=", "$", "this", "->", "override_exists", "(", "$", "userid", ")", ";", "// Merge with assign defaults.", "$", "keys", "=", "array", "(", "'duedate'", ",", "'cutof...
Updates the assign properties with override information for a user. Algorithm: For each assign setting, if there is a matching user-specific override, then use that otherwise, if there are group-specific overrides, return the most lenient combination of them. If neither applies, leave the assign setting unchanged. ...
[ "Updates", "the", "assign", "properties", "with", "override", "information", "for", "a", "user", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L901-L913
214,933
moodle/moodle
mod/assign/locallib.php
assign.has_overrides
public function has_overrides() { global $DB; $override = $DB->record_exists('assign_overrides', array('assignid' => $this->get_instance()->id)); if ($override) { return true; } return false; }
php
public function has_overrides() { global $DB; $override = $DB->record_exists('assign_overrides', array('assignid' => $this->get_instance()->id)); if ($override) { return true; } return false; }
[ "public", "function", "has_overrides", "(", ")", "{", "global", "$", "DB", ";", "$", "override", "=", "$", "DB", "->", "record_exists", "(", "'assign_overrides'", ",", "array", "(", "'assignid'", "=>", "$", "this", "->", "get_instance", "(", ")", "->", "...
Returns whether an assign has any overrides. @return true if any, false if not
[ "Returns", "whether", "an", "assign", "has", "any", "overrides", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L920-L930
214,934
moodle/moodle
mod/assign/locallib.php
assign.override_exists
public function override_exists($userid) { global $DB; // Gets an assoc array containing the keys for defined user overrides only. $getuseroverride = function($userid) use ($DB) { $useroverride = $DB->get_record('assign_overrides', ['assignid' => $this->get_instance()->id, 'userid' ...
php
public function override_exists($userid) { global $DB; // Gets an assoc array containing the keys for defined user overrides only. $getuseroverride = function($userid) use ($DB) { $useroverride = $DB->get_record('assign_overrides', ['assignid' => $this->get_instance()->id, 'userid' ...
[ "public", "function", "override_exists", "(", "$", "userid", ")", "{", "global", "$", "DB", ";", "// Gets an assoc array containing the keys for defined user overrides only.", "$", "getuseroverride", "=", "function", "(", "$", "userid", ")", "use", "(", "$", "DB", "...
Returns user override Algorithm: For each assign setting, if there is a matching user-specific override, then use that otherwise, if there are group-specific overrides, use the one with the lowest sort order. If neither applies, leave the assign setting unchanged. @param int $userid The userid. @return stdClass The ...
[ "Returns", "user", "override" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L942-L977
214,935
moodle/moodle
mod/assign/locallib.php
assign.is_override_calendar_event
public function is_override_calendar_event(\calendar_event $event) { global $DB; if (!isset($event->modulename)) { return false; } if ($event->modulename != 'assign') { return false; } if (!isset($event->instance)) { return false; ...
php
public function is_override_calendar_event(\calendar_event $event) { global $DB; if (!isset($event->modulename)) { return false; } if ($event->modulename != 'assign') { return false; } if (!isset($event->instance)) { return false; ...
[ "public", "function", "is_override_calendar_event", "(", "\\", "calendar_event", "$", "event", ")", "{", "global", "$", "DB", ";", "if", "(", "!", "isset", "(", "$", "event", "->", "modulename", ")", ")", "{", "return", "false", ";", "}", "if", "(", "$...
Check if the given calendar_event is either a user or group override event. @return bool
[ "Check", "if", "the", "given", "calendar_event", "is", "either", "a", "user", "or", "group", "override", "event", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L985-L1019
214,936
moodle/moodle
mod/assign/locallib.php
assign.get_valid_calendar_event_timestart_range
function get_valid_calendar_event_timestart_range(\calendar_event $event) { $instance = $this->get_instance(); $submissionsfromdate = $instance->allowsubmissionsfromdate; $cutoffdate = $instance->cutoffdate; $duedate = $instance->duedate; $gradingduedate = $instance->gradingdueda...
php
function get_valid_calendar_event_timestart_range(\calendar_event $event) { $instance = $this->get_instance(); $submissionsfromdate = $instance->allowsubmissionsfromdate; $cutoffdate = $instance->cutoffdate; $duedate = $instance->duedate; $gradingduedate = $instance->gradingdueda...
[ "function", "get_valid_calendar_event_timestart_range", "(", "\\", "calendar_event", "$", "event", ")", "{", "$", "instance", "=", "$", "this", "->", "get_instance", "(", ")", ";", "$", "submissionsfromdate", "=", "$", "instance", "->", "allowsubmissionsfromdate", ...
This function calculates the minimum and maximum cutoff values for the timestart of the given event. It will return an array with two values, the first being the minimum cutoff value and the second being the maximum cutoff value. Either or both values can be null, which indicates there is no minimum or maximum, respec...
[ "This", "function", "calculates", "the", "minimum", "and", "maximum", "cutoff", "values", "for", "the", "timestart", "of", "the", "given", "event", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L1044-L1103
214,937
moodle/moodle
mod/assign/locallib.php
assign.update_plugin_instance
protected function update_plugin_instance(assign_plugin $plugin, stdClass $formdata) { if ($plugin->is_visible()) { $enabledname = $plugin->get_subtype() . '_' . $plugin->get_type() . '_enabled'; if (!empty($formdata->$enabledname)) { $plugin->enable(); if...
php
protected function update_plugin_instance(assign_plugin $plugin, stdClass $formdata) { if ($plugin->is_visible()) { $enabledname = $plugin->get_subtype() . '_' . $plugin->get_type() . '_enabled'; if (!empty($formdata->$enabledname)) { $plugin->enable(); if...
[ "protected", "function", "update_plugin_instance", "(", "assign_plugin", "$", "plugin", ",", "stdClass", "$", "formdata", ")", "{", "if", "(", "$", "plugin", "->", "is_visible", "(", ")", ")", "{", "$", "enabledname", "=", "$", "plugin", "->", "get_subtype",...
Update the settings for a single plugin. @param assign_plugin $plugin The plugin to update @param stdClass $formdata The form data @return bool false if an error occurs
[ "Update", "the", "settings", "for", "a", "single", "plugin", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L1229-L1243
214,938
moodle/moodle
mod/assign/locallib.php
assign.update_gradebook
public function update_gradebook($reset, $coursemoduleid) { global $CFG; require_once($CFG->dirroot.'/mod/assign/lib.php'); $assign = clone $this->get_instance(); $assign->cmidnumber = $coursemoduleid; // Set assign gradebook feedback plugin status (enabled and visible). ...
php
public function update_gradebook($reset, $coursemoduleid) { global $CFG; require_once($CFG->dirroot.'/mod/assign/lib.php'); $assign = clone $this->get_instance(); $assign->cmidnumber = $coursemoduleid; // Set assign gradebook feedback plugin status (enabled and visible). ...
[ "public", "function", "update_gradebook", "(", "$", "reset", ",", "$", "coursemoduleid", ")", "{", "global", "$", "CFG", ";", "require_once", "(", "$", "CFG", "->", "dirroot", ".", "'/mod/assign/lib.php'", ")", ";", "$", "assign", "=", "clone", "$", "this"...
Update the gradebook information for this assignment. @param bool $reset If true, will reset all grades in the gradbook for this assignment @param int $coursemoduleid This is required because it might not exist in the database yet @return bool
[ "Update", "the", "gradebook", "information", "for", "this", "assignment", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L1252-L1268
214,939
moodle/moodle
mod/assign/locallib.php
assign.get_assign_perpage
public function get_assign_perpage() { $perpage = (int) get_user_preferences('assign_perpage', 10); $adminconfig = $this->get_admin_config(); $maxperpage = -1; if (isset($adminconfig->maxperpage)) { $maxperpage = $adminconfig->maxperpage; } if (isset($maxperpa...
php
public function get_assign_perpage() { $perpage = (int) get_user_preferences('assign_perpage', 10); $adminconfig = $this->get_admin_config(); $maxperpage = -1; if (isset($adminconfig->maxperpage)) { $maxperpage = $adminconfig->maxperpage; } if (isset($maxperpa...
[ "public", "function", "get_assign_perpage", "(", ")", "{", "$", "perpage", "=", "(", "int", ")", "get_user_preferences", "(", "'assign_perpage'", ",", "10", ")", ";", "$", "adminconfig", "=", "$", "this", "->", "get_admin_config", "(", ")", ";", "$", "maxp...
Get the marking table page size @return integer
[ "Get", "the", "marking", "table", "page", "size" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L1275-L1288
214,940
moodle/moodle
mod/assign/locallib.php
assign.get_admin_config
public function get_admin_config() { if ($this->adminconfig) { return $this->adminconfig; } $this->adminconfig = get_config('assign'); return $this->adminconfig; }
php
public function get_admin_config() { if ($this->adminconfig) { return $this->adminconfig; } $this->adminconfig = get_config('assign'); return $this->adminconfig; }
[ "public", "function", "get_admin_config", "(", ")", "{", "if", "(", "$", "this", "->", "adminconfig", ")", "{", "return", "$", "this", "->", "adminconfig", ";", "}", "$", "this", "->", "adminconfig", "=", "get_config", "(", "'assign'", ")", ";", "return"...
Load and cache the admin config for this module. @return stdClass the plugin config
[ "Load", "and", "cache", "the", "admin", "config", "for", "this", "module", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L1295-L1301
214,941
moodle/moodle
mod/assign/locallib.php
assign.save_intro_draft_files
protected function save_intro_draft_files($formdata) { if (isset($formdata->introattachments)) { file_save_draft_area_files($formdata->introattachments, $this->get_context()->id, 'mod_assign', ASSIGN_INTROATTACHMENT_FILEAREA, 0); } }
php
protected function save_intro_draft_files($formdata) { if (isset($formdata->introattachments)) { file_save_draft_area_files($formdata->introattachments, $this->get_context()->id, 'mod_assign', ASSIGN_INTROATTACHMENT_FILEAREA, 0); } }
[ "protected", "function", "save_intro_draft_files", "(", "$", "formdata", ")", "{", "if", "(", "isset", "(", "$", "formdata", "->", "introattachments", ")", ")", "{", "file_save_draft_area_files", "(", "$", "formdata", "->", "introattachments", ",", "$", "this", ...
Save the attachments in the draft areas. @param stdClass $formdata
[ "Save", "the", "attachments", "in", "the", "draft", "areas", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L1497-L1502
214,942
moodle/moodle
mod/assign/locallib.php
assign.add_plugin_grade_elements
protected function add_plugin_grade_elements($grade, MoodleQuickForm $mform, stdClass $data, $userid) { foreach ($this->feedbackplugins as $plugin) { if ($plugin->is_enabled() && $plugin->is_visible()) { $plugin->get_form_elements_for_user($grade, $mform, $data, $userid); ...
php
protected function add_plugin_grade_elements($grade, MoodleQuickForm $mform, stdClass $data, $userid) { foreach ($this->feedbackplugins as $plugin) { if ($plugin->is_enabled() && $plugin->is_visible()) { $plugin->get_form_elements_for_user($grade, $mform, $data, $userid); ...
[ "protected", "function", "add_plugin_grade_elements", "(", "$", "grade", ",", "MoodleQuickForm", "$", "mform", ",", "stdClass", "$", "data", ",", "$", "userid", ")", "{", "foreach", "(", "$", "this", "->", "feedbackplugins", "as", "$", "plugin", ")", "{", ...
Add elements in grading plugin form. @param mixed $grade stdClass|null @param MoodleQuickForm $mform @param stdClass $data @param int $userid - The userid we are grading @return void
[ "Add", "elements", "in", "grading", "plugin", "form", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L1513-L1519
214,943
moodle/moodle
mod/assign/locallib.php
assign.add_plugin_settings
protected function add_plugin_settings(assign_plugin $plugin, MoodleQuickForm $mform, & $pluginsenabled) { global $CFG; if ($plugin->is_visible() && !$plugin->is_configurable() && $plugin->is_enabled()) { $name = $plugin->get_subtype() . '_' . $plugin->get_type() . '_enabled'; $p...
php
protected function add_plugin_settings(assign_plugin $plugin, MoodleQuickForm $mform, & $pluginsenabled) { global $CFG; if ($plugin->is_visible() && !$plugin->is_configurable() && $plugin->is_enabled()) { $name = $plugin->get_subtype() . '_' . $plugin->get_type() . '_enabled'; $p...
[ "protected", "function", "add_plugin_settings", "(", "assign_plugin", "$", "plugin", ",", "MoodleQuickForm", "$", "mform", ",", "&", "$", "pluginsenabled", ")", "{", "global", "$", "CFG", ";", "if", "(", "$", "plugin", "->", "is_visible", "(", ")", "&&", "...
Add one plugins settings to edit plugin form. @param assign_plugin $plugin The plugin to add the settings from @param MoodleQuickForm $mform The form to add the configuration settings to. This form is modified directly (not returned). @param array $pluginsenabled A list of form elements to be added to a group. The new...
[ "Add", "one", "plugins", "settings", "to", "edit", "plugin", "form", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L1533-L1556
214,944
moodle/moodle
mod/assign/locallib.php
assign.add_all_plugin_settings
public function add_all_plugin_settings(MoodleQuickForm $mform) { $mform->addElement('header', 'submissiontypes', get_string('submissiontypes', 'assign')); $submissionpluginsenabled = array(); $group = $mform->addGroup(array(), 'submissionplugins', get_string('submissiontypes', 'assign'), array...
php
public function add_all_plugin_settings(MoodleQuickForm $mform) { $mform->addElement('header', 'submissiontypes', get_string('submissiontypes', 'assign')); $submissionpluginsenabled = array(); $group = $mform->addGroup(array(), 'submissionplugins', get_string('submissiontypes', 'assign'), array...
[ "public", "function", "add_all_plugin_settings", "(", "MoodleQuickForm", "$", "mform", ")", "{", "$", "mform", "->", "addElement", "(", "'header'", ",", "'submissiontypes'", ",", "get_string", "(", "'submissiontypes'", ",", "'assign'", ")", ")", ";", "$", "submi...
Add settings to edit plugin form. @param MoodleQuickForm $mform The form to add the configuration settings to. This form is modified directly (not returned). @return void
[ "Add", "settings", "to", "edit", "plugin", "form", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L1565-L1583
214,945
moodle/moodle
mod/assign/locallib.php
assign.get_module_name
protected function get_module_name() { if (isset(self::$modulename)) { return self::$modulename; } self::$modulename = get_string('modulename', 'assign'); return self::$modulename; }
php
protected function get_module_name() { if (isset(self::$modulename)) { return self::$modulename; } self::$modulename = get_string('modulename', 'assign'); return self::$modulename; }
[ "protected", "function", "get_module_name", "(", ")", "{", "if", "(", "isset", "(", "self", "::", "$", "modulename", ")", ")", "{", "return", "self", "::", "$", "modulename", ";", "}", "self", "::", "$", "modulename", "=", "get_string", "(", "'modulename...
Get the name of the current module. @return string the module name (Assignment)
[ "Get", "the", "name", "of", "the", "current", "module", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L1610-L1616
214,946
moodle/moodle
mod/assign/locallib.php
assign.get_module_name_plural
protected function get_module_name_plural() { if (isset(self::$modulenameplural)) { return self::$modulenameplural; } self::$modulenameplural = get_string('modulenameplural', 'assign'); return self::$modulenameplural; }
php
protected function get_module_name_plural() { if (isset(self::$modulenameplural)) { return self::$modulenameplural; } self::$modulenameplural = get_string('modulenameplural', 'assign'); return self::$modulenameplural; }
[ "protected", "function", "get_module_name_plural", "(", ")", "{", "if", "(", "isset", "(", "self", "::", "$", "modulenameplural", ")", ")", "{", "return", "self", "::", "$", "modulenameplural", ";", "}", "self", "::", "$", "modulenameplural", "=", "get_strin...
Get the plural name of the current module. @return string the module name plural (Assignments)
[ "Get", "the", "plural", "name", "of", "the", "current", "module", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L1623-L1629
214,947
moodle/moodle
mod/assign/locallib.php
assign.get_instance
public function get_instance() { global $DB; if ($this->instance) { return $this->instance; } if ($this->get_course_module()) { $params = array('id' => $this->get_course_module()->instance); $this->instance = $DB->get_record('assign', $params, '*', MUS...
php
public function get_instance() { global $DB; if ($this->instance) { return $this->instance; } if ($this->get_course_module()) { $params = array('id' => $this->get_course_module()->instance); $this->instance = $DB->get_record('assign', $params, '*', MUS...
[ "public", "function", "get_instance", "(", ")", "{", "global", "$", "DB", ";", "if", "(", "$", "this", "->", "instance", ")", "{", "return", "$", "this", "->", "instance", ";", "}", "if", "(", "$", "this", "->", "get_course_module", "(", ")", ")", ...
Get the settings for the current instance of this assignment @return stdClass The settings
[ "Get", "the", "settings", "for", "the", "current", "instance", "of", "this", "assignment" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L1645-L1659
214,948
moodle/moodle
mod/assign/locallib.php
assign.get_grade_item
public function get_grade_item() { if ($this->gradeitem) { return $this->gradeitem; } $instance = $this->get_instance(); $params = array('itemtype' => 'mod', 'itemmodule' => 'assign', 'iteminstance' => $instance->id, ...
php
public function get_grade_item() { if ($this->gradeitem) { return $this->gradeitem; } $instance = $this->get_instance(); $params = array('itemtype' => 'mod', 'itemmodule' => 'assign', 'iteminstance' => $instance->id, ...
[ "public", "function", "get_grade_item", "(", ")", "{", "if", "(", "$", "this", "->", "gradeitem", ")", "{", "return", "$", "this", "->", "gradeitem", ";", "}", "$", "instance", "=", "$", "this", "->", "get_instance", "(", ")", ";", "$", "params", "="...
Get the primary grade item for this assign instance. @return grade_item The grade_item record
[ "Get", "the", "primary", "grade", "item", "for", "this", "assign", "instance", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L1666-L1682
214,949
moodle/moodle
mod/assign/locallib.php
assign.get_course_context
public function get_course_context() { if (!$this->context && !$this->course) { throw new coding_exception('Improper use of the assignment class. ' . 'Cannot load the course context.'); } if ($this->context) { return $this->context->...
php
public function get_course_context() { if (!$this->context && !$this->course) { throw new coding_exception('Improper use of the assignment class. ' . 'Cannot load the course context.'); } if ($this->context) { return $this->context->...
[ "public", "function", "get_course_context", "(", ")", "{", "if", "(", "!", "$", "this", "->", "context", "&&", "!", "$", "this", "->", "course", ")", "{", "throw", "new", "coding_exception", "(", "'Improper use of the assignment class. '", ".", "'Cannot load the...
Get the context of the current course. @return mixed context|null The course context
[ "Get", "the", "context", "of", "the", "current", "course", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L1689-L1699
214,950
moodle/moodle
mod/assign/locallib.php
assign.get_course_module
public function get_course_module() { if ($this->coursemodule) { return $this->coursemodule; } if (!$this->context) { return null; } if ($this->context->contextlevel == CONTEXT_MODULE) { $modinfo = get_fast_modinfo($this->get_course()); ...
php
public function get_course_module() { if ($this->coursemodule) { return $this->coursemodule; } if (!$this->context) { return null; } if ($this->context->contextlevel == CONTEXT_MODULE) { $modinfo = get_fast_modinfo($this->get_course()); ...
[ "public", "function", "get_course_module", "(", ")", "{", "if", "(", "$", "this", "->", "coursemodule", ")", "{", "return", "$", "this", "->", "coursemodule", ";", "}", "if", "(", "!", "$", "this", "->", "context", ")", "{", "return", "null", ";", "}...
Get the current course module. @return cm_info|null The course module or null if not known
[ "Get", "the", "current", "course", "module", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L1707-L1721
214,951
moodle/moodle
mod/assign/locallib.php
assign.get_course
public function get_course() { global $DB; if ($this->course) { return $this->course; } if (!$this->context) { return null; } $params = array('id' => $this->get_course_context()->instanceid); $this->course = $DB->get_record('course', $par...
php
public function get_course() { global $DB; if ($this->course) { return $this->course; } if (!$this->context) { return null; } $params = array('id' => $this->get_course_context()->instanceid); $this->course = $DB->get_record('course', $par...
[ "public", "function", "get_course", "(", ")", "{", "global", "$", "DB", ";", "if", "(", "$", "this", "->", "course", ")", "{", "return", "$", "this", "->", "course", ";", "}", "if", "(", "!", "$", "this", "->", "context", ")", "{", "return", "nul...
Get the current course. @return mixed stdClass|null The course
[ "Get", "the", "current", "course", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L1737-L1751
214,952
moodle/moodle
mod/assign/locallib.php
assign.count_attachments
protected function count_attachments() { $fs = get_file_storage(); $files = $fs->get_area_files($this->get_context()->id, 'mod_assign', ASSIGN_INTROATTACHMENT_FILEAREA, 0, 'id', false); return count($files); }
php
protected function count_attachments() { $fs = get_file_storage(); $files = $fs->get_area_files($this->get_context()->id, 'mod_assign', ASSIGN_INTROATTACHMENT_FILEAREA, 0, 'id', false); return count($files); }
[ "protected", "function", "count_attachments", "(", ")", "{", "$", "fs", "=", "get_file_storage", "(", ")", ";", "$", "files", "=", "$", "fs", "->", "get_area_files", "(", "$", "this", "->", "get_context", "(", ")", "->", "id", ",", "'mod_assign'", ",", ...
Count the number of intro attachments. @return int
[ "Count", "the", "number", "of", "intro", "attachments", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L1758-L1765
214,953
moodle/moodle
mod/assign/locallib.php
assign.get_participant
public function get_participant($userid) { global $DB, $USER; if ($userid == $USER->id) { $participant = clone ($USER); } else { $participant = $DB->get_record('user', array('id' => $userid)); } if (!$participant) { return null; } ...
php
public function get_participant($userid) { global $DB, $USER; if ($userid == $USER->id) { $participant = clone ($USER); } else { $participant = $DB->get_record('user', array('id' => $userid)); } if (!$participant) { return null; } ...
[ "public", "function", "get_participant", "(", "$", "userid", ")", "{", "global", "$", "DB", ",", "$", "USER", ";", "if", "(", "$", "userid", "==", "$", "USER", "->", "id", ")", "{", "$", "participant", "=", "clone", "(", "$", "USER", ")", ";", "}...
Load a user if they are enrolled in the current course. Populated with submission status for this assignment. @param int $userid @return null|stdClass user record
[ "Load", "a", "user", "if", "they", "are", "enrolled", "in", "the", "current", "course", ".", "Populated", "with", "submission", "status", "for", "this", "assignment", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L2137-L2155
214,954
moodle/moodle
mod/assign/locallib.php
assign.count_teams
public function count_teams($activitygroup = 0) { $count = 0; $participants = $this->list_participants($activitygroup, true); // If a team submission grouping id is provided all good as all returned groups // are the submission teams, but if no team submission grouping was specified ...
php
public function count_teams($activitygroup = 0) { $count = 0; $participants = $this->list_participants($activitygroup, true); // If a team submission grouping id is provided all good as all returned groups // are the submission teams, but if no team submission grouping was specified ...
[ "public", "function", "count_teams", "(", "$", "activitygroup", "=", "0", ")", "{", "$", "count", "=", "0", ";", "$", "participants", "=", "$", "this", "->", "list_participants", "(", "$", "activitygroup", ",", "true", ")", ";", "// If a team submission grou...
Load a count of valid teams for this assignment. @param int $activitygroup Activity active group @return int number of valid teams
[ "Load", "a", "count", "of", "valid", "teams", "for", "this", "assignment", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L2163-L2211
214,955
moodle/moodle
mod/assign/locallib.php
assign.count_submissions_need_grading
public function count_submissions_need_grading($currentgroup = null) { global $DB; if ($this->get_instance()->teamsubmission) { // This does not make sense for group assignment because the submission is shared. return 0; } if ($currentgroup === null) { ...
php
public function count_submissions_need_grading($currentgroup = null) { global $DB; if ($this->get_instance()->teamsubmission) { // This does not make sense for group assignment because the submission is shared. return 0; } if ($currentgroup === null) { ...
[ "public", "function", "count_submissions_need_grading", "(", "$", "currentgroup", "=", "null", ")", "{", "global", "$", "DB", ";", "if", "(", "$", "this", "->", "get_instance", "(", ")", "->", "teamsubmission", ")", "{", "// This does not make sense for group assi...
Load a count of active users submissions in the current module that require grading This means the submission modification time is more recent than the grading modification time and the status is SUBMITTED. @param mixed $currentgroup int|null the group for counting (if null the function will determine it) @return int ...
[ "Load", "a", "count", "of", "active", "users", "submissions", "in", "the", "current", "module", "that", "require", "grading", "This", "means", "the", "submission", "modification", "time", "is", "more", "recent", "than", "the", "grading", "modification", "time", ...
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L2232-L2265
214,956
moodle/moodle
mod/assign/locallib.php
assign.count_grades
public function count_grades() { global $DB; if (!$this->has_instance()) { return 0; } $currentgroup = groups_get_activity_group($this->get_course_module(), true); list($esql, $params) = get_enrolled_sql($this->get_context(), 'mod/assign:submit', $currentgroup, true...
php
public function count_grades() { global $DB; if (!$this->has_instance()) { return 0; } $currentgroup = groups_get_activity_group($this->get_course_module(), true); list($esql, $params) = get_enrolled_sql($this->get_context(), 'mod/assign:submit', $currentgroup, true...
[ "public", "function", "count_grades", "(", ")", "{", "global", "$", "DB", ";", "if", "(", "!", "$", "this", "->", "has_instance", "(", ")", ")", "{", "return", "0", ";", "}", "$", "currentgroup", "=", "groups_get_activity_group", "(", "$", "this", "->"...
Load a count of grades. @return int number of grades
[ "Load", "a", "count", "of", "grades", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L2272-L2290
214,957
moodle/moodle
mod/assign/locallib.php
assign.count_submissions
public function count_submissions($includenew = false) { global $DB; if (!$this->has_instance()) { return 0; } $params = array(); $sqlnew = ''; if (!$includenew) { $sqlnew = ' AND s.status <> :status '; $params['status'] = ASSIGN_SUB...
php
public function count_submissions($includenew = false) { global $DB; if (!$this->has_instance()) { return 0; } $params = array(); $sqlnew = ''; if (!$includenew) { $sqlnew = ' AND s.status <> :status '; $params['status'] = ASSIGN_SUB...
[ "public", "function", "count_submissions", "(", "$", "includenew", "=", "false", ")", "{", "global", "$", "DB", ";", "if", "(", "!", "$", "this", "->", "has_instance", "(", ")", ")", "{", "return", "0", ";", "}", "$", "params", "=", "array", "(", "...
Load a count of submissions. @param bool $includenew When true, also counts the submissions with status 'new'. @return int number of submissions
[ "Load", "a", "count", "of", "submissions", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L2298-L2343
214,958
moodle/moodle
mod/assign/locallib.php
assign.count_submissions_with_status
public function count_submissions_with_status($status, $currentgroup = null) { global $DB; if ($currentgroup === null) { $currentgroup = groups_get_activity_group($this->get_course_module(), true); } list($esql, $params) = get_enrolled_sql($this->get_context(), 'mod/assign:s...
php
public function count_submissions_with_status($status, $currentgroup = null) { global $DB; if ($currentgroup === null) { $currentgroup = groups_get_activity_group($this->get_course_module(), true); } list($esql, $params) = get_enrolled_sql($this->get_context(), 'mod/assign:s...
[ "public", "function", "count_submissions_with_status", "(", "$", "status", ",", "$", "currentgroup", "=", "null", ")", "{", "global", "$", "DB", ";", "if", "(", "$", "currentgroup", "===", "null", ")", "{", "$", "currentgroup", "=", "groups_get_activity_group"...
Load a count of submissions with a specified status. @param string $status The submission status - should match one of the constants @param mixed $currentgroup int|null the group for counting (if null the function will determine it) @return int number of matching submissions
[ "Load", "a", "count", "of", "submissions", "with", "a", "specified", "status", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L2352-L2407
214,959
moodle/moodle
mod/assign/locallib.php
assign.get_grading_userid_list
protected function get_grading_userid_list($cached = false, $useridlistid = '') { if ($cached) { if (empty($useridlistid)) { $useridlistid = $this->get_useridlist_key_id(); } $useridlistkey = $this->get_useridlist_key($useridlistid); if (empty($SES...
php
protected function get_grading_userid_list($cached = false, $useridlistid = '') { if ($cached) { if (empty($useridlistid)) { $useridlistid = $this->get_useridlist_key_id(); } $useridlistkey = $this->get_useridlist_key($useridlistid); if (empty($SES...
[ "protected", "function", "get_grading_userid_list", "(", "$", "cached", "=", "false", ",", "$", "useridlistid", "=", "''", ")", "{", "if", "(", "$", "cached", ")", "{", "if", "(", "empty", "(", "$", "useridlistid", ")", ")", "{", "$", "useridlistid", "...
Utility function to get the userid for every row in the grading table so the order can be frozen while we iterate it. @param boolean $cached If true, the cached list from the session could be returned. @param string $useridlistid String value used for caching the participant list. @return array An array of userids
[ "Utility", "function", "to", "get", "the", "userid", "for", "every", "row", "in", "the", "grading", "table", "so", "the", "order", "can", "be", "frozen", "while", "we", "iterate", "it", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L2417-L2434
214,960
moodle/moodle
mod/assign/locallib.php
assign.pack_files
protected function pack_files($filesforzipping) { global $CFG; // Create path for new zip file. $tempzip = tempnam($CFG->tempdir . '/', 'assignment_'); // Zip files. $zipper = new zip_packer(); if ($zipper->archive_to_pathname($filesforzipping, $tempzip)) { re...
php
protected function pack_files($filesforzipping) { global $CFG; // Create path for new zip file. $tempzip = tempnam($CFG->tempdir . '/', 'assignment_'); // Zip files. $zipper = new zip_packer(); if ($zipper->archive_to_pathname($filesforzipping, $tempzip)) { re...
[ "protected", "function", "pack_files", "(", "$", "filesforzipping", ")", "{", "global", "$", "CFG", ";", "// Create path for new zip file.", "$", "tempzip", "=", "tempnam", "(", "$", "CFG", "->", "tempdir", ".", "'/'", ",", "'assignment_'", ")", ";", "// Zip f...
Generate zip file from array of given files. @param array $filesforzipping - array of files to pass into archive_to_pathname. This array is indexed by the final file name and each element in the array is an instance of a stored_file object. @return path of temp file - note this returned file does not have a .zip exten...
[ "Generate", "zip", "file", "from", "array", "of", "given", "files", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L2445-L2455
214,961
moodle/moodle
mod/assign/locallib.php
assign.notify_grade_modified
public function notify_grade_modified($grade, $mailedoverride = false) { global $DB; $flags = $this->get_user_flags($grade->userid, true); if ($flags->mailed != 1 || $mailedoverride) { $flags->mailed = 0; } return $this->update_user_flags($flags); }
php
public function notify_grade_modified($grade, $mailedoverride = false) { global $DB; $flags = $this->get_user_flags($grade->userid, true); if ($flags->mailed != 1 || $mailedoverride) { $flags->mailed = 0; } return $this->update_user_flags($flags); }
[ "public", "function", "notify_grade_modified", "(", "$", "grade", ",", "$", "mailedoverride", "=", "false", ")", "{", "global", "$", "DB", ";", "$", "flags", "=", "$", "this", "->", "get_user_flags", "(", "$", "grade", "->", "userid", ",", "true", ")", ...
Mark in the database that this grade record should have an update notification sent by cron. @param stdClass $grade a grade record keyed on id @param bool $mailedoverride when true, flag notification to be sent again. @return bool true for success
[ "Mark", "in", "the", "database", "that", "this", "grade", "record", "should", "have", "an", "update", "notification", "sent", "by", "cron", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L2665-L2674
214,962
moodle/moodle
mod/assign/locallib.php
assign.update_user_flags
public function update_user_flags($flags) { global $DB; if ($flags->userid <= 0 || $flags->assignment <= 0 || $flags->id <= 0) { return false; } $result = $DB->update_record('assign_user_flags', $flags); return $result; }
php
public function update_user_flags($flags) { global $DB; if ($flags->userid <= 0 || $flags->assignment <= 0 || $flags->id <= 0) { return false; } $result = $DB->update_record('assign_user_flags', $flags); return $result; }
[ "public", "function", "update_user_flags", "(", "$", "flags", ")", "{", "global", "$", "DB", ";", "if", "(", "$", "flags", "->", "userid", "<=", "0", "||", "$", "flags", "->", "assignment", "<=", "0", "||", "$", "flags", "->", "id", "<=", "0", ")",...
Update user flags for this user in this assignment. @param stdClass $flags a flags record keyed on id @return bool true for success
[ "Update", "user", "flags", "for", "this", "user", "in", "this", "assignment", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L2682-L2690
214,963
moodle/moodle
mod/assign/locallib.php
assign.update_grade
public function update_grade($grade, $reopenattempt = false) { global $DB; $grade->timemodified = time(); if (!empty($grade->workflowstate)) { $validstates = $this->get_marking_workflow_states_for_current_user(); if (!array_key_exists($grade->workflowstate, $validstates...
php
public function update_grade($grade, $reopenattempt = false) { global $DB; $grade->timemodified = time(); if (!empty($grade->workflowstate)) { $validstates = $this->get_marking_workflow_states_for_current_user(); if (!array_key_exists($grade->workflowstate, $validstates...
[ "public", "function", "update_grade", "(", "$", "grade", ",", "$", "reopenattempt", "=", "false", ")", "{", "global", "$", "DB", ";", "$", "grade", "->", "timemodified", "=", "time", "(", ")", ";", "if", "(", "!", "empty", "(", "$", "grade", "->", ...
Update a grade in the grade table for the assignment and in the gradebook. @param stdClass $grade a grade record keyed on id @param bool $reopenattempt If the attempt reopen method is manual, allow another attempt at this assignment. @return bool true for success
[ "Update", "a", "grade", "in", "the", "grade", "table", "for", "the", "assignment", "and", "in", "the", "gradebook", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L2699-L2765
214,964
moodle/moodle
mod/assign/locallib.php
assign.view_grant_extension
protected function view_grant_extension($mform) { global $CFG; require_once($CFG->dirroot . '/mod/assign/extensionform.php'); $o = ''; $data = new stdClass(); $data->id = $this->get_course_module()->id; $formparams = array( 'instance' => $this->get_instance...
php
protected function view_grant_extension($mform) { global $CFG; require_once($CFG->dirroot . '/mod/assign/extensionform.php'); $o = ''; $data = new stdClass(); $data->id = $this->get_course_module()->id; $formparams = array( 'instance' => $this->get_instance...
[ "protected", "function", "view_grant_extension", "(", "$", "mform", ")", "{", "global", "$", "CFG", ";", "require_once", "(", "$", "CFG", "->", "dirroot", ".", "'/mod/assign/extensionform.php'", ")", ";", "$", "o", "=", "''", ";", "$", "data", "=", "new", ...
View the grant extension date page. Uses url parameters 'userid' or from parameter 'selectedusers' @param moodleform $mform - Used for validation of the submitted data @return string
[ "View", "the", "grant", "extension", "date", "page", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L2776-L2835
214,965
moodle/moodle
mod/assign/locallib.php
assign.get_submission_group_members
public function get_submission_group_members($groupid, $onlyids, $excludesuspended = false) { $members = array(); if ($groupid != 0) { $allusers = $this->list_participants($groupid, $onlyids); foreach ($allusers as $user) { if ($this->get_submission_group($user->i...
php
public function get_submission_group_members($groupid, $onlyids, $excludesuspended = false) { $members = array(); if ($groupid != 0) { $allusers = $this->list_participants($groupid, $onlyids); foreach ($allusers as $user) { if ($this->get_submission_group($user->i...
[ "public", "function", "get_submission_group_members", "(", "$", "groupid", ",", "$", "onlyids", ",", "$", "excludesuspended", "=", "false", ")", "{", "$", "members", "=", "array", "(", ")", ";", "if", "(", "$", "groupid", "!=", "0", ")", "{", "$", "all...
Get a list of the users in the same group as this user. @param int $groupid The id of the group whose members we want or 0 for the default group @param bool $onlyids Whether to retrieve only the user id's @param bool $excludesuspended Whether to exclude suspended users @return array The users (possibly id's only)
[ "Get", "a", "list", "of", "the", "users", "in", "the", "same", "group", "as", "this", "user", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L2845-L2872
214,966
moodle/moodle
mod/assign/locallib.php
assign.get_submission_group_members_who_have_not_submitted
public function get_submission_group_members_who_have_not_submitted($groupid, $onlyids) { $instance = $this->get_instance(); if (!$instance->teamsubmission || !$instance->requireallteammemberssubmit) { return array(); } $members = $this->get_submission_group_members($groupid,...
php
public function get_submission_group_members_who_have_not_submitted($groupid, $onlyids) { $instance = $this->get_instance(); if (!$instance->teamsubmission || !$instance->requireallteammemberssubmit) { return array(); } $members = $this->get_submission_group_members($groupid,...
[ "public", "function", "get_submission_group_members_who_have_not_submitted", "(", "$", "groupid", ",", "$", "onlyids", ")", "{", "$", "instance", "=", "$", "this", "->", "get_instance", "(", ")", ";", "if", "(", "!", "$", "instance", "->", "teamsubmission", "|...
Get a list of the users in the same group as this user that have not submitted the assignment. @param int $groupid The id of the group whose members we want or 0 for the default group @param bool $onlyids Whether to retrieve only the user id's @return array The users (possibly id's only)
[ "Get", "a", "list", "of", "the", "users", "in", "the", "same", "group", "as", "this", "user", "that", "have", "not", "submitted", "the", "assignment", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L2881-L2900
214,967
moodle/moodle
mod/assign/locallib.php
assign.view_plugin_page
protected function view_plugin_page() { global $USER; $o = ''; $pluginsubtype = required_param('pluginsubtype', PARAM_ALPHA); $plugintype = required_param('plugin', PARAM_PLUGIN); $pluginaction = required_param('pluginaction', PARAM_ALPHA); $plugin = $this->get_plugin_...
php
protected function view_plugin_page() { global $USER; $o = ''; $pluginsubtype = required_param('pluginsubtype', PARAM_ALPHA); $plugintype = required_param('plugin', PARAM_PLUGIN); $pluginaction = required_param('pluginaction', PARAM_ALPHA); $plugin = $this->get_plugin_...
[ "protected", "function", "view_plugin_page", "(", ")", "{", "global", "$", "USER", ";", "$", "o", "=", "''", ";", "$", "pluginsubtype", "=", "required_param", "(", "'pluginsubtype'", ",", "PARAM_ALPHA", ")", ";", "$", "plugintype", "=", "required_param", "("...
View a page rendered by a plugin. Uses url parameters 'pluginaction', 'pluginsubtype', 'plugin', and 'id'. @return string
[ "View", "a", "page", "rendered", "by", "a", "plugin", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L3072-L3090
214,968
moodle/moodle
mod/assign/locallib.php
assign.get_submission_group
public function get_submission_group($userid) { if (isset($this->usersubmissiongroups[$userid])) { return $this->usersubmissiongroups[$userid]; } $groups = $this->get_all_groups($userid); if (count($groups) != 1) { $return = false; } else { $...
php
public function get_submission_group($userid) { if (isset($this->usersubmissiongroups[$userid])) { return $this->usersubmissiongroups[$userid]; } $groups = $this->get_all_groups($userid); if (count($groups) != 1) { $return = false; } else { $...
[ "public", "function", "get_submission_group", "(", "$", "userid", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "usersubmissiongroups", "[", "$", "userid", "]", ")", ")", "{", "return", "$", "this", "->", "usersubmissiongroups", "[", "$", "userid",...
This is used for team assignments to get the group for the specified user. If the user is a member of multiple or no groups this will return false @param int $userid The id of the user whose submission we want @return mixed The group or false
[ "This", "is", "used", "for", "team", "assignments", "to", "get", "the", "group", "for", "the", "specified", "user", ".", "If", "the", "user", "is", "a", "member", "of", "multiple", "or", "no", "groups", "this", "will", "return", "false" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L3100-L3117
214,969
moodle/moodle
mod/assign/locallib.php
assign.get_all_groups
public function get_all_groups($userid) { if (isset($this->usergroups[$userid])) { return $this->usergroups[$userid]; } $grouping = $this->get_instance()->teamsubmissiongroupingid; $return = groups_get_all_groups($this->get_course()->id, $userid, $grouping); $this->...
php
public function get_all_groups($userid) { if (isset($this->usergroups[$userid])) { return $this->usergroups[$userid]; } $grouping = $this->get_instance()->teamsubmissiongroupingid; $return = groups_get_all_groups($this->get_course()->id, $userid, $grouping); $this->...
[ "public", "function", "get_all_groups", "(", "$", "userid", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "usergroups", "[", "$", "userid", "]", ")", ")", "{", "return", "$", "this", "->", "usergroups", "[", "$", "userid", "]", ";", "}", "$...
Gets all groups the user is a member of. @param int $userid Teh id of the user who's groups we are checking @return array The group objects
[ "Gets", "all", "groups", "the", "user", "is", "a", "member", "of", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L3125-L3136
214,970
moodle/moodle
mod/assign/locallib.php
assign.view_plugin_content
protected function view_plugin_content($pluginsubtype) { $o = ''; $submissionid = optional_param('sid', 0, PARAM_INT); $gradeid = optional_param('gid', 0, PARAM_INT); $plugintype = required_param('plugin', PARAM_PLUGIN); $item = null; if ($pluginsubtype == 'assignsubmiss...
php
protected function view_plugin_content($pluginsubtype) { $o = ''; $submissionid = optional_param('sid', 0, PARAM_INT); $gradeid = optional_param('gid', 0, PARAM_INT); $plugintype = required_param('plugin', PARAM_PLUGIN); $item = null; if ($pluginsubtype == 'assignsubmiss...
[ "protected", "function", "view_plugin_content", "(", "$", "pluginsubtype", ")", "{", "$", "o", "=", "''", ";", "$", "submissionid", "=", "optional_param", "(", "'sid'", ",", "0", ",", "PARAM_INT", ")", ";", "$", "gradeid", "=", "optional_param", "(", "'gid...
Display the submission that is used by a plugin. Uses url parameters 'sid', 'gid' and 'plugin'. @param string $pluginsubtype @return string
[ "Display", "the", "submission", "that", "is", "used", "by", "a", "plugin", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L3147-L3212
214,971
moodle/moodle
mod/assign/locallib.php
assign.download_rewrite_pluginfile_urls
public function download_rewrite_pluginfile_urls($text, $user, $plugin) { // The groupname prefix for the urls doesn't depend on the group mode of the assignment instance. // Rather, it should be determined by checking the group submission settings of the instance, // which is what download_subm...
php
public function download_rewrite_pluginfile_urls($text, $user, $plugin) { // The groupname prefix for the urls doesn't depend on the group mode of the assignment instance. // Rather, it should be determined by checking the group submission settings of the instance, // which is what download_subm...
[ "public", "function", "download_rewrite_pluginfile_urls", "(", "$", "text", ",", "$", "user", ",", "$", "plugin", ")", "{", "// The groupname prefix for the urls doesn't depend on the group mode of the assignment instance.", "// Rather, it should be determined by checking the group sub...
Rewrite plugin file urls so they resolve correctly in an exported zip. @param string $text - The replacement text @param stdClass $user - The user record @param assign_plugin $plugin - The assignment plugin
[ "Rewrite", "plugin", "file", "urls", "so", "they", "resolve", "correctly", "in", "an", "exported", "zip", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L3221-L3256
214,972
moodle/moodle
mod/assign/locallib.php
assign.render_editor_content
public function render_editor_content($filearea, $submissionid, $plugintype, $editor, $component, $shortentext = false) { global $CFG; $result = ''; $plugin = $this->get_submission_plugin_by_type($plugintype); $text = $plugin->get_editor_text($editor, $submissionid); if ($shor...
php
public function render_editor_content($filearea, $submissionid, $plugintype, $editor, $component, $shortentext = false) { global $CFG; $result = ''; $plugin = $this->get_submission_plugin_by_type($plugintype); $text = $plugin->get_editor_text($editor, $submissionid); if ($shor...
[ "public", "function", "render_editor_content", "(", "$", "filearea", ",", "$", "submissionid", ",", "$", "plugintype", ",", "$", "editor", ",", "$", "component", ",", "$", "shortentext", "=", "false", ")", "{", "global", "$", "CFG", ";", "$", "result", "...
Render the content in editor that is often used by plugin. @param string $filearea @param int $submissionid @param string $plugintype @param string $editor @param string $component @param bool $shortentext Whether to shorten the text content. @return string
[ "Render", "the", "content", "in", "editor", "that", "is", "often", "used", "by", "plugin", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L3269-L3316
214,973
moodle/moodle
mod/assign/locallib.php
assign.view_savegrading_result
protected function view_savegrading_result($message) { $o = ''; $o .= $this->get_renderer()->render(new assign_header($this->get_instance(), $this->get_context(), $this->show_intro(), ...
php
protected function view_savegrading_result($message) { $o = ''; $o .= $this->get_renderer()->render(new assign_header($this->get_instance(), $this->get_context(), $this->show_intro(), ...
[ "protected", "function", "view_savegrading_result", "(", "$", "message", ")", "{", "$", "o", "=", "''", ";", "$", "o", ".=", "$", "this", "->", "get_renderer", "(", ")", "->", "render", "(", "new", "assign_header", "(", "$", "this", "->", "get_instance",...
Display a continue page after grading. @param string $message - The message to display. @return string
[ "Display", "a", "continue", "page", "after", "grading", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L3324-L3337
214,974
moodle/moodle
mod/assign/locallib.php
assign.view_quickgrading_result
protected function view_quickgrading_result($message) { $o = ''; $o .= $this->get_renderer()->render(new assign_header($this->get_instance(), $this->get_context(), $this->show_intro(), ...
php
protected function view_quickgrading_result($message) { $o = ''; $o .= $this->get_renderer()->render(new assign_header($this->get_instance(), $this->get_context(), $this->show_intro(), ...
[ "protected", "function", "view_quickgrading_result", "(", "$", "message", ")", "{", "$", "o", "=", "''", ";", "$", "o", ".=", "$", "this", "->", "get_renderer", "(", ")", "->", "render", "(", "new", "assign_header", "(", "$", "this", "->", "get_instance"...
Display a continue page after quickgrading. @param string $message - The message to display. @return string
[ "Display", "a", "continue", "page", "after", "quickgrading", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L3344-L3360
214,975
moodle/moodle
mod/assign/locallib.php
assign.can_view_grades
public function can_view_grades($groupid = null) { // Permissions check. if (!has_any_capability(array('mod/assign:viewgrades', 'mod/assign:grade'), $this->context)) { return false; } // Checks for the edge case when user belongs to no groups and groupmode is sep. if ...
php
public function can_view_grades($groupid = null) { // Permissions check. if (!has_any_capability(array('mod/assign:viewgrades', 'mod/assign:grade'), $this->context)) { return false; } // Checks for the edge case when user belongs to no groups and groupmode is sep. if ...
[ "public", "function", "can_view_grades", "(", "$", "groupid", "=", "null", ")", "{", "// Permissions check.", "if", "(", "!", "has_any_capability", "(", "array", "(", "'mod/assign:viewgrades'", ",", "'mod/assign:grade'", ")", ",", "$", "this", "->", "context", "...
Does this user have view grade or grade permission for this assignment? @param mixed $groupid int|null when is set to a value, use this group instead calculating it @return bool
[ "Does", "this", "user", "have", "view", "grade", "or", "grade", "permission", "for", "this", "assignment?" ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L3418-L3433
214,976
moodle/moodle
mod/assign/locallib.php
assign.add_to_log
public function add_to_log($action = '', $info = '', $url='', $return = false) { global $USER; $fullurl = 'view.php?id=' . $this->get_course_module()->id; if ($url != '') { $fullurl .= '&' . $url; } $args = array( $this->get_course()->id, 'as...
php
public function add_to_log($action = '', $info = '', $url='', $return = false) { global $USER; $fullurl = 'view.php?id=' . $this->get_course_module()->id; if ($url != '') { $fullurl .= '&' . $url; } $args = array( $this->get_course()->id, 'as...
[ "public", "function", "add_to_log", "(", "$", "action", "=", "''", ",", "$", "info", "=", "''", ",", "$", "url", "=", "''", ",", "$", "return", "=", "false", ")", "{", "global", "$", "USER", ";", "$", "fullurl", "=", "'view.php?id='", ".", "$", "...
Util function to add a message to the log. @deprecated since 2.7 - Use new events system instead. (see http://docs.moodle.org/dev/Migrating_logging_calls_in_plugins). @param string $action The current action @param string $info A detailed description of the change. But no more than 255 characters. @param string $url ...
[ "Util", "function", "to", "add", "a", "message", "to", "the", "log", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L3611-L3635
214,977
moodle/moodle
mod/assign/locallib.php
assign.get_renderer
public function get_renderer() { global $PAGE; if ($this->output) { return $this->output; } $this->output = $PAGE->get_renderer('mod_assign', null, RENDERER_TARGET_GENERAL); return $this->output; }
php
public function get_renderer() { global $PAGE; if ($this->output) { return $this->output; } $this->output = $PAGE->get_renderer('mod_assign', null, RENDERER_TARGET_GENERAL); return $this->output; }
[ "public", "function", "get_renderer", "(", ")", "{", "global", "$", "PAGE", ";", "if", "(", "$", "this", "->", "output", ")", "{", "return", "$", "this", "->", "output", ";", "}", "$", "this", "->", "output", "=", "$", "PAGE", "->", "get_renderer", ...
Lazy load the page renderer and expose the renderer to plugins. @return assign_renderer
[ "Lazy", "load", "the", "page", "renderer", "and", "expose", "the", "renderer", "to", "plugins", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L3642-L3649
214,978
moodle/moodle
mod/assign/locallib.php
assign.get_user_submission
public function get_user_submission($userid, $create, $attemptnumber=-1) { global $DB, $USER; if (!$userid) { $userid = $USER->id; } // If the userid is not null then use userid. $params = array('assignment'=>$this->get_instance()->id, 'userid'=>$userid, 'groupid'=>0...
php
public function get_user_submission($userid, $create, $attemptnumber=-1) { global $DB, $USER; if (!$userid) { $userid = $USER->id; } // If the userid is not null then use userid. $params = array('assignment'=>$this->get_instance()->id, 'userid'=>$userid, 'groupid'=>0...
[ "public", "function", "get_user_submission", "(", "$", "userid", ",", "$", "create", ",", "$", "attemptnumber", "=", "-", "1", ")", "{", "global", "$", "DB", ",", "$", "USER", ";", "if", "(", "!", "$", "userid", ")", "{", "$", "userid", "=", "$", ...
Load the submission object for a particular user, optionally creating it if required. For team assignments there are 2 submissions - the student submission and the team submission All files are associated with the team submission but the status of the students contribution is recorded separately. @param int $userid T...
[ "Load", "the", "submission", "object", "for", "a", "particular", "user", "optionally", "creating", "it", "if", "required", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L3663-L3722
214,979
moodle/moodle
mod/assign/locallib.php
assign.get_submission
protected function get_submission($submissionid) { global $DB; $params = array('assignment'=>$this->get_instance()->id, 'id'=>$submissionid); return $DB->get_record('assign_submission', $params, '*', MUST_EXIST); }
php
protected function get_submission($submissionid) { global $DB; $params = array('assignment'=>$this->get_instance()->id, 'id'=>$submissionid); return $DB->get_record('assign_submission', $params, '*', MUST_EXIST); }
[ "protected", "function", "get_submission", "(", "$", "submissionid", ")", "{", "global", "$", "DB", ";", "$", "params", "=", "array", "(", "'assignment'", "=>", "$", "this", "->", "get_instance", "(", ")", "->", "id", ",", "'id'", "=>", "$", "submissioni...
Load the submission object from it's id. @param int $submissionid The id of the submission we want @return stdClass The submission
[ "Load", "the", "submission", "object", "from", "it", "s", "id", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L3730-L3735
214,980
moodle/moodle
mod/assign/locallib.php
assign.get_user_flags
public function get_user_flags($userid, $create) { global $DB, $USER; // If the userid is not null then use userid. if (!$userid) { $userid = $USER->id; } $params = array('assignment'=>$this->get_instance()->id, 'userid'=>$userid); $flags = $DB->get_record(...
php
public function get_user_flags($userid, $create) { global $DB, $USER; // If the userid is not null then use userid. if (!$userid) { $userid = $USER->id; } $params = array('assignment'=>$this->get_instance()->id, 'userid'=>$userid); $flags = $DB->get_record(...
[ "public", "function", "get_user_flags", "(", "$", "userid", ",", "$", "create", ")", "{", "global", "$", "DB", ",", "$", "USER", ";", "// If the userid is not null then use userid.", "if", "(", "!", "$", "userid", ")", "{", "$", "userid", "=", "$", "USER",...
This will retrieve a user flags object from the db optionally creating it if required. The user flags was split from the user_grades table in 2.5. @param int $userid The user we are getting the flags for. @param bool $create If true the flags record will be created if it does not exist @return stdClass The flags recor...
[ "This", "will", "retrieve", "a", "user", "flags", "object", "from", "the", "db", "optionally", "creating", "it", "if", "required", ".", "The", "user", "flags", "was", "split", "from", "the", "user_grades", "table", "in", "2", ".", "5", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L3745-L3778
214,981
moodle/moodle
mod/assign/locallib.php
assign.get_user_grade
public function get_user_grade($userid, $create, $attemptnumber=-1) { global $DB, $USER; // If the userid is not null then use userid. if (!$userid) { $userid = $USER->id; } $submission = null; $params = array('assignment'=>$this->get_instance()->id, 'userid...
php
public function get_user_grade($userid, $create, $attemptnumber=-1) { global $DB, $USER; // If the userid is not null then use userid. if (!$userid) { $userid = $USER->id; } $submission = null; $params = array('assignment'=>$this->get_instance()->id, 'userid...
[ "public", "function", "get_user_grade", "(", "$", "userid", ",", "$", "create", ",", "$", "attemptnumber", "=", "-", "1", ")", "{", "global", "$", "DB", ",", "$", "USER", ";", "// If the userid is not null then use userid.", "if", "(", "!", "$", "userid", ...
This will retrieve a grade object from the db, optionally creating it if required. @param int $userid The user we are grading @param bool $create If true the grade will be created if it does not exist @param int $attemptnumber The attempt number to retrieve the grade for. -1 means the latest submission. @return stdCla...
[ "This", "will", "retrieve", "a", "grade", "object", "from", "the", "db", "optionally", "creating", "it", "if", "required", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L3788-L3844
214,982
moodle/moodle
mod/assign/locallib.php
assign.get_grade
protected function get_grade($gradeid) { global $DB; $params = array('assignment'=>$this->get_instance()->id, 'id'=>$gradeid); return $DB->get_record('assign_grades', $params, '*', MUST_EXIST); }
php
protected function get_grade($gradeid) { global $DB; $params = array('assignment'=>$this->get_instance()->id, 'id'=>$gradeid); return $DB->get_record('assign_grades', $params, '*', MUST_EXIST); }
[ "protected", "function", "get_grade", "(", "$", "gradeid", ")", "{", "global", "$", "DB", ";", "$", "params", "=", "array", "(", "'assignment'", "=>", "$", "this", "->", "get_instance", "(", ")", "->", "id", ",", "'id'", "=>", "$", "gradeid", ")", ";...
This will retrieve a grade object from the db. @param int $gradeid The id of the grade @return stdClass The grade record
[ "This", "will", "retrieve", "a", "grade", "object", "from", "the", "db", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L3852-L3857
214,983
moodle/moodle
mod/assign/locallib.php
assign.view_remove_submission_confirm
protected function view_remove_submission_confirm() { global $USER, $DB; $userid = optional_param('userid', $USER->id, PARAM_INT); if (!$this->can_edit_submission($userid, $USER->id)) { print_error('nopermission'); } $user = $DB->get_record('user', array('id' => $us...
php
protected function view_remove_submission_confirm() { global $USER, $DB; $userid = optional_param('userid', $USER->id, PARAM_INT); if (!$this->can_edit_submission($userid, $USER->id)) { print_error('nopermission'); } $user = $DB->get_record('user', array('id' => $us...
[ "protected", "function", "view_remove_submission_confirm", "(", ")", "{", "global", "$", "USER", ",", "$", "DB", ";", "$", "userid", "=", "optional_param", "(", "'userid'", ",", "$", "USER", "->", "id", ",", "PARAM_INT", ")", ";", "if", "(", "!", "$", ...
Show a confirmation page to make sure they want to remove submission data. @return string
[ "Show", "a", "confirmation", "page", "to", "make", "sure", "they", "want", "to", "remove", "submission", "data", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L4219-L4260
214,984
moodle/moodle
mod/assign/locallib.php
assign.view_reveal_identities_confirm
protected function view_reveal_identities_confirm() { require_capability('mod/assign:revealidentities', $this->get_context()); $o = ''; $header = new assign_header($this->get_instance(), $this->get_context(), false, ...
php
protected function view_reveal_identities_confirm() { require_capability('mod/assign:revealidentities', $this->get_context()); $o = ''; $header = new assign_header($this->get_instance(), $this->get_context(), false, ...
[ "protected", "function", "view_reveal_identities_confirm", "(", ")", "{", "require_capability", "(", "'mod/assign:revealidentities'", ",", "$", "this", "->", "get_context", "(", ")", ")", ";", "$", "o", "=", "''", ";", "$", "header", "=", "new", "assign_header",...
Show a confirmation page to make sure they want to release student identities. @return string
[ "Show", "a", "confirmation", "page", "to", "make", "sure", "they", "want", "to", "release", "student", "identities", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L4268-L4295
214,985
moodle/moodle
mod/assign/locallib.php
assign.view_return_links
protected function view_return_links() { $returnaction = optional_param('returnaction', '', PARAM_ALPHA); $returnparams = optional_param('returnparams', '', PARAM_TEXT); $params = array(); $returnparams = str_replace('&amp;', '&', $returnparams); parse_str($returnparams, $params...
php
protected function view_return_links() { $returnaction = optional_param('returnaction', '', PARAM_ALPHA); $returnparams = optional_param('returnparams', '', PARAM_TEXT); $params = array(); $returnparams = str_replace('&amp;', '&', $returnparams); parse_str($returnparams, $params...
[ "protected", "function", "view_return_links", "(", ")", "{", "$", "returnaction", "=", "optional_param", "(", "'returnaction'", ",", "''", ",", "PARAM_ALPHA", ")", ";", "$", "returnparams", "=", "optional_param", "(", "'returnparams'", ",", "''", ",", "PARAM_TEX...
View a link to go back to the previous page. Uses url parameters returnaction and returnparams. @return string
[ "View", "a", "link", "to", "go", "back", "to", "the", "previous", "page", ".", "Uses", "url", "parameters", "returnaction", "and", "returnparams", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L4302-L4314
214,986
moodle/moodle
mod/assign/locallib.php
assign.view_grader
protected function view_grader() { global $USER, $PAGE; $o = ''; // Need submit permission to submit an assignment. $this->require_view_grades(); $PAGE->set_pagelayout('embedded'); $courseshortname = $this->get_context()->get_course_context()->get_context_name(false, t...
php
protected function view_grader() { global $USER, $PAGE; $o = ''; // Need submit permission to submit an assignment. $this->require_view_grades(); $PAGE->set_pagelayout('embedded'); $courseshortname = $this->get_context()->get_course_context()->get_context_name(false, t...
[ "protected", "function", "view_grader", "(", ")", "{", "global", "$", "USER", ",", "$", "PAGE", ";", "$", "o", "=", "''", ";", "// Need submit permission to submit an assignment.", "$", "this", "->", "require_view_grades", "(", ")", ";", "$", "PAGE", "->", "...
View entire grader app. @return string
[ "View", "entire", "grader", "app", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L4510-L4549
214,987
moodle/moodle
mod/assign/locallib.php
assign.view_grading_page
protected function view_grading_page() { global $CFG; $o = ''; // Need submit permission to submit an assignment. $this->require_view_grades(); require_once($CFG->dirroot . '/mod/assign/gradeform.php'); $this->add_grade_notices(); // Only load this if it is. ...
php
protected function view_grading_page() { global $CFG; $o = ''; // Need submit permission to submit an assignment. $this->require_view_grades(); require_once($CFG->dirroot . '/mod/assign/gradeform.php'); $this->add_grade_notices(); // Only load this if it is. ...
[ "protected", "function", "view_grading_page", "(", ")", "{", "global", "$", "CFG", ";", "$", "o", "=", "''", ";", "// Need submit permission to submit an assignment.", "$", "this", "->", "require_view_grades", "(", ")", ";", "require_once", "(", "$", "CFG", "->"...
View entire grading page. @return string
[ "View", "entire", "grading", "page", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L4555-L4573
214,988
moodle/moodle
mod/assign/locallib.php
assign.plagiarism_print_disclosure
protected function plagiarism_print_disclosure() { global $CFG; $o = ''; if (!empty($CFG->enableplagiarism)) { require_once($CFG->libdir . '/plagiarismlib.php'); $o .= plagiarism_print_disclosure($this->get_course_module()->id); } return $o; }
php
protected function plagiarism_print_disclosure() { global $CFG; $o = ''; if (!empty($CFG->enableplagiarism)) { require_once($CFG->libdir . '/plagiarismlib.php'); $o .= plagiarism_print_disclosure($this->get_course_module()->id); } return $o; }
[ "protected", "function", "plagiarism_print_disclosure", "(", ")", "{", "global", "$", "CFG", ";", "$", "o", "=", "''", ";", "if", "(", "!", "empty", "(", "$", "CFG", "->", "enableplagiarism", ")", ")", "{", "require_once", "(", "$", "CFG", "->", "libdi...
Capture the output of the plagiarism plugins disclosures and return it as a string. @return string
[ "Capture", "the", "output", "of", "the", "plagiarism", "plugins", "disclosures", "and", "return", "it", "as", "a", "string", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L4580-L4591
214,989
moodle/moodle
mod/assign/locallib.php
assign.view_notices
protected function view_notices($title, $notices) { global $CFG; $o = ''; $header = new assign_header($this->get_instance(), $this->get_context(), $this->show_intro(), $this->get_course_...
php
protected function view_notices($title, $notices) { global $CFG; $o = ''; $header = new assign_header($this->get_instance(), $this->get_context(), $this->show_intro(), $this->get_course_...
[ "protected", "function", "view_notices", "(", "$", "title", ",", "$", "notices", ")", "{", "global", "$", "CFG", ";", "$", "o", "=", "''", ";", "$", "header", "=", "new", "assign_header", "(", "$", "this", "->", "get_instance", "(", ")", ",", "$", ...
Message for students when assignment submissions have been closed. @param string $title The page title @param array $notices The array of notices to show. @return string
[ "Message", "for", "students", "when", "assignment", "submissions", "have", "been", "closed", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L4600-L4622
214,990
moodle/moodle
mod/assign/locallib.php
assign.fullname
public function fullname($user) { if ($this->is_blind_marking()) { $hasviewblind = has_capability('mod/assign:viewblinddetails', $this->get_context()); if (empty($user->recordid)) { $uniqueid = $this->get_uniqueid_for_user($user->id); } else { ...
php
public function fullname($user) { if ($this->is_blind_marking()) { $hasviewblind = has_capability('mod/assign:viewblinddetails', $this->get_context()); if (empty($user->recordid)) { $uniqueid = $this->get_uniqueid_for_user($user->id); } else { ...
[ "public", "function", "fullname", "(", "$", "user", ")", "{", "if", "(", "$", "this", "->", "is_blind_marking", "(", ")", ")", "{", "$", "hasviewblind", "=", "has_capability", "(", "'mod/assign:viewblinddetails'", ",", "$", "this", "->", "get_context", "(", ...
Get the name for a user - hiding their real name if blind marking is on. @param stdClass $user The user record as required by fullname() @return string The name.
[ "Get", "the", "name", "for", "a", "user", "-", "hiding", "their", "real", "name", "if", "blind", "marking", "is", "on", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L4630-L4647
214,991
moodle/moodle
mod/assign/locallib.php
assign.view_edit_submission_page
protected function view_edit_submission_page($mform, $notices) { global $CFG, $USER, $DB; $o = ''; require_once($CFG->dirroot . '/mod/assign/submission_form.php'); // Need submit permission to submit an assignment. $userid = optional_param('userid', $USER->id, PARAM_INT); ...
php
protected function view_edit_submission_page($mform, $notices) { global $CFG, $USER, $DB; $o = ''; require_once($CFG->dirroot . '/mod/assign/submission_form.php'); // Need submit permission to submit an assignment. $userid = optional_param('userid', $USER->id, PARAM_INT); ...
[ "protected", "function", "view_edit_submission_page", "(", "$", "mform", ",", "$", "notices", ")", "{", "global", "$", "CFG", ",", "$", "USER", ",", "$", "DB", ";", "$", "o", "=", "''", ";", "require_once", "(", "$", "CFG", "->", "dirroot", ".", "'/m...
View edit submissions page. @param moodleform $mform @param array $notices A list of notices to display at the top of the edit submission form (e.g. from plugins). @return string The page output.
[ "View", "edit", "submissions", "page", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L4657-L4723
214,992
moodle/moodle
mod/assign/locallib.php
assign.is_graded
protected function is_graded($userid) { $grade = $this->get_user_grade($userid, false); if ($grade) { return ($grade->grade !== null && $grade->grade >= 0); } return false; }
php
protected function is_graded($userid) { $grade = $this->get_user_grade($userid, false); if ($grade) { return ($grade->grade !== null && $grade->grade >= 0); } return false; }
[ "protected", "function", "is_graded", "(", "$", "userid", ")", "{", "$", "grade", "=", "$", "this", "->", "get_user_grade", "(", "$", "userid", ",", "false", ")", ";", "if", "(", "$", "grade", ")", "{", "return", "(", "$", "grade", "->", "grade", "...
See if this assignment has a grade yet. @param int $userid @return bool
[ "See", "if", "this", "assignment", "has", "a", "grade", "yet", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L4731-L4737
214,993
moodle/moodle
mod/assign/locallib.php
assign.view_plugin_grading_batch_operation
protected function view_plugin_grading_batch_operation($mform) { require_capability('mod/assign:grade', $this->context); $prefix = 'plugingradingbatchoperation_'; if ($data = $mform->get_data()) { $tail = substr($data->operation, strlen($prefix)); list($plugintype, $acti...
php
protected function view_plugin_grading_batch_operation($mform) { require_capability('mod/assign:grade', $this->context); $prefix = 'plugingradingbatchoperation_'; if ($data = $mform->get_data()) { $tail = substr($data->operation, strlen($prefix)); list($plugintype, $acti...
[ "protected", "function", "view_plugin_grading_batch_operation", "(", "$", "mform", ")", "{", "require_capability", "(", "'mod/assign:grade'", ",", "$", "this", "->", "context", ")", ";", "$", "prefix", "=", "'plugingradingbatchoperation_'", ";", "if", "(", "$", "d...
Allows the plugin to show a batch grading operation page. @param moodleform $mform @return none
[ "Allows", "the", "plugin", "to", "show", "a", "batch", "grading", "operation", "page", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L4807-L4824
214,994
moodle/moodle
mod/assign/locallib.php
assign.view_batch_set_workflow_state
protected function view_batch_set_workflow_state($mform) { global $CFG, $DB; require_once($CFG->dirroot . '/mod/assign/batchsetmarkingworkflowstateform.php'); $o = ''; $submitteddata = $mform->get_data(); $users = $submitteddata->selectedusers; $userlist = explode(',',...
php
protected function view_batch_set_workflow_state($mform) { global $CFG, $DB; require_once($CFG->dirroot . '/mod/assign/batchsetmarkingworkflowstateform.php'); $o = ''; $submitteddata = $mform->get_data(); $users = $submitteddata->selectedusers; $userlist = explode(',',...
[ "protected", "function", "view_batch_set_workflow_state", "(", "$", "mform", ")", "{", "global", "$", "CFG", ",", "$", "DB", ";", "require_once", "(", "$", "CFG", "->", "dirroot", ".", "'/mod/assign/batchsetmarkingworkflowstateform.php'", ")", ";", "$", "o", "="...
Shows a form that allows the workflow state for selected submissions to be changed. @param moodleform $mform Set to a grading batch operations form @return string - the page to view after processing these actions
[ "Shows", "a", "form", "that", "allows", "the", "workflow", "state", "for", "selected", "submissions", "to", "be", "changed", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L4915-L4971
214,995
moodle/moodle
mod/assign/locallib.php
assign.view_batch_markingallocation
public function view_batch_markingallocation($mform) { global $CFG, $DB; require_once($CFG->dirroot . '/mod/assign/batchsetallocatedmarkerform.php'); $o = ''; $submitteddata = $mform->get_data(); $users = $submitteddata->selectedusers; $userlist = explode(',', $users);...
php
public function view_batch_markingallocation($mform) { global $CFG, $DB; require_once($CFG->dirroot . '/mod/assign/batchsetallocatedmarkerform.php'); $o = ''; $submitteddata = $mform->get_data(); $users = $submitteddata->selectedusers; $userlist = explode(',', $users);...
[ "public", "function", "view_batch_markingallocation", "(", "$", "mform", ")", "{", "global", "$", "CFG", ",", "$", "DB", ";", "require_once", "(", "$", "CFG", "->", "dirroot", ".", "'/mod/assign/batchsetallocatedmarkerform.php'", ")", ";", "$", "o", "=", "''",...
Shows a form that allows the allocated marker for selected submissions to be changed. @param moodleform $mform Set to a grading batch operations form @return string - the page to view after processing these actions
[ "Shows", "a", "form", "that", "allows", "the", "allocated", "marker", "for", "selected", "submissions", "to", "be", "changed", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L4979-L5044
214,996
moodle/moodle
mod/assign/locallib.php
assign.check_submit_for_grading
protected function check_submit_for_grading($mform) { global $USER, $CFG; require_once($CFG->dirroot . '/mod/assign/submissionconfirmform.php'); // Check that all of the submission plugins are ready for this submission. $notifications = array(); $submission = $this->get_user_su...
php
protected function check_submit_for_grading($mform) { global $USER, $CFG; require_once($CFG->dirroot . '/mod/assign/submissionconfirmform.php'); // Check that all of the submission plugins are ready for this submission. $notifications = array(); $submission = $this->get_user_su...
[ "protected", "function", "check_submit_for_grading", "(", "$", "mform", ")", "{", "global", "$", "USER", ",", "$", "CFG", ";", "require_once", "(", "$", "CFG", "->", "dirroot", ".", "'/mod/assign/submissionconfirmform.php'", ")", ";", "// Check that all of the submi...
Ask the user to confirm they want to submit their work for grading. @param moodleform $mform - null unless form validation has failed @return string
[ "Ask", "the", "user", "to", "confirm", "they", "want", "to", "submit", "their", "work", "for", "grading", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L5052-L5106
214,997
moodle/moodle
mod/assign/locallib.php
assign.get_assign_attempt_history_renderable
public function get_assign_attempt_history_renderable($user) { $allsubmissions = $this->get_all_submissions($user->id); $allgrades = $this->get_all_grades($user->id); $history = new assign_attempt_history($allsubmissions, $allgrades, ...
php
public function get_assign_attempt_history_renderable($user) { $allsubmissions = $this->get_all_submissions($user->id); $allgrades = $this->get_all_grades($user->id); $history = new assign_attempt_history($allsubmissions, $allgrades, ...
[ "public", "function", "get_assign_attempt_history_renderable", "(", "$", "user", ")", "{", "$", "allsubmissions", "=", "$", "this", "->", "get_all_submissions", "(", "$", "user", "->", "id", ")", ";", "$", "allgrades", "=", "$", "this", "->", "get_all_grades",...
Creates an assign_attempt_history renderable. @param stdClass $user the user to get the report for @return assign_attempt_history renderable object
[ "Creates", "an", "assign_attempt_history", "renderable", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L5310-L5326
214,998
moodle/moodle
mod/assign/locallib.php
assign.view_student_summary
public function view_student_summary($user, $showlinks) { $o = ''; if ($this->can_view_submission($user->id)) { if (has_capability('mod/assign:submit', $this->get_context(), $user, false)) { $submissionstatus = $this->get_assign_submission_status_renderable($user, $showlin...
php
public function view_student_summary($user, $showlinks) { $o = ''; if ($this->can_view_submission($user->id)) { if (has_capability('mod/assign:submit', $this->get_context(), $user, false)) { $submissionstatus = $this->get_assign_submission_status_renderable($user, $showlin...
[ "public", "function", "view_student_summary", "(", "$", "user", ",", "$", "showlinks", ")", "{", "$", "o", "=", "''", ";", "if", "(", "$", "this", "->", "can_view_submission", "(", "$", "user", "->", "id", ")", ")", "{", "if", "(", "has_capability", ...
Print 2 tables of information with no action links - the submission summary and the grading summary. @param stdClass $user the user to print the report for @param bool $showlinks - Return plain text or links to the profile @return string - the html summary
[ "Print", "2", "tables", "of", "information", "with", "no", "action", "links", "-", "the", "submission", "summary", "and", "the", "grading", "summary", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L5336-L5360
214,999
moodle/moodle
mod/assign/locallib.php
assign.show_submit_button
protected function show_submit_button($submission = null, $teamsubmission = null, $userid = null) { if ($teamsubmission) { if ($teamsubmission->status === ASSIGN_SUBMISSION_STATUS_SUBMITTED) { // The assignment submission has been completed. return false; ...
php
protected function show_submit_button($submission = null, $teamsubmission = null, $userid = null) { if ($teamsubmission) { if ($teamsubmission->status === ASSIGN_SUBMISSION_STATUS_SUBMITTED) { // The assignment submission has been completed. return false; ...
[ "protected", "function", "show_submit_button", "(", "$", "submission", "=", "null", ",", "$", "teamsubmission", "=", "null", ",", "$", "userid", "=", "null", ")", "{", "if", "(", "$", "teamsubmission", ")", "{", "if", "(", "$", "teamsubmission", "->", "s...
Returns true if the submit subsission button should be shown to the user. @param stdClass $submission The users own submission record. @param stdClass $teamsubmission The users team submission record if there is one @param int $userid The user @return bool
[ "Returns", "true", "if", "the", "submit", "subsission", "button", "should", "be", "shown", "to", "the", "user", "." ]
a411b499b98afc9901c24a9466c7e322946a04aa
https://github.com/moodle/moodle/blob/a411b499b98afc9901c24a9466c7e322946a04aa/mod/assign/locallib.php#L5370-L5401