Forum Discussion
Storyline 360: Printable Free-Response Javascript and Variable Review for Multiple Questions
Hi Nia,
This is a capability that interests me so I took Richard Watson's excellent example and customized it for your situation. Create a copy of your course and replace the following over the existing JavaScript trigger and see if it gives you the output you need. Hope this helps! -Bob
var player = GetPlayer();
var i1=player.GetVar("TextEntry1");
var i2=player.GetVar("TextEntry2");
var i3=player.GetVar("TextEntry3");
var i4=player.GetVar("TextEntry4");
var i5=player.GetVar("TextEntry5");
var i6=player.GetVar("TextEntry6");
var q1="What’s your first memory of gender defining or impacting your life?";
var q2="Growing up, did you think of yourself as a boy, a girl, both or neither? How did you come to that recognition? When do you first remember knowing your gender?\n";
var q3="What messages have you received from those around you about gender? Did those messages make sense to you";
var q4="How were kids who did not fit into expectations about gender treated by others (teachers, family, faith community, etc.)? By you?";
var q5="How have your race, ethnicity, faith, socioeconomic class, community/sense of place influenced your gender?";
var q6="How would you describe your gender today?"
var myWindow = window.open("","Print","width=810,height=610,scrollbars=1,resizable=1");
var contents = "<html><head></head><body style='width:650px;padding:20px;'>";
contents+="<div style='height:20px;padding:10px;margin-bottom:20px;text-align:center;'><button onclick='javascript:window.print();'>Print My Responses</button></div>";
contents+="<div style='font-size:18px;font-weight:bold;margin-top:10px;'>Here are your responses.</div>";
contents+="<div style='font-size:17px;margin-top:5px;'>"+q1+"</div>";
contents+="<div style='font-size:17px;margin-top:5px;'>"+i1+"</div>";
contents+="<div style='font-size:17px;margin-top:5px;'>"+q2+"</div>";
contents+="<div style='font-size:17px;margin-top:5px;'>"+i2+"</div>";
contents+="<div style='font-size:17px;margin-top:5px;'>"+q3+"</div>";
contents+="<div style='font-size:17px;margin-top:5px;'>"+i3+"</div>";
contents+="<div style='font-size:17px;margin-top:5px;'>"+q4+"</div>";
contents+="<div style='font-size:17px;margin-top:5px;'>"+i4+"</div>";
contents+="<div style='font-size:17px;margin-top:5px;'>"+q5+"</div>";
contents+="<div style='font-size:17px;margin-top:5px;'>"+i5+"</div>";
contents+="<div style='font-size:17px;margin-top:5px;'>"+q6+"</div>";
contents+="<div style='font-size:17px;margin-top:5px;'>"+i6+"</div>";
contents+= "</body></html>";
myWindow.document.write(contents);
- RichardWatson4 years agoSuper Hero
Nice job Bob! I like how you added the questions as part of the output.