Commit Graph

83 Commits

Author SHA1 Message Date
Eloy Lafuente (stronk7)
4e202d91e7 Merge branch 'MDL-65243-master' of git://github.com/mihailges/moodle 2019-10-13 16:31:14 +02:00
Damyon Wiese
b0213770d2 MDL-65243 badges: Use real time api
Never add or subtract timestamps - use the time api to do it correctly.
2019-10-09 11:51:45 +08: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
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
c659b1c53d MDL-65518 badges: Default Issuer name
If the issuer name is not set, use the site name.
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
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
Juan Leyva
36fa0ec900 MDL-60680 notifications: Return custom data in notifications 2019-04-25 14:55:18 +02:00
Damyon Wiese
b3337bd5a4 MDL-64702 badges: Add missing data to backup
Backup and restore of badges is missing data:
* alignments
* endorsement

Also added to "clone" (duplicate a badge).
2019-04-23 11:14:00 +08: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
7c36d66982 MDL-65191 core: shift badge_assemble_notification to badgeslib 2019-04-04 09:36:13 +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
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
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
Jake Dallimore
1dee827c39 MDL-63973 core_badges: related badges query now works both ways
If A is related to B, then we should be able to view this relationship
from both badge A and badge B. The following badge methods were updated:
- get_related_badges()
- has_related()
- delete_related_badge()
2018-11-19 11:08:00 +08:00
Jun Pataleta
9639cb487e MDL-58454 badges: Fix related badge deletion
* When deleting a badge, delete badge_related records where this badge
is also set as the related badge.
2018-11-06 11:47:20 +08:00
Sara Arjona
5a1ea82835 MDL-58454 badges: Fix some minor errors for Open Badges v2 2018-11-05 18:41:54 +01:00
Tung Thai
d363a5c2e6 MDL-58454 badges: Open Badges Specification Version 2.0 Changes 2018-11-05 14:20:46 +01:00
Charles Fulton
49b464f814 MDL-58000 badges: use large image when baking 2018-09-25 10:46:05 -04:00
Eugene Venter
abc07b53a7 MDL-55491 badges: Add cohort as badge criteria
commissioned by NZ Customs Service
2018-04-09 10:23:50 +02:00
Andrew Nicols
389aad6eef MDL-61221 badges: Ignore site availabilty for behat
Behat sites should not be available publically, and the check against
the backpack API for site availablity can time out in some situations.

We should be testing as though the site _is_ available, as this is the
standard expectation.
2018-01-16 13:21:51 +08:00
Damyon Wiese
a569a33097 Merge branch 'MDL-59875_m35v1' of https://github.com/sbourget/moodle 2017-12-06 19:53:31 +13:00
Stephen Bourget
a7370e0dd0 MDL-59875 Badges: Allow badges to be criteria for other badges 2017-11-28 08:03:02 -05:00
Sara Arjona
d77a6026d2 MDL-46768 core_badges: changed badge name type from FILE to TEXT 2017-11-24 11:34:15 +01:00
Adam Olley
b4846b88d9 MDL-53718 badges: Dont display course badges when disabled 2016-11-07 15:56:26 +10:30
Eloy Lafuente (stronk7)
f593e8271a MDL-47162 badges: site & profile badges do not have courseid
Because of that, we need to set the, now mandatory, SITEID for
those message events to be happy. This does not affect course or
activity badges, both coming with correct courseid.
2016-11-01 12:47:54 +01:00
Amanda Doughty
cc350fd9c8 MDL-47162 core_message: Add course id to message eventdata 2016-10-27 18:11:27 +02:00
Stephen Bourget
a0e13871cf MDL-45734 Badges: Add additional events 2016-07-29 21:51:05 -04:00
Eloy Lafuente (stronk7)
a763bb0553 MDL-54994 badges: Count correctly the number of external badges shown 2016-07-01 13:40:47 +02:00
Russell Smith
1fcf0ca8a5 MDL-35628 performance: Remove dirname() where possible.
dirname() is a slow function compared with __DIR__ and using
'/../'.  Moodle has a large number of legacy files that are included
each time a page loads and is not able to use an autoloader as it is
functional code.  This allows those required includes to perform as
best as possible in this situation.
2016-06-10 08:06:49 +10:00
Yuliya Bozhko
4d0ebdebc5 MDL-51390 badges: Switch backpack URL to use HTTPS
Signed-off-by: Yuliya Bozhko <yuliya.bozhko@totaralms.com>
2015-09-28 10:37:03 +01:00
Dan Poltawski
5f92c736e3 MDL-51110 badges: prevent duplicate award of badges
Previously duplicate users could be returned when they had
done duplicate badge criteria - this would lead to a duplicate
constraint being hit as they were attempted to be awarded twice.
2015-08-13 13:21:03 +01:00
Frederic Massart
cda2a8273a MDL-50041 gdlib: Badges need PNG files from process_new_icon() 2015-04-29 18:50:20 +08:00
Ankit Agarwal
b19cc4ef25 MDL-45898 myprofile: Redesign my profile page
Part of MDL-45774.

Contributions by John Okely, Jetha Chan and Damyon Wiese (squashed branch).

AMOS BEGIN
CPY [coursebadges,core_badges], [badges,core_badges]
AMOS END
2015-04-10 17:17:32 +08:00
Simey Lameze
2ec274f5ff MDL-48142 core_badge: final polishing on badge award event 2015-02-25 14:25:33 +00:00
Simey Lameze
4ae5ecbeef MDL-48142 core_badge: bug fixes on badge awarded event class 2015-02-19 12:32:36 +08:00
James Ballard
483cfd763d MDL-48142 core_badge: add badge awarded event 2015-02-17 09:37:35 +08:00
Yuliya Bozhko
62fef3cf7e MDL-47085 badges: Fix badges file download issues
Signed-off-by: Yuliya Bozhko <yuliya.bozhko@totaralms.com>
2015-02-09 16:00:17 +13:00
Sam Hemelryk
d237385e8a MDL-48753 badges: converted func to named params
Converted the SQL params within badges_get_user_badges to
named params.
Unit tests added for this function at the same time.
UI covered by behat already.
2015-01-11 20:08:39 -08:00
Yuliya Bozhko
1f258cd8ce MDL-47755 badges: Fix internal message output
Signed-off-by: Yuliya Bozhko <yuliya.bozhko@totaralms.com>
2014-10-21 16:25:13 +13:00
Tony Butler
1e31f11852 MDL-28484 core_lib: Add function for https detection
Signed-off-by: Tony Butler <tonyjbutler@gmail.com>
2014-10-03 13:02:29 +01:00
Damyon Wiese
f329801959 Merge branch 'MDL-41810_master' of https://github.com/totara/openbadges
Conflicts:
	badges/upgrade.txt
2014-01-21 13:06:30 +08:00
Yuliya Bozhko
e477ec0a39 MDL-43621 badges: Fix has_awards() result when deleted users are the only recipients of a badge 2014-01-15 16:24:37 +13:00
Yuliya Bozhko
7f964cfdc7 MDL-43621 badges: Don't display deleted users in badge recipients list 2014-01-15 09:31:45 +13:00