Type: Functional Test
Affects Version/s: Moodle 3.10
Fix Version/s: None
- A moodle site that can send emails
- A site with public access (use ngrok or similar)
- Create a badgr account on badgr.io (US) we will call it the Badgr user account
- An admin and a student available in the system.
- Login as admin.
- Access to the "Site home" and "Turn editing on".
- Add a label, upload an image there and save changes.
- Right-click over the uploaded image and copy the image address. You'll need to replace "https://471f8462.ngrok.io/m/stable_master/pluginfile.php/41/mod_label/intro/logo.png" of the next command to the copied image URL.
- Register the oAuth2 service in the IMS Global IdentityServer4 executing the following command, replacing "https://471f8462.ngrok.io/" by your server URL. You'll probably need to adapt "https://471f8462.ngrok.io/m/stable_master/" to your Moodle URL:
- You should get a result like this. Copy the client_id and the client_secret (you'll need them to configure the oAuth2 service)
- Go to "Site administration / Server / OAuth 2 services".
- Create a custom service with the following information:
- Name: "IMS Global"
- Client ID: <previous client_id>
- Client secret: <previous client_secret>
- Enable Authenticate token requests via HTTP headers
- Scopes included in a login request and Scopes included in a login request for offline access: "openid profile email"
- Service base URL: https://dc.imsglobal.org/obauth
- Logo URL: https://dc.imsglobal.org/obauth/icon.jpg
- Save changes.
- In Site admin -> Badges -> Manage backpacks
- Create a new backpack with the following details :
- Save changes.
- Edit the backpack and set OAuth2 services to IMS Global again
- Log in as admin and go to Site administration / Badges / Add a new badge.
- Add a new badge, setting the criteria as Manual issue by role and tick the Teacher and 'Any of the selected roles' options.
- Click the Save button and then the Enable access button.
- Click Recipients and then 'Award badge'. Select the student and award them the badge.
- Change 'Active external backpack' to the IMS Global provider
- Log in as a student, in the user menu (top right), select Preferences then 'Backpack settings' under Badges.
- Enter the Badgr user account email, select 'badgr.io' as the backpack and click the button 'Connect to backpack'.
- Look in your mailbox for a verification email and copy & paste the link to verify your connection to the backpack.
- Back in Moodle, logged in as the student, in the user menu select Preferences then 'Manage badges'.
- Verify that your badge is displayed and click on the badge.
- Click the button 'Add to backpack'.
- Verify that a message 'Added badge to backpack' is displayed.
- Go to https://badgr.io, log in with the Badgr user account and verify that the Moodle badge is displayed correctly (though you may need to be patient and wait a few minutes before the badge is displayed in the Badgr backpack).