Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-65315

BadgeClass and Issuer URLs should be the same for a badge

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.6, 3.7
    • Fix Version/s: 3.6.7, 3.7.3
    • Component/s: Badges
    • Labels:
    • Testing Instructions:
      Hide

      Note: You'll need to expose your test moodle site over the internet (e.g. using ngrok) so that badgr.io will be able to see your test moodle site.

      1. You have to configure Badgr as you default backpack: https://docs.moodle.org/37/en/Badges_settings#Enabling_Badgr_as_the_active_external_backpack
      2. In site admin, create a new badge
      3. Set the criteria to 'Manual issue by role'
      4. Award some badge for a user and log in as this user (or award the badge to the admin)
      5. Access to the user profile and click over the badge. A URL like this will be opened
          http://moodle.server/badges/badge.php?hash=27455a475756dbdfdff8b2273338c1fe541308de
      6. Replace

        badge.php?hash=

        to

        assertion.php?obversion=2&b=

        a JSON file will be displayed. 
        Tip: Firefox displays JSON files with collapsed information, so it will make easier to find this information.
      7. Look for the "type":"BadgeClass" (you'll find it inside the "badge" element).
      8. Confirm the URL in the id field points to 'badge_json.php'.
      9. Open up the URL and confirm you get returned some valid JSON with the information of the badge you've created in #2 (check, for instance, the fields name and description).
      10. Look for the "type":"Issuer"
      11. Repeat #7 - #8
      12. Open up the URL and confirm you get returned some valid JSON with the information of the issuer you've configured in #1 (check, for instance, the name contains the "Badge issuer name" site setting and email the "Badge issuer email address" site setting).

       

      Apart from that, confirm Unit test passes.

      Show
      Note: You'll need to expose your test moodle site over the internet (e.g. using ngrok) so that badgr.io will be able to see your test moodle site. You have to configure Badgr as you default backpack: https://docs.moodle.org/37/en/Badges_settings#Enabling_Badgr_as_the_active_external_backpack In site admin, create a new badge Set the criteria to 'Manual issue by role' Award some badge for a user and log in as this user (or award the badge to the admin) Access to the user profile and click over the badge. A URL like this will be opened   http://moodle.server/badges/badge.php?hash=27455a475756dbdfdff8b2273338c1fe541308de Replace badge.php?hash= to assertion.php?obversion=2&b= a JSON file will be displayed.  Tip: Firefox displays JSON files with collapsed information, so it will make easier to find this information. Look for the "type":"BadgeClass" (you'll find it inside the "badge" element). Confirm the URL in the id field points to 'badge_json.php'. Open up the URL and confirm you get returned some valid JSON with the information of the badge you've created in #2 (check, for instance, the fields name and description). Look for the "type":"Issuer" Repeat #7 - #8 Open up the URL and confirm you get returned some valid JSON with the information of the issuer you've configured in #1 (check, for instance, the name contains the "Badge issuer name" site setting and email the "Badge issuer email address" site setting).   Apart from that, confirm Unit test passes.
    • Affected Branches:
      MOODLE_36_STABLE, MOODLE_37_STABLE
    • Fixed Branches:
      MOODLE_36_STABLE, MOODLE_37_STABLE
    • Pull from Repository:
    • Pull 3.6 Branch:
    • Pull 3.7 Branch:
    • Pull Master Branch:
      MDL-65315-master

      Description

      Currently, BadgeClass and Issuer URLs depends on the badge Assertion hash:

       

      In Moodle 3.6, when OBv2.0 support was added, the badges/badge_json.php file was added, and it should be used for the BadgeClass and Issuer instead of current badges/assertion.php (at least for OBv2.0). So, for the previous sample:

      The $CFG->wwwroot/badges/assertion.php?b=xxxx&action=z calls should be replaced by $CFG->wwwroot/badges/badge_json.php?id=x[&action=0] for BadgeClass and Issuer.

        Attachments

          Activity

            People

            • Votes:
              2 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                11/Nov/19

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours, 46 minutes
                2h 46m