Posts

Showing posts from August, 2014

Open Badge Generator & Issuer Updates!

Image
Well, I spent last week tinkering with the Open Badges Generator that I worked on. I managed to implement a couple of features that I was keen to get in, specifically referencing each issued badge with a unique ID rather than a row number. I had a little scout around stack overflow  and found a nice little chunk of code by 'thoughcrime' which generated an 8 character random string. This would create me my uniqueID I was after. Here's the snippet: function genRandomString(len, bits){   bits = bits || 36;   var outStr = "", newStr;   while (outStr.length < len)   {     newStr = Math.random().toString(bits).slice(2);     outStr += newStr.slice(0, Math.min(newStr.length, (len - outStr.length)));   }   return outStr.toUpperCase(); } I did have to change the whole flow to accompany this new addition though, so the auto-email that was sent with the dynamically generated URL had to be amended, the querystring capture in the doGet() function had to change and