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

Low resolution badge image sent to Openbadges and used when duplicating badges

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Reopened
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.5.2, 3.6
    • Fix Version/s: None
    • Component/s: Badges
    • Labels:
    • Affected Branches:
      MOODLE_35_STABLE, MOODLE_36_STABLE

      Description

      • Send a better resolution image to backpack
      • Review resolution for duplicated badges because the copy has less resolution when it's downloaded by the student.

       

      Detailed explanation

      The image URL sent to openbadges.org is the `f1` size. This results in a blurry image when viewing the badge in the backpack.

      Image in Openbadges.org:

       

      This is the sample `assertion` and `badge` data (with redacted URLs):

      // assertion (https://example.com/badges/assertion.php?b=dfbbe96d01cb39f2438cb6970cdc8808e9c30dbc)
      {
       "uid": "f99a9e7518a2435bbb8ad443e1f1d9c4147af268",
       "recipient": {
       "identity": "sha256$47b22fbb24c5ad16ba6067b14372d0e5bd723358d3c831bf8687996bc4e92d4b",
       "type": "email",
       "hashed": true,
       "salt": "badges1541006821"
       },
       "badge": "https:\/\/example.com\/badges\/assertion.php?b=f99a9e7518a2435bbb8ad443e1f1d9c4147af268&action=1",
       "verify": {
       "type": "hosted",
       "url": "https:\/\/example.com\/badges\/assertion.php?b=f99a9e7518a2435bbb8ad443e1f1d9c4147af268"
       },
       "issuedOn": "1541705166",
       "evidence": "https:\/\/example.com\/badges\/badge.php?hash=f99a9e7518a2435bbb8ad443e1f1d9c4147af268"
      }
       

      // badge (https://example.com/badges/assertion.php?b=f99a9e7518a2435bbb8ad443e1f1d9c4147af268&action=1)
      {
       "name": "Test2",
       "description": "Test 2",
       "image": "https:\/\/example.com\/pluginfile.php\/1\/badges\/badgeimage\/2\/f1",
       "criteria": "https:\/\/example.com\/badges\/badge.php?hash=f99a9e7518a2435bbb8ad443e1f1d9c4147af268",
       "issuer": "https:\/\/example.com\/badges\/assertion.php?b=f99a9e7518a2435bbb8ad443e1f1d9c4147af268&action=0"
      } 

       

      The image URL is generated in `badges/classes/assertion.php` in the `get_badge_class` function. However, changing the image size from `f1` to `f3` breaks the style/CSS on `badges/badge.php` as follows:

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                hrpatel H Patel
                Participants:
                Component watchers:
                Yuliya Bozhko, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
              • Votes:
                1 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated: