Forums | Mahara Community

Support /
Mozilla Backpack moving to Badgr


Patric Lougheed's profile picture
Posts: 97

17 August 2018, 8:57

Just read this article on how Mozilla Backpacks will be migrated to Badgr:

https://marksurman.commons.ca/2018/08/15/an-update-on-badges-and-backpack/

It occured to me that when this happens the badges block will probably stop working. Not like you guys have enough to do but just want to see if you are aware of this development.

Robert Lyon's profile picture
Posts: 776

22 August 2018, 11:18

Hi Patric,

I saw your post and took a look into how difficult it would be to get Badgr badges to display in the Openbadgedisplayer block.

I set up a bug report here https://bugs.launchpad.net/mahara/+bug/1787507 and looked at getting the Badgr v2 API working with the block here https://reviews.mahara.org/#/c/9075/

Currently it's a proof of concept.

And unlike Mozilla backpack, where one could throw an email address at the API and retrieve public collections, one needs to fetch a token from Badgr (via Mahara Account -> Apps) before being able to select / display Badgr badges

Feel free to have a play with it if you wish

Cheers

Robert

Patric Lougheed's profile picture
Posts: 97

20 September 2018, 6:48

Finally had time to look into this... So far so good. Only issue encountered was a warning:

[WAR] 74 (blocktype/openbadgedisplayer/lib.php:583) Trying to get property of non-object

Call stack (most recent first):
log_message("Trying to get property of non-object", 8, true, true, "/var/www/beta/htdocs/blocktype/openbadgedis...", 583) at /var/www/beta/htdocs/lib/errors.php:521
error(8, "Trying to get property of non-object", "/var/www/beta/htdocs/blocktype/openbadgedis...", 583, array(size 6)) at /var/www/beta/htdocs/blocktype/openbadgedisplayer/lib.php:583
PluginBlocktypeOpenbadgedisplayer::get_badgegroupnames("passport", 10888) at /var/www/beta/htdocs/blocktype/openbadgedisplayer/badgegroupnames.json.php:32

Two questions now come to mind:

1. Can I add a url to my own badgr instance in the config file?

2. I see the Badgr API also has the ability to add issuer rights. It would be great to have badges being awarded from inside Mahara for tasks completed, like profile completion or group participation. i know this is a big task but can we put this feature on the roadmap for future development?

Thanks again for great work!

Patric

P.S. I just noticed that I get this warning: "Could not resolve host: api.badgekit.org" which looks to be dead now so you might want to remove that from the code as well.

Robert Lyon's profile picture
Posts: 776

26 September 2018, 12:22

Hi Patric

I've fixed up the "property of non-object" error

As for your questions:

1. Can I add a url to my own badgr instance in the config file?

There is the setting $cfg->openbadgedisplayer_source

That is set by default to '{"backpack":"https://backpack.openbadges.org/","passport":"https://openbadgepassport.com/","badgr":"https://api.badgr.io/"}'

If you want to access a different place then you can change that list, eg "badgr":"https://my.local.badgr/"

2. I see the Badgr API also has the ability to add issuer rights.

Yes the API allows much more than fetching badges - but I'd not add that to the openbadgedisplayer - but rather look into making a different system to allow awarding badges - maybe for group admins or site admins

Cheers

Robert

 

 

4 results