tsugiproject / tsugi

Tsugi Admin, Developer, and Management Console (pls join the dev list)
http://www.tsugi.org
Apache License 2.0
347 stars 257 forks source link

Badge Issuer and Class are unique for each awarded Badge #120

Open bencomp opened 3 years ago

bencomp commented 3 years ago

Since #90 was resolved (thanks again!), I can import earned badges into a backpack like Badgr's. I noticed that each badge shows up as coming from a different issuer, while the badges I earned are all from Python for Everyone.

It looks like the Badge Issuer URI is indeed unique, because it includes the assertion ID (the encoded badge information): https://github.com/tsugiproject/tsugi/blob/e991a259d2670b3aa3db9a241dc8ffb95e6de2a9/badges/badge-util.php#L105 and in https://github.com/tsugiproject/tsugi/blob/e991a259d2670b3aa3db9a241dc8ffb95e6de2a9/badges/badge-util.php#L126

I then realised that the line https://github.com/tsugiproject/tsugi/blob/e991a259d2670b3aa3db9a241dc8ffb95e6de2a9/badges/badge-util.php#L104 makes each badge class, i.e. the type of badge, unique as well – which makes comparing badges by their URIs impossible.

Would it be possible to define a single badge issuer URI per installation and one badge class URI for each defined badge in lessons.json? I think it is likely that one installation is supported by a singe issuer and it would reduce some of the code complexity as well.