Extend Expiration Date on Badges

Extend Expiration Date on Badges

by Robin Stark -
Number of replies: 2
Hey Guys,

I'm currently running into an issue with badges and was wondering if anyone has a solution.

Problem:
We have a data feed coming in from another source into the Moodle Database, I already have a script that parses the feed and adds it, this is great.  Ideally we would like to use badges as a mini certificate (figure I can use manual assignment and script it).  Only issue that I have found is it seems that there is no sane way to either add a 2nd badge of the same type or change the expiration date so a badge that was expired is no longer expired.

I was looking at the stamp module but really like the idea of badges since we can use the hash to verify them.

Thanks,

Robin

Average of ratings: -
In reply to Robin Stark

Re: Extend Expiration Date on Badges

by Robin Stark -

Best solution I was able to come up with is by having a script write to the badges table and update the dateexpire column with the unix timestamp of the new expiry date.  This works and the change is reflected by the badge no longer showing the expired stamp.

In reply to Robin Stark

Re: Extend Expiration Date on Badges

by Randy Thornton -
Picture of Documentation writers

Right, that will work for the badge definition, so for any future awarded badges it will reflect that. That may be all you need in your situation.

But already awarded badges also will have their own expiration in the expire column of the badge_issues table. 

And once a badge is "baked" with the metadata and downloaded that data is set in the image. So already awarded badges living out there somewhere in emails or backpacks etc will not have the updated expiration dates.