226 Commits

Author SHA1 Message Date
David Mudrák
6e61b34ac2 MDL-83238 lang: Fix the changed strings in the tests, too 2024-10-02 22:04:50 +02:00
Paul Holden
08127c83a7
MDL-83037 badges: ensure image is specified in Behat test generator. 2024-09-06 11:25:35 +01:00
Paul Holden
cd69894e95
MDL-82804 badges: define no results notice inside report instances.
When doing so from calling code, the property is not persisted when
filtering/paging (or any AJAX interaction); instead, it should be
set from within the report instance itself.
2024-08-29 16:37:58 +01:00
Paul Holden
fafeeda7e1
MDL-82455 badges: link report recipients count to appropriate page. 2024-08-15 21:40:41 +01:00
Wolfgang Reichert
9dde27f0bb MDL-73091 core_badges: Avoid undefined variable notice in review
* Fix review method for award_criteria_courseset when courseset is empty
* Add unit tests for coverage of the award_criteria_courseset class

@co-authored jz-reichert@web.de
2024-06-25 08:47:34 +02:00
Eloy Lafuente (stronk7)
1093256560
MDL-81522 phpunit: Add missing void return type to all tests
While this change is not 100% required now, it's good habit
and we are checking for it since Moodle 4.4.

All the changes in this commit have been applied automatically
using the moodle.PHPUnit.TestReturnType sniff and are, exclusively
adding the ": void" return types when missing.
2024-06-11 12:18:04 +02:00
Paul Holden
1c2f5dc1df
MDL-81434 reportbuilder: ensure filter/condition parameter uniqueness.
This change fixes an edge case that could be triggered by creating a
custom report that contained a filter instance that was active as both
a filter and condition, where the filter instance provides parameters
to it's SQL fragment.

There is only one such filter present currently with which we can test
this, see 2f9001cbe9.
2024-05-07 15:03:16 +01:00
Daniel Ziegenberg
08027e408c
MDL-81281 phpunit: assertObjectHasAttribute is deprecated
To be integrated as part of MDL-81266

When running PHPUnit 9.6 we get the following deprecation warnings:
"assertObjectHasAttribute() is deprecated and will be removed in PHPUnit
10. Refactor your test to use assertObjectHasProperty() instead."

So we replace all instances of assertObjectHasAttribute with
assertObjectHasProperty.

PHPUnit justifies the change with:
> PHPUnit currently refers to "fields" (see above) as "attributes". This
> is (or will become) confusing considering the introduction of
> attributes in PHP 8 and their support in PHPUnit.  PHPUnit will be
> changed to use the term "property" instead of "attribute" where "field"
> is meant.

Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
2024-03-25 16:21:45 +01:00
Sara Arjona
0d7af68082
Merge branch 'MDL-81073' of https://github.com/paulholden/moodle 2024-03-18 12:43:15 +01:00
Andrew Nicols
9cdc5850c5
Merge branch 'MDL-75952' of https://github.com/stronk7/moodle 2024-03-12 10:45:02 +08:00
Eloy Lafuente (stronk7)
361dfe8145
MDL-75952 general: Since php81, refection->setAccessible() is no-op
Refereces:
- https://wiki.php.net/rfc/make-reflection-setaccessible-no-op
- https://www.php.net/manual/en/reflectionproperty.setaccessible.php
- https://www.php.net/manual/en/reflectionmethod.setaccessible.php

As of PHP 8.1.0, calling this method has no effect; all methods are
invokable by default. So, let's remove all uses from core, they are
no-op.
2024-03-10 21:15:00 +01:00
David Cerezal
1ded2b9d48 MDL-81128 reportbuilder: use specific step instead workaround 2024-03-08 10:33:15 +01:00
Paul Holden
2f9001cbe9
MDL-81073 badges: implement badge entity version/expiry filtering.
Add the same to the manage badges report, plus pre-existing version
column.
2024-03-07 14:38:23 +00:00
Sara Arjona
0b3b739370
MDL-80866 behat: Fix failures after disabling Chat and Survey 2024-03-01 11:41:50 +01:00
Sara Arjona
b33ba0b9fb
Merge branch 'MDL-78967-main' of https://github.com/kevpercy/moodle 2024-02-27 12:49:06 +01:00
Angelia Dela Cruz
31ce6c87fb MDL-79792 core_badges: Behat test for awarding badge to group members 2024-02-21 13:55:45 +08:00
Kevin Percy
a72a810479 MDL-78967 core_grades: Removed advanced grade item and category options 2024-02-21 13:45:21 +08:00
Sara Arjona
ce7f3eef04
Merge branch 'MDL-79552' of https://github.com/paulholden/moodle 2024-02-14 09:30:09 +01:00
David Carrillo
76bed1480a
MDL-80052 badges: Convert Course badges report to use Report builder 2023-12-19 10:23:27 +01:00
David Carrillo
982581d5eb
MDL-80052 badges: Convert Badge recipients report to use Report builder 2023-12-19 10:23:26 +01:00
Paul Holden
4fb106506d
MDL-79552 cohort: add cohort data to user-focused custom reports. 2023-12-15 09:58:19 +00:00
Angelia Dela Cruz
b445e72c80 MDL-79828 core_badges: Delete already awarded course badges 2023-11-21 16:11:39 +08:00
Sara Arjona
95e50b59ea
MDL-75572 criteria: Only award badges to sucessfull completions
The UX team confirmed a badge shouldn't be awarded when the criteria
use a passing grade and the user gets a failing grade.
So the COMPLETION_COMPLETE_FAIL status won't be considered
completed for activities with completion that require a passing
grade.
2023-10-25 07:08:03 +02:00
Andrew Nicols
ee81bfabe8
Merge branch 'MDL-77061' of https://github.com/dravek/moodle 2023-09-05 10:53:19 +08:00
David Carrillo
f0770658fb
MDL-77061 badge: Convert "Manage badges" page to use Report Builder
- Manage badges page is now a Report Builder system report to show
the list of site and course badges.
2023-08-25 12:12:37 +02:00
Stefan Topfstedt
7b04638c52 MDL-71212 core_course: adds controls to the course index drawer. 2023-08-18 11:00:55 -07:00
Simey Lameze
74b25ba5fd MDL-77695 behat: use automatic completion to award badges 2023-08-16 11:03:46 +08:00
Sara Arjona
2fcdfc17c1
Merge branch 'MDL-78648-master' of https://github.com/rmady/moodle 2023-07-10 07:35:19 +02:00
Andrew Nicols
3d5afd6061
Merge branch 'MDL-75810' of https://github.com/paulholden/moodle 2023-07-09 22:23:29 +08:00
Sara Arjona
abcbeca33d
MDL-78184 badges: Improve user flow for connecting backpack 2023-07-07 08:53:43 +02:00
Rodrigo Mady
9a5eb76a56 MDL-78648 badges: Fix in unit tests for test_get_user_badge_by_hash 2023-07-06 09:41:03 -03:00
Sara Arjona
7ae114dd5f
MDL-74570 badges: Remove unnecessary hacks 2023-06-29 17:32:51 +08:00
Paul Holden
ccafa6e657
MDL-75810 badges: tag support in badge custom report sources. 2023-06-26 09:50:45 +01:00
Andrew Nicols
bd3a28eb2b
Merge branch 'MDL-74570-master' of https://github.com/rmady/moodle 2023-06-24 22:20:35 +08:00
Sara Arjona
5039f6980c Merge branch 'MDL-63120_Badges_cron_task_fails-master' of https://github.com/mebis-lp/moodle 2023-06-21 11:41:51 +02:00
Rodrigo Mady da Silva
4b26d1f784 MDL-74570 core_badges: Add webservice core_badges_get_user_by_hash 2023-06-20 21:14:17 -03:00
Paul Holden
697be4eaa3
MDL-75810 badges: allow tags to be specified in test data generator. 2023-06-16 16:06:09 +01:00
Jun Pataleta
620371e7d3 Merge branch 'MDL-73325-master' of https://github.com/ntdat1904/datnguyen_moodle 2023-06-15 11:31:22 +08:00
Sara Arjona
3878c85440 MDL-78102 badges: Check empty backpack email/password
For backpack connection using OBv2.0, email and password can't be
blank.
This patch adds some extra checks to validate this and displays an
error to the users before trying to connect to the backpack.
Besides, the error displayed when any error is returned by the
backpack (like invalid credentials), has also been improved, to
make it clearer for the users.
2023-06-13 11:21:13 +02:00
Damian Hippisley
faa41cd791 MDL-73325 core_badges: Add tags field to BadgeClass 2023-06-09 13:41:07 +01:00
Paul Holden
12bc873b26
MDL-73648 badges: add Behat generator class for creating badges. 2023-05-26 12:19:14 +01:00
=
a076a80dec MDL-63120 core_badges: Avoid multiple joins in sql statement 2023-05-24 13:37:59 +02:00
Andrew Nicols
03e4afdb39 MDL-78132 badges: move apiBase consumption to backpack
The logic to create the issuer has been moved to the backpack form
in order to improve the workflow and update the apiBase with the
proper value comming from the badgeconnect.json manifest file.

So, as part of this change in the workflow, the following changes
has been also implemented (to make the UI easier for users):

- The "Open Badges" oAuth issuer button has been removed from the
"OAuth Services" admin page. As they are created/updated when a backpack
is saved, this button is not required anymore.
- The "OAuth2 services" and "Backpack API URL" parameters have been
removed from the Manage backpacks form, because they are created on
the fly each time the backpack is saved.
2023-05-23 08:46:39 +02:00
Paul Holden
ab670ab286 MDL-76933 badges: create user-focused datasource for custom reporting.
This report source differs from the original badges source (5274ee5a)
by making `user` the primary table of the report, allowing for reports
on all users regardless of whether they have been awarded badges.
2023-01-20 10:20:01 +00:00
Andrew Nicols
a3cc26f8bb MDL-76583 core: Update uses of external_* classes 2023-01-19 07:34:09 +08:00
Paul Holden
45818da292 MDL-76221 reportbuilder: improve report test generator methods.
Test generators for creating report columns, filters and conditions
now allow for setting all persistent properties.
2023-01-04 10:56:27 +00:00
Huong Nguyen
d4d666cdf4 MDL-74996 Quiz: Change the submission confirmation dialogue content
- Changed the title from "Confirm" to "Submit all your answers and finish?"
 - Changed the content from "Once you submit, you will no longer be able to change your answers for this attempt."
   to "You will no longer be able to change your answers for this attempt."
 - Changed some Behat scenarios to match with the new dialogue content
2022-11-07 09:40:04 +07:00
Paul Holden
b40d438fbf MDL-75708 reportbuilder: consider stress tests as requiring longtest.
We should respect the value of the PHPUNIT_LONGTEST constant in the
report source stress tests, as it was discovered after 165e26fa that
the default configuration of some CIs (GHA) was not sufficient to run
them.

Hence, use the PHPUNIT_LONGTEST to determine whether to execute said
tests. Note this constant is enabled on internal CI.
2022-09-09 11:11:39 +01:00
Paul Holden
165e26fad9 MDL-73938 reportbuilder: helper methods for automating report tests.
Implement stress tester methods for iterating over report columns,
aggregation and conditions. Assert that each works correctly in
isolation, and when used in conjunction with other columns.
2022-09-05 12:07:17 +01:00
Paul Holden
0304508926 MDL-75245 reportbuilder: re-factor current tag elements to new entity.
Update previous implementation of tags (9ebd801c) in report sources to
use equivalent tag entity columns and filters.
2022-08-18 17:01:21 +01:00