Compare commits

...

12 Commits

Author SHA1 Message Date
Ilya Tregubov b798633ae0 Moodle release 4.4rc1 2024-04-16 17:14:27 +08:00
Huong Nguyen 7cb20672a7 MDL-81238 quiz: Fix maximum grade alignment 2024-04-16 10:18:33 +07:00
Huong Nguyen 272dd474f9 Merge branch 'MDL-81238-main' of https://github.com/lucaboesch/moodle 2024-04-16 10:16:27 +07:00
Jun Pataleta 9f081d8328 Merge branch 'MDL-80426-main-2' of https://github.com/rezaies/moodle 2024-04-16 11:07:06 +08:00
Shamim Rezaie b32617e346 MDL-80426 qtype_ordering: An announcement region to announce reorders 2024-04-15 20:07:11 +10:00
Shamim Rezaie eccfb73839 MDL-80426 qtype_ordering: Remove the unintuitive keyboard handling code
Users can now rearrange options using the move buttons that each option
have, therefore there is no need for the current unintuitive keyboard
interaction implementation in the ordering question type plugin.
2024-04-15 20:07:11 +10:00
Shamim Rezaie 84034c62f0 MDL-80426 qtype_ordering: Move options by single pointer
Each option has a couple of buttons to move the option's position. This
allows moving options by single pointer without dragging to address WCAG
 Success Criterion 2.5.7.
Having the buttons also addresses WCAG Success Criterion 2.1.1 as it
provides an intuitive way to move options using keyboard.
2024-04-15 20:07:11 +10:00
Andrew Nicols 613f933442 Merge branch 'MDL-80820' of https://github.com/marinaglancy/moodle 2024-04-15 10:42:22 +08:00
Luca Bösch 444a1acf63 MDL-81238 mod_data: Align search form with BS5 correctly again. 2024-04-14 20:26:51 +02:00
Luca Bösch a3a9a48374 MDL-81238 quiz: Align maximum grade with BS5 correctly again. 2024-04-14 20:26:51 +02:00
Marina Glancy 42c76b711a MDL-80820 lib/pear: phpdoc corrections 2024-04-08 10:13:39 +01:00
Marina Glancy ef1759da74 MDL-80820 various: fix incorrect phpdocs 2024-04-08 10:13:10 +01:00
68 changed files with 411 additions and 343 deletions
@@ -40,7 +40,7 @@ require_once($CFG->libdir.'/formslib.php');
*/
class verify_age_location_page implements renderable, templatable {
/** @var mform The form object */
/** @var \moodleform The form object */
protected $form;
/** @var string Error message */
@@ -49,7 +49,7 @@ class verify_age_location_page implements renderable, templatable {
/**
* Constructor
*
* @param mform $form The form object
* @param \moodleform $form The form object
* @param string $errormessage The error message.
*/
public function __construct($form, $errormessage = null) {
@@ -61,7 +61,7 @@ class verify_age_location_page implements renderable, templatable {
* Export the page data for the mustache template.
*
* @param renderer_base $output renderer to be used to render the page elements.
* @return stdClass
* @return \stdClass
*/
public function export_for_template(renderer_base $output) {
global $SITE;
+3 -3
View File
@@ -543,7 +543,7 @@ class comment {
*
* @param int $page
* @param str $sortdirection sort direction, ASC or DESC
* @return array
* @return array|false
*/
public function get_comments($page = '', $sortdirection = 'DESC') {
global $DB, $CFG, $USER, $OUTPUT;
@@ -956,7 +956,7 @@ class comment {
/**
* Revoke validate callbacks
*
* @param stdClass $params addtionall parameters need to add to callbacks
* @param array $params addtionall parameters need to add to callbacks
*/
protected function validate($params=array()) {
foreach ($params as $key=>$value) {
@@ -1074,7 +1074,7 @@ class comment {
/**
* Returns the comment area associated with the commentarea
*
* @return stdClass
* @return string
*/
public function get_commentarea() {
return $this->commentarea;
+1 -1
View File
@@ -242,7 +242,7 @@ class comment_manager {
* @param stdClass $context context object
* @param string $component component name
* @param int $since the time to check
* @param stdClass $cm course module object
* @param stdClass|\cm_info|null $cm course module object
* @return array list of comments db records since the given timelimit
* @since Moodle 3.2
*/
+14 -15
View File
@@ -97,7 +97,6 @@ abstract class base {
*
* @param string $format
* @param int $courseid
* @return course_format
*/
protected function __construct($format, $courseid) {
$this->format = $format;
@@ -315,7 +314,7 @@ abstract class base {
* Returns a record from course database table plus additional fields
* that course format defines
*
* @return stdClass
* @return ?stdClass
*/
public function get_course() {
global $DB;
@@ -503,7 +502,7 @@ abstract class base {
*
* @param int|stdClass $section either section number (field course_section.section) or row from course_section table
* @param int $strictness
* @return section_info
* @return ?section_info
*/
final public function get_section($section, $strictness = IGNORE_MISSING) {
if (is_object($section)) {
@@ -847,7 +846,7 @@ abstract class base {
*
* Used in course/rest.php
*
* @return array This will be passed in ajax respose
* @return ?array This will be passed in ajax respose
*/
public function ajax_section_move() {
return null;
@@ -958,7 +957,7 @@ abstract class base {
* Also note that if $navigation->includesectionnum is not null, the section with this relative
* number needs is expected to be loaded
*
* @param global_navigation $navigation
* @param \global_navigation $navigation
* @param navigation_node $node The course node within the navigation
*/
public function extend_course_navigation($navigation, navigation_node $node) {
@@ -1194,7 +1193,7 @@ abstract class base {
*
* This function is called from course_edit_form::definition_after_data()
*
* @param MoodleQuickForm $mform form the elements are added to
* @param \MoodleQuickForm $mform form the elements are added to
* @param bool $forsection 'true' if this is a section edit form, 'false' if this is course edit form
* @return array array of references to the added form elements
*/
@@ -1424,7 +1423,7 @@ abstract class base {
* @param array $customdata the array with custom data to be passed to the form
* /course/editsection.php passes section_info object in 'cs' field
* for filling availability fields
* @return moodleform
* @return \moodleform
*/
public function editsection_form($action, $customdata = array()) {
global $CFG;
@@ -1470,7 +1469,7 @@ abstract class base {
* Return instance of format_FORMATNAME_XXX in this function, the appropriate method from
* plugin renderer will be called
*
* @return null|renderable null for no output or object with data for plugin renderer
* @return null|\renderable null for no output or object with data for plugin renderer
*/
public function course_header() {
return null;
@@ -1482,7 +1481,7 @@ abstract class base {
*
* See course_format::course_header() for usage
*
* @return null|renderable null for no output or object with data for plugin renderer
* @return null|\renderable null for no output or object with data for plugin renderer
*/
public function course_footer() {
return null;
@@ -1493,7 +1492,7 @@ abstract class base {
*
* See course_format::course_header() for usage
*
* @return null|renderable null for no output or object with data for plugin renderer
* @return null|\renderable null for no output or object with data for plugin renderer
*/
public function course_content_header() {
return null;
@@ -1504,7 +1503,7 @@ abstract class base {
*
* See course_format::course_header() for usage
*
* @return null|renderable null for no output or object with data for plugin renderer
* @return null|\renderable null for no output or object with data for plugin renderer
*/
public function course_content_footer() {
return null;
@@ -1514,7 +1513,7 @@ abstract class base {
* Returns instance of page renderer used by this plugin
*
* @param moodle_page $page
* @return renderer_base
* @return \renderer_base
*/
public function get_renderer(moodle_page $page) {
try {
@@ -1844,7 +1843,7 @@ abstract class base {
* @param stdClass $section
* @param string $itemtype
* @param mixed $newvalue
* @return \core\output\inplace_editable
* @return ?\core\output\inplace_editable
*/
public function inplace_editable_update_section_name($section, $itemtype, $newvalue) {
if ($itemtype === 'sectionname' || $itemtype === 'sectionnamenl') {
@@ -1868,7 +1867,7 @@ abstract class base {
* moodlecourse/courseduration setting. Course formats like format_weeks for
* example can overwrite this method and return a value based on their internal options.
*
* @param moodleform $mform
* @param \MoodleQuickForm $mform
* @param array $fieldnames The form - field names mapping.
* @return int
*/
@@ -1911,7 +1910,7 @@ abstract class base {
/**
* Get the start date value from the course settings page form.
*
* @param moodleform $mform
* @param \MoodleQuickForm $mform
* @param array $fieldnames The form - field names mapping.
* @return int
*/
+9 -9
View File
@@ -290,7 +290,7 @@ function build_mnet_logs_array($hostid, $course, $user=0, $date=0, $order="l.tim
* course modules from sequences. Only to be used in site maintenance mode when we are
* sure that another user is not in the middle of the process of moving/removing a module.
* @param bool $checkonly Only performs the check without updating DB, outputs all errors as debug messages.
* @return array array of messages with found problems. Empty output means everything is ok
* @return array|false array of messages with found problems. Empty output means everything is ok
*/
function course_integrity_check($courseid, $rawmods = null, $sections = null, $fullcheck = false, $checkonly = false) {
global $DB;
@@ -916,7 +916,7 @@ function course_delete_module($cmid, $async = false) {
* The real deletion of the module is handled by the task, which calls 'course_delete_module($cmid)'.
*
* @param int $cmid the course module id.
* @return bool whether the module was successfully scheduled for deletion.
* @return ?bool whether the module was successfully scheduled for deletion.
* @throws \moodle_exception
*/
function course_module_flag_for_async_deletion($cmid) {
@@ -1244,7 +1244,7 @@ function course_delete_section_async($section, $forcedeleteifnotempty = true) {
* This function does not check permissions or clean values - this has to be done prior to calling it.
*
* @param int|stdClass $courseorid
* @param stdClass $section record from course_sections table - it will be updated with the new values
* @param stdClass|section_info $section record from course_sections table - it will be updated with the new values
* @param array|stdClass $data
*/
function course_update_section($courseorid, $section, $data) {
@@ -1306,7 +1306,7 @@ function course_can_delete_section($course, $section) {
* @param array $sections
* @param int $origin_position
* @param int $target_position
* @return array
* @return array|false
*/
function reorder_sections($sections, $origin_position, $target_position) {
if (!is_array($sections)) {
@@ -1614,7 +1614,7 @@ function course_get_cm_edit_actions(cm_info $mod, $indent = -1, $sr = null) {
*
* @param cm_info $mod The module to produce a move button for
* @param int $sr The section to link back to (used for creating the links)
* @return The markup for the move action, or an empty string if not available.
* @return string The markup for the move action, or an empty string if not available.
*/
function course_get_cm_move(cm_info $mod, $sr = null) {
global $OUTPUT;
@@ -1861,7 +1861,7 @@ function can_delete_course($courseid) {
* Save the Your name for 'Some role' strings.
*
* @param integer $courseid the id of this course.
* @param array $data the data that came from the course settings form.
* @param array|stdClass $data the data that came from the course settings form.
*/
function save_local_role_names($courseid, $data) {
global $DB;
@@ -3100,7 +3100,7 @@ function update_module($moduleinfo) {
* @param object $cm The course module to duplicate
* @param int $sr The section to link back to (used for creating the links)
* @throws moodle_exception if the plugin doesn't support duplication
* @return Object containing:
* @return stdClass Object containing:
* - fullcontent: The HTML markup for the created CM
* - cmid: The CMID of the newly created CM
* - redirect: Whether to trigger a redirect following this change
@@ -3476,7 +3476,7 @@ function course_get_tagged_courses($tag, $exclusivemode = false, $fromctx = 0, $
* @param string $itemtype
* @param int $itemid
* @param mixed $newvalue
* @return \core\output\inplace_editable
* @return ?\core\output\inplace_editable
*/
function core_course_inplace_editable($itemtype, $itemid, $newvalue) {
if ($itemtype === 'activityname') {
@@ -3565,7 +3565,7 @@ function core_course_drawer(): string {
* @param int $contextid context id where to search for records
* @param bool $recursivecontext search in subcontexts as well
* @param int $page 0-based number of page being displayed
* @return \core_tag\output\tagindex
* @return ?\core_tag\output\tagindex
*/
function course_get_tagged_course_modules($tag, $exclusivemode = false, $fromcontextid = 0, $contextid = 0,
$recursivecontext = 1, $page = 0) {
+1 -1
View File
@@ -499,7 +499,7 @@ function set_moduleinfo_defaults($moduleinfo) {
* Check that the user can add a module. Also returns some information like the module, context and course section info.
* The fucntion create the course section if it doesn't exist.
*
* @param object $course the course of the module
* @param stdClass $course the course of the module
* @param string $modulename the module name
* @param int $sectionnum the section of the module
* @return array list containing module, context, course section.
+4 -4
View File
@@ -383,7 +383,7 @@ function get_role_definitions_uncached(array $roleids) {
* Get the default guest role, this is used for guest account,
* search engine spiders, etc.
*
* @return stdClass role record
* @return stdClass|false role record
*/
function get_guest_role() {
global $CFG, $DB;
@@ -970,7 +970,7 @@ function get_empty_accessdata() {
* @access private
* @param int $userid
* @param bool $preloadonly true means do not return access array
* @return array accessdata
* @return ?array accessdata
*/
function get_user_accessdata($userid, $preloadonly=false) {
global $CFG, $ACCESSLIB_PRIVATE, $USER;
@@ -2587,7 +2587,7 @@ function is_inside_frontpage(context $context) {
* Returns capability information (cached)
*
* @param string $capabilityname
* @return stdClass or null if capability not found
* @return ?stdClass object or null if capability not found
*/
function get_capability_info($capabilityname) {
$caps = get_all_capabilities();
@@ -2619,7 +2619,7 @@ function get_capability_info($capabilityname) {
* Do not use this function except in the get_capability_info
*
* @param string $capabilityname
* @return stdClass|null with deprecation message and potential replacement if not null
* @return array|null with deprecation message and potential replacement if not null
*/
function get_deprecated_capability_info($capabilityname) {
$cache = cache::make('core', 'capabilities');
+26 -26
View File
@@ -729,7 +729,7 @@ interface part_of_admin_tree {
/**
* Mostly useful for removing of some parts of the tree in admin tree block.
*
* @return True is hidden from normal list view
* @return bool True is hidden from normal list view
*/
public function is_hidden();
@@ -1723,7 +1723,7 @@ abstract class admin_setting {
public $description;
/** @var mixed Can be string or array of string */
public $defaultsetting;
/** @var string */
/** @var ?callable */
public $updatedcallback;
/** @var mixed can be String or Null. Null means main config table */
public $plugin; // null means main config table
@@ -1888,7 +1888,7 @@ abstract class admin_setting {
/**
* Write the values of the flags for this admin setting.
*
* @param array $data - The data submitted from the form or null to set the default value for new installs.
* @param ?array $data - The data submitted from the form or null to set the default value for new installs.
* @return bool - true if successful.
*/
public function write_setting_flags($data) {
@@ -2065,7 +2065,7 @@ abstract class admin_setting {
/**
* Function called if setting updated - cleanup, cache reset, etc.
* @param string $functionname Sets the function name
* @param callable $functionname Sets the function name
* @return void
*/
public function set_updatedcallback($functionname) {
@@ -2196,9 +2196,9 @@ class admin_setting_flag {
private $shortname = '';
/** @var string String used as the label for this flag */
private $displayname = '';
/** @var Checkbox for this flag is displayed in admin page */
/** @var bool Checkbox for this flag is displayed in admin page */
const ENABLED = true;
/** @var Checkbox for this flag is not displayed in admin page */
/** @var bool Checkbox for this flag is not displayed in admin page */
const DISABLED = false;
/**
@@ -3175,8 +3175,8 @@ class admin_setting_configmulticheckbox extends admin_setting {
* @param string $name unique ascii name, either 'mysetting' for settings that in config, or 'myplugin/mysetting' for ones in config_plugins.
* @param string $visiblename localised
* @param string $description long localised info
* @param array $defaultsetting array of selected
* @param array|callable $choices array of $value => $label for each checkbox, or a callback
* @param ?array $defaultsetting array of selected
* @param array|callable|null $choices array of $value => $label for each checkbox, or a callback
*/
public function __construct($name, $visiblename, $description, $defaultsetting, $choices) {
if (is_array($choices)) {
@@ -3421,7 +3421,7 @@ class admin_setting_configselect extends admin_setting {
* @param string $name unique ascii name, either 'mysetting' for settings that in config, or 'myplugin/mysetting' for ones in config_plugins.
* @param string $visiblename localised
* @param string $description long localised info
* @param string|int $defaultsetting
* @param string|int|array $defaultsetting
* @param array|callable|null $choices array of $value=>$label for each selection, or callback
*/
public function __construct($name, $visiblename, $description, $defaultsetting, $choices) {
@@ -3658,7 +3658,7 @@ class admin_setting_configmultiselect extends admin_setting_configselect {
* @param string $visiblename localised
* @param string $description long localised info
* @param array $defaultsetting array of selected items
* @param array $choices array of $value=>$label for each list item
* @param ?array $choices array of $value=>$label for each list item
*/
public function __construct($name, $visiblename, $description, $defaultsetting, $choices) {
parent::__construct($name, $visiblename, $description, $defaultsetting, $choices);
@@ -3856,7 +3856,7 @@ class admin_setting_configtime extends admin_setting {
* Store the time (hours and minutes)
*
* @param array $data Must be form 'h'=>xx, 'm'=>xx
* @return bool true if success, false if not
* @return string error message or empty string on success
*/
public function write_setting($data) {
if (!is_array($data)) {
@@ -4097,7 +4097,7 @@ class admin_setting_configduration extends admin_setting {
* Store the duration as seconds.
*
* @param array $data Must be form 'h'=>xx, 'm'=>xx
* @return bool true if success, false if not
* @return string error message or empty string on success
*/
public function write_setting($data) {
if (!is_array($data)) {
@@ -5098,7 +5098,7 @@ class admin_setting_emoticons extends admin_setting {
/**
* Return the current setting(s)
*
* @return array Current settings array
* @return ?array Current settings array
*/
public function get_setting() {
global $CFG;
@@ -5122,7 +5122,7 @@ class admin_setting_emoticons extends admin_setting {
* Save selected settings
*
* @param array $data Array of settings to save
* @return bool
* @return string error message or empty string on success
*/
public function write_setting($data) {
@@ -5321,7 +5321,7 @@ class admin_setting_langlist extends admin_setting_configtext {
* Save the new setting
*
* @param string $data The new setting
* @return bool
* @return string error message or empty string on success
*/
public function write_setting($data) {
$return = parent::write_setting($data);
@@ -5620,7 +5620,7 @@ class admin_setting_special_calendar_weekend extends admin_setting {
* Save the new settings
*
* @param array $data Array of new settings
* @return bool
* @return string error message or empty string on success
*/
public function write_setting($data) {
if (!is_array($data)) {
@@ -5740,7 +5740,7 @@ class admin_setting_pickroles extends admin_setting_configmulticheckbox {
/**
* Return the default setting for this control
*
* @return array Array of default settings
* @return ?array Array of default settings
*/
public function get_defaultsetting() {
global $CFG;
@@ -6364,7 +6364,7 @@ class admin_setting_gradecat_combo extends admin_setting {
/**
* Return the current setting(s) array
*
* @return array Array of value=>xx, forced=>xx
* @return ?array Array of value=>xx, forced=>xx
*/
public function get_setting() {
global $CFG;
@@ -7130,7 +7130,7 @@ class admin_page_manageportfolios extends admin_externalpage {
/**
* Searches page for the specified string.
* @param string $query The string to search for
* @return bool True if it is found on this page
* @return array
*/
public function search($query) {
global $CFG;
@@ -7181,7 +7181,7 @@ class admin_page_managerepositories extends admin_externalpage {
/**
* Searches page for the specified string.
* @param string $query The string to search for
* @return bool True if it is found on this page
* @return array
*/
public function search($query) {
global $CFG;
@@ -8150,7 +8150,7 @@ abstract class admin_setting_manage_plugins extends admin_setting {
/**
* Get the type of plugin to manage.
*
* @param plugininfo The plugin info class.
* @param \core\plugininfo\base $plugininfo The plugin info class.
* @return string
*/
abstract public function get_info_column($plugininfo);
@@ -9194,7 +9194,7 @@ function admin_output_new_settings_by_page($node) {
* @param string $description
* @param mixed $label link label to id, true by default or string being the label to connect it to
* @param string $warning warning text
* @param sting $defaultinfo defaults info, null means nothing, '' is converted to "Empty" string, defaults to null
* @param ?string $defaultinfo defaults info, null means nothing, '' is converted to "Empty" string, defaults to null
* @param string $query search query to be highlighted
* @return string XHTML
*/
@@ -9692,7 +9692,7 @@ class admin_setting_enablemobileservice extends admin_setting_configcheckbox {
/**
* Set the 'webservice/rest:use' to the Authenticated user role (allow or not)
* @param type $status true to allow, false to not set
* @param bool $status true to allow, false to not set
*/
private function set_protocol_cap($status) {
global $CFG;
@@ -10472,7 +10472,7 @@ class admin_setting_configcolourpicker extends admin_setting {
* Saves the setting
*
* @param string $data
* @return bool
* @return string error message or empty string on success
*/
public function write_setting($data) {
$data = $this->validate($data);
@@ -10794,7 +10794,7 @@ class admin_setting_devicedetectregex extends admin_setting {
*
* @deprecated Moodle 4.3 MDL-78468 - No longer used since the devicedetectregex was removed.
* @todo Final deprecation on Moodle 4.7 MDL-79052
* @return array Current settings array
* @return ?array Current settings array
*/
public function get_setting() {
debugging(
@@ -10818,7 +10818,7 @@ class admin_setting_devicedetectregex extends admin_setting {
* @deprecated Moodle 4.3 MDL-78468 - No longer used since the devicedetectregex was removed.
* @todo Final deprecation on Moodle 4.7 MDL-79052
* @param array $data Array of settings to save
* @return bool
* @return string error message or empty string on success
*/
public function write_setting($data) {
debugging(
+4 -4
View File
@@ -162,7 +162,7 @@ class auth_plugin_base {
* If you are using a plugin config variable in this method, please make sure it is set before using it,
* as this method can be called even if the plugin is disabled, in which case the config values won't be set.
*
* @return moodle_url url of the profile page or null if standard used
* @return ?moodle_url url of the profile page or null if standard used
*/
function change_password_url() {
//override if needed
@@ -187,7 +187,7 @@ class auth_plugin_base {
* This method is used if can_edit_profile() returns true.
* This method is called only when user is logged in, it may use global $USER.
*
* @return moodle_url url of the profile page or null if standard used
* @return ?moodle_url url of the profile page or null if standard used
*/
function edit_profile_url() {
//override if needed
@@ -314,7 +314,7 @@ class auth_plugin_base {
/**
* Return a form to capture user details for account creation.
* This is used in /login/signup.php.
* @return moodle_form A form which edits a record from the user table.
* @return moodleform A form which edits a record from the user table.
*/
function signup_form() {
global $CFG;
@@ -1265,7 +1265,7 @@ function signup_setup_new_user($user) {
/**
* Check if user confirmation is enabled on this site and return the auth plugin handling registration if enabled.
*
* @return stdClass the current auth plugin handling user registration or false if registration not enabled
* @return auth_plugin_base|false the current auth plugin handling user registration or false if registration not enabled
* @since Moodle 3.2
*/
function signup_get_user_confirmation_authplugin() {
+3 -4
View File
@@ -236,7 +236,7 @@ function badges_notify_badge_award(badge $badge, $userid, $issued, $filepathhash
/**
* Caclulates date for the next message digest to badge creators.
*
* @param in $schedule Type of message schedule BADGE_MESSAGE_DAILY|BADGE_MESSAGE_WEEKLY|BADGE_MESSAGE_MONTHLY.
* @param int $schedule Type of message schedule BADGE_MESSAGE_DAILY|BADGE_MESSAGE_WEEKLY|BADGE_MESSAGE_MONTHLY.
* @return int Timestamp for next cron
*/
function badges_calculate_message_schedule($schedule) {
@@ -598,7 +598,7 @@ function print_badge_image(badge $badge, stdClass $context, $size = 'small') {
* @param int $badgeid ID of the original badge.
* @param int $userid ID of badge recipient (optional).
* @param boolean $pathhash Return file pathhash instead of image url (optional).
* @return string|url Returns either new file path hash or new file URL
* @return string|moodle_url|null Returns either new file path hash or new file URL
*/
function badges_bake($hash, $badgeid, $userid = 0, $pathhash = false) {
global $CFG, $USER;
@@ -1221,7 +1221,6 @@ function badges_external_delete_mappings($sitebackpackid) {
* @param integer $sitebackpackid The site backpack to connect to.
* @param string $type The type of this remote object.
* @param string $internalid The id for this object on the Moodle site.
* @return boolean
*/
function badges_external_delete_mapping($sitebackpackid, $type, $internalid) {
global $DB;
@@ -1471,7 +1470,7 @@ function badges_verify_backpack(int $backpackid) {
* @param stdClass $backpack The Badgr backpack we are pushing to
* @param string $type The type of object we are dealing with either Issuer, Assertion OR Badge.
* @param string $externalid The externalid as provided by the backpack
* @return string The public URL to access Badgr objects
* @return ?string The public URL to access Badgr objects
*/
function badges_generate_badgr_open_url($backpack, $type, $externalid) {
if (badges_open_badges_backpack_api($backpack->id) == OPEN_BADGES_V2) {
+7 -7
View File
@@ -929,10 +929,10 @@ class block_manager {
* and incremented by the position of the block in the $blocks array
*
* @param array $blocks array with array keys the region names, and values an array of block names.
* @param string $pagetypepattern optional. Passed to {@link add_block()}
* @param string $subpagepattern optional. Passed to {@link add_block()}
* @param boolean $showinsubcontexts optional. Passed to {@link add_block()}
* @param integer $weight optional. Determines the starting point that the blocks are added in the region.
* @param string|null $pagetypepattern optional. Passed to {@see self::add_block()}
* @param string|null $subpagepattern optional. Passed to {@see self::add_block()}
* @param bool $showinsubcontexts optional. Passed to {@see self::add_block()}
* @param int $weight optional. Determines the starting point that the blocks are added in the region.
*/
public function add_blocks($blocks, $pagetypepattern = NULL, $subpagepattern = NULL, $showinsubcontexts=false, $weight=0) {
$initialweight = $weight;
@@ -2128,7 +2128,7 @@ function block_instance_by_id($blockinstanceid) {
* @param string $blockname the name of the block.
* @param stdClass $instance block_instances DB table row (optional).
* @param moodle_page $page the page this block is appearing on.
* @return block_base the requested block instance.
* @return block_base|false the requested block instance.
*/
function block_instance($blockname, $instance = NULL, $page = NULL) {
if(!block_load_class($blockname)) {
@@ -2389,7 +2389,7 @@ function mod_page_type_list($pagetype, $parentcontext = null, $currentcontext =
* Return a {@link block_contents} representing the add a new block UI, if
* this user is allowed to see it.
*
* @return block_contents an appropriate block_contents, or null if the user
* @return ?block_contents an appropriate block_contents, or null if the user
* cannot add any blocks here.
*/
function block_add_block_ui($page, $output) {
@@ -2601,7 +2601,7 @@ function blocks_set_visibility($instance, $page, $newvisibility) {
*
* @param $int blockid block type id. If null, an array of all block types is returned.
* @param bool $notusedanymore No longer used.
* @return array|object row from block table, or all rows.
* @return array|object|false row from block table, or all rows.
*/
function blocks_get_record($blockid = NULL, $notusedanymore = false) {
global $PAGE;
+5 -5
View File
@@ -34,19 +34,19 @@ defined('MOODLE_INTERNAL') || die();
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class core_collator {
/** @var compare items using general PHP comparison, equivalent to Collator::SORT_REGULAR, this may bot be locale aware! */
/** @var int compare items using general PHP comparison, equivalent to Collator::SORT_REGULAR, this may bot be locale aware! */
const SORT_REGULAR = 0;
/** @var compare items as strings, equivalent to Collator::SORT_STRING */
/** @var int compare items as strings, equivalent to Collator::SORT_STRING */
const SORT_STRING = 1;
/** @var compare items as numbers, equivalent to Collator::SORT_NUMERIC */
/** @var int compare items as numbers, equivalent to Collator::SORT_NUMERIC */
const SORT_NUMERIC = 2;
/** @var compare items like natsort(), equivalent to SORT_NATURAL */
/** @var int compare items like natsort(), equivalent to SORT_NATURAL */
const SORT_NATURAL = 6;
/** @var do not ignore case when sorting, use bitwise "|" with SORT_NATURAL or SORT_STRING, equivalent to Collator::UPPER_FIRST */
/** @var int do not ignore case when sorting, use bitwise "|" with SORT_NATURAL or SORT_STRING, equivalent to Collator::UPPER_FIRST */
const CASE_SENSITIVE = 64;
/** @var Collator|false|null **/
+4 -5
View File
@@ -949,7 +949,7 @@ class completion_info {
* Resetting state of manual tickbox has same result as deleting state for
* it.
*
* @param stcClass|cm_info $cm Activity
* @param stdClass|cm_info $cm Activity
*/
public function reset_all_state($cm) {
global $DB;
@@ -991,7 +991,7 @@ class completion_info {
* fill the cache, retrieves information from the entire course not just for
* this one activity
* @param int $userid User ID or 0 (default) for current user
* @param null $unused This parameter has been deprecated since 4.0 and should not be used anymore.
* @param mixed $unused This parameter has been deprecated since 4.0 and should not be used anymore.
* @return object Completion data. Record from course_modules_completion plus other completion statuses such as
* - Completion status for 'must-receive-grade' completion rule.
* - Custom completion statuses defined by the activity module plugin.
@@ -1443,7 +1443,7 @@ class completion_info {
* @param int $start User to start at if paging (optional)
* @param context $extracontext If set, includes extra user information fields
* as appropriate to display for current user in this context
* @return stdClass with ->total and ->start (same as $start) and ->users;
* @return array with ->total and ->start (same as $start) and ->users;
* an array of user objects (like mdl_user id, firstname, lastname)
* containing an additional ->progress array of coursemoduleid => completionstate
*/
@@ -1495,7 +1495,7 @@ class completion_info {
*
* @param stdClass|cm_info $cm Course-module for item that owns grade
* @param grade_item $item Grade item
* @param stdClass $grade
* @param stdClass|grade_grade $grade
* @param bool $deleted
* @param bool $isbulkupdate If bulk grade update is happening.
*/
@@ -1590,7 +1590,6 @@ class completion_info {
* This is to be used only for system errors (things that shouldn't happen)
* and not user-level errors.
*
* @global type $CFG
* @param string $error Error string (will not be displayed to user unless debugging is enabled)
* @throws moodle_exception Exception with the error string as debug info
*/
+1 -1
View File
@@ -792,7 +792,7 @@ class lang_installer {
*
* @uses component_installer
* @param string $langcode
* @return int return status
* @return string return status
*/
protected function install_language_pack($langcode) {
+3 -3
View File
@@ -190,7 +190,7 @@ class csv_import_reader {
/**
* Returns list of columns
*
* @return array
* @return array|false
*/
public function get_columns() {
if (isset($this->_columns)) {
@@ -456,7 +456,7 @@ class csv_export_writer {
* Echos or returns a csv data line by line for displaying.
*
* @param bool $return Set to true to return a string with the csv data.
* @return string csv data.
* @return ?string csv data.
*/
public function print_csv_data($return = false) {
fseek($this->fp, 0);
@@ -548,7 +548,7 @@ class csv_export_writer {
* @param string $delimiter The name of the delimiter. Supported types(comma, tab, semicolon, colon, cfg)
* @param string $enclosure How speical fields are enclosed.
* @param bool $return If true will return a string with the csv data.
* @return string csv data.
* @return ?string csv data.
*/
public static function print_array(array &$records, $delimiter = 'comma', $enclosure = '"', $return = false) {
$csvdata = new csv_export_writer($delimiter, $enclosure);
+3 -3
View File
@@ -63,7 +63,7 @@ define('USER_SEARCH_EXACT_MATCH', 2);
* Returns $user object of the main admin user
*
* @static stdClass $mainadmin
* @return stdClass {@link $USER} record from DB, false if not found
* @return stdClass|false {user} record from DB, false if not found
*/
function get_admin() {
global $CFG, $DB;
@@ -1205,7 +1205,7 @@ function increment_revision_number($table, $field, $select, array $params = null
*
* @global object
* @param int $courseid The id of the course as found in the 'course' table.
* @return array
* @return array|false
*/
function get_course_mods($courseid) {
global $DB;
@@ -1236,7 +1236,7 @@ function get_course_mods($courseid) {
* @param int $strictness IGNORE_MISSING means compatible mode, false returned if record not found, debug message if more found;
* IGNORE_MULTIPLE means return first, ignore multiple records found(not recommended);
* MUST_EXIST means throw exception if no record or multiple records found
* @return stdClass
* @return stdClass|false
*/
function get_coursemodule_from_id($modulename, $cmid, $courseid=0, $sectionnum=false, $strictness=IGNORE_MISSING) {
global $DB;
+3 -3
View File
@@ -128,7 +128,7 @@ abstract class moodle_database {
/** @var cache_application for column info */
protected $metacache;
/** @var cache_request for column info on temp tables */
/** @var cache_application|cache_session|cache_store for column info on temp tables */
protected $metacachetemp;
/** @var bool flag marking database instance as disposed */
@@ -188,7 +188,7 @@ abstract class moodle_database {
* @param string $type Database driver's type. (eg: mysqli, pgsql, mssql, sqldrv, oci, etc.)
* @param string $library Database driver's library (native, pdo, etc.)
* @param bool $external True if this is an external database.
* @return moodle_database driver object or null if error, for example of driver object see {@link mysqli_native_moodle_database}
* @return ?moodle_database driver object or null if error, for example of driver object see {@see mysqli_native_moodle_database}
*/
public static function get_driver_instance($type, $library, $external = false) {
global $CFG;
@@ -380,7 +380,7 @@ abstract class moodle_database {
/**
* Returns transaction trace for debugging purposes.
* @private to be used by core only
* @return array or null if not in transaction.
* @return ?array or null if not in transaction.
*/
public function get_transaction_start_backtrace() {
if (!$this->transactions) {
+2 -2
View File
@@ -269,8 +269,8 @@ class dml_transaction_exception extends dml_exception {
/**
* Constructor
* @param array $debuginfo Optional debugging information.
* @param moodle_transaction $transaction The instance of the transaction.(Optional)
* @param ?string $debuginfo Optional debugging information.
* @param ?moodle_transaction $transaction The instance of the transaction.(Optional)
*/
function __construct($debuginfo=null, $transaction=null) {
$this->transaction = $transaction; // TODO: MDL-20625 use the info from $transaction for debugging purposes
+7 -8
View File
@@ -137,7 +137,7 @@ function enrol_get_plugins($enabled) {
/**
* Returns instance of enrol plugin
* @param string $name name of enrol plugin ('manual', 'guest', ...)
* @return enrol_plugin
* @return ?enrol_plugin
*/
function enrol_get_plugin($name) {
global $CFG;
@@ -1476,7 +1476,7 @@ function is_enrolled(context $context, $user = null, $withcapability = '', $only
* @param string|array $capability optional, may include a capability name, or array of names.
* If an array is provided then this is the equivalent of a logical 'OR',
* i.e. the user needs to have one of these capabilities.
* @param int|array $groupids The groupids, 0 or [] means all groups and USERSWITHOUTGROUP no group
* @param int|array|null $groupids The groupids, 0 or [] means all groups and USERSWITHOUTGROUP no group
* @param bool $onlyactive consider only active enrolments in enabled plugins and time restrictions
* @param bool $onlysuspended inverse of onlyactive, consider only suspended enrolments
* @param int $enrolid The enrolment ID. If not 0, only users enrolled using this enrolment method will be returned.
@@ -1528,7 +1528,7 @@ function get_enrolled_with_capabilities_join(context $context, $prefix = '', $ca
*
* @param context $context
* @param string $withcapability
* @param int|array $groupids The groupids, 0 or [] means all groups and USERSWITHOUTGROUP no group
* @param int|array|null $groupids The groupids, 0 or [] means all groups and USERSWITHOUTGROUP no group
* @param bool $onlyactive consider only active enrolments in enabled plugins and time restrictions
* @param bool $onlysuspended inverse of onlyactive, consider only suspended enrolments
* @param int $enrolid The enrolment ID. If not 0, only users enrolled using this enrolment method will be returned.
@@ -1963,7 +1963,6 @@ abstract class enrol_plugin {
* Sets plugin config value
* @param string $name name of config
* @param string $value string config value, null means delete
* @return string value
*/
public function set_config($name, $value) {
$pluginname = $this->get_name();
@@ -2428,7 +2427,7 @@ abstract class enrol_plugin {
/**
* Returns link to page which may be used to add new instance of enrolment plugin in course.
* @param int $courseid
* @return moodle_url page url
* @return ?moodle_url page url
*/
public function get_newinstance_link($courseid) {
// override for most plugins, check if instance already exists in cases only one instance is supported
@@ -2469,7 +2468,7 @@ abstract class enrol_plugin {
* Does the access control tests automatically.
*
* @param object $instance
* @return moodle_url
* @return ?moodle_url
*/
public function get_manual_enrol_link($instance) {
return NULL;
@@ -2479,7 +2478,7 @@ abstract class enrol_plugin {
* Returns list of unenrol links for all enrol instances in course.
*
* @param stdClass $instance
* @return moodle_url or NULL if self unenrolment not supported
* @return ?moodle_url or NULL if self unenrolment not supported
*/
public function get_unenrolself_link($instance) {
global $USER, $CFG, $DB;
@@ -2665,7 +2664,7 @@ abstract class enrol_plugin {
* Not all plugins support this.
*
* @param object $course
* @return int id of new instance or null if no default supported
* @return ?int id of new instance or null if no default supported
*/
public function add_default_instance($course) {
return null;
+7 -7
View File
@@ -895,7 +895,7 @@ function environment_check_php($version, $env_select) {
* Looks for buggy PCRE implementation, we need unicode support in Moodle...
* @param string $version xml version we are going to use to test this server
* @param int|string $env_select one of ENV_SELECT_NEWER | ENV_SELECT_DATAROOT | ENV_SELECT_RELEASE decide xml to use. String means plugin name.
* @return stdClass results encapsulated in one environment_result object, null if irrelevant
* @return ?environment_results results encapsulated in one environment_result object, null if irrelevant
*/
function environment_check_pcre_unicode($version, $env_select) {
$result = new environment_results('pcreunicode');
@@ -1102,8 +1102,8 @@ function environment_check_database($version, $env_select) {
* such bypass functions are able to directly handling the result object
* although it should be only under exceptional conditions.
*
* @param string xmldata containing the bypass data
* @param object result object to be updated
* @param array $xml xml containing the bypass data
* @param environment_results $result object to be updated
* @return void
*/
function process_environment_bypass($xml, &$result) {
@@ -1143,8 +1143,8 @@ function process_environment_bypass($xml, &$result) {
* such restrict functions are able to directly handling the result object
* although it should be only under exceptional conditions.
*
* @param string xmldata containing the restrict data
* @param object result object to be updated
* @param array $xml xmldata containing the restrict data
* @param environment_results $result object to be updated
* @return void
*/
function process_environment_restrict($xml, &$result) {
@@ -1180,8 +1180,8 @@ function process_environment_restrict($xml, &$result) {
*
* @uses INCORRECT_FEEDBACK_FOR_REQUIRED
* @uses INCORRECT_FEEDBACK_FOR_OPTIONAL
* @param string xmldata containing the feedback data
* @param object reult object to be updated
* @param array $xml xmldata containing the feedback data
* @param environment_results $result object to be updated
*/
function process_environment_messages($xml, &$result) {
+1 -1
View File
@@ -462,7 +462,7 @@ class util {
*
* @param string|null $content The string to be filtered. Should be plain text, expect
* possibly for multilang tags.
* @param context $context The id of the context for the string or the context (affects filters).
* @param int|context $context The id of the context for the string or the context (affects filters).
* @param boolean $striplinks To strip any link in the result text. Moodle 1.8 default changed from false to true! MDL-8713
* @param array $options options array/object or courseid
* @return string text
+1 -1
View File
@@ -92,7 +92,7 @@ function external_generate_token($tokentype, $serviceorid, $userid, $contextorid
*
* @param string $servicename name of the web service. Service name as defined in db/services.php
* @param int $context context within which the web service can operate.
* @return int returns token id.
* @return string returns token id.
* @since Moodle 2.0
*/
function external_create_service_token($servicename, $contextid) {
+22 -22
View File
@@ -482,7 +482,7 @@ function file_prepare_draft_area(&$draftitemid, $contextid, $component, $fileare
* @param int $contextid This parameter and the next two identify the file area to use.
* @param string $component
* @param string $filearea helps identify the file area.
* @param int $itemid helps identify the file area.
* @param ?int $itemid helps identify the file area.
* @param array $options
* bool $options.forcehttps Force the user of https
* bool $options.reverse Reverse the behaviour of the function
@@ -926,7 +926,7 @@ function file_restore_source_field_from_draft_file($storedfile) {
/**
* Removes those files from the user drafts filearea which are not referenced in the editor text.
*
* @param stdClass $editor The online text editor element from the submitted form data.
* @param array $editor The online text editor element from the submitted form data.
*/
function file_remove_editor_orphaned_files($editor) {
global $CFG, $USER;
@@ -1475,7 +1475,7 @@ function format_array_postdata_for_curlcall($arraydata, $currentdata, &$data) {
* Transform a PHP array into POST parameter
* (see the recursive function format_array_postdata_for_curlcall)
* @param array $postdata
* @return array containing all POST parameters (1 row = 1 POST parameter)
* @return string containing all POST parameters (1 row = 1 POST parameter)
*/
function format_postdata_for_curlcall($postdata) {
$data = array();
@@ -1860,7 +1860,7 @@ function mimeinfo_from_type($element, $mimetype) {
*
* @param stored_file|file_info|stdClass|array $file (in case of object attributes $file->filename
* and $file->mimetype are expected)
* @param null $unused This parameter has been deprecated since 4.3 and should not be used anymore.
* @param mixed $unused This parameter has been deprecated since 4.3 and should not be used anymore.
* @return string
*/
function file_file_icon($file, $unused = null) {
@@ -1911,7 +1911,7 @@ function file_file_icon($file, $unused = null) {
* echo $OUTPUT->pix_icon(file_folder_icon(), '');
* </code>
*
* @param null $unused This parameter has been deprecated since 4.3 and should not be used anymore.
* @param mixed $unused This parameter has been deprecated since 4.3 and should not be used anymore.
* @return string
*/
function file_folder_icon($unused = null) {
@@ -1940,7 +1940,7 @@ function file_folder_icon($unused = null) {
* @todo MDL-31074 When an $OUTPUT->icon method is available this function should be altered
* to conform with that.
* @param string $mimetype The mimetype to fetch an icon for
* @param null $unused This parameter has been deprecated since 4.3 and should not be used anymore.
* @param mixed $unused This parameter has been deprecated since 4.3 and should not be used anymore.
* @return string The relative path to the icon
*/
function file_mimetype_icon($mimetype, $unused = null) {
@@ -1964,7 +1964,7 @@ function file_mimetype_icon($mimetype, $unused = null) {
* @todo MDL-31074 Implement $size
* @category files
* @param string $filename The filename to get the icon for
* @param null $unused This parameter has been deprecated since 4.3 and should not be used anymore.
* @param mixed $unused This parameter has been deprecated since 4.3 and should not be used anymore.
* @return string
*/
function file_extension_icon($filename, $unused = null) {
@@ -3149,7 +3149,7 @@ class curl {
private $cookie = false;
/** @var bool tracks multiple headers in response - redirect detection */
private $responsefinished = false;
/** @var security helper class, responsible for checking host/ports against allowed/blocked entries.*/
/** @var ?\core\files\curl_security_helper security helper class, responsible for checking host/ports against allowed/blocked entries.*/
private $securityhelper;
/** @var bool ignoresecurity a flag which can be supplied to the constructor, allowing security to be bypassed. */
private $ignoresecurity;
@@ -3177,7 +3177,7 @@ class curl {
if (!function_exists('curl_init')) {
$this->error = 'cURL module must be enabled!';
trigger_error($this->error, E_USER_ERROR);
return false;
return;
}
// All settings of this class should be init here.
@@ -3379,7 +3379,7 @@ class curl {
/**
* Set HTTP Request Header
*
* @param array $header
* @param array|string $header
*/
public function setHeader($header) {
if (is_array($header)) {
@@ -3719,7 +3719,7 @@ class curl {
* This augments all installed plugin's security helpers if there is any.
*
* @param string $url the url to check.
* @return string - an error message if URL is blocked or null if URL is not blocked.
* @return ?string - an error message if URL is blocked or null if URL is not blocked.
*/
protected function check_securityhelper_blocklist(string $url): ?string {
@@ -3761,7 +3761,7 @@ class curl {
*
* @param string $url The URL to request
* @param array $options
* @return bool
* @return string
*/
protected function request($url, $options = array()) {
// Reset here so that the data is valid when result returned from cache, or if we return due to a blocked URL hit.
@@ -3962,14 +3962,14 @@ class curl {
$event->trigger();
}
/**
/**
* HTTP HEAD method
*
* @see request()
*
* @param string $url
* @param array $options
* @return bool
* @return string
*/
public function head($url, $options = array()) {
$options['CURLOPT_HTTPGET'] = 0;
@@ -3984,7 +3984,7 @@ class curl {
* @param string $url
* @param array|string $params
* @param array $options
* @return bool
* @return string
*/
public function patch($url, $params = '', $options = array()) {
$options['CURLOPT_CUSTOMREQUEST'] = 'PATCH';
@@ -4012,7 +4012,7 @@ class curl {
* @param string $url
* @param array|string $params
* @param array $options
* @return bool
* @return string
*/
public function post($url, $params = '', $options = array()) {
$options['CURLOPT_POST'] = 1;
@@ -4038,9 +4038,9 @@ class curl {
* HTTP GET method
*
* @param string $url
* @param array $params
* @param ?array $params
* @param array $options
* @return bool
* @return string
*/
public function get($url, $params = array(), $options = array()) {
$options['CURLOPT_HTTPGET'] = 1;
@@ -4113,7 +4113,7 @@ class curl {
* @param string $url
* @param array $params
* @param array $options
* @return bool
* @return ?string
*/
public function put($url, $params = array(), $options = array()) {
$file = '';
@@ -4150,7 +4150,7 @@ class curl {
* @param string $url
* @param array $param
* @param array $options
* @return bool
* @return string
*/
public function delete($url, $param = array(), $options = array()) {
$options['CURLOPT_CUSTOMREQUEST'] = 'DELETE';
@@ -4166,7 +4166,7 @@ class curl {
*
* @param string $url
* @param array $options
* @return bool
* @return string
*/
public function trace($url, $options = array()) {
$options['CURLOPT_CUSTOMREQUEST'] = 'TRACE';
@@ -4179,7 +4179,7 @@ class curl {
*
* @param string $url
* @param array $options
* @return bool
* @return string
*/
public function options($url, $options = array()) {
$options['CURLOPT_CUSTOMREQUEST'] = 'OPTIONS';
+2 -2
View File
@@ -37,7 +37,7 @@ class file_exception extends moodle_exception {
* Constructor
*
* @param string $errorcode error code
* @param stdClass $a Extra words and phrases that might be required in the error string
* @param mixed $a Extra words and phrases that might be required in the error string
* @param string $debuginfo optional debugging information
*/
function __construct($errorcode, $a=NULL, $debuginfo = NULL) {
@@ -129,7 +129,7 @@ class file_reference_exception extends file_exception {
/**
* Constructor.
*
* @param int $repositoryid the id of the repository that provides the referenced file
* @param ?int $repositoryid the id of the repository that provides the referenced file
* @param string $reference the information for the repository to locate the file
* @param int|null $referencefileid the id of the record in {files_reference} if known
* @param int|null $fileid the id of the referrer's record in {files} if known
+1 -1
View File
@@ -1929,7 +1929,7 @@ class file_storage {
/**
* When user referring to a moodle file, we build the reference field
*
* @param array $params
* @param array|stdClass $params
* @return string
*/
public static function pack_reference($params) {
+1 -1
View File
@@ -140,7 +140,7 @@ class filter_manager {
* @param string $filtername The filter name, for example 'tex'.
* @param context $context context object.
* @param array $localconfig array of local configuration variables for this filter.
* @return moodle_text_filter The filter, or null, if this type of filter is
* @return ?moodle_text_filter The filter, or null, if this type of filter is
* not recognised or could not be created.
*/
protected function make_filter_object($filtername, $context, $localconfig) {
+1 -1
View File
@@ -63,7 +63,7 @@ class MoodleQuickForm_filemanager extends HTML_QuickForm_element implements temp
* @param string $elementLabel (optional) filemanager label
* @param array $attributes (optional) Either a typical HTML attribute string
* or an associative array
* @param array $options set of options to initalize filemanager
* @param array|stdClass $options set of options to initalize filemanager
*/
public function __construct($elementName=null, $elementLabel=null, $attributes=null, $options=null) {
global $CFG, $PAGE;
+2 -1
View File
@@ -60,7 +60,7 @@ class MoodleQuickForm_group extends HTML_QuickForm_group implements templatable
* @param string $elementName (optional) name of the group
* @param string $elementLabel (optional) group label
* @param array $elements (optional) array of HTML_QuickForm_element elements to group
* @param string $separator (optional) string to seperate elements.
* @param string|array $separator (optional) Use a string for one separator, or use an array to alternate the separators
* @param string $appendName (optional) string to appened to grouped elements.
* @param mixed $attributes (optional) Either a typical HTML attribute string
* or an associative array
@@ -159,6 +159,7 @@ class MoodleQuickForm_group extends HTML_QuickForm_group implements templatable
* @param string $event Name of event
* @param mixed $arg event arguments
* @param mixed $caller calling object
* @return ?bool
*/
public function onQuickFormEvent($event, $arg, &$caller) {
$this->setMoodleForm($caller);
+1 -1
View File
@@ -1519,7 +1519,7 @@ abstract class moodleform {
* @param array $simulatedsubmitteddata An associative array of form values (same format as $_POST).
* @param array $simulatedsubmittedfiles An associative array of files uploaded (same format as $_FILES). Can be omitted.
* @param string $method 'post' or 'get', defaults to 'post'.
* @param null $formidentifier the default is to use the class name for this class but you may need to provide
* @param ?string $formidentifier the default is to use the class name for this class but you may need to provide
* a different value here for some forms that are used more than once on the
* same page.
*/
+1 -1
View File
@@ -43,7 +43,7 @@ defined('MOODLE_INTERNAL') || die();
* @param int $dst_h the height of the destination rectangle
* @param int $src_w the width of the source rectangle
* @param int $src_h the height of the source rectangle
* @return bool tru on success, false otherwise
* @return ?bool tru on success, false otherwise
*/
function imagecopybicubic($dst_img, $src_img, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h) {
global $CFG;
+1 -1
View File
@@ -250,7 +250,7 @@ class google_oauth extends oauth2_client {
* @param string $url The URL to request
* @param array $options
* @param mixed $acceptheader Not used.
* @return bool
* @return string
*/
protected function request($url, $options = array(), $acceptheader = 'application/json') {
return parent::request($url, $options, false);
+5 -5
View File
@@ -265,7 +265,7 @@ class grade_grade extends grade_object {
/**
* Loads the grade_item object referenced by $this->itemid and saves it as $this->grade_item for easy access
*
* @return grade_item The grade_item instance referenced by $this->itemid
* @return ?grade_item The grade_item instance referenced by $this->itemid
*/
public function load_grade_item() {
if (empty($this->itemid)) {
@@ -449,7 +449,7 @@ class grade_grade extends grade_object {
/**
* Returns timestamp when last graded, null if no grade present
*
* @return int
* @return ?int
*/
public function get_dategraded() {
//TODO: HACK - create new fields (MDL-31379)
@@ -712,7 +712,7 @@ class grade_grade extends grade_object {
* @param float $source_max
* @param float $target_min
* @param float $target_max
* @return float Converted value
* @return ?float Converted value
*/
public static function standardise_score($rawgrade, $source_min, $source_max, $target_min, $target_max) {
if (is_null($rawgrade)) {
@@ -743,7 +743,7 @@ class grade_grade extends grade_object {
*
* @param array $dependson Array to flatten
* @param array $dependencydepth Array of itemids => depth. Initially these should be all set to 1.
* @return array Flattened array
* @return bool|null
*/
protected static function flatten_dependencies_array(&$dependson, &$dependencydepth) {
// Flatten the nested dependencies - this will handle recursion bombs because it removes duplicates.
@@ -1030,7 +1030,7 @@ class grade_grade extends grade_object {
* Returns true if the grade's value is superior or equal to the grade item's gradepass value, false otherwise.
*
* @param grade_item $grade_item An optional grade_item of which gradepass value we can use, saves having to load the grade_grade's grade_item
* @return bool
* @return ?bool
*/
public function is_passed($grade_item = null) {
if (empty($grade_item)) {
+1 -1
View File
@@ -380,7 +380,7 @@ function grade_needs_regrade_progress_bar($courseid) {
*
* @param stdClass $course The course to regrade
* @param callable $callback A function to call if regrading took place
* @return moodle_url The URL to redirect to if redirecting
* @return moodle_url|false The URL to redirect to if redirecting
*/
function grade_regrade_final_grades_if_required($course, callable $callback = null) {
global $PAGE, $OUTPUT;
+2 -2
View File
@@ -145,7 +145,7 @@ function groups_get_group_by_name($courseid, $name) {
* @category group
* @param int $courseid The id of the course
* @param string $idnumber idnumber of group
* @return group object
* @return stdClass|false group object
*/
function groups_get_group_by_idnumber($courseid, $idnumber) {
if (empty($idnumber)) {
@@ -186,7 +186,7 @@ function groups_get_grouping_by_name($courseid, $name) {
* @category group
* @param int $courseid The id of the course
* @param string $idnumber idnumber of the group
* @return grouping object
* @return stdClass|false grouping object
*/
function groups_get_grouping_by_idnumber($courseid, $idnumber) {
if (empty($idnumber)) {
+8 -8
View File
@@ -350,7 +350,7 @@ class course_modinfo {
* Gets data about specific numbered section.
* @param int $sectionnumber Number (not id) of section
* @param int $strictness Use MUST_EXIST to throw exception if it doesn't
* @return section_info Information for numbered section or null if not found
* @return ?section_info Information for numbered section or null if not found
*/
public function get_section_info($sectionnumber, $strictness = IGNORE_MISSING) {
if (!array_key_exists($sectionnumber, $this->sectioninfobynum)) {
@@ -2024,7 +2024,7 @@ class cm_info implements IteratorAggregate {
* Returns a localised human-readable name of the module type.
*
* @param bool $plural If true, the function returns the plural form of the name.
* @return lang_string
* @return ?lang_string
*/
public function get_module_type_name($plural = false) {
$modnames = get_module_types_names($plural);
@@ -2345,9 +2345,9 @@ class cm_info implements IteratorAggregate {
* Constructor should not be called directly; use {@link get_fast_modinfo()}
*
* @param course_modinfo $modinfo Parent object
* @param stdClass $notused1 Argument not used
* @param mixed $notused1 Argument not used
* @param stdClass $mod Module object from the modinfo field of course table
* @param stdClass $notused2 Argument not used
* @param mixed $notused2 Argument not used
*/
public function __construct(course_modinfo $modinfo, $notused1, $mod, $notused2) {
$this->modinfo = $modinfo;
@@ -3278,10 +3278,10 @@ class section_info implements IteratorAggregate {
* Constructs object from database information plus extra required data.
* @param object $data Array entry from cached sectioncache
* @param int $number Section number (array key)
* @param int $notused1 argument not used (informaion is available in $modinfo)
* @param int $notused2 argument not used (informaion is available in $modinfo)
* @param mixed $notused1 argument not used (informaion is available in $modinfo)
* @param mixed $notused2 argument not used (informaion is available in $modinfo)
* @param course_modinfo $modinfo Owner (needed for checking availability)
* @param int $notused3 argument not used (informaion is available in $modinfo)
* @param mixed $notused3 argument not used (informaion is available in $modinfo)
*/
public function __construct($data, $number, $notused1, $notused2, $modinfo, $notused3) {
global $CFG;
@@ -3372,7 +3372,7 @@ class section_info implements IteratorAggregate {
* or availability information or additional properties added by course format
*
* @param string $name name of the property
* @return bool
* @return mixed
*/
public function __get($name) {
if (isset(self::$standardproperties[$name])) {
+8 -7
View File
@@ -918,7 +918,8 @@ function html_is_blank($string) {
* NOTE: this function is called from lib/db/upgrade.php
*
* @param string $name the key to set
* @param string $value the value to set (without magic quotes)
* @param string|int|bool|null $value the value to set (without magic quotes),
* null to unset the value
* @param string $plugin (optional) the plugin scope, default null
* @return bool true or exception
*/
@@ -1465,7 +1466,7 @@ function mark_user_preferences_changed($userid) {
* @category preference
* @access public
* @param string $name The key to set as preference for the specified user
* @param string $value The value to set for the $name key in the specified user's
* @param string|int|bool|null $value The value to set for the $name key in the specified user's
* record, null means delete current value.
* @param stdClass|int|null $user A moodle user object or id, null means current user
* @throws coding_exception
@@ -6242,7 +6243,7 @@ function email_is_not_allowed($email) {
/**
* Returns local file storage instance
*
* @return file_storage
* @return ?file_storage
*/
function get_file_storage($reset = false) {
global $CFG;
@@ -6290,7 +6291,7 @@ function get_file_browser() {
* Returns file packer
*
* @param string $mimetype default application/zip
* @return file_packer
* @return file_packer|false
*/
function get_file_packer($mimetype='application/zip') {
global $CFG;
@@ -6404,7 +6405,7 @@ function get_max_upload_file_size($sitebytes=0, $coursebytes=0, $modulebytes=0,
* @param int $sitebytes Set maximum size
* @param int $coursebytes Current course $course->maxbytes (in bytes)
* @param int $modulebytes Current module ->maxbytes (in bytes)
* @param stdClass $user The user
* @param stdClass|int|null $user The user
* @param bool $unused This parameter has been deprecated and is not used any more.
* @return int The maximum size for uploading files.
*/
@@ -10090,7 +10091,7 @@ function get_mnet_environment() {
* during xmlrpc server code execution, any code wishing to access
* information about the remote peer must use this to get it.
*
* @return mnet_remote_client the equivalent of old $MNETREMOTE_CLIENT global
* @return mnet_remote_client|false the equivalent of old $MNETREMOTE_CLIENT global
*/
function get_mnet_remote_client() {
if (!defined('MNET_SERVER')) {
@@ -10470,7 +10471,7 @@ class lang_string {
* string properties... the string cannot be regenerated so we need to ensure
* it is generated for this.
*
* @return string
* @return array
*/
public function __sleep() {
$this->get_string();
-2
View File
@@ -31,8 +31,6 @@ defined('MOODLE_INTERNAL') || die();
* @param stdClass $user user object
* @param bool $iscurrentuser is the user viewing profile, current user ?
* @param stdClass $course course object
*
* @return bool
*/
function core_myprofile_navigation(core_user\output\myprofile\tree $tree, $user, $iscurrentuser, $course) {
global $CFG, $USER, $DB, $PAGE, $OUTPUT;
+8 -8
View File
@@ -372,7 +372,7 @@ class navigation_node implements renderable {
*
* @param string $text
* @param moodle_url|action_link|string $action
* @param int $type
* @param ?int $type
* @param string $shorttext
* @param string|int $key
* @param pix_icon $icon
@@ -443,7 +443,7 @@ class navigation_node implements renderable {
* use the get method instead.
*
* @param int|string $key The key of the node we are looking for
* @param int $type One of navigation_node::TYPE_*
* @param ?int $type One of navigation_node::TYPE_*
* @return navigation_node|false
*/
public function find($key, $type) {
@@ -1165,7 +1165,7 @@ class navigation_node_collection implements IteratorAggregate, Countable {
*
* @param string|int $key The key of the node we want to find.
* @param int $type One of navigation_node::TYPE_*.
* @return navigation_node|null
* @return navigation_node|null|false
*/
public function get($key, $type=null) {
if ($type !== null) {
@@ -1969,7 +1969,7 @@ class global_navigation extends navigation_node {
* @param int $categoryid The category id to load or null/0 to load all base level categories
* @param bool $showbasecategories If set to true all base level categories will be loaded as well
* as the requested category and any parent categories.
* @return navigation_node|void returns a navigation node if a category has been loaded.
* @return true|void
*/
protected function load_all_categories($categoryid = self::LOAD_ROOT_CATEGORIES, $showbasecategories = false) {
global $CFG, $DB;
@@ -3208,7 +3208,7 @@ class global_navigation extends navigation_node {
* may be of more use to you.
*
* @param string|int $key The key of the node you wish to receive.
* @param int $type One of navigation_node::TYPE_*
* @param ?int $type One of navigation_node::TYPE_*
* @return navigation_node|false
*/
public function find($key, $type) {
@@ -3659,7 +3659,7 @@ class navbar extends navigation_node {
global $CFG;
if (during_initial_install()) {
$this->duringinstall = true;
return false;
return;
}
$this->page = $page;
$this->text = get_string('home');
@@ -4177,7 +4177,7 @@ class flat_navigation extends navigation_node_collection {
*/
public function __construct(moodle_page &$page) {
if (during_initial_install()) {
return false;
return;
}
debugging("Flat navigation has been deprecated in favour of primary/secondary navigation concepts");
$this->page = $page;
@@ -4330,7 +4330,7 @@ class settings_navigation extends navigation_node {
*/
public function __construct(moodle_page &$page) {
if (during_initial_install()) {
return false;
return;
}
$this->page = $page;
// Initialise the main navigation. It is most important that this is done
+1 -1
View File
@@ -639,7 +639,7 @@ abstract class oauth2_client extends curl {
* @param string $url The URL to request
* @param array $options
* @param mixed $acceptheader mimetype (as string) or false to skip sending an accept header.
* @return bool
* @return string
*/
protected function request($url, $options = array(), $acceptheader = 'application/json') {
$murl = new moodle_url($url);
+7 -7
View File
@@ -494,7 +494,7 @@ class help_icon implements renderable, templatable {
* Export this data so it can be used as the context for a mustache template.
*
* @param renderer_base $output Used to do a final render of any components that need to be rendered for export.
* @return array
* @return stdClass
*/
public function export_for_template(renderer_base $output) {
global $CFG;
@@ -1135,7 +1135,7 @@ class single_select implements renderable, templatable {
* @param string $name name of selection field - the changing parameter in url
* @param array $options list of options
* @param string $selected selected element
* @param array $nothing
* @param ?array $nothing
* @param string $formid
*/
public function __construct(moodle_url $url, $name, array $options, $selected = '', $nothing = array('' => 'choosedots'), $formid = null) {
@@ -1438,7 +1438,7 @@ class url_select implements renderable, templatable {
* Clean a URL.
*
* @param string $value The URL.
* @return The cleaned URL.
* @return string The cleaned URL.
*/
protected function clean_url($value) {
global $CFG;
@@ -1857,7 +1857,7 @@ class html_writer {
* Generates random html element id.
*
* @staticvar int $counter
* @staticvar type $uniq
* @staticvar string $uniq
* @param string $base A string fragment that will be included in the random ID.
* @return string A unique ID
*/
@@ -1949,7 +1949,7 @@ class html_writer {
* array(1=>'One', '--1uniquekey'=>array('More'=>array(2=>'Two', 3=>'Three')))
* @param string $name name of select element
* @param string|array $selected value or array of values depending on multiple attribute
* @param array|bool $nothing add nothing selected option, or false of not added
* @param array|bool|null $nothing add nothing selected option, or false of not added
* @param array $attributes html select element attributes
* @return string HTML fragment
*/
@@ -3779,7 +3779,7 @@ class custom_menu_item implements renderable, templatable {
* Export this data so it can be used as the context for a mustache template.
*
* @param renderer_base $output Used to do a final render of any components that need to be rendered for export.
* @return array
* @return stdClass
*/
public function export_for_template(renderer_base $output) {
$syscontext = context_system::instance();
@@ -4490,7 +4490,7 @@ class action_menu implements renderable, templatable {
/**
* Adds an action to this action menu.
*
* @param action_menu_link|pix_icon|subpanel|string $action
* @param action_link|pix_icon|subpanel|string $action
*/
public function add($action) {
+6 -6
View File
@@ -558,7 +558,7 @@ class theme_config {
public $doctype = 'html5';
/**
* @var string requiredblocks If set to a string, will list the block types that cannot be deleted. Defaults to
* @var string|false requiredblocks If set to a string, will list the block types that cannot be deleted. Defaults to
* navigation and settings.
*/
public $requiredblocks = false;
@@ -1686,7 +1686,7 @@ class theme_config {
* the stylesheet for the theme. It will look at parents themes and check the
* SCSS properties there.
*
* @return False when SCSS is not used.
* @return array|false False when SCSS is not used.
* An array with the import paths, and the path to the SCSS file or Closure as second.
*/
public function get_scss_property() {
@@ -1927,7 +1927,7 @@ class theme_config {
/**
* Flip a stylesheet to RTL.
*
* @param Object $csstree The parsed CSS tree structure to flip.
* @param mixed $csstree The parsed CSS tree structure to flip.
* @return void
*/
protected function rtlize($csstree) {
@@ -2120,7 +2120,7 @@ class theme_config {
*
* @param string $image name of image, may contain relative path
* @param string $component
* @param bool $svg|null Should SVG images also be looked for? If null, falls back to auto-detection of browser support
* @param bool|null $svg Should SVG images also be looked for? If null, falls back to auto-detection of browser support
* @return string full file path
*/
public function resolve_image_location($image, $component, $svg = false) {
@@ -2368,7 +2368,7 @@ class theme_config {
* @param string $themename
* @param stdClass $settings from config_plugins table
* @param boolean $parentscheck true to also check the parents. .
* @return stdClass The theme configuration
* @return ?stdClass The theme configuration
*/
private static function find_theme_config($themename, $settings, $parentscheck = true) {
// We have to use the variable name $THEME (upper case) because that
@@ -2691,7 +2691,7 @@ class xhtml_container_stack {
* warning will be output.
*
* @param string $type The type of container.
* @return string the HTML required to close the container.
* @return ?string the HTML required to close the container.
*/
public function pop($type) {
if (empty($this->opencontainers)) {
+7 -7
View File
@@ -1906,7 +1906,7 @@ class core_renderer extends renderer_base {
/**
* Renders a primary action_menu_filler item.
*
* @param action_menu_link_filler $action
* @param action_menu_filler $action
* @return string HTML fragment
*/
protected function render_action_menu_filler(action_menu_filler $action) {
@@ -2942,7 +2942,7 @@ EOD;
*
* @param moodle_url $url The URL + params to send through when clicking the button
* @param string $method
* @return string HTML the button
* @return ?string HTML the button
*/
public function edit_button(moodle_url $url, string $method = 'post') {
@@ -2964,7 +2964,7 @@ EOD;
/**
* Create a navbar switch for toggling editing mode.
*
* @return string Html containing the edit switch
* @return ?string Html containing the edit switch
*/
public function edit_switch() {
if ($this->page->user_allowed_editing()) {
@@ -5110,7 +5110,7 @@ EOD;
/**
* Render the login signup form into a nice template for the theme.
*
* @param mform $form
* @param moodleform $form
* @return string
*/
public function render_login_signup_form($form) {
@@ -5211,7 +5211,7 @@ EOD;
/**
* Renders release information in the footer popup
* @return string Moodle release info.
* @return ?string Moodle release info.
*/
public function moodle_release() {
global $CFG;
@@ -5416,7 +5416,7 @@ class core_renderer_cli extends core_renderer {
/**
* Renders a Check API result
*
* @param result $result
* @param core\check\result $result
* @return string fragment
*/
public function check_result(core\check\result $result) {
@@ -5904,7 +5904,7 @@ class core_renderer_maintenance extends core_renderer {
/**
* Does nothing. The maintenance renderer has no need for login information.
*
* @param null $withlinks
* @param mixed $withlinks
* @return string
*/
public function login_info($withlinks = null) {
+18 -18
View File
@@ -1867,9 +1867,9 @@ class YUI_config {
/**
* Create a new group within the YUI_config system.
*
* @param String $name The name of the group. This must be unique and
* @param string $name The name of the group. This must be unique and
* not previously used.
* @param Array $config The configuration for this group.
* @param array $config The configuration for this group.
* @return void
*/
public function add_group($name, $config) {
@@ -1885,9 +1885,9 @@ class YUI_config {
* Note, any existing configuration for that group will be wiped out.
* This includes module configuration.
*
* @param String $name The name of the group. This must be unique and
* @param string $name The name of the group. This must be unique and
* not previously used.
* @param Array $config The configuration for this group.
* @param array $config The configuration for this group.
* @return void
*/
public function update_group($name, $config) {
@@ -1906,7 +1906,7 @@ class YUI_config {
* name of the module being loaded.
*
* @param $function String the body of the JavaScript function. This should be used i
* @return String the name of the function to use in the group pattern configuration.
* @return string the name of the function to use in the group pattern configuration.
*/
public function set_config_function($function) {
$configname = 'yui' . (count($this->jsconfigfunctions) + 1) . 'ConfigFn';
@@ -1924,7 +1924,7 @@ class YUI_config {
* When jsrev is positive, the function is minified and stored in a MUC cache for subsequent uses.
*
* @param $file The path to the JavaScript function used for YUI configuration.
* @return String the name of the function to use in the group pattern configuration.
* @return string the name of the function to use in the group pattern configuration.
*/
public function set_config_source($file) {
global $CFG;
@@ -1950,7 +1950,7 @@ class YUI_config {
/**
* Retrieve the list of JavaScript functions for YUI_config groups.
*
* @return String The complete set of config functions
* @return string The complete set of config functions
*/
public function get_config_functions() {
$configfunctions = '';
@@ -1966,7 +1966,7 @@ class YUI_config {
* Update the header JavaScript with any required modification for the YUI Loader.
*
* @param $js String The JavaScript to manipulate.
* @return String the modified JS string.
* @return string the modified JS string.
*/
public function update_header_js($js) {
// Update the names of the the configFn variables.
@@ -1981,9 +1981,9 @@ class YUI_config {
/**
* Add configuration for a specific module.
*
* @param String $name The name of the module to add configuration for.
* @param Array $config The configuration for the specified module.
* @param String $group The name of the group to add configuration for.
* @param string $name The name of the module to add configuration for.
* @param array $config The configuration for the specified module.
* @param string $group The name of the group to add configuration for.
* If not specified, then this module is added to the global
* configuration.
* @return void
@@ -2047,7 +2047,7 @@ class YUI_config {
* This works through all modules capable of serving YUI modules, and attempts to get
* metadata for each of those modules.
*
* @return Array of module metadata
* @return array of module metadata
*/
private function get_moodle_metadata() {
$moodlemodules = array();
@@ -2084,8 +2084,8 @@ class YUI_config {
/**
* Helper function process and return the YUI metadata for all of the modules under the specified path.
*
* @param String $path the UNC path to the YUI src directory.
* @return Array the complete array for frankenstyle directory.
* @param string $path the UNC path to the YUI src directory.
* @return array the complete array for frankenstyle directory.
*/
private function get_moodle_path_metadata($path) {
// Add module metadata is stored in frankenstyle_modname/yui/src/yui_modname/meta/yui_modname.json.
@@ -2114,10 +2114,10 @@ class YUI_config {
* We must do this because we aggressively cache content on the browser, and we must also override use of the
* external CDN which will serve the true authoritative copy of the code without our patches.
*
* @param String combobase The local combobase
* @param String yuiversion The current YUI version
* @param Int patchlevel The patch level we're working to for YUI
* @param Array patchedmodules An array containing the names of the patched modules
* @param string $combobase The local combobase
* @param string $yuiversion The current YUI version
* @param int $patchlevel The patch level we're working to for YUI
* @param array $patchedmodules An array containing the names of the patched modules
* @return void
*/
public function define_patched_core_modules($combobase, $yuiversion, $patchlevel, $patchedmodules) {
+1 -3
View File
@@ -1183,7 +1183,7 @@ class moodle_page {
/**
* Set the main context to which this page belongs.
*
* @param context $context a context object. You normally get this with context_xxxx::instance().
* @param ?context $context a context object. You normally get this with context_xxxx::instance().
*/
public function set_context($context) {
if ($context === null) {
@@ -1892,8 +1892,6 @@ class moodle_page {
/**
* Reset the theme and output for a new context. This only makes sense from
* external::validate_context(). Do not cheat.
*
* @return string the name of the theme that should be used on this page.
*/
public function reset_theme_and_output() {
global $COURSE, $SITE;
+3 -3
View File
@@ -721,7 +721,7 @@ class HTML_QuickForm extends HTML_Common {
* @param array $elements array of elements composing the group
* @param string $name (optional)group name
* @param string $groupLabel (optional)group label
* @param string $separator (optional)string to separate elements
* @param string|array $separator (optional) Use a string for one separator, or use an array to alternate the separators
* @param bool $appendName (optional)specify whether the group name should be
* used in the form element name ex: group[element]
* @param mixed $attributes Either a typical HTML attribute string or an associative array
@@ -904,7 +904,7 @@ class HTML_QuickForm extends HTML_Common {
* @param string $element Name of form element to check
* @since 1.0
* @access public
* @return string error message corresponding to checked element
* @return ?string error message corresponding to checked element
*/
function getElementError($element)
{
@@ -1242,7 +1242,7 @@ class HTML_QuickForm extends HTML_Common {
* @param mixed $value submitted values
* @since 2.0
* @access private
* @return cleaned values
* @return mixed cleaned values
*/
function _recursiveFilter($filter, $value)
{
+1 -1
View File
@@ -392,7 +392,7 @@ class HTML_QuickForm_group extends HTML_QuickForm_element
* @param object $caller calling object
* @since 1.0
* @access public
* @return void
* @return ?bool
*/
function onQuickFormEvent($event, $arg, &$caller)
{
+1
View File
@@ -40,6 +40,7 @@ MDL-78145 - PHP 8.2 compliance. Added a missing class property that still need t
And also remove the $_elementIdx because it is not needed in Moodle code.
MDL-78527 - Adding a sixth parameter to allow groups to use attributes.
MDL-80818 - Freezing all elements with the same name (e.g. radio buttons)
MDL-80820 - PHPdocs corrections
Pear
====
+1 -1
View File
@@ -1045,7 +1045,7 @@ function portfolio_expected_time_db($recordcount) {
* Function to send portfolio report to admins
*
* @param array $insane array of insane plugins
* @param array $instances (optional) if reporting instances rather than whole plugins
* @param bool $instances (optional) if reporting instances rather than whole plugins
*/
function portfolio_insane_notify_admins($insane, $instances=false) {
+2 -2
View File
@@ -495,7 +495,7 @@ function question_delete_course_category($category, $newcategory, $notused=false
* Creates a new category to save the questions in use.
*
* @param array $questionids of question ids
* @param object $newcontextid the context to create the saved category in.
* @param int $newcontextid the context to create the saved category in.
* @param string $oldplace a textual description of the think being deleted,
* e.g. from get_context_name
* @param object $newcategory
@@ -1506,7 +1506,7 @@ function question_require_capability_on($question, $cap): bool {
* Gets the question edit url.
*
* @param object $context a context
* @return string|bool A URL for editing questions in this context.
* @return string|bool|void A URL for editing questions in this context.
*/
function question_edit_url($context) {
global $CFG, $SITE;
+1 -1
View File
@@ -144,7 +144,7 @@ function recaptcha_get_challenge_html($apiurl, $pubkey, $lang = null, bool $comp
* @param string $privkey The private key for reCAPTCHA
* @param string $remoteip The user's IP
* @param string $response The response from reCAPTCHA
* @return ReCaptchaResponse
* @return array
*/
function recaptcha_check_response($verifyurl, $privkey, $remoteip, $response) {
global $CFG;
+5 -5
View File
@@ -2084,10 +2084,10 @@ class bootstrap_renderer {
* Returns nicely formatted error message in a div box.
* @static
* @param string $message error message
* @param string $moreinfourl (ignored in early errors)
* @param string $link (ignored in early errors)
* @param array $backtrace
* @param string $debuginfo
* @param ?string $moreinfourl (ignored in early errors)
* @param ?string $link (ignored in early errors)
* @param ?array $backtrace
* @param ?string $debuginfo
* @return string
*/
public static function early_error_content($message, $moreinfourl, $link, $backtrace, $debuginfo = null) {
@@ -2129,7 +2129,7 @@ class bootstrap_renderer {
* @param string $link (ignored in early errors)
* @param array $backtrace
* @param string $debuginfo extra information for developers
* @return string
* @return ?string
*/
public static function early_error($message, $moreinfourl, $link, $backtrace, $debuginfo = null, $errorcode = null) {
global $CFG;
+4 -4
View File
@@ -1026,7 +1026,7 @@ function stats_get_base_monthly($time=0) {
/**
* Start of next day
* @param int $time timestamp
* @return start of next day
* @return int start of next day
*/
function stats_get_next_day_start($time) {
$next = stats_get_base_daily($time);
@@ -1039,7 +1039,7 @@ function stats_get_next_day_start($time) {
/**
* Start of next week
* @param int $time timestamp
* @return start of next week
* @return int start of next week
*/
function stats_get_next_week_start($time) {
$next = stats_get_base_weekly($time);
@@ -1052,7 +1052,7 @@ function stats_get_next_week_start($time) {
/**
* Start of next month
* @param int $time timestamp
* @return start of next month
* @return int start of next month
*/
function stats_get_next_month_start($time) {
$next = stats_get_base_monthly($time);
@@ -1457,7 +1457,7 @@ function stats_get_report_options($courseid,$mode) {
* @param string $timestr type of statistics to generate (dayly, weekly, monthly).
* @param boolean $line2
* @param boolean $line3
* @return array of fixed statistics.
* @return ?array of fixed statistics.
*/
function stats_fix_zeros($stats,$timeafter,$timestr,$line2=true,$line3=false) {
+1 -1
View File
@@ -704,7 +704,7 @@ class flexible_table {
}
/**
* @return string sql to add to where statement.
* @return array sql to add to where statement.
*/
function get_sql_where() {
global $DB;
+5 -5
View File
@@ -867,7 +867,7 @@ class moodle_url {
* @param int $contextid
* @param string $component
* @param string $area
* @param int $itemid
* @param ?int $itemid
* @param string $pathname
* @param string $filename
* @param bool $forcedownload
@@ -1494,7 +1494,7 @@ function reset_text_filters_cache($phpunitreset = false) {
* @staticvar bool $strcache
* @param string $string The string to be filtered. Should be plain text, expect
* possibly for multilang tags.
* @param boolean $striplinks To strip any link in the result text. Moodle 1.8 default changed from false to true! MDL-8713
* @param ?bool $striplinks To strip any link in the result text. Moodle 1.8 default changed from false to true! MDL-8713
* @param array $options options array/object or courseid
* @return string
*/
@@ -2691,7 +2691,7 @@ function print_group_picture($group, $courseid, $large = false, $return = false,
* user whose id is the value indicated.
* If the group picture is included in an e-mail or some other location where the audience is a specific
* user who will not be logged in when viewing, then we use a token to authenticate the user.
* @return moodle_url Returns the url for the group picture.
* @return ?moodle_url Returns the url for the group picture.
*/
function get_group_picture_url($group, $courseid, $large = false, $includetoken = false) {
global $CFG;
@@ -2726,7 +2726,7 @@ function get_group_picture_url($group, $courseid, $large = false, $includetoken
* @param string $link The link to wrap around the text
* @param bool $return If set to true the HTML is returned rather than echo'd
* @param string $viewfullnames
* @return string If $retrun was true returns HTML for a recent activity notice.
* @return ?string If $retrun was true returns HTML for a recent activity notice.
*/
function print_recent_activity_note($time, $user, $text, $link, $return=false, $viewfullnames=null) {
static $strftimerecent = null;
@@ -2861,7 +2861,7 @@ function navmenulist($course, $sections, $modinfo, $strsection, $strjumpto, $wid
* @param string $current
* @param boolean $includenograde Include those with no grades
* @param boolean $return If set to true returns rather than echo's
* @return string|bool Depending on value of $return
* @return string|bool|null Depending on value of $return
*/
function print_grade_menu($courseid, $name, $current, $includenograde=true, $return=false) {
global $OUTPUT;
+3 -3
View File
@@ -42,14 +42,14 @@ defined('MOODLE_INTERNAL') || die();
class xml_format_exception extends moodle_exception {
/** @var string */
public $errorstring;
/** @var char */
/** @var string */
public $char;
/**
* Constructor function
*
* @param string $errorstring Errorstring
* @param int $line Linenumber
* @param char $char Errorcharacter
* @param string $char Errorcharacter
* @param string $link Link
*/
public function __construct($errorstring, $line, $char, $link = '') {
@@ -188,7 +188,7 @@ class core_xml_parser {
* @param string $encoding Specify an OUTPUT encoding. If not specified, it defaults to UTF-8.
* @param bool $reporterrors if set to true, then a {@link xml_format_exception}
* exception will be thrown if the XML is not well-formed. Otherwise errors are ignored.
* @return array representation of the parsed XML.
* @return array|false representation of the parsed XML.
*/
public function parse($data, $whitespace = 1, $encoding = 'UTF-8', $reporterrors = false) {
$data = trim($data);
+10 -9
View File
@@ -1786,7 +1786,8 @@ function data_print_preference_form($data, $perpage, $search, $sort='', $order='
echo '<label for="pref_perpage">'.get_string('pagesize','data').'</label> ';
$pagesizes = array(2=>2,3=>3,4=>4,5=>5,6=>6,7=>7,8=>8,9=>9,10=>10,15=>15,
20=>20,30=>30,40=>40,50=>50,100=>100,200=>200,300=>300,400=>400,500=>500,1000=>1000);
echo html_writer::select($pagesizes, 'perpage', $perpage, false, array('id' => 'pref_perpage', 'class' => 'custom-select'));
echo html_writer::select($pagesizes, 'perpage', $perpage, false, array('id' => 'pref_perpage',
'class' => 'custom-select mr-1'));
if ($advanced) {
$regsearchclass = 'search_none';
@@ -1795,10 +1796,10 @@ function data_print_preference_form($data, $perpage, $search, $sort='', $order='
$regsearchclass = 'search_inline';
$advancedsearchclass = 'search_none';
}
echo '<div id="reg_search" class="' . $regsearchclass . ' d-flex flex-wrap align-items-center" >&nbsp;&nbsp;&nbsp;';
echo '<label for="pref_search">' . get_string('search') . '</label> <input type="text" ' .
'class="form-control" size="16" name="search" id= "pref_search" value="' . s($search) . '" /></div>';
echo '&nbsp;&nbsp;&nbsp;<label for="pref_sortby">'.get_string('sortby').'</label> ';
echo '<div id="reg_search" class="' . $regsearchclass . ' mr-1" >';
echo '<label for="pref_search" class="mr-1">' . get_string('search') . '</label><input type="text" ' .
'class="form-control d-inline-block align-middle w-auto mr-1" size="16" name="search" id= "pref_search" value="' . s($search) . '" /></div>';
echo '<label for="pref_sortby">'.get_string('sortby').'</label> ';
// foreach field, print the option
echo '<select name="sort" id="pref_sortby" class="custom-select mr-1">';
if ($fields = $DB->get_records('data_fields', array('dataid'=>$data->id), 'name')) {
@@ -1851,14 +1852,14 @@ function data_print_preference_form($data, $perpage, $search, $sort='', $order='
$checked = '';
}
$PAGE->requires->js('/mod/data/data.js');
echo '&nbsp;<input type="hidden" name="advanced" value="0" />';
echo '&nbsp;<input type="hidden" name="filter" value="1" />';
echo '&nbsp;<input type="checkbox" id="advancedcheckbox" name="advanced" value="1" ' . $checked . ' ' .
echo '<input type="hidden" name="advanced" value="0" />';
echo '<input type="hidden" name="filter" value="1" />';
echo '<input type="checkbox" id="advancedcheckbox" name="advanced" value="1" ' . $checked . ' ' .
'onchange="showHideAdvSearch(this.checked);" class="mx-1" />' .
'<label for="advancedcheckbox">' . get_string('advancedsearch', 'data') . '</label>';
echo '</div>';
echo '<div id="advsearch-save-sec" class="ml-auto '. $regsearchclass . '">';
echo '&nbsp;<input type="submit" class="btn btn-secondary" value="' . get_string('savesettings', 'data') . '" />';
echo '<input type="submit" class="btn btn-secondary" value="' . get_string('savesettings', 'data') . '" />';
echo '</div>';
echo '</div>';
echo '<div>';
+3 -3
View File
@@ -85,9 +85,9 @@ class mod_data_generator extends testing_module_generator {
/**
* Creates a field for a mod_data instance.
*
* @param StdClass $record
* @param mod_data $data
* @return data_field_{type}
* @param stdClass $record
* @param stdClass|null $data
* @return data_field_base
*/
public function create_field(stdClass $record = null, $data = null) {
$record = (array) $record;
+7 -7
View File
@@ -66,7 +66,7 @@ class edit_renderer extends \plugin_renderer_base {
$output .= html_writer::start_div('mod_quiz-edit-top-controls');
$output .= html_writer::start_div('d-flex justify-content-between flex-wrap mb-1');
$output .= html_writer::start_div('d-flex flex-column justify-content-around');
$output .= html_writer::start_div('d-flex align-items-center justify-content-around');
$output .= $this->quiz_information($structure);
$output .= html_writer::end_tag('div');
$output .= $this->maximum_grade_input($structure, $pageurl);
@@ -179,19 +179,19 @@ class edit_renderer extends \plugin_renderer_base {
*/
public function maximum_grade_input($structure, \moodle_url $pageurl) {
$output = '';
$output .= html_writer::start_div('maxgrade');
$output .= html_writer::start_div('maxgrade', ['class' => 'mt-2 mt-sm-0']);
$output .= html_writer::start_tag('form', ['method' => 'post', 'action' => 'edit.php',
'class' => 'quizsavegradesform d-flex flex-wrap align-items-center']);
$output .= html_writer::start_tag('fieldset', ['class' => 'invisiblefieldset']);
'class' => 'quizsavegradesform']);
$output .= html_writer::start_tag('fieldset', ['class' => 'invisiblefieldset d-flex align-items-center']);
$output .= html_writer::empty_tag('input', ['type' => 'hidden', 'name' => 'sesskey', 'value' => sesskey()]);
$output .= html_writer::input_hidden_params($pageurl);
$output .= html_writer::tag('label', get_string('maximumgrade') . ' ',
['for' => 'inputmaxgrade']);
['for' => 'inputmaxgrade', 'class' => 'd-inline-block w-auto mb-0']);
$output .= html_writer::empty_tag('input', ['type' => 'text', 'id' => 'inputmaxgrade',
'name' => 'maxgrade', 'size' => ($structure->get_decimal_places_for_grades() + 2),
'value' => $structure->formatted_quiz_grade(),
'class' => 'form-control']);
$output .= html_writer::empty_tag('input', ['type' => 'submit', 'class' => 'btn btn-secondary ml-1',
'class' => 'form-control d-inline-block align-middle w-auto ml-1']);
$output .= html_writer::empty_tag('input', ['type' => 'submit', 'class' => 'btn btn-secondary ml-1 d-inline-block w-auto ',
'name' => 'savechanges', 'value' => get_string('save', 'quiz')]);
$output .= html_writer::end_tag('fieldset');
$output .= html_writer::end_tag('form');
-9
View File
@@ -505,15 +505,6 @@ table.quizreviewsummary td.cell {
min-height: 2.85em;
}
@media (max-width: 576px) {
#page-mod-quiz-edit .maxgrade {
margin-bottom: 0.6em;
}
#page-mod-quiz-edit .maxgrade .form-control {
display: inline-block;
vertical-align: middle;
}
}
#page-mod-quiz-edit .maxgrade label {
display: inline;
}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+48 -55
View File
@@ -26,9 +26,10 @@
import $ from 'jquery';
import drag from 'core/dragdrop';
import keys from 'core/key_codes';
import Templates from 'core/templates';
import Notification from 'core/notification';
import {getString} from 'core/str';
import {prefetchString} from 'core/prefetch';
export default class DragReorder {
@@ -101,10 +102,6 @@ export default class DragReorder {
this.orderList = document.querySelector(this.config.list);
this.startListeners();
// Make the items tabbable.
// TODO: This can be removed once we move to templates and add the tabindex there.
$(this.combineSelectors(config.list, config.item)).attr('tabindex', '0');
}
/**
@@ -117,7 +114,7 @@ export default class DragReorder {
* @param {Event} e The event.
*/
const pointerHandle = e => {
if (e.target.closest(this.config.item)) {
if (e.target.closest(this.config.item) && !e.target.closest(this.config.actionButton)) {
this.itemDragging = $(e.target.closest(this.config.item));
const details = drag.prepare(e);
if (details.start) {
@@ -128,7 +125,7 @@ export default class DragReorder {
// Set up the list listeners for moving list items around.
this.orderList.addEventListener('mousedown', pointerHandle);
this.orderList.addEventListener('touchstart', pointerHandle);
this.orderList.addEventListener('keydown', this.itemMovedByKeyboard.bind(this));
this.orderList.addEventListener('click', this.itemMovedByClick.bind(this));
}
/**
@@ -213,11 +210,8 @@ export default class DragReorder {
/**
* End dragging.
*
* @param {number} x X co-ordinate
* @param {number} y Y co-ordinate
*/
dragEnd(x, y) {
dragEnd() {
if (typeof this.config.reorderEnd !== 'undefined') {
this.config.reorderEnd(this.itemDragging.closest(this.config.list), this.itemDragging);
}
@@ -226,10 +220,13 @@ export default class DragReorder {
// Order has changed, call the callback.
this.config.reorderDone(this.itemDragging.closest(this.config.list), this.itemDragging, this.getCurrentOrder());
} else if (new Date().getTime() - this.dragStart.time < 500 &&
Math.abs(this.dragStart.x - x) < 10 && Math.abs(this.dragStart.y - y) < 10) {
// This was really a click. Set the focus on the current item.
this.itemDragging[0].focus();
getString('moved', 'qtype_ordering', {
item: this.itemDragging.find('[data-itemcontent]').text().trim(),
position: this.itemDragging.index() + 1,
total: this.orderList.querySelectorAll(this.config.item).length
}).then((str) => {
this.config.announcementRegion.innerHTML = str;
});
}
// Clean up after the drag is finished.
@@ -241,69 +238,61 @@ export default class DragReorder {
}
/**
* Items can be moved and placed using certain keys.
* Tab for tabbing though and choose the item to be moved
* space, arrow-right arrow-down for moving current element forwards.
* arrow-right arrow-down for moving the current element backwards.
* Handles the movement of an item by click.
*
* @param {Event} e The keyboard event.
* @param {MouseEvent} e The pointer event.
*/
itemMovedByKeyboard(e) {
if (e.target.closest(this.config.item)) {
itemMovedByClick(e) {
const actionButton = e.target.closest(this.config.actionButton);
if (actionButton) {
this.itemDragging = $(e.target.closest(this.config.item));
// Store the current state of the list.
this.originalOrder = this.getCurrentOrder();
switch (e.keyCode) {
case keys.space:
case keys.arrowRight:
case keys.arrowDown:
e.preventDefault();
e.stopPropagation();
if (this.itemDragging.next().length) {
this.itemDragging.next().insertBefore(this.itemDragging);
}
break;
case keys.arrowLeft:
case keys.arrowUp:
switch (actionButton.dataset.action) {
case 'move-backward':
e.preventDefault();
e.stopPropagation();
if (this.itemDragging.prev().length) {
this.itemDragging.prev().insertAfter(this.itemDragging);
}
break;
case 'move-forward':
e.preventDefault();
e.stopPropagation();
if (this.itemDragging.next().length) {
this.itemDragging.next().insertBefore(this.itemDragging);
}
break;
}
// After we have potentially moved the item, we need to check if the order has changed.
if (!this.arrayEquals(this.originalOrder, this.getCurrentOrder())) {
// Order has changed, call the callback.
this.config.reorderDone(this.itemDragging.closest(this.config.list), this.itemDragging, this.getCurrentOrder());
// When moving an item to the first or last position, the button that was clicked will be hidden.
// In this case, we need to focus the other button.
if (!this.itemDragging.prev().length) {
// Focus the 'next' action button.
this.itemDragging.find('[data-action="move-forward"]').focus();
} else if (!this.itemDragging.next().length) {
// Focus the 'previous' action button.
this.itemDragging.find('[data-action="move-backward"]').focus();
}
getString('moved', 'qtype_ordering', {
item: this.itemDragging.find('[data-itemcontent]').text().trim(),
position: this.itemDragging.index() + 1,
total: this.orderList.querySelectorAll(this.config.item).length
}).then((str) => {
this.config.announcementRegion.innerHTML = str;
});
}
}
}
/**
* TODO: Once the tabindex is added to the template, this can be removed.
* Our outer and inner are two CSS selectors, which may contain commas.
* We want to combine them safely. So for instance combineSelectors('a, b', 'c, d')
* gives 'a c, a d, b c, b d'.
*
* @param {String} outer The selector for the outer element.
* @param {String} inner The selector for the inner element.
* @returns {String} The combined selector used to listen to the list item.
*/
combineSelectors(outer, inner) {
let combined = [];
outer.split(',').forEach(firstSelector => {
inner.split(',').forEach(secondSelector => {
combined.push(firstSelector.trim() + ' ' + secondSelector.trim());
});
});
return combined.join(', ');
}
/**
* Get the x-position of the middle of the DOM node represented by the given jQuery object.
*
@@ -369,6 +358,8 @@ export default class DragReorder {
*/
static init(sortableid, responseid) {
new DragReorder({
actionButton: '[data-action]',
announcementRegion: document.querySelector(`#${sortableid}-announcement`),
list: 'ul#' + sortableid,
item: 'li.sortableitem',
itemMovingClass: "current-drop",
@@ -379,5 +370,7 @@ export default class DragReorder {
$('input#' + responseid)[0].value = newOrder.join(',');
}
});
prefetchString('qtype_ordering', 'moved');
}
}
@@ -71,6 +71,8 @@ class formulation_and_controls extends renderable_base {
$data['numberingstyle'] = $numberingstyle;
}
$data['horizontallayout'] = $question->layouttype == \qtype_ordering_question::LAYOUT_HORIZONTAL;
// In the multi-tries, the highlight response base on the hint highlight option.
if (
(isset($this->options->highlightresponse) && $this->options->highlightresponse) ||
@@ -78,7 +78,9 @@ $string['layouttype'] = 'Layout of items';
$string['layouttype_help'] = 'Choose whether to display the items vertically or horizontally.';
$string['longestcontiguoussubset'] = 'Longest contiguous subset';
$string['longestorderedsubset'] = 'Longest ordered subset';
$string['moved'] = '{$a->item} moved. New position: {$a->position} of {$a->total}.';
$string['moveleft'] = 'Move left';
$string['moveright'] = 'Move right';
$string['noresponsedetails'] = 'Sorry, no details of the response to this question are available.';
$string['noscore'] = 'No score';
$string['notenoughanswers'] = 'Ordering questions must have more than {$a} answers.';
+14 -4
View File
@@ -21,7 +21,10 @@
border-radius: 4px;
list-style-type: none;
margin: 4px;
padding: 6px 12px;
}
.que.ordering .sortablelist li .grip {
opacity: 0.45;
}
.que.ordering .sortablelist li.sortableitem {
@@ -29,9 +32,16 @@
cursor: move;
margin-left: 26px; /* The margin is needed for the list-style-type in numberingxxx classes */
}
.que.ordering .sortablelist li.sortableitem:focus {
border-color: #0a0;
box-shadow: 0 0 5px 5px rgba(255, 255, 150, 1);
.que.ordering .sortablelist li.sortableitem:first-of-type [data-action="move-backward"],
.que.ordering .sortablelist li.sortableitem:last-of-type [data-action="move-forward"] {
visibility: hidden;
}
.que.ordering .sortableitem .btn.btn-icon {
height: 32px;
width: 32px;
border-radius: 0.5rem;
}
.que.ordering .sortablelist.numbering123 li,
@@ -65,10 +65,81 @@
{{#responsename}}
<div class="ablock" id="{{ablockid}}">
<div class="answer ordering">
<div aria-live="polite" class="sr-only" id="{{sortableid}}-announcement"></div>
<ul class="sortablelist {{layoutclass}} {{#numberingstyle}}numbering{{numberingstyle}}{{/numberingstyle}} {{#active}}active{{/active}}{{^active}}notactive{{/active}}" id="{{sortableid}}">
{{#answers}}
<li class="{{^readonly}}sortableitem{{/readonly}} {{scoreclass}}" id="{{id}}">
{{{feedbackimage}}}{{{answertext}}}
<li class="p-2 {{^readonly}}sortableitem{{/readonly}} {{scoreclass}}" id="{{id}}">
<div class="d-flex">
{{^readonly}}
<div class="d-flex p-2 grip">
<i class='fas fa-grip-vertical' aria-hidden="true"></i>
</div>
{{/readonly}}
<div class="d-flex align-items-center flex-grow-1 px-2" id="{{id}}-text" data-itemcontent>
{{{feedbackimage}}}{{{answertext}}}
</div>
{{^readonly}}
<div class="d-flex px-2">
{{#horizontallayout}}
<button
type="button"
class="dir-rtl-hide btn btn-icon icon-no-margin"
data-action="move-backward"
aria-label="{{#cleanstr}}moveleft, qtype_ordering{{/cleanstr}}"
aria-describedby="{{id}}-text"
>
<i class="icon fa fa-chevron-left" aria-hidden="true"></i>
</button>
<button
type="button"
class="dir-rtl-hide btn btn-icon icon-no-margin"
data-action="move-forward"
aria-label="{{#cleanstr}}moveright, qtype_ordering{{/cleanstr}}"
aria-describedby="{{id}}-text"
>
<i class="icon fa fa-chevron-right" aria-hidden="true"></i>
</button>
<button
type="button"
class="dir-ltr-hide btn btn-icon icon-no-margin"
data-action="move-backward"
aria-label="{{#cleanstr}}moveright, qtype_ordering{{/cleanstr}}"
aria-describedby="{{id}}-text"
>
<i class="icon fa fa-chevron-right" aria-hidden="true"></i>
</button>
<button
type="button"
class="dir-ltr-hide btn btn-icon icon-no-margin"
data-action="move-forward"
aria-label="{{#cleanstr}}moveleft, qtype_ordering{{/cleanstr}}"
aria-describedby="{{id}}-text"
>
<i class="icon fa fa-chevron-left" aria-hidden="true"></i>
</button>
{{/horizontallayout}}
{{^horizontallayout}}
<button
type="button"
class="btn btn-icon icon-no-margin"
data-action="move-backward"
aria-label="{{#cleanstr}}moveup{{/cleanstr}}"
aria-describedby="{{id}}-text"
>
<i class="icon fa fa-chevron-up" aria-hidden="true"></i>
</button>
<button
type="button"
class="btn btn-icon icon-no-margin"
data-action="move-forward" aria-label="{{#cleanstr}}movedown{{/cleanstr}}"
aria-describedby="{{id}}-text"
>
<i class="icon fa fa-chevron-down" aria-hidden="true"></i>
</button>
{{/horizontallayout}}
</div>
{{/readonly}}
</div>
</li>
{{/answers}}
</ul>
@@ -119,6 +119,7 @@ final class formulation_and_controls_test extends advanced_testcase {
'ablockid' => 'id_ablock_0',
'layoutclass' => 'horizontal',
'numberingstyle' => 'none',
'horizontallayout' => true,
'active' => false,
'sortableid' => 'id_sortable_0',
'answers' => [
@@ -179,6 +180,7 @@ final class formulation_and_controls_test extends advanced_testcase {
'ablockid' => 'id_ablock_0',
'layoutclass' => 'vertical',
'numberingstyle' => 'none',
'horizontallayout' => false,
'active' => false,
'sortableid' => 'id_sortable_0',
'answers' => [
@@ -239,6 +241,7 @@ final class formulation_and_controls_test extends advanced_testcase {
'ablockid' => 'id_ablock_0',
'layoutclass' => 'horizontal',
'numberingstyle' => 'none',
'horizontallayout' => true,
'active' => true,
'sortableid' => 'id_sortable_0',
'answers' => [
+3 -3
View File
@@ -29,9 +29,9 @@
defined('MOODLE_INTERNAL') || die();
$version = 2024041200.01; // YYYYMMDD = weekly release date of this DEV branch.
$version = 2024041600.00; // YYYYMMDD = weekly release date of this DEV branch.
// RR = release increments - 00 in DEV branches.
// .XX = incremental changes.
$release = '4.4beta (Build: 20240412)'; // Human-friendly version name
$release = '4.4rc1 (Build: 20240416)'; // Human-friendly version name
$branch = '404'; // This version's branch.
$maturity = MATURITY_BETA; // This version's maturity level.
$maturity = MATURITY_RC; // This version's maturity level.