Commit graph

345 commits

Author SHA1 Message Date
Andrew Nicols
8669b0ebb7 MDL-72179 behat: Make use of page resolvers 2021-07-24 18:56:38 +08:00
Sara Arjona
df9c7f755d MDL-67935 tool_lp: fix random errors with login/logout 2021-05-14 10:53:25 +02:00
Sara Arjona
81da134c2c MDL-71119 core_badges: Add more information to errors
Some errors raised when calling external services were ignored.
Displaying this information helps to debug and find the real reasons
why some action, like connecting to an external backpack, can't be
done.
2021-04-14 11:04:28 +02:00
Sara Arjona
dc4a36c3b1 MDL-71119 core_badges: Use basicauth and remove urlencode
Basic authorization header is required to get token. Besides, client
id and secret shouldn't call urlencode.
2021-04-14 11:04:28 +02:00
Sara Arjona
946120eeee MDL-71119 core_badges: Initialise scopes param in backpack-connect.php
The scopes parameter should be passed when creating the OAuth2 badges
client. As it is an optional parameter, when it's empty, it will
be initilised with the supported scopes for the backpack issuer.

It will happen, for instance, when a call is done to oauth2callback.php
because, as defined in RFC6749, OAuth2 authorization response only
supports code and state.
2021-04-14 11:04:28 +02:00
Eloy Lafuente (stronk7)
e2f2de4885 Merge branch 'MDL-69102-39' of https://github.com/martygilbert/moodle into MOODLE_39_STABLE 2021-04-12 00:02:14 +02:00
Eloy Lafuente (stronk7)
5279159083
MDL-69102 phpunit: Add test to cover ALL cohort criteria
That way we can check that the expectations are
working ok for every database. Previously only the
ANY case was being tested.

Also, convert them to course badges and check, via
review_all_criteria() that the SQL structures returned
by award_criteria_cohort->get_completed_criteria_sql()
doesn't fail and return the expected counters.
2021-04-10 12:37:52 -04:00
Víctor Déniz
3db93ec2a2 Merge branch 'MDL-71116-39' of git://github.com/sarjona/moodle into MOODLE_39_STABLE 2021-04-08 01:06:30 +01:00
Marty Gilbert
88f81cf8d1
MDL-69102 badge: Fixes broken WHERE clause
When buildilng the 'WHERE' clause, the SQL generated
a query that selected any user who was a member of the
**last** group, not all of the groups.

I believe the query has to be re-worked so that it only
returns users who are in ALL of the groups. This can
be done by a GROUP BY and HAVING.
2021-04-01 14:51:27 -04:00
Sara Arjona
4736877c43 MDL-70963 core_badges: Use expected JSON format for OBv2.1
This patch adds some changes to guarantee that OpenBadges 2.1 (OBv2.1)
will return always the same JSON format that OBv2.0 (because the only
difference between both versions it's the BadgeConnect API).
2021-03-26 09:02:41 +01:00
Sara Arjona
3784dcc912 MDL-71116 core_badges: Backpack URLs with more than 50 chars
Backpack URLs (web and API) can have up to 255. However, the form
for creating/editing them, doesn't allow URLs with more than 50
characters. This patch align limitation to DB value (255).
2021-03-19 15:09:12 +01:00
Eloy Lafuente (stronk7)
5987bed350 Merge branch 'MDL-70726-3.9' of https://github.com/NashTechOpenUniversity/moodle into MOODLE_39_STABLE 2021-03-11 00:12:19 +01:00
Amaia Anabitarte
616935475b MDL-70726 behat: Fixing existing fail tests
Some of the current behat tests were wrong but not failing because of the bug in 'should not exist' step.
Once the bug is fixed, we must fix also wrong behats.
2021-03-01 16:09:20 +07:00
Sara Arjona
4c4c74c13b MDL-67974 core_badges: Badge expiry date when hover
Text displayed for expired badges when the user hovers over the
warning (!) icon has been fixed in the "Issued badge information"
page.
2021-02-23 15:33:06 +01:00
Sara Arjona
a3f78dbd7a MDL-70264 badges: remove badges/oauth2callback.php
File badges/oauth2callback.php has been removed and now badges
API will use admin/oauth2callback.php because it makes no sense having
it twice.

Credits go to Andrew Nicols for raising it!
2021-02-11 16:58:55 +01:00
Sara Arjona
481c57cabe MDL-70139 core_badges: fix invalid request when sending to backpack
Having mixed $data in badge exporters is causing some issues.
As all these exporters are using $data as an object, $data can be
converted to object in the constructor, to avoid errors and get
the expected behaviour always.
2020-11-06 16:21:34 +01:00
Andrew Nicols
06be826b2e Merge branch 'MDL-70066-39' of git://github.com/lameze/moodle into MOODLE_39_STABLE 2020-11-05 10:09:48 +08:00
Simey Lameze
06a4390060 MDL-70066 badges: change usages of array_key_exists to isset 2020-11-05 10:06:39 +08:00
Ferran Recio
2488fe37ca MDL-70119 core_badges: fix tab names 2020-11-04 12:57:24 +01:00
Adrian Greeve
6bbb4e4df2 Merge branch 'MDL-69055-39' of git://github.com/sarjona/moodle into MOODLE_39_STABLE 2020-08-20 12:02:49 +08:00
Andrew Nicols
4fd5a7bfcb Merge branch 'MDL-69054-39' of git://github.com/sarjona/moodle into MOODLE_39_STABLE 2020-08-20 07:32:03 +08:00
Sara Arjona
c6895d7dd4 MDL-69055 core_badges: display password/oauth fields properly 2020-08-14 17:10:33 +02:00
Sara Arjona
1f7f5e368d MDL-69054 core_badges: allow editing OBv1.0 backpacks 2020-08-14 17:09:45 +02:00
Sara Arjona
9e42721660 MDL-61215 core_badges: use the new optimised_image filetype group
For the badge picture (instead of the web_image which includes
SVG files).
2020-08-14 17:06:57 +02:00
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