Forum Discussion
JavaScript
Hello community, I need your help. I used a template that runs a JavaScript. I am trying to make changes to it, but I don't quite understand it.
Attached is questionnaire. My goal is for when the user clicks the print button, they are able to view their question and answers.
If there is a better way to program it, please let me know.
Thank you for your help.
- MathNotermans-9Community Member
First of all... name your variables properly...that makes all a lot clearer. Not TextEntry - TextEntry18 but Question 1 - Question 18 or some like that.
- MathNotermans-9Community Member
Second error in your Javascript code.... var player = GetPlayer()...
This command connects with the Storyline player. so its only needed once.
- MathNotermans-9Community Member
So fixed it.
https://360.articulate.com/review/content/b554cfe5-e3b3-49c0-9ea6-5abe96078c8b/review
Next to the previous mentioned errors you closed the print window for each question. Fixed that and added a variable to use on each question slide ( scopeQ1 ~ scope Q7 ) that is also used in the print script so you only need to change the Storyline variable when needed.