Historically it was possible, through a series of question restores,
moves and edits, to end up with multiple questions in the same
category with the same stamp, but differences in other question
or answer fields. This, combined with changes in versions, led
to errors when restoring or duplicating quizzes using these questions.
While recent changes have made it impossible to create this situation
in current Moodle versions, as any edits will create a new question
version with a new stamp, this situation may exist on long-standing
Moodle sites which have been upgraded since pre-4.0.
This change performs a much wider-ranging comparison of restored
existing questions, generating a hash of all the data for a question in
a backup file, and a corresponding hash for each question in the target
category, to decide if a restored question matches a question already in
the database.
Given that
* There is no formally defined limit for alt text length,
* Current versions of screen readers can read alt texts longer than
125 characters,
* Accessibility checkers like axe DevTools, WAVE, etc., do not raise
errors or warnings about long image alt texts.
This patch:
- Downgrades the default severity for the `img_alt_is_too_long`
check from `BA_TEST_SEVERE` to `BA_TEST_SUGGESTION`.
- Updates the `checkdesc:imgaltistoolong` lang string to be more of a
reminder/suggestion rather than an error.
This adds the "Show All" button to the question bank filters
to allow users to select all questions easily.
It also adds new behat tests to test the functionality.
- This adds simple logic check to filter.js to stop user
submitting an invalid category.
- This adds new behat steps to check this validation.
- This adds a new behat test to test this in managecategories.
While MDL-43938 introduced badge importing, two tasks were left incomplete.
1) Creating the backup_import_badges setting for default import behaviour.
2) Preventing the inclusion of badges during activity duplication.
This commit implements them.
This commit does few things:
- Remove unnecessary grade field to assign generator.
- Remove unnecessary comment lines.
- Update the warning message assertion to use the no-break space unicode character.
ChartJs has a property called locale that makes possible to format scale
numbers according to a language. This way we ensure that decimal places
will be displayed correctly in the chart labels and tooltips.
The changes also affect the AI usage report. The provider column will show
the provider plugin name instead of the plugin class in the database.
Co-authored-by: Stevani Andolo <stevani.andolo@moodle.com>
The SELECT statement can only include columns that are part of the
GROUP BY clause. To resolve this issue, instead of including all columns
('*'), only the 'id' column is now included in the SELECT statement,
while still preserving the existing GROUP BY statement. This column is
the only one needed to identify the relevant qtype_ordering_options
record that requires updating in the next step.
Change list_participants() to exclude both suspended users and users
with auth='nologin' when show_only_active_users() is true. This
prevents the failure of notification tasks when such users are enrolled
in the course.
Co-authored-by: Leon Stringer <leonstr@users.noreply.github.com>
Random questions set to question categories which no longer exist
was throwing an error making it impossible to use or edit the quiz
to fix it. This will now allow the user to view the questions and
edit the quiz in order to fix the problem of the missing category.
Previously the version ordering was done on timecreated which
wasn't always correct. This now uses the version number instead.
Also set the default sorting on the history page to be version.
Also backports a change to the behat question generator to let
us set the value of fields on updated questions in the step.
When chartJs was updated to version 3.8.0, chart axis were now accessed
as a object property instead of an array element. This solution aims to
update the way we set the axis properties, aiming to display the labels
and other properties.
Now units tests covering external functions `core_badges_get_badge`,
`core_badges_get_user_badges` and `core_badges_get_user_badge_by_hash`
check all badge fields, including cases where the user has no
permission to view all details.
This fixes the bug where if the latest version of the question is hidden,
the question disappears, even if older versions exist that are still visible.
This change fixes 2 issues:
1 The focus lock for modals (e.g. within Tiny editor) did not
correctly loop round from the end of the modal to the start.
2 After clicking 'Browse repositories' button in a Tiny editor
modal, and closing the file picker, focus did not return to
the button as expected.
It is unnecessary to allow HTML to be added to the drop zone label text,
as this content is hidden and only accessible to screen readers.
Additionally, the content is currently not properly formatted, which
introduces a risk for potential XSS exploits. This change ensures that
only plain text (PARAM_TEXT) is allowed when adding content and that the
content is properly formatted before being output.
With the change from `aside` to `section` for blocks within the main
content region, the selector for instances of the calendar block not in
the main content region also needs to be updated to use a more generic
selector that can cover when either the blocks container containing the
calendar block is an `aside` or a `section`.
The `data-blockregion` attribute is a good selector for this purpose.
Unique labels for the block regions:
* `side-pre` blocks - "Blocks"
* `side-post` blocks - "Supplementary blocks"
* `content` blocks - "Main content blocks"
Blocks in the main content region (div role="main") should not also be
in an <aside> as it is a top-level landmark.
Blocks are contained in an <aside> which has a default ARIA role of
"complementary", a top-level landmark. So assigning a "complementary"
role for block instances is not needed. As blocks are already in a
<section> tag which has a default role of "region", there's no need
to override the ARIA role, unless specified by the block plugin.
Read more at:
https://www.w3.org/WAI/ARIA/apg/practices/landmark-regions/
The containers for the blocks in layout templates should not be using a
<section> tag (which has a default landmark role of "region") as the
blocks are already contained in an <aside> tag that has the default
"complementary" role which should be a top-level landmark.
Read more at:
https://www.w3.org/WAI/ARIA/apg/practices/landmark-regions/
The #region-main container should not be a <section> tag (which has a
default landmark role of "region") as it contains the container with
the "main" role which should be a top-level landmark.
Read more at:
https://www.w3.org/WAI/ARIA/apg/practices/landmark-regions/
This fixes various external methods that initialize page output
manually, e.g. `core_get_fragment`, which can mess with third party
proxies that modify data in transit because of the current default
response type header (text/html).
Co-authored-by: Mario Torres
The endorsement has been removed from the JSON because, according to
the OBv2.0specification, it must not be included in either the badge
or the assertion.
Including it results in a format error, rendering the badge invalid.
In timezones where daylight savings time is used, courses that start
on a Monday at 00:00 would display the week headings incorrectly
during the change forward.
When the time changes backwards, courses that have a start time of
Sunday at 23:00 also have a mislabeled week.
This attempts to use the DateTime() library, along with the user's
local timezone setting to display the correct day, rather than just
subtracting 86400.
After deploying to our production environment, we noticed that for large gradebooks, having a max of 200,000 grades per
page was still too high and resulted in the gradebook page crashing or failing to load entirely. This commit will make
this value configurable (e.g. ->maxgradesperpage = 70000) rather than a constant so that other institutions can tune it.
Co-authored-by: Leon Stringer <leon.stringer@ucl.ac.uk>
This removes the setting of the 'deleteall' param to every link
on the question edit page and inserts it into the url based
on if we actually want to delete all versions or not.
The "See questions" link for random questions was still using the old
format the filter conditions, so was only applying the category filter
on the list of questions displayed. This means that if a tag filter (or
any other filter) was set on the random question set, it was not applied
when viewing the list of questions.
This change takes all the filter conditions applied in random question's
slot and passes them to the question bank in the "See questions" link.
It's possible the first returned field contains a null value, while
subsequent fields may be non-null - in this case we should still
populate the fullname in column callback.
The function returns the number of modules completed by a user and
executes a COUNT aggregate function to avoid running many queries
to obtain this information, aiming to optimize performance.
Co-authored-by: Carlos Castillo <carlos.castillo@moodle.com>
Avoid mixing float/string types, where the decimal separator could
vary according to current locale (as per previous fix 5a1aef5a, which
was subsequently re-broken by b92886ad).
This makes the rendering of the question comments count additionally
check the core moodle/comment:post capability, since this capability
is required to make comments. Previously, this was not being checked
so users could open the modal to make a comment, which was causing
a javascript error due to expected elements being missing.
- Adds the "cat" field to the converted legacy filter, which was
missing.
- Does the conversion on the editrandom.php page as this was
throwing a warning.
Fix PHP fatal error "Call to undefined function
core\session\disk_free_space()" when disable_functions=disk_free_space.
Prior to PHP 8.0 this error was suppressed by '@'.
Co-authored-by: Federico Alvarez <32086536+fedealvz@users.noreply.github.com>
This changes prevent the admin to define an incorrect proxybypass value.
Dropped out formats in MDL-74289 are now fixed automatically.
e.g.: "192.168." becomes "192.168.0.0/16" and ".domain.tld" becomes "*.domain.tld".
The report performs a `LEFT JOIN` on the external service table/entity
so we need to account for that in column callbacks and actions.
Also the shortname field is nullable, so account for that too.
Prior to fd676913 the manage course categories tree element used
the 'i/empty' icon as a fixed width spacer (fa-fw). However this
icon is now shown as a square, which looks out of place here.
Change to a different icon that maps to the same fixed width spacer
in order to restore the previous behaviour.
Onedrive direct download URL does not accept authorization headers,
it will just return the `unauthenticated` content with 401 HTTP Code
We switched to a safer way. We fetch the item information and use
a new curl instance (without authorization headers)
to fetch the content via direct download URL
This makes the tags which are available to the user on the question
bank tag filter, use tags from all available contexts, not just
that course. This means they can filter by tags assigned to system
questions as well, for example.
This way of highlighting user tour content removes the need to
juggle z-index. It also resolves the problem of cloning the target
element into a separate container and breaking styling.
Popovers were not being closed when clicking elsewhere resulting in
multiple popovers open at the same time that cannot be closed. That
was happening because the trigger for popovers was set to "focus" and
"click" at the same time. This patch removes the "click" as trigger.
Also, adds the click event listener to show the popover and avoid the
problem described in MDL-82570, that caused this regression.
Before checking for and calling the module _refresh_events function in
course_module_calendar_event_update_process, the module lib.php file
needs to be included if it has not been already.
@@ -6,6 +6,129 @@ More detailed information on key changes can be found in the [Developer update n
The format of this change log follows the advice given at [Keep a CHANGELOG](https://keepachangelog.com).
## 4.5.3
### core_question
#### Added
- Question bank Condition classes can now implement a function called "filter_invalid_values($filterconditions)" to remove anything from the filterconditions array which is invalid or should not be there.
For more information see [MDL-83784](https://tracker.moodle.org/browse/MDL-83784)
#### Fixed
- Duplication or multiple restores of questions has been modified to avoid errors where a question with the same stamp already exists in the target category.
To achieve this all data for the question is hashed, excluding any ID fields.
The question data from the backup is first reformatted to match the questiondata structure returned by calling `get_question_options()` (see https://docs.moodle.org/dev/Question_data_structures#Representation_1:_%24questiondata). Common question elements will be handled automatically, but any elements that the qtype adds to the backup will need to be handled by overriding `restore_qtype_plugin::convert_backup_to_questiondata`. See `restore_qtype_match_plugin` as an example.
If a qtype plugin calls any `$this->add_question_*()` methods in its `restore_qtype_*_plugin::define_question_plugin_structure()` method, the ID fields used in these records will be excluded automatically.
If a qtype plugin defines its own tables with ID fields, it must define `restore_qtype_*_plugin::define_excluded_identity_hash_fields()` to return an array of paths to these fields within the question data. This should be all that is required for the majority of plugins. See the PHPDoc of `restore_qtype_plugin::define_excluded_identity_hash_fields()` for a full explanation of how these paths should be defined, and `restore_qtype_truefalse_plugin` for an example.
If the data structure for a qtype returned by calling `get_question_options()` contains data other than ID fields that are not contained in the backup structure or vice-versa, it will need to override `restore_qtype_*_plugin::remove_excluded_question_data()` to remove the inconsistent data. See `restore_qtype_multianswer_plugin` as an example.
For more information see [MDL-83541](https://tracker.moodle.org/browse/MDL-83541)
## 4.5.2
### core
#### Added
- A new core\ip_utils::normalize_internet_address() method is created to sanitize an IP address, a range of IP addresses, a domain name or a wildcard domain matching pattern.
Moodle previously allowed entries such as 192.168. or .moodle.org for certain variables (eg: $CFG->proxybypass). Since MDL-74289, these formats are no longer allowed. This method converts this informations into an authorized format. For example, 192.168. becomes 192.168.0.0/16 and .moodle.org becomes *.moodle.org.
Also a new core\ip_utils::normalize_internet_address_list() method is created. Based on core\ip_utils::normalize_internet_address(), this method normalizes a string containing a series of Internet addresses.
For more information see [MDL-79121](https://tracker.moodle.org/browse/MDL-79121)
#### Changed
- The `core_renderer::tag_list` function now has a new parameter named `displaylink`. When `displaylink` is set to `true`, the tag name will be displayed as a clickable hyperlink. Otherwise, it will be rendered as plain text.
For more information see [MDL-75075](https://tracker.moodle.org/browse/MDL-75075)
- The following test classes have been moved into autoloadable locations:
For more information see [MDL-83968](https://tracker.moodle.org/browse/MDL-83968)
### core_completion
#### Added
- The method `count_modules_completed` now delegate the logic to count the completed modules to the DBMS improving the performance of the method.
For more information see [MDL-83917](https://tracker.moodle.org/browse/MDL-83917)
### core_courseformat
#### Fixed
- HTML IDs relating to section collapse/expand have been changed in the course format templates.
- core_courseformat/local/content/section/header #collapssesection{{num}} has been changed to #collapsesectionid{{id}}
- core_courseformat/local/content/section/content #coursecontentcollapse{{num}} had been changed to #coursecontentcollapseid{{id}}
For more information see [MDL-82679](https://tracker.moodle.org/browse/MDL-82679)
### core_question
#### Added
- The `get_bulk_actions()` method on the base `plugin_features_base` class has been changed to allow a qbank view object to be passed through. This is nullable and therefore optional for qbank plugins which don't need to do so.
For more information see [MDL-79281](https://tracker.moodle.org/browse/MDL-79281)
### core_reportbuilder
#### Added
- The `core_reportbuilder_testcase` class has been moved to new autoloaded `core_reportbuilder\tests\core_reportbuilder_testcase` location, affected tests no longer have to manually require `/reportbuilder/tests/helpers.php`
For more information see [MDL-84000](https://tracker.moodle.org/browse/MDL-84000)
### core_tag
#### Changed
- The `core_tag\taglist` class now includes a new property called `displaylink`, which has a default value of `true`. When `displaylink` is set to `true`, the tag name will be displayed as a clickable hyperlink. If `displaylink` is set to `false`, the tag name will be rendered as plain text instead.
For more information see [MDL-75075](https://tracker.moodle.org/browse/MDL-75075)
### mod_assign
#### Fixed
- The unit test for the privacy provider has been marked as final.
A number of core tests had been incorrectly configured to extend this test
but should instead be extending `\mod_assign\tests\provider_testcase`.
Any community plugins extending the `\mod_assign\privacy\provider_test` test
class should be updated to extend `\mod_assign\tests\provider_testcase` instead.
For more information see [MDL-81520](https://tracker.moodle.org/browse/MDL-81520)
### mod_quiz
#### Changed
- The `quiz_question_tostring` method now includes a new boolean parameter, `displaytaglink`. This parameter specifies whether the tag name in the question bank should be displayed as a clickable hyperlink (`true`) or as plain text (`false`).
For more information see [MDL-75075](https://tracker.moodle.org/browse/MDL-75075)
### tool_behat
#### Added
- New Behat step `\behat_general::the_url_should_match()` has been added to allow checking the current URL. You can use it to check whether a user has been redirected to the expected location.
e.g. `And the url should match "/mod/forum/view\.php\?id=[0-9]+"`
For more information see [MDL-83617](https://tracker.moodle.org/browse/MDL-83617)
And Inavigateto"Plugins>Pluginsoverview"insiteadministration
Scenario: An administrator can view plugins overview page
Then "Pluginsoverview""text"shouldexist
And "Checkforavailableupdates""button"shouldexist
And "Allplugins""link"shouldexist
And "Additionalplugins""link"shouldexist
Scenario: An administrator can access list of activities when activity modules cog icon is pressed
When Iclickon"Settings""link"inthe"Activitymodules""table_row"
Then "Activities""text"shouldexist
And "Manageactivities""text"shouldexistinthe".breadcrumb""css_element"
And "Activitymodules""link"shouldexistinthe".breadcrumb""css_element"
Scenario: An administrator can access plugin settings
When Iclickon"Settings""link"inthe"Assignment""table_row"
Then "Assignmentsettings""text"shouldexist
And "Assignmentsettings""text"shouldexistinthe".breadcrumb""css_element"
And "Assignment""link"shouldexistinthe".breadcrumb""css_element"
And "Activitymodules""link"shouldexistinthe".breadcrumb""css_element"
Scenario: Plugins with dependencies cannot be uninstalled
When Inavigateto"Plugins>Pluginsoverview"insiteadministration
Then "Uninstall""link"shouldnotexistinthe"Database""table_row"
And "Requiredby:filter_data""text"shouldexistinthe"Database""table_row"
Scenario: Cancelling plugin uninstall does not uninstall the selected plugin
When Iclickon"Uninstall""link"inthe"Assignment""table_row"
Then "UninstallingAssignment""text"shouldexist
And "YouareabouttouninstallthepluginAssignment.Thiswillcompletelydeleteeverythinginthedatabaseassociatedwiththisplugin,includingitsconfiguration,logrecords,userfilesmanagedbythepluginetc.ThereisnowaybackandMoodleitselfdoesnotcreateanyrecoverybackup.AreyouSUREyouwanttocontinue?""text"shouldexist
And Iclickon"Cancel""button"
And "Uninstall""link"shouldexistinthe"Assignment""table_row"
- New Behat step `\behat_general::the_url_should_match()` has been added to allow checking the current URL. You can use it to check whether a user has been redirected to the expected location.
e.g. `And the url should match "/mod/forum/view\.php\?id=[0-9]+"`
For more information see [MDL-83617](https://tracker.moodle.org/browse/MDL-83617)
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.