Forum Discussion
Storyline 360: Printable Free-Response Javascript and Variable Review for Multiple Questions
Bob,
I tweaked the script a little more to make it easier to read. For some reason, I could not get /n to work to create space between questions. I'm still learning...
Anyway, I modified the script to provide the following output and posted the updated .story file for Nia if she wants it.
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;'>Q1 Response.</div>";
contents+="<div style='font-size:17px;margin-top:5px;'>"+q1+"</div>";
contents+="<div style='font-size:17px;font-style:italic;margin-top:5px;'>Learner Reponse:"+i1+"</n></div>";
contents+="<div style='font-size:18px;font-weight:bold;margin-top:10px;'>Q2 Response.</div>";
contents+="<div style='font-size:17px;margin-top:5px;'>"+q2+"</div>";
contents+="<div style='font-size:17px;font-style:italic;margin-top:5px;'>Learner Reponse:"+i2+"</div>";
contents+="<div style='font-size:18px;font-weight:bold;margin-top:10px;'>Q3 Response.</div>";
contents+="<div style='font-size:17px;margin-top:5px;'>"+q3+"</div>";
contents+="<div style='font-size:17px;font-style:italic;margin-top:5px;'>Learner Reponse:"+i3+"</div>";
contents+="<div style='font-size:18px;font-weight:bold;margin-top:10px;'>Q4 Response.</div>";
contents+="<div style='font-size:17px;margin-top:5px;'>"+q4+"</div>";
contents+="<div style='font-size:17px;font-style:italic;margin-top:5px;'>Learner Reponse:"+i4+"</div>";
contents+="<div style='font-size:18px;font-weight:bold;margin-top:10px;'>Q5 Response.</div>";
contents+="<div style='font-size:17px;margin-top:5px;'>"+q5+"</div>";
contents+="<div style='font-size:17px;font-style:italic;margin-top:5px;'>Learner Reponse:"+i5+"</div>";
contents+="<div style='font-size:18px;font-weight:bold;margin-top:10px;'>Q6 Response.</div>";
contents+="<div style='font-size:17px;margin-top:5px;'>"+q6+"</div>";
contents+="<div style='font-size:17px;font-style:italic;margin-top:5px;'>Learner Reponse:"+i6+"</div>";
contents+= "</body></html>";
myWindow.document.write(contents);