Show
Tip : Firefox displays JSON files with collapsed information, so it will make it easier to find this information.
Setup
Login as admin.
Go to "Badges > Add a new badge".
Fill in required fields and also, at least, the Version.
Press Create badge.
Add badge criteria Manual issue by role.
Select "Teacher" and press Save.
Press Enable access > Continue.
Annotate the id of this badge (you'll find it in the URL of the page, for instance: badges/overview.php?id= [BADGEID] ).
Press Recipients.
Press Award Badge.
Select the current user from Potential badge recipients, press Award Badge.
Create a course.
Add a badge to this course (with the same configuration as the previous system badge) and award it to the same user.
Add another badge to the course but do not enable access for it.
Annotate the id of these badges too.
Testing scenario 1: System badge
Go to the user profile.
Access to the system badge that appears in the Badges section.
In the URL, replace "badges/badge.php?hash=" to "badges/assertion.php?b=".
Check the URL in the element badge/criteria/id contains [YOURMOODLESITEURL] /badges/badgeclass.php?id= [BADGEID] (where id is the system badge you created first).
Access to this URL ( [YOURMOODLESITEURL] /badges/badgeclass.php?id= [BADGEID] )
Check the page is displayed without errors and contains the badge information: image, title, description...
In the URL, replace "badges/badgeclass.php?id=" to "badges/badge_json.php?id=".
Check the URL in the element criteria/id contains [YOURMOODLESITEURL] /badges/badgeclass.php?id= [BADGEID] (where id is the system badge you created first).
Testing scenario 2: Course badge
Go to the user profile.
Access to the course badge that appears in the Badges section.
In the URL, replace "badges/badge.php?hash=" to "badges/assertion.php?b=".
Check the URL in the element badge/criteria/id contains [YOURMOODLESITEURL] /badges/badgeclass.php?id= [BADGEID] (where id is the course badge you created first).
Access to this URL ( [YOURMOODLESITEURL] /badges/badgeclass.php?id= [BADGEID] )
Check the page is displayed without errors and contains the badge information: image, title, description, course...
In the URL, replace "badges/badgeclass.php?id=" to "badges/badge_json.php?id=".
Check the URL in the element criteria/id contains [YOURMOODLESITEURL] /badges/badgeclass.php?id= [BADGEID] (where id is the course badge you created first).
Testing scenario 3: Unpublished badge
Access to the URL (YOURMOODLESITEURL]/badges/badgeclass.php?id= [BADGEID] where BADGEID is the id of the unpublished course badge (the last one that you created in the setup)
Check the page displays the "There is no public badge with this identifier" error and the badge information (image, title, description...) is not displayed.
Testing scenario 4: Unexisting badge
Access to the URL (YOURMOODLESITEURL]/badges/badgeclass.php?id= [BADGEID] where BADGEID is an existing badge id (for instance, if you have a new clean instance, 99999)
Check the page displays the "Badge with id xxx does not exist." error and the badge information (image, title, description...) is not displayed.
ATTENTION!! The following testing scenarios should be only executed in 3.11 because MDL-71937 and MDL-72141 have been backported.
Prerequisites
An outgoing server configured (mailcacher or similar).
One Badgr account on badgr.io with some badges and a collection (you'll find one testing account in the "Moodle testing accounts, data & credentials").
Setup
Login as admin.
Create s1 user.
Create system and course badges
Go to " Recipients (0)" and assign the enabled system and course badges to s1.
Logout.
Login as s1.
Go to "Preferences / Badges / Backpack settings".
Connect to the backpack using the Badgr.io account.
Open the verification email and open the URL to validate the account.
Confirm status is set to Connected.
In the "Badge import settings" section (in the "Backpack settings" page), select at least one collection with badges and save changes.
Go to the user profile, and check there is, at least, one badge in the "Badges from other web sites:" section.
Logout.
Testing scenario A.1: The fields are displayed properly (copied from MDL-72141 )
Login as s1.
Go to the user profile page.
Open a badge from the "Badges from other web sites:" section.
Check the badge image, name, date and description are displayed in a similar way to the [^ux_badges_proposal.jpg] image (taken from MDL-71937 ).
Check the Download button is not displayed.
Check the "More details" link is not displayed.
Check the "External URL" link is displayed and opens the external URL from badgr.io where the Badge was originally placed.
Testing scenario A.2: New fields are displayed in the template
Login as admin.
Go to "Development > Template library"
Search for the "issued_badge" template and click over the "core_badges/issued_badge" link
Check the following fields are displayed:
A warning notification is displayed below the badge name and above the user who has awarded the badge (something like "This user cannot be verified as a recipient of this badge").
The External URL field is displayed above the course name and the badge description.
Testing scenario B.1: All the fields are displayed properly (copied from MDL-71937 )
Login as s1
Access to the user profile.
Go to the badge.
Check the badge image, name, date and description are displayed in a similar way to the [^ux_badges_proposal.jpg] image linked in MDL-71937 .
Check the Download button is displayed.
Click the "More details" link.
Check other fields appear, such as Version and Language.
Click again the "More details" link.
Check these extra fields (from step 7) are hidden.
Testing scenario B.2: Deleted user (copied from MDL-71937 )
Login as admin.
Go to "Site administration > Badges > Manage badges".
Click over the badge you created during the setup.
Access to "Recipients ".
Follow the "View issued badge" link for the Student 1 row.
Check the badge is displayed and the fullname of the user is displayed near the "Awarded to" text.
Check the text "(This user no longer exists in XXXX)" is NOT displayed.
Copy the URL of this page (you'll need it later).
Access to "Site administration > Users > Accounts > Browse list of users".
Delete user s1.
Go to the URL copied in step #8.
Check the badge is displayed and the fullname of the user is displayed near the "Awarded to" text.
Check the text "(This user no longer exists in XXXX)" is displayed, where XXXX is the site fullname.