104560 Commits

Author SHA1 Message Date
Shamim Rezaie
c6a74d4752 MDL-74033 theme_boost: Ability to remove primary nav items in boost 2022-03-08 11:39:38 +11:00
Víctor Déniz
2ac75e55a9 Merge branch 'MDL-74090-master' of https://github.com/junpataleta/moodle 2022-03-08 00:00:19 +00:00
Paul Holden
2916f89d12 MDL-74106 reportbuilder: handle non-recurring schedules properly.
When a schedule is created with "No recurrence", it should only be
sent when both conditions are true: it's start time is after the
current time; and the time it was last sent is before it's start
time (either 0/never sent; or a time it was manually sent).
2022-03-07 15:47:33 +00:00
Shamim Rezaie
e016d20e5f MDL-71305 core_question: Remove duplicate strings 2022-03-07 11:28:10 +11:00
Mahmoud Kassaei
1bf0fa4719 MDL-73760 Quiz: Manual grading report does not handle separate groups
when the user is not in any group
2022-03-05 13:24:33 +00:00
Daniel Ziegenberg
13ad25310d
MDL-73520 adodb: Remove usage of $php_errormsg from DB2 driver
This applies #791 from upstream libraries: https://github.com/ADOdb/ADOdb/issues/791

Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
2022-03-05 14:19:50 +01:00
Daniel Ziegenberg
f60f6dfade
MDL-73520 general: replace deprecated php_errormsg with error_get_last()
For a better PHP8 compatibility this commit replaces the deprecated $php_errormsg
with error_get_last().

The PHP 8.0 migration guide (https://www.php.net/manual/de/migration80.incompatible.php) says:
    The track_errors ini directive has been removed.
    This means that php_errormsg is no longer available.
    The error_get_last() function may be used instead.
Also the documentation on $php_errormsg (https://www.php.net/manual/en/reserved.variables.phperrormsg.php) says:
    This feature has been DEPRECATED as of PHP 7.2.0.
    Relying on this feature is highly discouraged.
    Use error_get_last() instead.

Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
2022-03-05 14:19:48 +01:00
Jun Pataleta
3314000eaf MDL-74090 core: Proper RTL/LTR display of collapsed icons 2022-03-05 00:45:32 +08:00
Eloy Lafuente (stronk7)
87791a13a4 Merge branch 'MDL-74020' of https://github.com/paulholden/moodle 2022-03-04 16:52:21 +01:00
Paul Holden
ad7583cd33 MDL-74076 reportbuilder: deterministic ordering of schedule users.
Now that we have consistent ordering we can also revert 898f3d0a.
2022-03-04 15:25:22 +00:00
Shamim Rezaie
a9d8207da9 Merge branch 'MDL-73824' of https://github.com/stronk7/moodle 2022-03-05 00:39:29 +11:00
Eloy Lafuente (stronk7)
93b59411f1 Merge branch 'MDL-73954' of https://github.com/timhunt/moodle 2022-03-04 14:20:27 +01:00
Marc-Alexandre Ghaly
3e09319e7a MDL-72890 core_question : Question regrade for question versions
This commit implements a question regrade for the selected
version in the quiz for a slot.

Co-Authored-By: Safat Shahin <safatshahin@catalyst-au.net>
Co-Authored-By: Tim Hunt <tim.hunt@open.ac.uk>
2022-03-04 23:06:50 +11:00
Tim Hunt
4f99e92a81 MDL-73954 quiz: fix decimal places for the percentage on review page 2022-03-04 11:58:16 +00:00
Eloy Lafuente (stronk7)
c111717ffb Merge branch 'MDL-74042-master' of https://github.com/jleyva/moodle 2022-03-04 12:19:22 +01:00
Sara Arjona
bc7dec8c2b MDL-66940 badges: Create page to display badges info
The OBv2.0 specification includes a field "Criteria" for
BadgeClass. Until now, this field was filled using the
URL of the badge assertion, but that is causing some issues
in Badgr because it linked to the badge assertion of the
first user sending this badge to the Badgr backpack (so then,
the following users linked to the first user assertion page
too).

This patch adds a new page, badgeclass.php which will be
used from now to display any badge information which is
not related to any assertion (like happens with the criteria
in BadgeClass).
2022-03-04 12:18:59 +01:00
Tim Hunt
61f11f848d MDL-74007 quiz: questions should start as 'Always latest' version
Thanks to Safat Shahin <safatshahin@catalyst-au.net> for help with
the Behat scenarios.
2022-03-04 10:59:13 +00:00
Jun Pataleta
1aa65fbdfe Merge branch 'MDL-73902-master' of https://github.com/bmbrands/moodle 2022-03-04 18:28:18 +08:00
Eloy Lafuente (stronk7)
43b4e6b339 MDL-73824 test: Cover all the changed code with special decsep tests
Various tests have been added to cover the points fixed in the previous
commit, using a localised decimal separator (#). Using the same
numbering, here there are the details:

A. grade/report/singleview/tests/behat/singleview.feature
   grade/tests/behat/grade_category_validation.feature

B. grade/tests/behat/grade_override_letter.feature

C. (done within various scenarios)

D. grade/report/singleview/tests/behat/singleview.feature

E. admin/tool/behat/tests/behat_form_text_test.php

F. grade/tests/behat/grade_to_pass.feature
   mod/lesson/tests/behat/lesson_informations_at_end.feature

G. quiz/tests/behat/preview.feature

H. mod/quiz/tests/behat/info_page.feature

I. question/type/ddimageortext/tests/behat/edit.feature
2022-03-04 10:22:49 +01:00
Eloy Lafuente (stronk7)
3a016e2784 MDL-73824 gradebook: Add support for localised floats where missing
It has been detected, thanks to php80 specially, that there are
various places in core where support for localised floats is
missing. Before php80, some locale-dependent conversions were
performed by PHP, allowing things to work. But with php80 all
those comparisons are now locale-independent. See:

https://wiki.php.net/rfc/locale_independent_float_to_string

That implies that we now need to, always, unformat floats to
be internally the correct (decimal point as separator) in
order to compare it.

While this was visited in the php80 epic (MDL-70745), nothing
was found, all automated tests were passing ok. Problem is that
we run behat tests with en-AU laguage that has the decimal point
separator.

So, in this issue we are fixing all the problems detected by
running those Behat tests using localised (comma) decimal
separator.

Note that there may be other places still causing problems, but
it's really hard to find them programmatically, so we'll have to
wait for real use reports / issues and go fixing them while they
happen.

Back to this commit, this is the list of changes performed (note that
in the next commit, we'll be adding scenarios explicitly using
a localised decimal separator to ensure that they work ok).

A. Changes to various grade forms to ensure that, on their validation
  floats are unformatted properly. Also, changed the corresponding
  form element from current text/PARAM_RAW to proper float ones that
  take care of the conversion in a number of places (but when disabled,
  that's the reason we still have to unformat in validation.
  This includes the following forms:
    - edit_category_form
    - edit_item_form
  (this is the original problem reported that cause all the research
  to be performed against full behat runs)

B. Changes to edit_letter_form, so it uses a proper PARAM_LOCALISEDFLOAT
  (note this is the type of change that surely should be used for all
  the rest of /grade/edit/tree form, including those in the previous
  point).

C. Changes to the grade_item behat generator, so it's able to work with
  localised floats, un-formatting them when needed.
  At lib/behat/classes/behat_core_generator.php

D. Fix problem passing localised floats to scales, not displaying
  properly. At grade/report/singleview/classes/local/ui/finalgrade.php

E. Change the behat text matcher in order to allow comparison of
  localised floats when they are the current ones. Before this change
  the matches was using soft/lazy comparison, so '50' and '50.0000'
  match. Now, when the comma (for example) is used (and only then),
  '50' and '50,000' will also match. This comparison is in use in a
  bunch of tests and makes sense to make it localisation-aware.
  At grade/report/singleview/classes/local/ui/finalgrade.php

F. Fix a couple of number_format() uses in lesson, because they are
  not localised-aware. Switched to format_float(). At mod/lesson/locallib.php

G. Change the quiz_contains_the_following_questions() step to accept
  localised maxmark expectations. At mod/quiz/tests/behat/behat_mod_quiz.php

H. Change the quiz generator so it accepts localised gradepass.
  At mod/quiz/tests/generator/lib.php

I. Change the edit question form to show proper localised penalties,
  previously it was always showing point-decimal ones. Of course,
  leaving the values of the select element unmodified (internal floats).
  Related, also change a couple of tests to, instead of try to match the
  value (always internal floats), match the description (now localised),
  so we can test them with different separators. At:
    - question/type/ddimageortext/tests/behat/backup_and_restore.feature
    - question/type/ddmarker/tests/behat/backup_and_restore.feature
    - question/type/edit_question_form.php
2022-03-04 10:22:49 +01:00
Jake Dallimore
7192744443 Merge branch 'MDL-74048-master' of https://github.com/bmbrands/moodle 2022-03-04 16:18:31 +08:00
Jake Dallimore
8ccf8390c3 Merge branch 'MDL-73796-master' of https://github.com/bmbrands/moodle 2022-03-04 14:56:09 +08:00
Jun Pataleta
c9d466cb80 Merge branch 'MDL-73799' of https://github.com/stronk7/moodle 2022-03-04 14:47:39 +08:00
Jun Pataleta
e9ee905619 Merge branch 'MDL-73785' of https://github.com/stronk7/moodle 2022-03-04 14:36:47 +08:00
Jun Pataleta
4aa63901c3 Merge branch 'MDL-73906-master' of https://github.com/bmbrands/moodle 2022-03-04 13:06:43 +08:00
Peter Spicer
edde68e078
MDL-67428 navigation: Apply navigation text filters at system context
On some larger sites, processing the navigation with format_string will
habitually load all the contexts for navigation which can take 400+ DB
queries. Explicitly tying all those format_string calls to the system
context reduces this overhead to a single DB query that probably has
already been run on the page previously.

Co-authored-by: Peter Burnett <peterburnett@catalyst-au.net>
2022-03-04 14:36:25 +10:00
Jake Dallimore
9be31a19dd Merge branch 'MDL-73457-master-2' of https://github.com/HuongNV13/moodle 2022-03-04 11:59:26 +08:00
Jake Dallimore
84160619c6 Merge branch 'MDL-74002' of https://github.com/Chocolate-lightning/moodle 2022-03-04 10:24:48 +08:00
Shamim Rezaie
29c14e979b Merge branch 'MDL-74045-master' of https://github.com/bmbrands/moodle 2022-03-04 10:13:05 +11:00
Eloy Lafuente (stronk7)
3965067836 Merge branch 'MDL-64770' of https://github.com/paulholden/moodle 2022-03-03 23:20:26 +01:00
Sara Arjona
4495182ac5 Merge branch 'MDL-72915-master' of https://github.com/HuongNV13/moodle 2022-03-03 17:30:54 +01:00
Sara Arjona
4f95c39ef0 Merge branch 'MDL-73841-master' of https://github.com/bmbrands/moodle 2022-03-03 16:31:15 +01:00
Paul Holden
4471724bab MDL-73737 report_loglive: ensure action link popups work post-AJAX. 2022-03-03 14:02:42 +00:00
Daniel Ziegenberg
a4d64bd71b
MDL-73923 tool_task: make a more relaxed check on cron run interval
Prior to this change, the tool_task_cronrunning check had very tight
limits for checking the last cron interval and comparing it to the
expected frequency. When a cron job should take 1:00 min and the last
run was 1:02 min it complained that there was 1:02 between the last two
runs of the cron maintenance script and it should run every 1:00.

This change makes the check a bit more relaxed and adds an additional
minute on top of the expectedfrequency to give the cron job some time.

Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
2022-03-03 14:27:32 +01:00
Eloy Lafuente (stronk7)
b3c4bd6250 MDL-73799 phpunit: Move some test names, as agreed in the issue
- behaviourtype_test => behaviour_type_test (10)
- questiontype_test => question_type_test (16)
- upgradelibnewqe_test => upgrade_old_attempt_data_test (13)
2022-03-03 12:22:36 +01:00
Eloy Lafuente (stronk7)
68b4a13cec MDL-73799 phpunit: various question & quiz testcase names
To all the walkthrough, questiontype, question, upgradelibnewqe,
behaviourtype_test and edit_form testcase classes::

- Namespaced with component[\level2-API]
- Moved to level2-API subdirectory when required.
- Fixed incorrect use statements with leading backslash.
- Remove file phpdoc block
- Remove MOODLE_INTERNAL if not needed.
- Changed code to point to global scope when needed.
- Fix some relative paths and comments here and there.
- All them passing individually.
- Complete runs passing too.

Special mention to:
- When belonging to other component and being valid api:
  - form related tests have been moved to tests/form subdir.
2022-03-03 12:22:36 +01:00
Eloy Lafuente (stronk7)
4003e31983 MDL-73785 phpunit: Move more tests to use correct names and namespaces
Applied the following changes to various testcase classes:

- Namespaced with component[\level2-API]
- Moved to level2-API subdirectory when required.
- Fixed incorrect use statements with leading backslash.
- Remove file phpdoc block
- Remove MOODLE_INTERNAL if not needed.
- Changed code to point to global scope when needed.
- Fix some relative paths and comments here and there.
- All them passing individually.
- Complete runs passing too.

Special mention to:

- When belonging to other components and being valid api:
  - analytics related tests have been moved to tests/analytics subdir.
  - backup & restore related tests have been moved to tests/backup subdir.
  - events related tests have been moved to tests/event subdir.
  - privacy related tests have been moved to tests/privacy.
  - task related tests have been moved to tests/task subdir.
- Some simple renames, not including the component part anymore (not
  needed now that they are namespaced):
  - some xxxlib_test.php have been renamed lib_test.php
    (when they where testing the corresponding lib.php).
  - cache stores tests have been all renamed store_test, originally
    each one had its own name (file_test, apcu_test, redis_test...)
  - assign feedback tests have been all renamed feedback_test, originally
    each one had its own name (file_test, editpdf_test...)
2022-03-03 12:19:30 +01:00
Eloy Lafuente (stronk7)
e2821bf1ce MDL-73824 gradebook: Stricter float check to some gradelib functions
It has been detected that, right now, some localised floats are
being passed to those functions (say comma separator, say thousands)
and that's leading to all sort of problems later when comparing,
processing or storing those "wrong-floats" (user entered).

This just makes all those functions to be stricter, so any attempt
of passing to them a wrong float will fail with a clear TypeError.

Any existing case must be converted to a corrrect (X.Y) format, using
unformat_float() or PARAM_LOCALISEDFLOAT before any processing.

Localised floats cannot be used.

Also, fix all the places where those functions are called from
files having strict_types enabled because, with that, now float-like
strings are not accepted any more. Luckily, there is only case,
within the grade/classes/component_gradeitem.php file, and it has
been fixed by casting the float-like string coming from DB to float.
2022-03-03 12:19:02 +01:00
Jun Pataleta
1d99ba19a2 Moodle release 4.0beta v4.0.0-beta 2022-03-03 18:22:28 +08:00
Paul Holden
7f3d270a37 MDL-74071 output: code docs for activity header API to aid IDE hints. 2022-03-03 09:59:57 +00:00
Jun Pataleta
a1044ab030 NOBUG: Fixed file access permissions 2022-03-03 17:51:53 +08:00
Jun Pataleta
96e5418134 NOBUG: Fixed SVG browser compatibility 2022-03-03 17:51:51 +08:00
Jun Pataleta
26194eebbf Merge branch 'install_master' of https://git.in.moodle.com/amosbot/moodle-install 2022-03-03 17:51:50 +08:00
Paul Holden
506229dd95 MDL-73999 quizaccess_seb: use raw getter in pre-validate method.
Changes in 78735a72 made the persistent `get` method return property
values consistently, according to their type and nullability.

The rule `templateid` property is not nullable, but still has code
that treats it as such. Fix that by retrieving the raw value.
2022-03-03 09:34:21 +00:00
Bas Brands
729ae8f096 MDL-73902 theme_boost: prevent dropdowns being cut off 2022-03-03 09:44:33 +01:00
Jake Dallimore
cfdd51a0da Merge branch 'MDL-73996-master-fix' of https://github.com/junpataleta/moodle 2022-03-03 11:30:51 +08:00
Jun Pataleta
898f3d0a82 MDL-73996 reportbuilder: Assert task log contains expected strings
* Ordering issues from \core_reportbuilder\local\helpers\schedule's
get_schedule_report_users() method won't guarantee that the expected
task log output will always be the same as user two can be fetched first
before user one which will cause the message to be sent to user two
first. So just get the task log's output string and make sure it
contains the expected log strings.
2022-03-03 11:09:59 +08:00
Jake Dallimore
350d7b9515 Merge branch 'MDL-73645-integration-master' of https://github.com/mihailges/moodle 2022-03-03 10:24:09 +08:00
Mikhail Golenkov
8c914c8756 MDL-73993 phpdoc: get_module_types_names returns lang_string objects 2022-03-03 10:39:09 +11:00
Eloy Lafuente (stronk7)
8d362e7249 Merge branch 'MDL-73996' of https://github.com/paulholden/moodle 2022-03-02 23:15:11 +01:00