Forum Discussion
Storyline 2 Example - Generating a PDF Certificate for users who successfully complete a quiz
Hi all,
I've been experimenting with a JavaScript PDF library (pdfmake) to generate PDF certificates client side for learners who have successfully completed a quiz in Storyline 2.
You can see an example at http://rlowry.github.io/certificate/story.html
The 1st slide of the example provides a brief overview of how this works. I've tested this successfully in Internet Explorer, Chrome, Firefox, Chrome on Android and Safari on iOS.
I've attached a simple source file that contains a basic .story file as well as a folder (certificate) that includes the required HTML and JavaScript that needs to be included within a web object within the project. Feel free to have a look and re-use if it's useful.
The generated PDF certificate is very basic at the moment, you'll need to refer to the pdfmake documentation to update the design.
UPDATE: Originally this example only worked with the HTML5 output. I've tweaked it so it now works with the Flash output as well. I've updated the attached files to reflect this change.
UPDATE 2: I've updated the attached source files so they now use the latest version of pdfmake (v0.1.27).
Cheers,
Ryan
- RyanLowryCommunity Member
Hi Stef, You shouldn't need to upload the WebObject separately. When adding the WebObject select the certificate folder on your local file system. This folder will be automatically included with your project on publication.
- TristanHunt3Community Member
Bumping an old thread, but this is a great feature!
I just used this on a project to capture a number of long answer questions (for a learner self-reflection) and allow them to download their answers to keep on record.
- KevinBrake1Community Member
NIce work you should provide an example .story file.
Hey Kevin - Are you asking Tristan for an example here? I know that Ryan recently shared an example above.
- KevinBrake1Community Member
Yes, I wanted to see his exact example.
Gotcha Kevin - hopefully he'll be able to pop in and share with you.
- NancyWoinoskiSuper Hero
I am using PDFMake in a course I'm developing in Articulate 360 and am finding that the PDF is not created when I update the course to Articulate Review.
It works when I upload to Articulate Online, SCORM Cloud and my own web server but not Review.
Has anyone else encountered this issue?
- TristanHunt3Community Member
Yes I also had this issue in review...
- NancyWoinoskiSuper Hero
Thanks for confirming Tristan, I thought I was going crazy. Did you report this to Articulate?
Hi Nancy and Tristan,
I'm not familiar with PDFMake, but would love to try and help! Can you tell me a bit more about what's happening (or you'd expect to be happening)?
If you can share a copy of it with our Support engineers we're always happy to take a look! Upload a copy of your course here and a link to the Review hosted version here.
- NancyWoinoskiSuper Hero
Hi Ashley, PDFMake is a JavaScript library that enables you to create downloadable PDF files in your browser. When used with Storyline it is a great way to capture user input, pass it to an html doc which is then converted to a downloadable pdf .
To do this you have to create an html doc that gets the player vars from Storyline, formats the content and references the js functions that create the pdf. You then insert the folder containing the html doc and the JS funtions as a webObject into Storyline.
There is a trigger in Storyline to run a JS script which runs the JS functions to create the PDF and download it to the user's client.
So to make a long story short, when you execute the trigger in the Review hosted version nothing happens. When you execute the trigger in SCORM Cloud, Articulate-online and from a website, the pdf is downloaded as expected.
- NancyWoinoskiSuper Hero
Interesting!
So I guess that means I would have to change the code to get it to work in Review and then change it back again when my client hosts the course on their LMS (which is Moodle). I'm not sure I like that. It is just one more point in which to introduce errors.
Thanks for the explanation Nancy! Could you share that sample with our team so that we can take a look? If it's behaving differently in Review than SCORM Cloud, AO, etc. that's something we'd want to figure out and share with our team. Let me know if you can send it along here (even just a sample/mock up project!).
- NancyWoinoskiSuper Hero
Sure, I can do that.
I just submitted the case. It is case number 01090120