396 Commits

Author SHA1 Message Date
Eloy Lafuente (stronk7)
8e90d8309c MDL-72714 behat: Make the window larger earlier
The step that causes the problem is:

And I navigate to "Badges > Add a new badge" in current page administration

(because "Add a new badge" is exactly on the edge (bottom) of the window)

So we need to make the window large before it, not after it, or the
"Add a new badge" link won't be ever clicked.
2021-10-01 22:40:10 +02:00
Víctor Déniz
f01d69cb05 Merge branch 'MDL-72714-master' of git://github.com/ilyatregubov/moodle 2021-10-01 13:21:46 +02:00
Ilya Tregubov
fad4743ea8 MDL-72714 behat: Fix Behat failures for chrome 94. 2021-10-01 08:36:50 +02:00
Bas Brands
16c726cde7 MDL-71610 core_behat: use new edit mode step in feature files 2021-09-29 09:25:36 +02:00
Mihail Geshoski
7d821080f0 MDL-72093 navigation: Update behat tests 2021-09-14 12:02:35 +08:00
Mathew May
1f6bcd7eae MDL-69588 accessibility: Address review points 2021-08-23 17:47:24 +08:00
Adrian Greeve
c3871a9174 MDL-70196 navigation: Update to pages to add a URL.
- Part of: MDL-69588
Some pages have added an item to the end of the  navbar without a
link for it. This adds the current page as a url to this navigation
node. Doing this brings it in line with all of the other pages
around Moodle and also helps with the new navigation changes in
theme boost.
2021-08-23 17:46:38 +08:00
Adrian Greeve
7d435fb5f2 MDL-70196 navigation: Update to feature files.
- Part of: MDL-69588
A lot of tests rely on the last element of the breadcrumb being
active. This updates feature files to not rely on this anymore.
2021-08-23 17:46:38 +08:00
Sara Arjona
24fcc7ebea MDL-71937 badges: simplify badges page
Apart from reorganising the information displayed in the badges page,
this information has been moved to a template in order to make it
easier to modify and maintain.
2021-08-10 15:59:06 +02:00
Andrew Nicols
776f4bd80c MDL-72179 behat: Make use of page resolvers 2021-07-26 15:14:28 +08:00
Andrew Nicols
92179b7057 MDL-71113 js: Fix all jsdoc warnings 2021-06-18 09:38:05 +08:00
Sara Arjona
c2a1bb5545 MDL-67935 tool_lp: fix random errors with login/logout 2021-05-14 10:11:12 +02:00
Ruslan Kabalin
3bf770c801 MDL-71051 core_user: fix issues and address review issues 2021-04-28 11:47:26 +02:00
Marina Glancy
ef3d6a3d70 MDL-71051 core_user: use user profile generator in all tests 2021-04-28 11:47:21 +02:00
Marina Glancy
5682b9a585 MDL-71051 core_user: always use API when working with profile fields 2021-04-28 11:39:04 +02:00
Bas Brands
f9e1c2587a MDL-28452 core_user: migrate social profile fields
Create a new profile field type, move all existing content of the fields
'icq', 'skype', 'aim', 'yahoo', 'msn' and 'url' in the mdl_user table to
theses new profile fields if needed.

AMOS BEGIN
MOV [aimid,core],[aimid,courseimage,profilefield_social]
MOV [yahooid,core],[yahooid,profilefield_social]
MOV [skypeid,core],[skypeid,profilefield_social]
MOV [icqnumber,core],[icqnumber,profilefield_social]
MOV [msnid,core],[msnid,profilefield_social]
MOV [webpage,core],[webpage,profilefield_social]
AMOS END
2021-04-21 11:22:25 +02:00
Jake Dallimore
1ed346c3cc Merge branch 'MDL-71119-master' of git://github.com/sarjona/moodle 2021-04-15 08:31:47 +08:00
Sara Arjona
24ff49f681 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 10:52:47 +02:00
Sara Arjona
c1649591a2 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 09:18:36 +02:00
Sara Arjona
c974a59f41 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 09:18:35 +02:00
Sara Arjona
e281a5ef69 MDL-71315 core_badges: Fix warning when rendering badges 2021-04-14 09:06:06 +02:00
Adrian Greeve
d24df2a201 Merge branch 'MDL-70821-master-5' of git://github.com/junpataleta/moodle 2021-04-12 14:45:59 +08:00
Jun Pataleta
1c15796a75 MDL-70821 behat: Use new activity completion steps for Behat tests
Replace usages of completion Behat steps that check for the completion
checkboxes with the new activity completion Behat steps.
2021-04-12 11:41:37 +08:00
Eloy Lafuente (stronk7)
7467584517 Merge branch 'MDL-69102-master' of https://github.com/martygilbert/moodle 2021-04-11 23:52:41 +02:00
Eloy Lafuente (stronk7)
377d6dc12a
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:31:22 -04:00
Marty Gilbert
d8085396de
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-10 12:26:22 -04:00
Víctor Déniz
25b8cb9783 Merge branch 'MDL-71116-master' of git://github.com/sarjona/moodle 2021-04-08 01:01:15 +01:00
Eloy Lafuente (stronk7)
67b2e62fe7 Merge branch 'MDL-70963-master' of git://github.com/sarjona/moodle 2021-03-29 12:39:32 +02:00
Sara Arjona
51ec496f75 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-29 10:02:58 +02:00
sam marshall
5e72715e4f MDL-71099 Lib: Move new user_fields class from core to core_user
This class would belong more appropriately within the 'user' API
(core_user) instead of within the 'core' API, since it is
directly related to user data.

Since the class has only just been added to Moodle, now is a good
time to move it.
2021-03-25 13:47:23 +00:00
Sara Arjona
50e9e5b2bd MDL-69792 core_badges: deprecated backpack.js and BADGE_BACKPACKURL
Final deprecation for constant BADGE_BACKPACKURL (it has been removed)
and badges/backpack.js file (it has been removed too).
Besides, some methods have started the deprecation process too:
 - badges_check_backpack_accessibility
 - badges_setup_backpack_js()
 - badges_local_backpack_js()

Apart from that, string 'addbackpack' has been deprecated here
because it's not used anywhere.
2021-03-19 15:13:03 +01:00
Sara Arjona
2c8de780d5 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:08:12 +01:00
Jun Pataleta
8eab098f26 Merge branch 'MDL-70911-master' of git://github.com/sarjona/moodle 2021-03-11 17:41:46 +08:00
Sara Arjona
0a0729f48e MDL-70911 core_badges: Add navigation menu in classic
Manage backpacks page wasn't displaying the navigation and administration
menus when using classic theme (it's unrelated to changes done here).
This patch fixes this unexpected behaviour (raised thanks to behat tests).
2021-03-11 09:00:35 +01:00
Eloy Lafuente (stronk7)
90db228323 Merge branch 'MDL-70726-master' of https://github.com/NashTechOpenUniversity/moodle 2021-03-11 00:11:15 +01:00
Jun Pataleta
5a7c629f7c Merge branch 'MDL-45242-master' of https://github.com/sammarshallou/moodle 2021-03-10 23:39:30 +08:00
sam marshall
987e55452f MDL-45242 Course: Enrol feature supports custom profile fields 2021-03-10 10:57:11 +00:00
sam marshall
558cc1b85e MDL-45242 Lib: Replace calls to deprecated functions
In all cases changes have been kept to a minimum while not making
the code completely horrible. For example, there are many instances
where it would probably be better to rewrite a query entirely, but
I have not done that (in order to reduce the risk of changes).
2021-03-10 10:57:10 +00:00
Jun Pataleta
644f32784d Merge branch 'MDL-70911-master' of git://github.com/sarjona/moodle 2021-03-10 16:15:43 +08:00
Sara Arjona
49c1d41a60 MDL-70911 core_badges: Remove $CFG->badges_site_backpack
The $CFG->badges_site_backpack setting has been completely removed
because it's not required anymore. From now, the primary site
backpack will be the first one in the "Manage backpacks" list (so,
the one with lower sortorder value).
2021-03-10 09:09:05 +01:00
Sara Arjona
066e998400 MDL-70911 core_badges: Add support to backpacks sortorder
Before removing $CFG->badges_site_backpack setting, admins should be
able to re-order the existing site-backpacks (because then, the first
one will be treated as the default one).
This patch adds the sort order feature to the backpack list.
2021-03-10 08:29:47 +01:00
Eloy Lafuente (stronk7)
9e1da41763 Merge branch 'MDL-63961-master' of git://github.com/sarjona/moodle 2021-03-10 00:19:31 +01:00
Sara Arjona
a306fd7a18 MDL-70911 core_badges: Move "External backpack" to badges settings
Setting "External backpack connection" has been moved from "Backpack
settings" to "Badges settings" in order to make easier to find and
configure it.
Some extra tests have been added to cover existing behaviour and
confirm is still working as expected.
2021-03-08 09:24:53 +01:00
Amaia Anabitarte
d0bea8aa5e 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-05 14:19:55 +07:00
Eloy Lafuente (stronk7)
476a0ad905 Merge branch 'MDL-67974-master' of git://github.com/sarjona/moodle 2021-03-01 22:33:17 +01:00
Sara Arjona
9e5655b7c7 MDL-70913 core_badges: Use and update properly sortorder
Sortorder field in badge_external_backpack was updated with a wrong
value. This patch fixes this behaviour and adds sortorder as
sorting criteria for displaying the list of site backpacks.

In the phpunit method reviewed for covering this, a couple of
assertEquals() calls have been changed too to put the expected value
first.
2021-03-01 13:04:00 +01:00
Sara Arjona
5b4204a584 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:23:56 +01:00
Sara Arjona
49c5b85eba MDL-63961 core_badges: Use high-resolution image
High-resolution image for a badge (f3) should be sent to external
backpacks through JSON and WS methods.
Besides, when a badge is cloned, the high-resolution image should be
used to avoid the copied looks blurry.
2021-02-22 12:43:06 +01:00
Sara Arjona
329b87720a 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:56:56 +01:00
Sara Arjona
e85c7179b2 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:05:44 +01:00