Hi

I tried to install and use your module (once i got the achievement module working). I verified that the module is working as the jscripts are both injected into the user's achievement page.

But I fail to see the promised button in step 4 if I navigate to the user's achievement page:

4.Navigate to your achievements page (user/%/achievements), and click on the "Send to Mozilla Open Badges Backpack" button to send the badge.

Comments

wvd_vegt’s picture

Hi

Found the cause of the missing buttons

I use some of the default images that came with the achievement module (and parts of its api code as a starter) and these images have an extension jpg instead of png. Changing the test in amobb.js to include jpg fixes the missing buttons.

Now all is left i find out where the posting to open badges goes wrong (the assertion seems to fail).

wvd_vegt’s picture

Status: Active » Closed (won't fix)

Hi

It seems to be a problem of the achievement module in that it's default images are jpg (which open badges does not support).

So I will post an issue there and close this one.

wvd_vegt’s picture

Status: Closed (won't fix) » Active

Hi

Sorry, still run into problems with the images, I converted the default achievement images to png, adjusted the configuration to use them, but still this amobb module does not pick up these default badges (they are not present in the $achievements array).

The actual values are stored in variables 'achievements_image_locked', 'achievements_image_secret' and 'achievements_image_unlocked'.

I changed the code a bit in amobb.module/amobb_assertions() to read:

     elseif (isset($achievement['images']['unlocked'])) {
        // Otherwise use the unlock image.
        $image = $achievement['images']['unlocked'];
      }
      //veg: 23-05-2012 added default images.
      elseif (variable_get('achievements_image_unlocked'. '')!='') {
        $image = variable_get('achievements_image_unlocked', '');
      } else {
        //veg: 23-05-2012 debugging
        watchdog('amobb', t('No valid image was found'), array(), WATCHDOG_INFO);
        // No valid image was found.
        break;
      }
Royce Kimmons’s picture

Status: Active » Closed (fixed)

As you figured out, the Open Badges framework only supports .png, and this is why any unlocked images you're using in an achievement must be .png. If the images aren't .png, then the javascript won't include the "Send to Mozilla..." button (amobb.js line 9).

In the latest version (which I'm releasing right now), I've updated the code to resemble what you suggested with default images except that I have it make sure that the default image is a .png.

And, if I didn't explain this elsewhere, if you're still having issues with Mozilla recognizing the badge, make sure that you're developing on a server that is web accessible (e.g., MAMP and other local development environments won't work to test that functionality).

Hope this helps!

Royce Kimmons’s picture

Status: Closed (fixed) » Fixed
Royce Kimmons’s picture

Status: Fixed » Closed (fixed)