129 Commits

Author SHA1 Message Date
Sara Arjona
a399be5f01
Merge branch 'MDL-81073' of https://github.com/paulholden/moodle 2024-03-19 23:18:13 +07:00
Paul Holden
ba1f9cb26c
MDL-81073 badges: better Oracle support for expiry filter.
Avoid the following error by casting the bound parameter:

ORA-00932: inconsistent datatypes: expected CHAR got NUMBER.
2024-03-18 19:53:29 +00:00
Sara Arjona
0d7af68082
Merge branch 'MDL-81073' of https://github.com/paulholden/moodle 2024-03-18 12:43:15 +01:00
Jun Pataleta
3278ce7aba
Merge branch 'MDL-65292' of https://github.com/stronk7/moodle 2024-03-08 08:00:41 +08: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
Eloy Lafuente (stronk7)
ba1f804ffa
MDL-65292 style: Fix all function declarations white space
This has been generated running the following Sniffs, all
them part of the Moodle's CodeSniffer standard:
- PSR12.Functions.ReturnTypeDeclaration
- PSR12.Functions.NullableTypeDeclaration
- moodle.Methods.MethodDeclarationSpacing
- Squiz.Whitespace.ScopeKeywordSpacing

All them are, exclusively, about correct spacing, so the changes
are, all them, only white space changes.

Only exceptions to the above are 3 changes what were setting the
return type in a new line, and, when that happens, the closing
parenthesis (bracket) has to go to the same line than the colon.
2024-02-28 23:33:26 +01:00
Paul Holden
958090edc6
MDL-80342 reportbuilder: use new cohort filter in related reports. 2024-02-21 16:34:35 +00:00
Sara Arjona
ce7f3eef04
Merge branch 'MDL-79552' of https://github.com/paulholden/moodle 2024-02-14 09:30:09 +01:00
David Carrillo
10d2b5864b
MDL-80325 reportbuilder: Update 'Delete' links to red color
- Update all 'Delete' links on RB system report actions to red color
2024-01-12 15:38:19 +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
Paul Holden
7143cf4cbc
MDL-79397 reportbuilder: update existing entity table definitions. 2023-12-07 17:19:01 +00: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
Ilya Tregubov
5da0cee324
Merge branch 'MDL-79334' of https://github.com/paulholden/moodle 2023-09-14 19:46:53 +08:00
Paul Holden
b6e85266da
MDL-79334 badges: fix return URL of activate action in system report.
We cannot rely on `qualified_me()` to work reliably upon report reload
events (paging, sorting, filtering, etc. are all performed via AJAX).

Small cleanup after f0770658.
2023-09-12 15:13:22 +01:00
Andrew Nicols
adce2874b0
MDL-78324 badges: Remove unnecessary Modal
The core/utility confirmation modal can be used in this case to confirm
backpack actions. It is not necessary to have a custom module for this
purpose.
2023-09-09 00:04:04 +08: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
Sara Arjona
f2199b5c2d
MDL-78179 badges: Clean SESSION when user disconnect backpack
The token information was not being properly cleared from the $SESSION.
As a result, certain errors were occurring when users attempted to
reconnect within the same session.
2023-08-23 07:35:44 +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
Paul Holden
ccafa6e657
MDL-75810 badges: tag support in badge custom report sources. 2023-06-26 09:50:45 +01: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
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
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
Meirza
3895529b74 MDL-77350 badges: Added class properties that are not declared
In PHP 8.2 and later, setting a value to an undeclared class property is
deprecated and emits a deprecation notice.
So we need to add missing class properties that still need to be declared.
2023-05-16 01:03:01 +07:00
Andrew Nicols
bd214de282 MDL-75552 badges: move apiBase consumption to backpack
The apiBase in .well-known/badgeconnect.json was ignored and it was
causing some failures when connecting or sending badges to an
external backpack.
For OBv2.1, it has been changed to always use the apiBase defined
in the badgeconnect.json backpack provider.
2023-05-09 08:50:42 +02:00
Sara Arjona
ed53d81dc7 MDL-77842 badges: Improve debugging information for Badgr
In MDL-77086 some extra information was added when a badge can't be
sent to a backpack. However, as the Badgr is not following the
specification, it's still hard to debug it when it fails (as
raised in MDL-75552, Badgr is not working because, in some cases,
it's returning the "Method Not Allowed / Request method 'POST'
not supported" error.
2023-04-14 13:47:23 +02:00
Marina Glancy
8fc1486d36 MDL-77164 various: fix incorrect phpdocs 2023-04-13 11:35:06 +01:00
Sara Arjona
597564d7b4 MDL-77086 badges: Improve debugging
Display more information, like the status error, when the badge can't
be sent to the backpack.
2023-02-13 08:40:45 +01:00
Andrew Nicols
edd1fa9218 Merge branch 'MDL-76933' of https://github.com/paulholden/moodle 2023-01-30 11:25:27 +08:00
Sara Arjona
ae53d04144 Merge branch 'MDL-75337-master' of https://github.com/laurentdavid/moodle 2023-01-24 16:07:35 +01:00
Laurent David
fc72a1d7b1 MDL-75337 core: Single button - core changes
* Change all core calls toward single_button to use single_button::BUTTON_PRIMARY
    when needed
2023-01-24 06:01:35 +01:00
Marina Glancy
b0a83aa7bd MDL-76362 various: Avoid passing nulls to functions that don't allow nulls
PHP 8.1 is more strict on the parameter type. Functions such as trim(), strlen(), str_replace(), etc
show notice when null is passed as an argument
2023-01-23 09:15:54 +08: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
David Woloszyn
126028cc76 MDL-76183 lib: Update Github URLs 2022-11-30 14:01:31 +11:00
Marina Glancy
064eccd4fc MDL-75525 reportbuilder: specify initial sorting for datasources 2022-11-07 15:43:45 +01:00
Marina Glancy
5a9590dfad MDL-76073 badges: badge RB entity should have nullable callbacks 2022-10-25 10:49:06 +02:00
Paul Holden
208adcf3d1 MDL-73938 reportbuilder: better Oracle support of long text columns.
Specifically during column grouping/aggregation, we need to avoid CLOB
datatype inconsistencies (ORA-00932).
2022-09-05 12:08:54 +01:00
Víctor Déniz
5087f56905 Merge branch 'MDL-75119' of https://github.com/paulholden/moodle 2022-07-19 13:48:58 +01:00
Jun Pataleta
399a922f0d Merge branch 'MDL-74784-master' of https://github.com/sarjona/moodle 2022-07-11 16:54:22 +08:00
Paul Holden
dc60fe6662 MDL-75119 reportbuilder: preload context data for column callbacks.
This prevents additional requests for context instances in the
callback methods, by preloading all required data in the initial
field select.
2022-07-04 13:07:02 +01:00
Paul Holden
5274ee5a25 MDL-73988 badges: implement badges datasource for custom reporting.
Create two entities exposing reportable data on badges and their
recipients, via column and filter definitions.

Create report source bringing them together along with the user and
course entities to provide data for the reportbuilder editor.
2022-05-19 16:43:28 +01:00
Sara Arjona
1cedbd1e19 MDL-74784 core_badges: Fix exception with related badges
System badges with related badges were displaying an error before this patch,
because the is_guest($context) function expects a context_course.
2022-05-18 08:18:33 +02: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
Paul Holden
a7b940ba7d MDL-72880 badges: change badge exporter issuername field to text.
This matches it's type in the settings pages, and also the type
of the site name used as the default for the setting. It's content
will now be automatically filtered by the external exporter class.
2022-01-07 09:11:35 +00:00