1334 Commits

Author SHA1 Message Date
Mihail Geshoski
3d1bb8e863 MDL-75513 behat: Update existing behat tests 2022-11-02 17:45:52 +08:00
Mihail Geshoski
e8caeb85e3 MDL-75513 gradereport_user: Add behat tests 2022-11-02 17:45:52 +08:00
Mihail Geshoski
3414a93268 MDL-75513 gradereport_user: Output the tertiary nav action in index.php
Outputs the relevant tertiary navigation actions based in index.php,
the prev/next user navigation and removes the old trigger buttons for
the group and user selector from the zero state page.
2022-11-02 17:45:52 +08:00
Mihail Geshoski
42c5109652 MDL-75513 gradereport_user: Create tertiary navigation actions 2022-11-02 17:45:52 +08:00
Mihail Geshoski
df5e5c0f88 MDL-75513 gradereport_user: Trigger element for the view mode selector
Creates a renderer method and a template for the element that would
trigger the view mode selector in the grade user report.
2022-11-02 17:45:52 +08:00
Mihail Geshoski
ba80b78119 MDL-75513 core_grades: Renderer for the prev/next user navigation 2022-11-02 17:45:52 +08:00
Mihail Geshoski
1046e06e83 MDL-75513 gradereport_user: Create trigger element for the user selector
Creates a renderer method and a template for the element that would
trigger the user selector.
2022-11-02 17:45:52 +08:00
Mihail Geshoski
c2851ed141 MDL-75513 gradereport_user: Update the grade user report
Updates the styling of the grade user reports and introduces
functionality which enables expanding and collapsing grade
categories.
2022-11-02 17:45:52 +08:00
Ilya Tregubov
660b56eb50 Merge branch 'MDL-75362-refactor' of https://github.com/Chocolate-lightning/moodle 2022-10-21 09:56:19 +03:00
Mathew May
ee71eae12a MDL-75362 gradebook: add group selector into reports 2022-10-20 21:24:51 +08:00
Mathew May
e84948c4a7 MDL-75362 gradereport_singleview: Roll in zero state 2022-10-20 21:24:51 +08:00
Mathew May
e7c1c2841d MDL-75362 gradereport_user: Roll in zero state work for user report 2022-10-20 21:24:51 +08:00
Mathew May
7973d6b11c MDL-75362 gradereport_singleview: CiBot complaints 2022-10-20 21:24:51 +08:00
Mathew May
84d8c98d04 MDL-75362 gradereport_singleview: Typehinting and arrays 2022-10-20 21:24:51 +08:00
Mathew May
0b6d841806 MDL-75362 gradereport_singleview: Move classes 2022-10-20 21:24:51 +08:00
Mathew May
547bf73ea7 MDL-75362 gradereport_user: CiBot 2022-10-20 21:24:51 +08:00
Mathew May
fdeda7f222 MDL-75362 gradereport_user: Comments and type hinting 2022-10-20 21:24:51 +08:00
Mathew May
8539da6af7 MDL-75362 gradereport_user: Class movement 2022-10-17 12:00:40 +08:00
Paul Holden
ffea18688c MDL-75955 gradereport_summary: ensure page context is always set.
Remove global course object, and pass via entity constructor.
2022-10-11 21:50:16 +01:00
Ilya Tregubov
10570acfde MDL-75156 gradebook: Fix grade handling. 2022-10-11 09:32:58 +04:00
Ilya Tregubov
b3e05d0e4e MDL-75156 gradebook: Grade summary plugin (grade averages).
Also included updates for existing unit tests and navigation.
2022-10-07 11:31:41 +04:00
Ilya Tregubov
c8d950bde7 MDL-75156 gradebook: Functions to calculate grade averages.
Also include unit tests.
2022-10-07 11:31:41 +04:00
Mihail Geshoski
3001995be8 MDL-75153 grade: Update behat tests 2022-09-20 00:17:56 +08:00
Paul Holden
ab89e3caae MDL-74770 gradereport_grader: allow sorting by all user fields. 2022-08-18 15:58:11 +01:00
Jun Pataleta
3c6fdb1993 Merge branch 'MDL-71062-master' of https://github.com/sharidas/moodle 2022-07-13 11:39:08 +08:00
Sujith Haridasan
73d604369d MDL-71062 core: Step 1 deprecation of print_error function 2022-07-13 08:20:54 +05:30
Jun Pataleta
f283906423 Merge branch 'MDL-71747' of https://github.com/stronk7/moodle 2022-07-12 10:50:22 +08:00
Paul Holden
7ee1dc421f MDL-74282 grade: omit outcomes report if outcomes aren't enabled. 2022-07-08 10:43:38 +01:00
Eloy Lafuente (stronk7)
58b56e2395 MDL-71747 upgrade: remove all the < 3.9.0 upgrade steps
This just deletes all the upgrade steps previous to 3.9.0. Some
small adjustments, like tweaking globals can also be applied
when needed.

Also includes an upgrade step to prevent upgrading from any
version < 2020061500 (v3.9.0) as anti-cheating measure.

The next commits will proceed to deprecate / remove functions
that were exclusively (usually belonging to upgradelib) being
used by those, now removed, upgrade steps. This is the list
of code to remove and document in upgrade.txt files:

  - upgrade_analytics_fix_contextids_defaults()
  - upgrade_convert_hub_config_site_param_names()
  - upgrade_rename_prediction_actions_useful_incorrectly_flagged()
  - \mod_forum\task\refresh_forum_post_counts adhoc task.

And these is the code that has NOT been removed
because it may be needed later (no matter there aren't uses now):

  - \core_search\manager::clean_up_non_existing_area(), used by
  - \core\task\clean_up_deleted_search_area_task adhoc task
2022-07-07 19:16:37 +02:00
Andrew Nicols
6d46332a94 Merge branch 'MDL-74613-master' of https://github.com/NoelDeMartin/moodle 2022-06-30 11:02:41 +08:00
Paul Holden
f70fc89217 MDL-74565 gradereport_grader: define capability required for editing. 2022-06-12 20:04:28 +01:00
Noel De Martin
bbaf83322f MDL-74613 grade: Add missing generators 2022-05-31 17:59:52 +02:00
Eloy Lafuente (stronk7)
caf55abf17 MDL-74413 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:

- Moved to the level2 "privacy" namespace:
  - \mod_assign\privacy\feedback_legacy_polyfill_test
  - \mod_assign\privacy\submission_legacy_polyfill_test

- Moved to the level2 "task" namespace:
  - \core_message\task\migrate_message_data_test
  - \ltiservice_gradebookservices\task\cleanup_test
  - \message_email\task\send_email_test
  - \mod_lti\task\clean_access_tokens_test
  - \mod_workshop\task\cron_task_test

- Moved to the level2 "event" namespace:
  - \core_h5p\event\deleted_test
  - \core_h5p\event\viewed_test

- Renamed to a better name:
  - backup_forum_activity_task_test.php (missing "task")
2022-05-07 20:32:30 +02:00
Eloy Lafuente (stronk7)
76f5445451 MDL-74510 upgrade: add the 4.0.0 separation line to all upgrade scripts 2022-04-22 18:45:10 +02:00
Jun Pataleta
70f6b1605b MDL-74471 versions: bump all versions and requires near release 2022-04-13 10:37:36 +08:00
Sara Arjona
e2d435ca93 Merge branch 'MDL-74286-master' of https://github.com/ferranrecio/moodle 2022-04-01 17:34:30 +02:00
Eloy Lafuente (stronk7)
4e2b4a138d MDL-74231 grader report: Fix case where old settings are empty / null
There is an edge case in the conversion from old collapse/expand
settings (stored as user preference) to the new ones that can lead
to notices / warnings / errors.

Before PHP 8, they weren't being detected, but now they are.

Basically, if some of the expected components of the preferences
are missing, then some array (array_diff(), array_intersect()..)
operations now are failing, because now those parameter functions
do require to be arrays (so empty strings or nulls aren't allowed).

Also, there were some cases where the old preference was not being
removed ever, so its removal has been moved to a common place at
the end of the function, where it's always evaluated in case
the preference still exists but is empty of contents.

I've tried to cover all the cases I've been able to imagine with
unit tests (empty information, some component not set, all components
not set...), have moved it to a new unit test because the one
already performing some tests with those old preferences was
already too long to add more cases.
2022-03-29 23:46:45 +02:00
Ferran Recio
fb3fb34b09 MDL-74286 gradereport_grader: fix overlap scale selector 2022-03-24 14:07:54 +01: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)
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
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
Andrew Nicols
e1b9d5f3cd MDL-73915 js: Drop support for IE and android
Moodle announced that support for IE would be dropped back in August
2020 with Moodle 3.9 but not active steps were taken at that time. That
decision was made in MDLSITE-6109 and this particular step was meant to
be taken in Moodle 3.10.

This is the first step taken to actively drop support for IE.

This commit also bumps the browser support pattern from 0.25% to 0.3%.
The percentage here includes any browser where at least this percentage
of users worldwide may be using a browser. In this case it causes
support for Android 4.3-4.4 to be dropped, which relate to Android
KitKat (released 2013).

This combination of changes means that all of the supported browsers in
our compatibility list support modern features including async,
for...of, classes, native Promises, and more which has a huge impact on
the ease of debugging code, and drastically reduces the minified file
size because a number of native Polyfills included by Babel are no
longer included.
2022-02-23 08:55:20 +08:00
Andrew Nicols
0a4047ab31 MDL-73915 js: Switch amd minification to terser
Unfortunately the babel minify-mangle plugin seems to be abandoned and
in certain circumstances can be very buggy. The only safe options are to
disable it, or to switch to a different minification library.

Not minifying our javascript is not ideal, so this commit updates the
javascript tasks to use a rollup, combined with babel, and terser.

Babel still converts code from ES/UMD/AMD to AMD modules with the
relevant browser support, whilst terser minifies the code.

The rollup bundler handles tracking and creation of sourcemaps, and
supports better parallelisation of the tasks.

Since the upgrade to Node LTS/Gallium requires an upgrade to @babel/core
and eslint, which change the built files anyway, this seems like the
ideal time to make this change.
2022-02-23 08:55:09 +08:00
Andrew Nicols
aa7f7957ea MDL-73915 js: Upgrade babel and eslint 2022-02-23 08:53:54 +08:00
Shamim Rezaie
a70a2b25de Merge branch 'MDL-73612-master-2' of https://github.com/bmbrands/moodle 2022-02-01 14:33:34 +11:00
Bas Brands
a74c715627 MDL-73612 gradereport_grader: drawer layout issues 2022-01-31 10:09:33 +01:00
Eloy Lafuente (stronk7)
100bc51f1d MDL-73485 phpunit: externallib, generator and filter tescase names
All externallib_test, generator_test and filter_test classes:

- Namespaced with component[\level2-API]
- Moved to level2-API subdirectory when required.
- Fixed incorrect use statements with leading backslash.
- 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 tests under testing/tests:

1) The core_testing component doesn't exist.
2) But testing/tests are allowed because there is a suite pointing to it (phpunit.xml).
3) So, the only possible namespace for them is "core".
4) And to avoid problems with other core testcases (under lib/tests)
   they have been renamed to have testing_xxxx as prefix.

Finally, also modified calendar/tests/events/events_test.php because it uses
some renamed (core_calendar_externallib_testcase => \core_calendar\externallib_test)
classes.
2022-01-21 19:48:23 +01:00
Sara Arjona
8969abd82a MDL-73581 grade: Display success message on the same page
The "Grades were set for X items "message will be displayed on the
same screen, to safe one click to users and make it more consistent
with other similar actions in Moodle.
2022-01-18 15:12:55 +01:00
Víctor Déniz
ea3568ff6d Merge branch 'MDL-73572-master' of git://github.com/jleyva/moodle 2022-01-13 23:40:51 +00:00