267 Commits

Author SHA1 Message Date
Sara Arjona
3f2f2e85bb MDL-72115 course: Rename Miscellaneous category
The "Miscellaneous" course category has been renamed to Category 1.
Besides, the description field has been set from FORMAT_MOODLE to
FORMAT_HTML.
2021-09-13 08:36:17 +02:00
Jun Pataleta
4e75e73cb5 Merge branch 'primary_secondary_nav' of https://github.com/Chocolate-lightning/moodle 2021-08-25 10:42:57 +08:00
Adrian Greeve
7d435fb5f2 MDL-70196 navigation: Update to feature files.
- Part of: MDL-69588
A lot of tests rely on the last element of the breadcrumb being
active. This updates feature files to not rely on this anymore.
2021-08-23 17:46:38 +08:00
Dan Marsden
34bdef0b62 MDL-70006 analytics: Don't send notifications to suspended enrolments. 2021-08-03 10:52:53 +12:00
Amaia Anabitarte
5af5368059 MDL-65553 core_analytics: Don't allow to flag predictions several times
Even if a prediction is hidden from the report once is flagged,
it can be flagged several times if the user visits detailed view via URL.
We remove the checkbox to select a prediction and flag it
once it has already been flagged.
2021-04-15 16:39:09 +02:00
Eloy Lafuente (stronk7)
81407f18ec MDL-71036 phpunit: Mock->setMethods() silently deprecated
The current ->setMethods() has been silently (won't emit any
warning) in PHPUnit 9. And will stop working (current plans)
in PHPUnit 10.

Basically the now deprecated method has been split into:

- onlyMethods(): To point to existing methods in the mocked artifact.
- addMethods(): To point to non existing (yet) methods in the mocked
  artifact.

In practice that means that all our current setMethods() calls can be
converted to onlyMethods() (existing) and done. The addMethods() is
mostly useful on development phases, not final testing.

Finally note that <null> isn't accepted anymore as parameter to
double all the methods. Instead empty array [] must be used.

Link: https://github.com/sebastianbergmann/phpunit/issues/3770
2021-03-11 23:04:31 +01:00
Eloy Lafuente (stronk7)
8a14a7bd22 MDL-71036 phpunit: assertContains() now performs strict comparison
The methods assertContains() and assertNotContains() now perform
strict (type and value) comparison, pretty much like assertSame()
does.

A couple of new assertContainsEquals() and assertNotContainsEquals()
methods have been created to provide old (non-strict) behavior, pretty
much like assertEquals() do.

Apart from replacing the calls needing a relaxed comparison to those
new methods, there are also a couple of alternative, about how to
fix this, depending of every case:

- If the test is making any array_values() conversion, then it's better
  to remove that conversion and use assertArrayHasKey(), that is not
  strict.
- Sometimes if may be also possible to, simply, cast the expectation
  to the exact type coming in the array. I've not applied this technique
  to any of the cases in core.

Link: https://github.com/sebastianbergmann/phpunit/issues/3426
2021-03-11 23:04:31 +01:00
Marina Glancy
0af0a96bb1 MDL-70898 various: private functions can not be declared final 2021-02-15 16:20:06 +01:00
Sara Arjona
8099deda48 Merge branch 'MDL-69107-master-2' of git://github.com/andrewnicols/moodle 2020-12-18 15:22:09 +01:00
Amaia Anabitarte
46927df906 MDL-65284 analytics: Final deprecation get_analysables() 2020-12-16 12:47:52 +01:00
Andrew Nicols
31402aa406 MDL-69107 user: Fix autocomplete usages 2020-12-16 07:50:56 +08:00
Ilya Tregubov
2cc84a792b MDL-65186 analytics: Deprecate add_builtin_models 2020-12-08 09:12:00 +02:00
Jake Dallimore
c196068cc4 Merge branch 'MDL-65086-master' of git://github.com/peterRd/moodle 2020-12-03 10:15:19 +08:00
Dan Marsden
9ae716734f MDL-68052 analytics: Clean up analytics_indicator_calc records. 2020-11-17 20:27:00 +13:00
Peter Dias
a726e52e80 MDL-65086 analytics: Deprecate get_enabled_time_splitting_methods 2020-11-17 13:55:26 +08:00
Eloy Lafuente (stronk7)
284d0ae8f8 Merge branch 'MDL-66392' of https://github.com/paulholden/moodle into master 2020-10-21 19:43:13 +02:00
Paul Holden
cecd90ffec MDL-66392 analytics: make model output directory default to empty.
Falling back to path within $CFG->dataroot/models.
2020-10-21 18:04:26 +01:00
Eloy Lafuente (stronk7)
40de097e65 MDL-67673 phpunit: Remove deprecated assertContains() uses on strings
Both assertContains() and assertNotContains() are deprecated in PHPUnit 8
for operations on strings. Also the optional case parameter is. All uses
must be changed to one of:

- assertStringContainsString()
- assertStringContainsStringIgnoringCase()
- assertStringNotContainsString()
- assertStringNotContainsStringIgnoringCase()

More info: https://github.com/sebastianbergmann/phpunit/issues/3422

Regexp to find all uses:

ag 'assert(Not)?Contains\('
2020-10-21 12:46:00 +02:00
Eloy Lafuente (stronk7)
d95c378771 MDL-67673 phpunit: Remove expectedException annotations
While this is not strictly required, because removal will
happen in PHPUnit 9.0, we are already getting rid of all
uses in core.

From release notes:https://phpunit.de/announcements/phpunit-8.html

The annotations `@expectedException`, `@expectedExceptionCode`,
`@expectedExceptionMessage`, and `@expectedExceptionMessageRegExp`
are now deprecated.
Using these annotations will trigger a deprecation warning
in PHPUnit 8 and in PHPUnit 9 these annotations will be removed.

Also, all uses of expectExceptionMessageRegExp() has been moved
to expectExceptionMessageMatches(). See https://github.com/sebastianbergmann/phpunit/issues/3957

TODO: Various weirdness found while doing the changes with these tests:
- vendor/bin/phpunit lib/tests/exporter_test.php (created MDL-69700)
- vendor/bin/phpunit competency/tests/external_test.php (same issue than prev one)
- vendor/bin/phpunit question/engine/tests/questionengine_test.php (created MDL-69624)
- vendor/bin/phpunit lib/tests/event_test.php (created MDL-69688)
2020-10-21 12:46:00 +02:00
Eloy Lafuente (stronk7)
f94195c320 MDL-67673 phpunit: Remove deprecated assertInternalType()
While this is not strictly required, because removal will
happen in PHPUnit 9.0, we are already getting rid of all
uses in core.

From release notes:https://phpunit.de/announcements/phpunit-8.html

assertInternalType() is deprecated and will be removed in
PHPUnit 9. Refactor your test to use assertIsArray(), assertIsBool(),
assertIsFloat(), assertIsInt(), assertIsNumeric(), assertIsObject(),
assertIsResource(), assertIsString(), assertIsScalar(),
assertIsCallable(), or assertIsIterable() instead.
2020-10-21 12:45:59 +02:00
Eloy Lafuente (stronk7)
f6711bb394 MDL-67673 phpunit: Fix the return type of template methods
All the setup/teardown/pre/post/conditions template methods
now are required to return void. This was warned with phpunit 7
and now is enforced.

At the same time, fix a few wrong function names,
provider data and param types, return statements...
2020-10-21 12:45:59 +02:00
Eloy Lafuente (stronk7)
74ee34fd87 MDL-69521 core: Move all comments in code from 4.1 to 3.11 2020-09-08 18:59:30 +02:00
Bas Brands
4394f9e358 MDL-67735 theme_boost: remove bs2 and bs4alpha compatibility css 2020-08-17 08:16:42 +00:00
Matt Clarkson
7f55289912 MDL-67440 analytics: optimse delete's in clean up task. 2020-07-08 11:16:36 +12:00
Andrew Nicols
a2bc97a386 MDL-68750 analytics: Correct behat test modal checks 2020-05-26 12:55:29 +08:00
Jun Pataleta
1eac44f128 Merge branch 'MDL-67217_master' of git://github.com/dmonllao/moodle 2019-11-25 16:13:01 +08:00
David Monllaó
e477e1350a MDL-67217 unittest: usleep and windows don't get along well 2019-11-22 07:41:07 +08:00
Jun Pataleta
fd8c021447 Merge branch 'MDL-67039_master' of git://github.com/dmonllao/moodle 2019-11-04 19:21:41 +08:00
David Monllaó
b92c764872 MDL-67039 analytics: Unit tests for unidimensional arrays 2019-11-04 09:33:50 +08:00
David Monllaó
47b506e2f7 MDL-67039 analytics: Unidimensional array if no predictions 2019-11-04 09:32:05 +08:00
Eloy Lafuente (stronk7)
6e4cee745b Merge branch 'MDL-66807_master' of git://github.com/dmonllao/moodle 2019-11-01 00:08:16 +01:00
David Monllaó
87e5342a5b MDL-66807 analytics: Fix templates for gmail 2019-10-31 11:41:53 +08:00
David Monllaó
ef05f29267 MDL-67038 analytics: Remove null strings from the DB 2019-10-30 12:40:32 +08:00
David Monllaó
06579b18cc MDL-64739 analytics: Contexts autocomplete with ajax 2019-10-21 15:33:29 +08:00
David Monllaó
76b5ee4545 MDL-64739 tool_analytics: Restrict models to specific contexts 2019-10-21 09:54:39 +08:00
David Monllaó
c22fb4bd4b MDL-64739 core_analytics: Contexts param for get_analysables_iterator 2019-10-21 09:54:34 +08:00
David Monllaó
bf25fb166c MDL-65585 analytics: Global on/off switch 2019-10-10 10:06:31 +08:00
David Monllaó
63c15f6c58 MDL-66004 mlbackend_python: Purge testing output dirs properly 2019-10-03 09:45:57 +08:00
Eloy Lafuente (stronk7)
20502fa30c Merge branch 'MDL-66004_master' of git://github.com/dmonllao/moodle 2019-10-02 20:53:24 +02:00
David Monllaó
463b63db2a MDL-66004 analytics: mlbackend_python tested just once
Either running locally from the web server or using a server if
TEST_MLBACKEND_* vars are set. The tests will still be skipped if
the python backend is not available in the web server.
2019-10-02 08:41:14 +08:00
David Monllaó
aa5b705607 MDL-66004 mlbackend_python: Package installed on a separate server 2019-10-02 08:41:14 +08:00
David Monllaó
386d109172 MDL-62191 analytics: Support for bulk actions 2019-09-27 14:13:52 +08:00
Eloy Lafuente (stronk7)
08a6375507 Merge branch 'MDL-65588_master' of git://github.com/dmonllao/moodle 2019-09-23 22:51:10 +02:00
Sara Arjona
1445f82315 Merge branch 'MDL-66090_master' of git://github.com/dmonllao/moodle 2019-09-20 12:46:16 +02:00
David Monllaó
2d9280e0df MDL-65588 analytics: New models for student accesses 2019-09-20 08:14:13 +08:00
David Monllaó
16cb4f32a0 MDL-66536 analytics: Indicators can add extra data for targets 2019-09-18 13:07:21 +08:00
David Monllaó
b024720499 MDL-66536 analytics: Bulk-fetch samples data
For one_sample_per_analysable models.
2019-09-18 13:04:30 +08:00
David Monllaó
93e71c712d MDL-66091 report_insights: Unify contextwithinsights cache sets 2019-09-18 13:00:06 +08:00
David Monllaó
486e797c5f MDL-66091 analytics: Targets choose if there should be a report or not 2019-09-17 13:58:55 +08:00
David Monllaó
21202090f7 MDL-66091 report_insights: Usability improvements
- More feedback provided for the user once they click on useful/notuseful from the email.
- Replace the indicator calculations table headers for the table caption and
  replace the text by just "Indicators"
- Replace "System" for the site name for insights generated at system
  level
- Replace "$modelname prediction" for "$modelname" in report/insights/prediction.php
  heading

MDL-66091
2019-09-17 13:57:36 +08:00