Bootstrap 5 removed _print.scss which included print-specific styles,
including one for hiding the nav. This just re-introduces a single
style override for the navbar. Any other print-specific styles removed
in BS5 are left as removed.
Formats the output of the penalised grades shown in the
'Previous attempts' for advanced grading methods for consistency
with other sections/areas where this information is displayed.
Ensures the penalty indicator is displayed in the 'Feedback' and
'Previous Attempts' sections for penalized grades when using advanced
grading methods.
This is used by the forms implementation for faux-label elements
so that when they are clicked on, the first input element of the
corresponding group is focused.
> ARIA Expanded
A disclosure is a widget that allows content to be
collapsed (hidden) or expanded (visible). It has two elements:
1. Disclosure button, and
2. Section of content whose visibility is controlled by the button.
ARIA Expanded must be applied to the disclosure button element
or the element with role="button" rather than the content.
> ARIA label
Move the icon title and aria-label as they are not
interactive elements to the toggle element.
The title attribute is helpful for the tooltip,
and the aria-label benefits the screen reader.
The "Switch question bank" modal was attempting to load every question
bank in the system the user has access to. For a highly privileged user,
this could mean loading the coursemodinfo cache for every course in the
system, resulting in memory exhaustion.
This change updates the API for getting shared question banks so it can
be searched by name and limited to a number of results. There is a new
external service that uses this functionality, and a Javascript data
provider for calling the service. The autocomplete in the "Switch
question bank" modal will now use this data provider for the "Other
question bank" autocomplete, rather than loading all banks up front.
Adds padding on the .dropdown-item element to fix the lack of spacing
between the 'active' indicator and the item in the select_menu component.
Also converts some of the hard-coded padding to use existing spacer
definitions.
Modifies the query used to filter graded students by removing the
condition that requires a submission to be marked as submitted. This
change allows the query to return students who have not submitted
their work but have still been graded, a scenario supported in the
assignment module.
Previously, the test was passing by fluke because all question attempt
steps had the same timecreated date. However, the $originaliterator only
contained the first step of the question, not all 3 attempts that were
being backed up and restored. This means we were comparing the
timecreated of the first backed-up step with the timecreated on the
third restored step. As of MDL-68806, the first step's timecreated is
question_attempt_step::TIMECREATED_ON_FIRST_RENDER, which shows up this
error.
This change gets the question_usage_by_activity object back from the
attempt object which contains all the attempt steps, rather than using
the one created in the test, which doesn't.
Previously, the timecreated for the first step of any question attempt
was set to the current time when the quiz attempt was created. With quiz
attempts being pre-created, this means the question attempts looking
like they were started before the quiz attempt. It also limits the
ability to analyse when a student actually started each question.
This change adds a new class constant,
question_attempt_step::TIMECREATED_ON_FIRST_RENDER. Passing this to the
question_attempt_step constructor will cause the timecreated to be set
to the time when the question attempt is first rendered, rather than
when the step is created.
In case questions used in pre-created attempts were edited after
pre-creation, we check when the attempt is started and create
new question attempts if needed. There is still an opportunity to
improve performance further by finding a way to do this efficiently
when a new question version is created.
In previous versions of Moodle we recommended use of the fallback
resource with /error/index.php.
This is incompatible with the routing system because they use the same
mechanism for responding to any unknown request.
To better handle this we need to move the current error handler page to
a routed page, and to provide a shim for the old location.
At the same time we need to improve the Slim Error handling middleware
to respond with our 404 handler for all 404s, except for those on API
routes where we always respond with JSON.
This is the beginning of the end for non-routed pages in Moodle and the
start of SEO-friendly page URLs.
A 'shim' is provided for backwards compatibility.
This ensures that we always dispatch the dynamic table updated event
against the same table we just updated. Previously it was possible
for another table to receive the event, where both tables were
effectively the same instance of one another (e.g. custom reports).
Where the same report exists multiple times on the page, ensure we
are still able to uniquely identify each via ID. Update the filters
module to ensure the filters form for each report is initialised.
Ollama is an open-source project that serves as a powerful
and user-friendly platform for running LLMs on your local machine.
It acts as a bridge between the complexities of LLM technology
and the desire for an accessible and customizable AI experience.
This plugin interfaces with the upstream AI service and will
make available AI Actions to the subsystem.
The overall structure of these messages, which adds the course
and assignment name to whatever comes from the particular
message language string, was hard-coded in the assignment code.
By changing this to use a template, now themes can override this.
Simplified the acquire_lock method in the redis cache store, so that it
sets the key with an expiry in one go. Before, it would set it, then
update it afterwards with an expiry.
This also makes test_lock_timeouts() more robust.
Co-authored-by: Daniel Ziegenberg <daniel@ziegenberg.at>
Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
The "currentcat" parameter contains the categoryid, but is being
compared to a string like "contextid,categoryid" so was not being
matched correctly to exclude the current category from the list of
options.
The previous create_module actions uses section number instead of
section id. This produces several bugs when sections are moved around
the course in edit mode. This issue implements a new_module action with
all related mutations and webservices. The new one uses section id
instead of section number.
After Bootstrap 5 upgrade in MDL-75669 some inline input elements inside questions
(qtype_gapselect, qtype_match and qtype_multianswer) are not correctly displayed.
That happened because new "form-select" class adds "display: block" instead of
"display: inline-block" as before in Bootstrap 4.
This commit fixes the "select" inputs in the question types adding "d-inline-block"
class.
Clicking "Switch bank" in the random question modal resulted in a
Javascript error, because the initial modal was being returned from the
event listener for the button, not from the promise that tried to
.then() it.
This moves destruction of the initial modal to after the new modal is
created.
- Improve SCSS deprecated-styles @mixin to receive a paramenter of the
deprecated selector.
- Update all the current deprecated styles that are using deprecated-styles @mixin
to include the deprecated selector as parameter.
- Improve the 'look_for_deprecated_styles' behat function.
This add the ability for assingment submission plugins to summarise
what was submitted, and then that summary is included in the
message to students confirming to them that their submission
was received.
Then, this new API is implemented in the file and online text plugins.
Co-authored-by: Tim Hunt <T.J.Hunt@open.ac.uk>
- Improve visuals of invalid questions by highlighting and
labelling.
- Removes links to actions which will not work for invalid
questions
- Doesn't allow a preview/attempt of a quiz if it has invalid
questions. This is an improvement over it throwing an exception.
- Don't allow the adding of questions to a quiz if they have
an invalid type.
We now report un-released locks in Behat tests, and when developer
debug is on, as well as in PHPunit.
The exception now has a full stack track, to help locate the problem.
- Highlight the row and adds a badge to indicate that a question
is invalid, to make it much clearer.
- Remove the bulk action checkbox
- Fixes usage count and comments links for missingtype questions.
- Add new behat tests and fix up some existing ones to work
with new logic.
I assume that it was necessary at some point to run the ad-hoc tasks in
these tests, however the only task now being run is
regrade_final_grades, which causes the tests to fail due as they produce
output.
Whether the regrade is performed or not has no impact on the result of
the test, so removing the ad-hoc task run seems appropriate.
Currently, large courses can take a long time to perform a full regrade.
This is currently handled with a progress bar to prevent frontend
timeouts while the regrade takes place. However, because it can take so
long a teacher may not want to wait with the page open for several
minutes, particularly if they are performing several operations that
trigger a regrade.
This adds a new async flag to grade_regrade_final_grades which is true
by default. Instead of performing the regrade immediately, this queues
an instance of \core\task\regrade_final_grades for the course, which
will be executed in the background.
It is advisable to always leave the async flag set true, except in the
following scenarios:
- Automated tests.
- The regrade_final_grades task which actually wants to do the
calculations immediately.
- When you have performed a check to determine that the regrade process
is unlikely to take a long time, for example there are only a small
number of grade items.
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.
We know that, due to old bugs in places like backup and restore,
you can get question categories with a different contextid from
their parents. This was breaking the upgrade, so this is code
to auto-fix them before the upgrade continues.
Co-authored-by: Stephan Robotta <stephan.robotta@bfh.ch>
The upstream changes to scssphp to support include a breaking version
change. As an interim measure this change addresses the nullable param
deprecations introduced by PHP 8.4.
Mustache.php has been largely abandoned. No version compatibly with PHP
8.4 is currently available.
As an interim measure this change addresses the nullable param
deprecations introduced by PHP 8.4.
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.
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.
After Bootstrap 5 upgrade in MDL-75669 the main action buttons displayed
after the activity header were not displayed horizontally. Fix the layout
for BS5.
The restore process assumes all categories in the backup need restoring,
then sorts out which ones to keep later.
This caused issues with restoring set references that used categories
from a shared question bank, since the reference was updated to point to
a copy of the original category, which then got removed as it wasn't
needed.
This change checks whether we should keep the set reference pointing at
the original category, which it will unless:
- We are restoring to a different site (so the original category will
not exist)
- The context the original category belonged to no longer exists.
- The original category itself no longer exists
- The original category belonged to the same context as the original set
reference (in which case we are restoring a whole module, including a
copy of the category)
- We do not have permission to access questions in the original context.
If any of these are true, we should be keeping the restored copy of the
category, and the filter condition should point to it instead.
question_category_delete_safe checks if questions in the category to be
deleted are in use, and if so, saves them to a new qbank instance to
avoid breaking existing quizzes.
However, if the whole course is being deleted, the qbank is created in
the current course as question_category_delete_safe does not know is is
about to be deleted, and the questions are lost when the deletion
occurs.
This change passes down a flag to question_category_delete_safe so it
knows it was called as part of a whole course deletion, and moves saved
questions to the site course instead of the current course.
More work built upon e76d99f2, we need to perform the alias processing
earlier to ensure that it works for system reports where user sorting
isn't the default.
Expand the methods available in the stored_progress_bar output component
and stored_progress_task_trait to allow a progress bar to be created in
a "pending" state before the associated task is executed.
This progress class updates a stored_progress_bar in a similar way to
how \core\progress\display updates a regular progress_bar, but it does
not produce any output unless the progress bar does.
For the group concatenation types, allow callers to define the text to
display between aggregated items. Use this to change the separator for
formatted tag names to be a space character.
- removed sources in the `library/` directory of the SimplePie lib as
those were for PSR-0 namespaces and we use PSR-4
- removed the PSR-4 autoloader provided by SimmpePie as we use our own
class loading mechanism
- updated the instructions in readme_moodle.txt
- fixed constants now being namespaced under \SimplePie\SimplePie
Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
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.
Amendments to the column class allow reports/entities to specify these
options for column instances, which are then passed to the aggregation
type when it is applied.
The library raises the minimum required PHP version to 8.0 and comes
with an advertised PHP 8.4 compatibility.
Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
The library raises the minimum required PHP version to 8.0 and comes
with an advertised PHP 8.4 compatibility.
Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
The library raises the minimum required PHP version to 7.1 and comes with PHP 8.4 compatibility.
Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
This privacy provider was erroneously added to auth_mnet where it should
not have been in the first place.
Original issue: MDL-84307
Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
- Remove auth_mnet from the standard plugins
- PHP Unit:
- Remove auth_mnet as a sample from unit testing in login tests
and component tests replacing it with auth_ldap.
- Conditionally skip tests for block mnet_hosts when auth_mnet is
not installed.
Original issue: MDL-84307
Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
- Remove block_mnet_hosts from the standard plugins
- Remove block_mnet_hosts from default admin presets
- Replace block_mnet_hosts in behat tests of core features
Original issue: MDL-84309
Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
After Bootstrap upgrade in MDL-75669 the checkbox and advanced checkbox
form elements were not correctly displayed, because there was no space
between the input and the label. Fixed it using BS5 syntax.
We're introducing two new sets of APIs for both custom and system
reports:
* Report actions allow for the definition of an action to belong
to the report and be rendered alongside the filters button;
* Report info container allows for the definition of content to
render between the aforementioned action buttons and the table
content itself
Add additional question filters for the "Created by" name and "Modified
by" name.
These filters will operate on all name fields that are selected for
these columns, as the exact text displayed is determined by the
fullname() function and not he query.
- This adds JS validation to the category autocomplete.
- This adds new behat steps to check this validation.
- This adds a new behat test to test this in managecategories.
The versions of the following dependencies have been updated as of
integration:
- codemirror/search: 6.5.9 => 6.5.10
- codemirror/view: 6.36.2 => 6.36.4
Replaced by mlbackend_python as the new default. New installs
will have analytics disabled to give admins a chance to
configure mlbackend_python before enabling analytics again.
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.
-After Bootstrap 5 upgrade in MDL-75669 the AI image model form buttons
were not working correctly. Fix the related syntax to BS5.
- Fix some deprecated 'form-group' usages
Some references can remain, and others should remain until we drop
support for YUI, or Atto is no longer supported in the plugins database.
Note: Some reference to Atto will remain until such a time as it is no
longer possible to support the editor via the plugins database.
One of the error levels PHP previously emitted was E_STRICT, on code
that was not strictly correct to ensure interoperability and forward
compatibility. PHP 7.0 converted the majority of existing E_STRICT
warnings to E_NOTICE, and since PHP 8.0, all E_STRICT notices have
changed to E_NOTICE.
Because all of the E_STRICT notices are upgraded to E_NOTICE since PHP
8.0, PHP 8.4 deprecates the E_STRICT constant.
The E_STRICT constant is deprecated in PHP 8.4. Using the constant
anywhere in PHP code now emits a deprecation notice in PHP 8.4 and
later.
The E_STRICT constant will be removed in PHP 9.0.
PHP core and core extensions since PHP 8.0 and later do not emit
E_STRICT notices at all. It is safe to assume that any PHP applications
that run on PHP 8.0 and later will never encounter E_STRICT notices, and
error reporting and handling can be safely updated to ignore E_STRICT
notices.
See: https://php.watch/versions/8.4/E_STRICT-deprecated
Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
I also removed the version specific parts of readme_moodle.txt as those
infos are already available in the thirdpartylibs.xml. Also the
mentioned local changes are no longer relevant, so they can go too.
Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
The library raises the minimum required PHP version to 8.1 and comes
with an advertised PHP 8.4 compatibility.
Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
- Update and improve styles for .btn-icon helper class for consistency.
- Added new $btn-icon-border-radius SCSS variable to cuztomize the btn-icon
border radius.
- Fix and simplify current .btn-icon usages
After the Bootstrap 5 upgrade the contrast of the form inputs was
not enough. This commit adds the same colour contrast as before.
Also fixed some inconsistencies in classic theme variables.
The following methods have been removed (they were deprecated
long time ago):
- prepare_for_view()
- calendar_add_event_metadata()
The following methods have been deprecated (they are not used
anymore):
- calendar_get_courselink()
- calendar_events_by_day have been
Co-author: Amaia Anabitarte <amaia@moodle.com>
To improve usability, the UX team proposed the following changes:
- Remove most tooltips
- Add information directly to the page
- Simplify several text strings
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.
This removes the "max" attribute from the input field of the
datetime filter. This can then be added back in by specific
filters if they inherit the core one and add their own
getContext() method.
After the Bootstrap 5 upgrade, table rows with defined text colour
(using "text-muted" helper class) were not affecting the inner cells.
Add a custom rule in tables.scss to avoid that behaviour.
New `theme_boost/bs4-compat` JS module added to silectly convert old BS4
data-attributes syntax to the new in BS5.
For example: data-toggle="dropdown" > data-bs-toggle="dropdown"
Co-authored-by: ferranrecio <ferran@moodle.com>
After Bootstrap 5 upgrade completion badges (success, danger) in the
activity pages were incorrectly displayed. This commit is fixing the
helper classes needed.
Bootstrap EventHandler is managing the keydown event at document
level in the capture phase. That is conflicting with dropdown elements
with form autocomplete inputs inside, because when suggestions panel is
open, pressing the "Esc" key will close the whole dropdown.
This commit fixes that behaviour by realocating the Bootsrap dropdown
event listener to the body instead of the document.
This commit will add a bs4-compat SCSS file with some of the helper classes
that are dropped in BS5. That will help third-party plugins to do the migration.
- Add backward compatibility for .media
- Add backward compatibility for badges
- Add backward compatibility for forms
- Add backward compatibility for cards
- Add backward compatibility for .no-gutters
- Add backward compatibility for spacing
- Add backward compatibility for margins and paddings
- Add backward compatibility for float directions
- Add backward compatibility for border directions
- Add backward compatibility for text directions
- Add backward compatibility for .close
- Add backward compatibility for font utilities
- Add backward compatibility for rounded sizes
- Add backward compatibility for sr-only
- Add backward compatibility for custom controls
- Add backward compatibility for .btn-block
The course activities overview shows the section name under each
activity. However, this information should not be present when the
course format does not support sections.
Adds the necessary code to present the feedback information in the
course overview page. Due to this integration, the message user gets
when a feedback is already submitted has been unified and it is now the
same on both activity UI and the overview report.
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>
Adds a new get_instance_record in the cm_info object so core can get the
activity table record without using the $DB object every time. Also, the
method caches de result so getting more than once per execution is much
faster.
- Add new .btn-subtle helper class that accept different colour themes
(.btn-subtle-success, .btn-subtle-warning, ...) and also .btn-subtle-body
for basic styling
- Remove specific styles in course.scss that are not needed anymore
- Adjust some styles in course.scss that were affected by this change
The change introduced in MDL-46739, which modified the 'value' column in
the 'user_preferences' database table from CHAR to TEXT, caused the
upgrade query to fail due to the '=' comparison operator being used on
this column in the WHERE clause. This fix updates the query to use
$DB->sql_compare_text() instead.
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.
* Final deprecation for the use of a boolean as 'primary' parameter
(4th parameter of the constructor), used before to specify a button
was a primary button. This has been replaced by a wider range of
choices.
Bootstrap 5 upgrade in MDL-75669 generated a regression in Forum table
where form switches in "Subscribe" column were not correcly displayed.
This commit fixes that UI problem.
Because the fix is affecting "toggle all" checkboxes, an small fix was
also needed there.
You don’t need jQuery in Bootstrap 5, but it’s still possible to use our components with jQuery.
If Bootstrap detects jQuery in the window object, it’ll add all of our components in jQuery’s plugin system.
This allows you to do the following:
$('#myTooltip').tooltip('show')
It was a dependency of zipstream, but is no longer required as this
functionality has been replaced by native PHP functionality.
Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
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>
The course overview page can represent a table with the overview
integration implemented by the activity plugins. Each plugin
table is loaded as a fragment to optimize the course overview
loading time.
The course overview page allows plugins to implementa an
activity overview integration. This commit adds all the
base classes for the integration, and also the "resources"
integration used by default in all plugins considered
resources like url, file, folder...
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.
The current completion button has specific templates only for the course
view page. However, from now on this component may be used in other
places and it needs a main template to be rendered in a standard way.
Due to Oracle re-factoring, we can improve the performance of date
aggregation by only executing the column supplied query once. We
can also improve the generated GROUP BY query to re-use the column
alias on supported DBs, rather than executing the aggregation again.
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.
- Fix subpanels positioning using data-bs-popper static
- Fix subpanels and dialogs event listener to use Boostrap EventHandler.
Doing that will avoid Bootstrap from stop propagating the event to the
subpanels and dialogs listeners.
- Because of the new BS5 syntax and changes in event listeners the sorting
filter for block timeline was now working. This commit fixes the incorrect
behaviour.
Bootstrap5 documents that, for tooltips and when title is used, Popper
will replace it automatically with data-bs-title when the element is rendered.
So using title makes no sense because Popper will replace it. We are using
data-bs-original-title instead.
The parameter are usable in course participants page because user
could add bulk notes linked to users. But that script is not used
in report/participants, so we don't need those arguments on the call.
Fix problem where having a dropdown with a form autocomplete inside and
pressing Escape key will close the hole dropdown instead only the autocomplete
suggestions.
After Bootstrap 5 upgrade, when expanding/collapsing sections in course index and
move content modal using the chevrons, the Bootstrap collapse event will occur
before the courseindex logic (In BS4 if was the opposite and the BS collapse event
was triggered after). This commit fixes that specific problem.
In BS5 the combination of both ".d-none" and ".d-inline" block together
is now prioritizing "d-none". Because of that the logic has been changed
to only use ".d-none" for toggling the display.
- Fix some behat steps and scenarios that are failing because of
Bootstrap 5 syntax changes.
- Add a new $behatsite SCSS variable when behat is runinng that
disables Bootstrap transitions and effects.
- media-breakpoint-down() uses the breakpoint itself instead of the next breakpoint (e.g., media-breakpoint-down(lg)
instead of media-breakpoint-down(md) targets viewports smaller than lg).
In BS5 all .row classes are intended to contain elements with any .col class
There were some cases where the .row class was being used only for display flex
purposes, so they where replaced.
- .custom-check is now .form-check.
- .custom-check.custom-switch is now .form-check.form-switch.
- .custom-select is now .form-select.
- .custom-file and .form-file have been replaced by custom styles on top of .form-control.
- .custom-range is now .form-range.
- Dropped .input-group-append and .input-group-prepend. You can now just add buttons
and .input-group-text as direct children of the input groups.
Data attributes for all Bootstrap5 JavaScript plugins are now namespaced
to help distinguish Bootstrap functionality from third parties and your own code.
For example, data-bs-toggle instead of data-toggle.
This commit refactor all old Bootstrap data-attributes to the new syntax.
Co-authored-by: Daniel Ziegenberg <daniel@ziegenberg.at>
In manu ocasions, the select menu template is used for the tertiary
navigation. However, in many scenarios this tertiary navigation acts as
a heading level. With this patch the template data can specify the
desired heading level to guarantee accessibility.
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.
- A hook to enable plugins to add extra settings to the restore task.
This would be placed inside restore_root_task::define_settings()
- A hook to enable plugins to add extra fields to the copy course form. This would be done inside the copy_form class.
- An adjustment to add the restore plan settings to the course restored event data.
This would be done inside restore_plan::execute().
- A hook to enable extra work inside the asynchronous copy task. To be placed inside asynchronous_copy_task::execute().
This issue creates a couple of enum to style buttons and text
alignments. Enums can be used by output classes to limit the
types of values accepted by using strict types.
This was only an issue for tasks set to run in the hour when the clocks
change for daylight saving time. E.g. if a task is set to run at 1am
every day in the Europe/London timezone, then the day the clocks go
forward gets skipped because 1am doesn't exist on that day.
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/
The fields imageauthorname, imageauthoremail, and imageauthorurl have
been removed from badges due to confusion and their absence from the
official specification. These fields also do not appear in OBv3.0.
Additionally, the image_author_json.php file has been removed as it
is no longer needed.
The old activities block will be fully replaced by a new course
activities overview page in the course secondary navigation. This
commit has the initial implementation of the page.
Where course entity select elements theme, language and calendar are
defined we should prepend with "Do not force" in order to match the
interface when editing the same fields.
The select filter has been updated to ensure it supports empty values
when switched to simplified version (a0ef4bb8) as well as improving
validation to ensure only present options can be used for filtering.
This change exposes the underlying table library API for setting
help icon for table headers, via column instance getter/setter.
Support added for rendering said icons in system reports.
As MDL-73016 set the minimum supported PHP version for Moodle 4.4 and up
to PHP 8.1 we can now safely remove this check. It was introduced with
MDL-73523 because of deprecated openssl_x509_free(), openssl_pkey_free()
and openssl_free_key() functions.
Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
As MDL-73016 set the minimum supported PHP version for Moodle 4.4 and up
to PHP 8.1 we can now safely remove this check.
Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
As MDL-73016 set the minimum supported PHP version for Moodle 4.4 and up
to PHP 8.1 we can now remove the check PHP version 7.2 in combination
with the igbinary extension version.
Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
As MDL-73016 set the minimum supported PHP version for Moodle 4.4 and up
to PHP 8.1 we can now safely switch to php_serialize as the serialize
handler.
Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
As MDL-73016 set the minimum supported PHP version for Moodle 4.4 and up
to PHP 8.1 we can now safely remove this check. As the lang string
`errorphp7required` is particular to mlbackend php plugin we are going
for direct deletion instead of regular deprecation.
Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
Because of PHP bug #70322 two different behaviours were tested (see
MDL-51863). Since those 10 year old PHP versions are way outdated there
is no reason to test for them any longer.
Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
While searching for no longer needed PHP 5.x & 7.0 checks, the
`phpversionhelp` lang string and, subsequently, the `memorylimithelp`
lang string and the `install_helpbutton()` and
`install_print_help_page()` functions were discovered. According to
comments on MDL-2787 and MDL-64482 they are no longer in use since
Moodle 1.x (approximately), neither reachable since some good versions
ago. With MDL-17458 (commit 3b09331066),
the function `print_compatibility_row()` was gone, and it seems like it
was the only place calling `install_helpbutton()`. And
`install_helpbutton()` was the only place where a link to the help mode
(e.g. `install.php?help=$helpfield`) ever surfaced. As both lang
strings and functions are particular to the installer and never could
have been used outside of it, we are going for direct deletion instead
of regular deprecation.
Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
As MDL-73016 set the minimum supported PHP version for Moodle 4.4 and up
to PHP 8.1 we can now safely write this as a one-liner.
Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
As MDL-73016 set the minimum supported PHP version for Moodle 4.4 and up
to PHP 8.1 we can now safely remove this check.
As it was decided that we will not upgrade this library from upstream
any more (see MDL-52465) we can probably safely remove this. This change
is one of a long series of earlier changes. See readme_moodle.txt.
Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
As MDL-73016 set the minimum supported PHP version for Moodle 4.4 and up
to PHP 8.1 we can now safely remove this check. It was introduced with
MDL-75945 because a new signature was introduced to ImagePolygon
functions from PHP 8.1 with the previous signature deprecated in 8.1.
Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
As MDL-73016 set the minimum supported PHP version for Moodle 4.4 and up
to PHP 8.1 we can now safely remove this check. It was introduced with
MDL-73523 because of deprecated openssl_x509_free(), openssl_pkey_free()
and openssl_free_key() functions.
Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
As MDL-73016 set the minimum supported PHP version for Moodle 4.4 and up
to PHP 8.1 we can now safely remove this check. It was introduced with
MDL-73523 because of deprecated openssl_x509_free(), openssl_pkey_free()
and openssl_free_key() functions.
Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
As MDL-73016 set the minimum supported PHP version for Moodle 4.4 and up
to PHP 8.1 we can now safely remove this check. It was introduced with
MDL-73523 because of deprecated openssl_x509_free(), openssl_pkey_free()
and openssl_free_key() functions.
Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
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
This just asserts that web services provided by deprecated plugins can
still be used (similar to how their APIs can still be used during the
deprecation period).
Presets are stored in the DB and may contain config for plugins which
have since been deprecated. This just makes sure these are skipped when
trying to apply the preset.
This ensures:
- existing adhoc tasks will run and be cleared from the queue
- new adhoc tasks cannot be scheduled
- scheduled tasks cannot be listed or fetched via scheduling
Given the nature of the task API, since all tasks are just objects,
a manually created task can still be run via its ::execute() method.
This change:
- reports deprecated plugins during upgrade (informational only)
- reports deprecated plugins via site admin, permitting uninstall
- adds env check to block site install/upgrade when phase 2 deprecated
(deleted) plugins are detected. They must be uninstalled to continue.
This change also includes a small extension to testable_plugin_manager,
allowing it to load a fixture plugininfo class for mock plugintypes from
the respective mock type directory root instead of requiring the
plugininfo be located in lib/classes/plugininfo. This prevents debugging
calls during mock use in tests.
This change:
- Adds param to plugin_manager::get_plugins() to permit return of
plugininfo for deprecated/deleted plugins, defaulting to false for
b/c.
- ensures plugininfo represents the deprecation state, via:
-- base::is_deprecated() and
-- base::is_deleted()
- ensures plugin_manager supports deprecated/deleted plugins in the
following APIs:
-- plugin_manager::get_present_plugins()
-- plugin_manager::get_installed_plugins()
-- plugin_manager::get_plugin_info()
-- plugin_manager::get_plugintype_root()
-- plugin_manager::can_uninstall_plugin()
-- plugin_manager::get_uninstall_url()
The above changes facilitate listing/reporting on deprecated or deleted
plugins in install, upgrade or site admin views.
This change adds the following fake plugintype+plugins for testing
\core\component:
- mock plugintype 'fake'
- mock plugin 'fake_fullfeatured'
- mock subplugintype for the 'fake' plugintype, 'fullsubtype'
- mock subplugintype for the 'fake' plugintype, 'fulldeprecatedsubtype'
- mock subplugintype for the 'fake' plugintype, 'fulldeletedsubtype'
- various mock implementations for APIs like access, events,
web services, hooks, legacy callbacks and class callbacks.
This adds support to the existing, shallow fakeplugin mocks provided by:
- advanced_testcase::add_mocked_plugintype() and
- advanced_testcase::add_mocked_plugin()
and adds new methods for deep mocking fakeplugins:
- advanced_testcase::add_full_mocked_plugintype()
- advanced_testcase::deprecate_full_mocked_plugintype()
- advanced_testcase::delete_full_mock_plugintype()
Deep mocking is required to test \core\component itself.
This allows filter fields to use client-side form validation attributes to check for valid values,
and adds a validation() method for filters to implement custom validation conditions.
In the event of a validation failure, the invalid filters will not be applied, and the URL will
not be updated to avoid user sharing a URL that will generate an error. Filter conditions should
still implement server-side validation and throw exceptions to avoid erroneous values being
manually inserted into the URL.
Previously it was not possible to manually specify the modified time for
a question in the test generator. This extends to the mechanism allowing
the modifying user to be specified (rather than using the current user)
to also allow the timemodified to be specified.
This adds a new datafilter Javascript class for a
datetime filter. This supports filtering by dates before,
after or between the selected value(s).
The fields for selecting datetimes in the filter use
<input type="datetime-local">, so this commit also adds
support for filling reading and writing those fields in
behat tests.
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.
This commit reverts 57dc5a7f17297c2a0dcffd47b3aecf5e1c228a713 "MDL-83470 composer: Require behat/gherkin 4.9.0 for now"
unpin behat/gherkin and fix Behat failures because of the update.
Most edit logic embed directly into course/view.php and course/mod.php
is now redirected to course/format/update.php. This commit add
deprecations messages to the old get params so it can be removed in
Moodle 6.0 for good.
Now there is course/format/update.php all course actions menus must
point to the new one instead of keep pointing at the course/view.php and
course/mod.php.
Since Moodle 4.0, most course edit actions can be executed using the
core_courseformat_course_edit webservice using only four parameters
(courseid, ids, targetsectionid and targetcmid). However, some actions
logic is still replicated and embed in course/view.php and
course/mod.php files since the beginning of time. Now the
course/update.php offers a non-ajax way of executing the same actions
and replace the old replicated ways of doing the same.
Create provider instances for AI povider plugins.
Each provider plugin can now have multiple instances,
allowing for different configurations and models using
the same base provider.
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>
In previous versions of PHPUnit, the `assertEqualsCanonicalizing()`
method compared values only, ignoring the keys entirely. Since PHPUnit
10 the method now checks keys where they are non-numeric.
To solve this we call `array_values()`.
The PHPUnit MockBuilder `setMethods()` method has been deprecated in
favour of the more accurately defined `onlyMethods()` method.
This was previously addressed in MDL-71036 for Moodle 3.11, but these
cases have crept back in.
PHPUnit removed the ability to mock a destructor, but our lock system
throws an exception if a lock has not been explicitly released in its
destructor.
Normally thhis is fine because the lock is released, and if not then we
want to know about it.
However, where we are mocking the lock, we do not actually obtain the
lock, and we may expect the test to fail.
This change moves the release and notification to a separate, reusable
public method, which is called from the destructor. This allows it to be
mocked at the appropriate time.
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.
Add a new admin setting that allows rendering of a template.
This means templated content can be rendered as part of
admin forms, giving more flexibility to forms and their actions.
Added fail delay column in the adhock task table on the admin page,
Added a new column for a delete action for the adhoc tasks on and
Wrote delete_adhoctask.php for delete functionality of adhoc tasks.
Wrote behat test for the delete functionality. Also there was a
logical error in the previous code where it was checking if the task
is due or not and it was just showing Never or ASAP instead of
actual time so fixed that as well.
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.
As part of the course format cleanup epic, all course editor action menu
output classes needs to be refactored to be more mantainable and
reusable. Also, it added notes for the final deprecation of many lines
of code in Moodle 6.0.
While updating the custom icons for import/export, it was observed
that the default width for FontAwesome icons is 20px instead of
the previously assumed 16px.
This commit adjusts the default width accordingly and resolves several
styles where the width was incorrectly applied.
Additionally, the default icon color has been updated to ensure consistent
appearance across both SVG icons and FontAwesome icons.
This expands upon original work in d73a827a and allows for an entity
to define replacements for deprecated table names. The previous format
defining only the deprecated table names themselves is also supported.
Now themes can change the activity purpose colors using only the
$activity-icon-XXXX-bg scss variables. The filter is not computed using
a sass mixin intead of a custom filter.
When a question bank is created by the system, it's name may be created
by combining a course of category name with a language string. If the
course name is already near the limit for its database field, the
resulting question bank name may be too long for that field, and cause
an error.
This implements a function for generating question bank names which will
trim string parameters down until the resulting name is below the
allowed length. It also implements some validation to prevent
manually-created banks with names that are too long.
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).
- 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.
* Only the first section is visible in social format, so we
limit the visibility of the section to the first section.
This impacts the move dialog.
* Fix PHP unit tests
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>
Both core_course_edit_section and core_course_edit_module are not needed
anymore. All course edit actions are now executed as state actions from
core_courseformat_update_course. Also, the core_course_get_module is
fully replaced by the core_courseformat cmitem fragment (including also
any possible JS module).
When a quiz that used shared questions was being restored without the
qbank the questions came from, if the qbank still existed on the target
site, the restored questions were being left in a category in an invalid
course context.
This changes the process so that if the original qbank does exist and
the user can access to it, we will find any references to the restored
copies of questions from that qbank, switch them to refer back to the
original qbank, then delete the category they were restored to from the
course context.
If the user does not have access to the qbank, a new one will be created
in the target course and the questions moved there, just as if the
original qbank did not exist.
The course page employs a scroll spy to highlight the
relevant element in the course index. However, the
frequency of updates is excessively high. This commit add
throttling of the scroll spy and prevents the page item
state from updating if the value hasn’t changed.
Sabina Abellán from the UX team has created the following custom icons:
- ai*:sparkles
- core:e/insert_col_after
- core:e/insert_col_before
- core:e/split_cells
- core:e/text_color
- core:i/bulk_edit
- core:i/export
- core:i/grade_partiallycorrect
- core:i/item
- core:t/completion_incomplete
- core:t/locktime
- mod_scorm:browsed
- tool_policy:level
In addition to updating these SVG files, the entries in the icon_map() have
been removed to ensure that the customized version is always used.
While addressing MDL-82211, these icons were identified as candidates
for deprecation. After confirmation that they are no longer in use,
they can now be safely deprecated.
The quiz icons from the theme/boost/pix folder have been relocated
to mod/quiz/pix. The icons in the theme/boost/pix/mod/quiz folder
will be deprecated and replaced by those in mod/quiz/pix.
Previously, question categories which contained only questions with no
usages were deleted during migration to mod_qbank.
Also, contexts that contained no questions once unsused questions were
deleted were still migrated to a mod_qbank instance, which was empty.
The intention is that hidden questions with no usages should be deleted,
then any categories which are now empty should be deleted rather than
migrated. If there are no categories that contain questions left in a
context, creation of a mod_qbank to migrate those categories is not
necessary.
The unit tests did not cover the cases of categories containing only
non-hidden questions without usages, of categories containing only
unused questions with multiple hidden versions, or of empty categories
with children that were not empty.
This change now specifically checks whether a category or is children
are empty before deleting the category, rather than checking question
usage, since stale questions (hidden questions with no usage) are
already deleted before this point. It also expands the unit tests to
cover the above cases.
This allows each class to define the type of data that they return,
regardless of the type of column to which they are applied. This is the
pre-cursor to work on graphing and filtering of aggregated data.
E.g. a text field that is aggregated with "count" is returning numeric
data rather than text.
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".
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.
This change introduces updates to the existing aggregation API, to
allow types to define whether to group by fields of a column to which
the aggregation is applied.
The new date aggregation utilises this, to allow for creation of time
series reports, e.g. report data grouped by dates.
Co-authored-by: Daniel Neis Araujo <danielneis@gmail.com>
Implements a status check which confirms that the Solr search engine
is available. Optionally, the check can also show a warning if the
index grows beyond a certain size.
As part of this change, a new API was added in search_solr\engine
to allow using http_client (Guzzle) instead of raw Curl; this makes
it easier to create mock tests in PHPunit for the new functionality.
- Add .visually-hidden to the Boostratp 5 bridge SCSS file
- Replace .sr-only occurrences with .visually-hidden
- Replace .dropzone-sr-only-focusable with .dropzone-visually-hidden-focusable
for consistency
* Remove chat and survey plugins from the standard plugins
* Remove all related tables and settings from both plugins
using upgrade.
* Remove temporary admin notification (MDL-82297) and strings.
* PHP Unit:
- Remove chat and survey as a sample module for unit testing
replacing it with assignment module when possible (if not page).
- Remove chat and survey from bulk update test
* Behat: Remove chat and survey behat tests
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 adds a new question bank filter for filtering by question type. The
filter can be applied with one or multiple question types, and can
either include or exclude the selected types.
This corrects some definitions of the methods in the base condition
class to make things more obvious to developers implementing new
filters.
Previously if your filter wanted to use the default
`core/datafilter/filtertype` class, you still had to implement
`get_filter_class` to return `null`, since it was declared as abstract.
This change defines it as returning `null` by default, so this is no
longer necessary.
Also, this removes the default definitions for `get_condition_key` and
`build_query_from_functions`, and declares them abstract. Currently it
is necessary to override these to implement a functional filter so it
doesn't make sense to have a useless default definition.
This will not cause any breakages with existing filters. All filters
must already be defining the methods that are now abstract, otherwise
they will not function. Any filter that is now overriding
`get_filter_class` to return `null` will continue to work as before,
even though this is no longer necessary.
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.
The issue is that Bootstrap’s dropdown component likely stops
event propagation after the first click to manage its own
dropdown behavior. This prevents your click event handler from
running on subsequent clicks.
To fix this, we can handle the event before Bootstrap’s code stops
the propagation by using capture option with addEventListener.
This is extending work started in 8f32e623 that removed duplicate
fields when sorting user fullname columns (to ensure compatibility
across supported DBs).
We must now refer to these sorted fields by their alias in order to
ensure they continue working when processed from the report table.
Co-authored-by: David Carrillo <davidmc@moodle.com>
- Reorder SCSS blocks to improve readability
- Clean comment style to improve readability
- Refactor some SCSS blocks
- Move some styles from core.scss to course.scss
- Remove unused/unneeded styles in course.scss
- The .activity-wrapper class and its related SCSS styles are not
needed anymore after MDL-77863 was integrated.
- Move course management SCSS to a new coursemanagement.scss file
- Move course listings and summary SCSS to a new courselisting.scss file
- Move block related SCSS to blocks.scss
- Move classic specific styles to theme_classic
- Move non-course specific styles to core.scss file
visibilityChanged in the dialogue base class does important things.
Therefore if ajaxException and exception also want to do something
else in response to the visibleChange event, it should use a
different method name, rather than a name that collides with the
base class method.
`behat/gherkin` 4.10.0 introduces a breaking change where backslashes
in feature files need to be escaped. We need to pin the Behat version
to 4.9.0 for now and raise a separate issue to update to the later
versions once we've fixed the affected feature files and communicated
this change to the community.
More details:
https://github.com/Behat/Gherkin/releases/tag/v4.10.0
Even though Oracle support is planned to be dropped for 5.0, the
actual issue that drops it (MDL-83172) has not yet landed. So, it's
better to keep this in environment.xml for now and defer its removal
from environment.xml in MDL-83172.
We currently use MMM and MMMM which mean 'month in year', however in
some locales this is context-specific and should only be used in
conjunction with a day, for example "10 October 2024".
LLL and LLLL are for "stand-alone on the in year" and should be used
when a month is used without a day.
The "includesubcategories" parameter is passed in the URL as lowercase,
but the Javascript was looking for "includeSubcategories" in camel case.
This meant it was always being set as false (unchecked) even when the
URL said it was true.
This fixes the casing in the Javascript, and adds a behat test to
confirm the fix.
This commit integrate and clean the social activities block to use the
standard course format outputs and the course editor modules. The code
is similar to the one used in the site_main_menu block and cleanup most
of the ancient code.
The commit adds all the necessary methods to allow social format to use
the course editor. The code is similar to the one used in the frontpage
format. The commit does not include the migration of the
social_activities blocks.
Some formats like the social need the blocks and drawers to access the
course editor. However, the include_course_ajax was called after the
main page structure is created and produces some errors, especially in
behat. Now include_course_ajax is called before the page header.
The course_ajax_enabled was using a course_format_ajax_support which
does not initialize the course format with the correct parameters.
Having a global function to get something the format base format can
provide is unnecessary and redudant, for this reason the function is now
deprecated.
When the user drags and drops a file into a course section that can
create more than one type of activity (for example a zip file) the modal
had repeated form elements ids. Now every radio option has its own id.
Where the select filter contains upto two items (making it a binary
choice), then we can simplify the filter form elements to always
assume: "Equal to [ Option 1 | Option 2 ]".
This condition was checking whether navgfilter was true, and the
stringfilter was also true.
In most cases the condition will have actually worked correctly, albeit
by fluke. For users upgrading or otherwise missing the navfilter
configuration this condition led to warnings.
Refactor workshop participant queries to improve performance.
This commit refactors how the authors/reviewers selectors are done in
mod_workshop. Previously this was trying to do all the work within SQL
so querying user roles and capabilities, with massive UNIONS for each
group on the course, which on big courses lead to SQL thousands of
lines long which broke the page, or took 5+ minutes to load.
This has been refactored to try and query only what is required
and then do capability checks within code instead of SQL.
The current code may have a bug. If users set the audio bit rate to
a non-supported value, such as 1000,
Firefox will display an error in the console,
while Chrome will create the recorded audio file successfully,
but it will have no sound. I tested this on Ubuntu 24.04.
The minimum bit rate threshold varies depending on the audio format.
During my tests with Firefox version 131.0.3, which uses
the audio/Ogg format, I found that the minimum supported value
is 24000. In Chrome 129.0.6668.70, which uses the audio/MP4 format,
the minimum supported value is 2400.
Due to these differences, I decided to change the input from
a text field to a select field, offering options that support both
Ogg and MP4 audio formats.
The database conversion for the old value has been provided in
the lib/db/upgrade.php. The script will find the closest match to
the current data and update it accordingly.
Use the new "counted recordset" DML API from 42664ee49a to obtain
the raw table data for reports. For those databases with defined
support for count window functions, this should give a performance
benefit by combining the count and main query into one request.
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.
- Remove YUI drag and drop.
- Add new 'mod_feedback\external\questions\reorder' web service.
- Use SortableList JS component to refactor drag and drop, using
the new webservice.
- Update new SCSS styles
- Fix and create Behat scenarios
This is mainly for the benefit of multilang users.
As well as changing the database schema, it is also necessary to change
where this is inforced in PHP code (forms, web services). This was missed
when shortname was changed from 100 to 255 chars some time ago, but I have
fixed that here.
Note, I have not changed the legacy mnet code, since as far as I am aware
that is deprecated.
Changes search indexing so that (except for test scripts) each indexing
run indexes only items up to 5 seconds ago, and the following indexing
will start from the same point. This ensures all items are indexed,
even if an item is written to the database one or two seconds after its
timecreated value.
The display logic for including the title in the activity header was
such that the title would only display if both the theme default and the
layout option for 'notitle' were undefined or false. It was not possible
to a theme to have 'notitle' default to true, but have a layout override
that as false to display the title.
This change re-writes the is_title_allowed method to encapsulte the new
logic, first checking if the current layout has the option set and using
that, and if not falling back to the theme default if that is set. If
neither is set, the title is displayed.
This also tweaks moodle_page::magic_get_layout_options to ensure the
theme is initialised before trying to return the layout options.
AMOS BEGIN
CPY [serializer_igbinary,cachestore_redis],[serializer_igbinary,cachestore_file]
CPY [serializer_php,cachestore_redis],[serializer_php,cachestore_file]
AMOS END
The list of subplugin types was loaded from the json/php subplugins
file, but then the actual list of subplugins was loaded from the cache
in the component, rendering any benefit of using the source json/php as
pointless.
The string "sectionname" was an unnecessary coupling between
formats and other plugins. Now the generic name for a section
should be obtained using $format->get_generic_section_name.
This allow formats to use an alternative string for nameing
sections. This is especially important for rare formats like
the frontpage one that does not have a plugin lang file.
Other similar columns config.value and config_plugins.value are TEXT, so
it is surprising that this column is different, and that has lead to
bugs in the past, so we should make it consistent.
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.
Finale removal of block_tag_youtube::fetch_request() and
block_tag_youtube::render_video_list(). The functions where never meant
to be called from external, so removing them entirely.
Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
When upgraded to Moodle 4.4 or higher, for qbank_columnsortorder
the colsize values in the config_plugins were getting incorrectly set,
resulting in errors accessing the question bank. Changes done to fix
this code and to remove the corrupted colsize value from
config_plugins table.
Added a check for empty email address so that if the adhoc task
for sending email notifcation to users for forum update fails
because of empty email address an exception is not thrown as
the exception was causing the the task for user with empty email
address to keep requeuing again and again after failing.
Wrote two test cases for testing if the fix has now prevented
the task for empty email address to be requeued after failing
and to test that if its still requeuing for other cases when
the adhoc task fails for some other reason in this cause we are
testing for bounce threshold.
Before this change, file type errors were reported like system errors. Now,
they are reported in a plain dialoue, which is more like how it works for
drag-drop upload.
Also, before this, after an upload errors, you were left with a blank
filepicker dialogue. Now, the upload form is redisplayed.
- Add new actions to the table in a single action menu.
- Refactor 'usetemplate' module to allow to be called multiple
times in the same page.
- Remove 'mode' parameter and logic from template management.
- Add a heading to template preview page.
- Add 'Actions' menu to the template preview page.
- Fix related behat scenarios.
The library raises the minimum required PHP version to 8.0 and comes with
an advertised PHP 8.4 compatibility.
Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
Ensure that provided columns and filters for each use appropriate
checks to determine their availability (based on user permissions,
etc), rather than conditionally adding them to the entity.
Fix 'feedback_get_incomplete_users' early return when there are no users with
the 'mod/feedback:complete' capability from 'false' to an empty array. That
will follow the function signature.
Related to MDL-77077, but was a case missed there. Now, any unusable
keys (i.e. can't be used during the JWT decode), are dropped from the
keyset if they don't have the 'alg' prop, preventing a 'missing alg'
exception during keyset parsing. Since these cannot be used during
decode, these aren't needed anyway.
This was introduced in Tiny 7.1 to focus notifications, but it conflicts
with the German keyboard layout which uses Alt+F12 to access the open
curly brace.
This is an upstream problem with TinyMCE and should be fixed in a future
release.
The recommended workaround is to disable the shortcut.
Removes jQuery dependency from calling code that wants to listen for
these events. Maintains backwards compatibility with existing code
that does want to listen to jQuery-style events.
From PHP 8.4, `xml_set_object()`, and passing a string helper to
`xml_set_.*_handler()` has been deprecated.
This commit updates all uses of these in core code.
Please note the following libraries have not been modified and will be
handled via library upgrades separately:
- simplepie
- phpxmlrpc
- tcpdf
When an entity no longer uses a table (due to re-factoring, etc), we
should avoid breaking third-party reports by deprecating the table
name from the entity instead of straight removal. In doing so, we
can then emit debugging to inform developers.
- It fixes the problem that when "pathtophp" setting is stored with
whitespaces, the "Run now" button will still show up in the tasks list,
but the task will never run
{"version":3,"file":"expand_hash.min.js","sources":["../src/expand_hash.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Expand the collapse section element.\n *\n * @module core_admin/expand_hash\n * @copyright Meirza <meirza.arson@moodle.com>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 4.5\n */\n\nconst SELECTORS = {\n COLLAPSE_ELEMENTS: '[data-toggle=\"collapse\"]',\n FOCUSTHENEXPAND_ELEMENTS: '.focus-expand',\n};\n\n/**\n * Initializes the focus and expand functionality.\n */\nexport const init = () => {\n // Select all collapsible elements only.\n const focusexpand = document.querySelector(SELECTORS.FOCUSTHENEXPAND_ELEMENTS);\n\n // Add click event listener to the anchor element\n focusexpand?.addEventListener('click', () => {\n expandSection(`${focusexpand.getAttribute('href')}`);\n });\n};\n\n/**\n * Expands a section based on the provided URL hash.\n *\n * This function takes a hash string, finds the corresponding element in the DOM,\n * and expands it if it is currently collapsed. It updates the necessary ARIA\n * attributes and classes to reflect the expanded state.\n *\n * @param {string} hash - The hash (e.g., '#elementId') of the element to expand.\n */\nexport const expandSection = (hash) => {\n const container = document.querySelector(hash);\n const targetContainer = container?.querySelector(SELECTORS.COLLAPSE_ELEMENTS);\n\n if (targetContainer?.getAttribute('aria-expanded') === 'false') {\n const collapseId = targetContainer.getAttribute('aria-controls');\n const collapseContainer = document.getElementById(collapseId);\n\n // Show the content.\n collapseContainer.classList.remove('collapse');\n collapseContainer.classList.add('show');\n\n // Update aria-expanded attribute to reflect the new state.\n targetContainer.setAttribute('aria-expanded', 'true');\n targetContainer.classList.remove('collapsed');\n\n // Get collapse expand menu element.\n const collapseElement = document.querySelector('.collapseexpand.collapsemenu');\n // Ensure it gets noticed to make it work.\n collapseElement.setAttribute('aria-expanded', 'true');\n collapseElement.classList.remove('collapsed');\n }\n};\n"],"names":["SELECTORS","focusexpand","document","querySelector","addEventListener","expandSection","getAttribute","hash","container","targetContainer","collapseId","collapseContainer","getElementById","classList","remove","add","setAttribute","collapseElement"],"mappings":";;;;;;;;;MAwBMA,4BACiB,2BADjBA,mCAEwB,8BAMV,WAEVC,YAAcC,SAASC,cAAcH,oCAG3CC,MAAAA,aAAAA,YAAaG,iBAAiB,SAAS,KACnCC,wBAAiBJ,YAAYK,aAAa,oBAarCD,cAAiBE,aACpBC,UAAYN,SAASC,cAAcI,MACnCE,gBAAkBD,MAAAA,iBAAAA,UAAWL,cAAcH,gCAEM,WAAnDS,MAAAA,uBAAAA,gBAAiBH,aAAa,kBAA8B,OACtDI,WAAaD,gBAAgBH,aAAa,iBAC1CK,kBAAoBT,SAASU,eAAeF,YAGlDC,kBAAkBE,UAAUC,OAAO,YACnCH,kBAAkBE,UAAUE,IAAI,QAGhCN,gBAAgBO,aAAa,gBAAiB,QAC9CP,gBAAgBI,UAAUC,OAAO,mBAG3BG,gBAAkBf,SAASC,cAAc,gCAE/Cc,gBAAgBD,aAAa,gBAAiB,QAC9CC,gBAAgBJ,UAAUC,OAAO"}
{"version":3,"file":"expand_hash.min.js","sources":["../src/expand_hash.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Expand the collapse section element.\n *\n * @module core_admin/expand_hash\n * @copyright Meirza <meirza.arson@moodle.com>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 4.5\n */\n\nconst SELECTORS = {\n COLLAPSE_ELEMENTS: '[data-bs-toggle=\"collapse\"]',\n FOCUSTHENEXPAND_ELEMENTS: '.focus-expand',\n};\n\n/**\n * Initializes the focus and expand functionality.\n */\nexport const init = () => {\n // Select all collapsible elements only.\n const focusexpand = document.querySelector(SELECTORS.FOCUSTHENEXPAND_ELEMENTS);\n\n // Add click event listener to the anchor element\n focusexpand?.addEventListener('click', () => {\n expandSection(`${focusexpand.getAttribute('href')}`);\n });\n};\n\n/**\n * Expands a section based on the provided URL hash.\n *\n * This function takes a hash string, finds the corresponding element in the DOM,\n * and expands it if it is currently collapsed. It updates the necessary ARIA\n * attributes and classes to reflect the expanded state.\n *\n * @param {string} hash - The hash (e.g., '#elementId') of the element to expand.\n */\nexport const expandSection = (hash) => {\n const container = document.querySelector(hash);\n const targetContainer = container?.querySelector(SELECTORS.COLLAPSE_ELEMENTS);\n\n if (targetContainer?.getAttribute('aria-expanded') === 'false') {\n const collapseId = targetContainer.getAttribute('aria-controls');\n const collapseContainer = document.getElementById(collapseId);\n\n // Show the content.\n collapseContainer.classList.remove('collapse');\n collapseContainer.classList.add('show');\n\n // Update aria-expanded attribute to reflect the new state.\n targetContainer.setAttribute('aria-expanded', 'true');\n targetContainer.classList.remove('collapsed');\n\n // Get collapse expand menu element.\n const collapseElement = document.querySelector('.collapseexpand.collapsemenu');\n // Ensure it gets noticed to make it work.\n collapseElement.setAttribute('aria-expanded', 'true');\n collapseElement.classList.remove('collapsed');\n }\n};\n"],"names":["SELECTORS","focusexpand","document","querySelector","addEventListener","expandSection","getAttribute","hash","container","targetContainer","collapseId","collapseContainer","getElementById","classList","remove","add","setAttribute","collapseElement"],"mappings":";;;;;;;;;MAwBMA,4BACiB,8BADjBA,mCAEwB,8BAMV,WAEVC,YAAcC,SAASC,cAAcH,oCAG3CC,MAAAA,aAAAA,YAAaG,iBAAiB,SAAS,KACnCC,wBAAiBJ,YAAYK,aAAa,oBAarCD,cAAiBE,aACpBC,UAAYN,SAASC,cAAcI,MACnCE,gBAAkBD,MAAAA,iBAAAA,UAAWL,cAAcH,gCAEM,WAAnDS,MAAAA,uBAAAA,gBAAiBH,aAAa,kBAA8B,OACtDI,WAAaD,gBAAgBH,aAAa,iBAC1CK,kBAAoBT,SAASU,eAAeF,YAGlDC,kBAAkBE,UAAUC,OAAO,YACnCH,kBAAkBE,UAAUE,IAAI,QAGhCN,gBAAgBO,aAAa,gBAAiB,QAC9CP,gBAAgBI,UAAUC,OAAO,mBAG3BG,gBAAkBf,SAASC,cAAc,gCAE/Cc,gBAAgBD,aAAa,gBAAiB,QAC9CC,gBAAgBJ,UAAUC,OAAO"}
<COMMENTS><p dir="ltr" style="text-align:left;">Porfolios enabled, Emojipicker enabled, Lesson media width set to 900 and maxanswers set to 2 and disabled advanced. Plugins: disabled block_html, mod_database and mod_chat plugins and enabled atto_html, block_activity_modules and mod_lesson.</p></COMMENTS>
<COMMENTS><p dir="ltr" style="text-align:left;">Porfolios enabled, Emojipicker enabled, Lesson media width set to 900 and maxanswers set to 2 and disabled advanced. Plugins: disabled block_html, mod_database and mod_page plugins and enabled atto_html, block_activity_modules and mod_lesson.</p></COMMENTS>
<COMMENTS><p dir="ltr" style="text-align:left;">Badges disabled, Emojipicker enabled, Lesson media width set to 900 and maxanswers set to 2 and disabled advanced. Plugins: disabled block_html, mod_database and mod_chat plugins and enabled atto_html and block_activity_modules.</p></COMMENTS>
<COMMENTS><p dir="ltr" style="text-align:left;">Badges disabled, Emojipicker enabled, Lesson media width set to 900 and maxanswers set to 2 and disabled advanced. Plugins: disabled block_html, mod_database and mod_page plugins and enabled atto_html and block_activity_modules.</p></COMMENTS>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
classbehat_admin_presetsextendsbehat_base{
/**
* Downloads the file from a specific link on the page and checks the size is in a given range.
*
* Only works if the link has an href attribute. Javascript downloads are
* not supported. Currently, the href must be an absolute URL.
*
* The range includes the endpoints. That is, a 10 byte file in considered to
* be between "5" and "10" bytes, and between "10" and "20" bytes.
*
* @Then /^following "(?P<link_string>[^"]*)" "(?P<selector_string>[^"]*)" in the "(?P<element_container_string>(?:[^"]|\\")*)" "(?P<text_selector_string>[^"]*)" should download between "(?P<min_bytes>\d+)" and "(?P<max_bytes>\d+)" bytes$/
* @param string $link the text of the link.
* @param string $selectortype The type of what we look for
* @param string $nodeelement Element we look in
* @param string $nodeselectortype The type of selector where we look in
* @param int $minexpectedsize the minimum expected file size in bytes.
* @param int $maxexpectedsize the maximum expected file size in bytes.
* Downloads the file from a specific link on the page and checks the size is in a given range.
*
* Only works if the link has an href attribute. Javascript downloads are
* not supported. Currently, the href must be an absolute URL.
*
* The range includes the endpoints. That is, a 10 byte file in considered to
* be between "5" and "10" bytes, and between "10" and "20" bytes.
*
* @deprecated since 5.0
*
* @Then /^following "(?P<link_string>[^"]*)" "(?P<selector_string>[^"]*)" in the "(?P<element_container_string>(?:[^"]|\\")*)" "(?P<text_selector_string>[^"]*)" should download between "(?P<min_bytes>\d+)" and "(?P<max_bytes>\d+)" bytes$/
* @param string $link the text of the link.
* @param string $selectortype The type of what we look for
* @param string $nodeelement Element we look in
* @param string $nodeselectortype The type of selector where we look in
* @param int $minexpectedsize the minimum expected file size in bytes.
* @param int $maxexpectedsize the maximum expected file size in bytes.
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
classnameextendsmodule_area_base{
/**
* Get table name.
* @return string
*/
publicfunctionget_tablename():string{
return'survey';
}
/**
* Get field name.
* @return string
*/
publicfunctionget_fieldname():string{
return'name';
}
}
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.