301 Commits

Author SHA1 Message Date
Mihail Geshoski
9ad5cff41f MDL-65515 badges: Split install/upgrade
Use badges/upgradelib.php for functions that only affect install/upgrade.

All credit goes to Damyon Wiese.
2019-10-09 11:15:28 +08:00
Peter
e6445c5bd9 MDL-65315 badges: Update the class and issuer OBv2.0 url 2019-09-24 07:33:13 +08:00
Eloy Lafuente (stronk7)
c010001b90 Merge branch 'MDL-66032-master_awarded_badges_criteria' of https://github.com/andrewmadden/moodle 2019-07-17 01:31:46 +02:00
Andrew Madden
7599223a1c MDL-66032 badges: Prevent empty awarded badges criteria being created.
When creating or editing the awarded badges criteria, the select element should be
required to prevent empty criteria from being created. In addition, if there are
already badges created with the empty criteria, there should be not be an exception
thrown when assessing whether the criteria has been completed.
2019-07-16 09:31:25 +10:00
Silvia Pinheiro
ae1556ad93 MDL-62836 badges: Add behat test for the new group selector 2019-07-12 18:13:37 +02:00
Silvia Pinheiro
b1e63fc7e2 MDL-62836 badges: Potential badge recipients by group
This affects the case when a badge is setup with the criteria "manual issue by role".
The non-editing teacher can see all participants of the course, when awarding a badge, even with SEPARATE GROUPS mode enabled.
With this change, when the non-editing teacher chooses a group, and searches for a user, the results are filtered for that group.
The same happens for "Existing badge recipients by group" when revoking a badge.
2019-07-12 18:13:37 +02:00
Sara Arjona
4221e36b16 MDL-65787 badges: fix warning count() with PHP 7.2 2019-06-05 11:02:53 +02:00
Sara Arjona
39f4caf351 MDL-65705 badges: fix issued date for external badges
The preg_match('~^[1-9][0-9]*$~', x) calls have been replaced to
is_numeric(x).
2019-05-28 09:23:35 +02:00
Damyon Wiese
8f7fba80d1 MDL-65544 badges: Any all criteria
When testing any vs all aggregation method, we expect a different result
when we have looped all the competencies and they all passed or failed.
2019-05-13 10:50:05 +08:00
Damyon Wiese
084a42f9f5 MDL-65518 badges: Require the issuercontact
For Badges V2 we can't use just any email address to issue badges, it needs to be a valid
account on the backpack.
2019-05-10 15:51:27 +08:00
Damyon Wiese
2fe34536d5 MDL-65518 badges: Retry auth test
When testing the site backpack login credentials, don't rely on a previous login
because the username and password could have changed.
2019-05-09 14:56:27 +08:00
Damyon Wiese
d48a52ddb1 MDL-65518 badges: Admin settings warning
If the backpack is changed to Open Badges V2 backpack,
attempt the authenticate with the site settings and return a warning
if it fails.
2019-05-09 14:56:21 +08:00
Adrian Greeve
48c8a555e0 NOBUG: Fix white space issue due to history rewrite. 2019-05-07 12:51:01 +02:00
Damyon Wiese
58c7d2ce2b MDL-63262 badges: Show all public badges
Use the "expand" parameter so the backpack returns nested public
information about each badge in a public collection. This saves 2 requests per badge and
fixes the problem where we don't have permission to see some public badge details.
2019-05-06 11:25:26 +08:00
Damyon Wiese
7444ba743f MDL-63262 badges: More changes for badgr.io
This commit combines several changes:
* Show authentication errors.
* Show more detailed authentication errors
* When the site backpack is different to the user backpack, show a warning
* Do not duplicate the apiversion and backpackurls in each user backpack.
* Do not support different issuer information for each badge with Open Badges v2.
* Add obversion to assertion url
* Combine separate badges upgrade steps and bump the version number.
* Don't show private collections.
* Push the larger image size to backpacks (512x512).
* BADGE_BACKPACKURL is deprecated
* Don't use property alignments, only alignment
2019-05-03 15:00:01 +08:00
Damyon Wiese
1837b1d5fd MDL-63262 badges: Coding style 2019-05-03 15:00:00 +08:00
Damyon Wiese
aae219acce MDL-63262 badges: Add badgr.io
Upgrade the support for Open Badges 2 to support a real open badges 2 backpack.
Moodle can only talk to one backpack at a time, so after switching backpacks, users
will have to manually disconnect and then reconnect their backpack to the new one.

This commit combines several changes:
* Split classes into badges namespace
* Publish expiry data with a badge
* Publish badge alignments in badges exported to the backpack.
* Export the criteria for a badge to the backpack.
2019-05-03 15:00:00 +08:00
Sara Arjona
bef6805656 Merge branch 'MDL-64702-master' of git://github.com/damyon/moodle 2019-04-29 08:34:21 +02:00
David Monllaó
b63c0b9079 Merge branch 'MDL-60680-master' of git://github.com/jleyva/moodle 2019-04-25 18:55:45 +02:00
Juan Leyva
2356454f21 MDL-60680 notifications: Include action buttons information 2019-04-25 14:55:57 +02:00
Juan Leyva
36fa0ec900 MDL-60680 notifications: Return custom data in notifications 2019-04-25 14:55:18 +02:00
Shamim Rezaie
30ce76c792 MDL-64782 core_badges: Performance improvement 2019-04-23 17:01:48 +10:00
Damyon Wiese
0dc93da62a MDL-64702 badges: Add to privacy
Add endorsement, related badges and alignment to privacy export.
2019-04-23 11:13:55 +08:00
Marina Glancy
76f2d89471 MDL-10965 course: search only courses with completion
it is quite often when we need to have an autocomplete element that searches courses that
have completion enabled. This commit adds an option for the 'course' form element, and also
changes two places where we search for courses with completion. This should fix MDL-58989
2019-04-10 12:35:29 +02:00
Eloy Lafuente (stronk7)
dabc69afe5 Merge branch 'MDL-65191-master' of git://github.com/lameze/moodle 2019-04-09 00:46:47 +02:00
Simey Lameze
15263647fa MDL-65191 core_badges: delete badges legacy cron file 2019-04-04 09:36:20 +08:00
Damyon Wiese
f44557d045 MDL-63876 badges: Competency deletion
Do not delete a competency if it is a criteria for a badge.
2019-03-29 11:31:15 +08:00
Damyon Wiese
6bdaf20462 MDL-63876 competencies: Skip enabled check
Allow rendering a competency summary if competencies are disabled, but do not include
links to competencies pages.
2019-03-29 11:31:15 +08:00
Damyon Wiese
8aff6f6f14 MDL-63876 badges: Coding style
Add comments to document function params and template example context.
2019-03-29 11:31:15 +08:00
Damyon Wiese
43f1c8e23c MDL-63876 badges: Allow criteria to be optional
Competencies criteria type is only added if competencies are enabled.
2019-03-29 11:31:15 +08:00
Damyon Wiese
da5e19a128 MDL-63876 badges: Do not call tool_lp directly 2019-03-29 11:31:15 +08:00
Damyon Wiese
f94786e0e1 MDL-63876 badges: Add competency criteria
Properly integration badges with competencies provided in Moodle.

Automatically grant the badge when the defined competencies are marked as proficient.
2019-03-29 11:31:15 +08:00
Damyon Wiese
e8bfd9b4a9 MDL-63876 badges: Remove invalid table from badges 2019-03-29 11:30:09 +08:00
Sara Arjona
0c04a44457 MDL-64974 badges: add missing configurecriteria capability check 2019-03-11 10:24:39 +01:00
Sara Arjona
22348a3b96 MDL-62631 badges: Add manage/add badges buttons on Badges page
Direct access from the navigation Badges section to the "Manage badges"
and "Add a new badge" buttons.
2019-02-22 08:02:35 +01:00
Eloy Lafuente (stronk7)
c94dbc411f Merge branch 'MDL-63614_M37v1' of https://github.com/sbourget/moodle 2019-02-06 13:19:01 +01:00
Eloy Lafuente (stronk7)
5a9195d922 Merge branch 'MDL-64211-master' of git://github.com/damyon/moodle 2019-01-24 00:31:54 +01:00
Eloy Lafuente (stronk7)
59776faf6f Merge branch 'MDL-64441-master' of git://github.com/sarjona/moodle 2019-01-22 18:49:07 +01:00
Sara Arjona
502650a3e2 MDL-64222 badge: Removed backpackurl from the edit_form 2019-01-08 16:24:48 +01:00
Sara Arjona
706c8d1936 MDL-64441 badges: Remove notice when language is empty 2018-12-20 16:20:05 +01:00
Stephen Bourget
3e42942d73 MDL-63614 badges: Add COMPLETION_FAIL support to badge criteria 2018-12-19 10:16:51 -05:00
Damyon Wiese
263a58338f MDL-64211 badges: Display links to related badges 2018-11-26 14:51:18 +08:00
Eloy Lafuente (stronk7)
16d4f75b26 Merge branch 'MDL-63976-master-enfix' of git://github.com/mudrd8mz/moodle 2018-11-19 22:17:44 +01:00
David Mudrák
94693027e0 MDL-63976 lang: Update the Behat scenarios with the new strings 2018-11-19 19:18:53 +01:00
Adrian Greeve
674c00edb2 MDL-64008 badges: Stop displaying empty fields in badge display. 2018-11-19 18:42:49 +01:00
David Monllao
dd2d82e55c Merge branch 'MDL-64010-master' of git://github.com/abgreeve/moodle 2018-11-19 11:12:09 +01:00
Damyon Wiese
a356db0db2 Merge branch 'MDL-63973-master' of https://github.com/snake/moodle 2018-11-19 16:28:13 +08:00
Jake Dallimore
810da68e14 MDL-63973 core_badges: exclude related badges when adding related badges
The form which allows a user to add related badges should exclude any
related badges, regardless of the direction of the relationship.
2018-11-19 11:19:12 +08:00
Jake Dallimore
c660772600 MDL-63973 core_badges: fix related badges count in the badges tabs
If A is related to B, this should show a 1 count for either A or B.
2018-11-19 11:10:14 +08:00
Luca Bösch
2e477f03cc MDL-63487 badges: Style "◀ Award badge" and "Revoke badge ▶" buttons 2018-11-16 17:29:17 +01:00