321 Commits

Author SHA1 Message Date
Sara Arjona
92219c8ffd MDL-69002 core_badges: move backpack validation to a separate page
Instead of running the site backpack validation every time badges/backpacks.php
page is loaded, an action button has been added to the backpacks with OB set
to 2.0 to let admins running manually this verification when needed.
2020-06-10 13:02:44 +02:00
Sara Arjona
3e567085a8 MDL-69002 core_badges: add methods to support backpack validation
A more generic method has been added to the API to validate the
backpack connection (for now, there was only one method for
validating current backpack).
Besides, a renderer has been added to display this information
depending on the backpackid.
2020-06-10 12:26:47 +02:00
Sara Arjona
cbe0bb91fd MDL-68905 core_badges: remove issuer details from edit page
In MDL-68746 issuer details fields were removed from the badges
form, because they are filled from the site settings.
This is a regression because these fields should be removed also
from the edit page.
2020-06-03 19:38:09 +02:00
Sara Arjona
dcbc830cfa MDL-68746 core_badges: fix behat error with issuername 2020-05-28 11:20:46 +02:00
Jake Dallimore
b08e4b5cd6 Merge branch 'MDL-68746-master' of git://github.com/sarjona/moodle 2020-05-28 11:56:23 +08:00
Sara Arjona
a80541ea90 MDL-68567 badges: add/remove site backpacks 2020-05-22 09:01:59 +02:00
Sara Arjona
630a19ebd5 MDL-68746 core_badges: remove Issuer details from badges form
When OBv2.0 support was added, the issuername and issuercontact
fields were changed to static.
In order to avoid confusion for the user, these fields shouldn't
be displayed for OBv2.0 or higher.
2020-05-20 08:51:52 +02:00
Tung Thai
15a00bead1 MDL-66992 core_badges: Add support to Open Badges 2.1 2020-05-17 20:01:55 +07:00
Andrew Nicols
7afd16ad84 MDL-66109 behat: Require newline at EOF
This change enables the gherkinlint rule to require a new line at the
end of the file. This change is in keeping with existing Moodle coding
style guidelines.
2020-05-11 11:07:49 +08:00
Eloy Lafuente (stronk7)
f1f1497f04 Merge branch 'MDL-66357-master' of git://github.com/sarjona/moodle 2020-04-08 02:52:15 +02:00
Sara Arjona
faf0029eed MDL-66357 core_badges: remove action=0 usage for issuer
In MDL-67971, issuer_json.php was created, to display issuer JSON content.
However, some files were still using action=0 to display this information.
It has been replaced by issuer_json.php.
The action=0 support won't be removed (at least for now), because several
public badges URLs are using it.
2020-04-03 08:09:55 +02:00
Sara Arjona
640628192a MDL-66357 core_badges: set OBv2 as default 2020-04-03 08:09:55 +02:00
Sara Arjona
f958f5c19b MDL-66357 core_badges: remove mozilla backpack references
Mozilla backpack closed a few months ago. It was moved to Badgr.io
(as OBv1.0) but as we're also supporting Badgr.io OBv2.0, it
makes no sense to leave old references to Mozilla backpack there.
2020-04-03 08:09:55 +02:00
Tim Hunt
1dcd0d3499 MDL-68233 renderers/block: remove illegal uses of $PAGE and $OUTPUT 2020-03-29 15:34:26 +01:00
Sara Arjona
2f45b6f7cf MDL-67971 core_badges: review issuer URL 2020-03-02 08:02:08 +01:00
Paul Holden
5253834d03 MDL-67532 badges: better default for new badge language. 2020-02-07 09:46:56 +00:00
Sara Arjona
f8d9b1eb8c MDL-49103 badges: bake badges with iTXt chunk instead of tEXt
The final OB 1.0 specification changed the baking badges method
from tEXt to iTXt. Besides, the iTXt chunk should be a signed
assertion or the raw JSON (instead of the assertion URL).
This has been changed in order to make Moodle OB compliant.

Yuliya Bozhko, thanks for the patch! :-)
2020-02-04 18:49:39 +01:00
Adrian Greeve
f00542c485 Merge branch 'MDL-66999-master' of git://github.com/bmbrands/moodle 2019-12-23 14:26:39 +08:00
Bas Brands
6c4dbbf061 MDL-66999 theme_boost: @extend use .table classes in badges renderer
The table.collection class is not needed if the bootstrap classes
for tables are used in the badges renderer
2019-12-09 10:49:39 +01:00
Sara Arjona
d03d11095f MDL-67451 badges: use the site OB version as default 2019-12-04 21:01:09 +01:00
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