Forum Discussion
Need help with open-ended responses download
Hi everyone. A few months ago, I asked how to create a downloadable/printable pdf containing the open-ended responses in a Storyline course. I was able to get this to work for one open-ended question, but not multiples. There are 6 open-ended questions throughout the course. I've attached a file so you can see what I mean (although in the course itself they will not be in order like this, they are spread throughout). I am by no means an expert coder, so I suspect I'm missing something. If anyone can help, I'd be grateful!
4 Replies
- AndrewBlemings-Community Member
It's impossible to say for now simply because the critical logic, the embedded "certificate" web object, isn't in the .story file. The published course would pull it from your C:\Users\jpapp\Downloads\Certificate folder but that's not included when you upload and attach the .story file here.
Since that web object is I assume what's responsible for both collecting the user responses as well as generating the PDF, can you upload the content of the web object separately here as well?
- JenniferPappCommunity Member
These are the files. Yes, the web object is what's responsible for collecting user responses as well as generating the PDF. Thanks.
- AndrewBlemings-Community Member
You were really close. There are two different things working against the script. The first is that some of your questions contain apostrophes inside the text:
That's a hiccup because when the script reads your question, it interprets the apostrophe in Jersey's as the end of that text string. That means "s Chafee Plan." is interpreted as random characters outside of a text string, and then what you intended to be the closing apostrophe ends up signaling to the browser that a new text string is beginning. This throws a lot of red flags for the browser so it cuts the whole thing short, ending the script.
Adding apostrophes to JSON objects like you want will require using the backslash as an "escape character."
That signals to the browser that the apostrophe you're including should be rendered as text, not interpreted as part of a command. If you're going to work in JavaScript but don't have a code editor on your computer (e.g., VS Code), then I'd recommend pasting your code into an online tool like jsfiddle.net anytime it's not working. Errors are much more obvious when they're color-coded like so:
That screenshot shows that something funky is going on with "Chafee Plan," allowing us to see the error much quicker. I've attached a fixed version of the .html file, so just overwrite your original with the "escaped" version.
Secondarily, your folder has the js.map file but not the js file the map maps. At least for me, the console was throwing errors with the map file. I downloaded the actual min.js file and added it to the src folder. You're able to download it by opening this and right-click saving.
Lastly, Storyline will hang onto the old web object files so you'll need to outright delete the web object and add a new one with the updated files. Otherwise when you publish, it'll still use the old ones. I was able to create the PDF with all six of my test answers so hopefully this fixes it for you.
- JenniferPappCommunity Member
AndrewBlemings- I can't thank you enough for your help. It's up and running!
Related Content
- 2 months ago
- 4 months ago
- 7 months ago