Forum Discussion
User notes that they can print and email
This one gets very complicated but it works very well thank you. This is what i turned it into:
var exercisenotes12=player.GetVar("tf1"); as a test we are trying to load in a variable information of a true or false button to show yes or no for a moc intake form that we have made. anyone have any ideas?********** trying to get the information of a button that is checked to be translated into something i can stick in to this crazy mess i have created off of this any takers?
var player = GetPlayer();
var useremail=player.GetVar("email");
var subject="New Multimedia Learning Solutions Project Outline";
var usernotes=player.GetVar("notes");
var exercisenotes1=player.GetVar("Ans1");
var exercisenotes2=player.GetVar("Ans2");
var exercisenotes3=player.GetVar("Ans3");
var exercisenotes4=player.GetVar("Ans4");
var exercisenotes5=player.GetVar("Ans5");
var exercisenotes6=player.GetVar("Ans6");
var exercisenotes7=player.GetVar("Ans7");
var exercisenotes8=player.GetVar("Ans8");
var exercisenotes9=player.GetVar("Ans9");
var exercisenotes10=player.GetVar("Ans10");
var exercisenotes11=player.GetVar("Ans11");
var exercisenotes12=player.GetVar("tf1"); as a test we are trying to load in a variable information of a true or false button to show yes or no for a moc intake form that we have made. anyone have any ideas?**********
var mailto_link='mailto:'+useremail+'?subject='+subject+'&body='+"How many times can your learner take this test?%0d%0A"+exercisenotes1+"%0d%0A%0d%0AWhat percentage correct means passing?.%0d%0A"+exercisenotes2+"%0d%0A%0d%0ADo they need to be able to re-take it if they fail it?%0d%0A"+exercisenotes3+"%0d%0A%0d%0ACan the questions be given to your user in any order (randomly arranged)?%0d%0A"+exercisenotes4+"%0d%0A%0d%0ADoes your user need to know which questions they got wrong in a review at the end?%0d%0A"+exercisenotes5+"%0d%0A%0d%0ALength of questions AND answers (word count) is limited?%0d%0A"+exercisenotes6+"%0d%0A%0d%0AHOW DO YOU TAKE PEOPLE OFF TO MEET YOUR MOTHER?0d%0A"+exercisenotes7+"%0d%0A%0d%0AWhat if Sponge Bob Square Pants was actually real and Bikini Bottom was actually a real place?%0d%0A"+exercisenotes8+"%0d%0A%0d%0Aquestion question nine question nine?%0d%0A"+exercisenotes9+"%0d%0A%0d%0A0Atime lookFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF?%0d%0A"+exercisenotes10+"%0d%0A%0d%0A0Atime lookFFFFFFFFFFFFFFdFFFFFFFF?%0d%0A"+exercisenotes11+"%0d%0A%0d%0A0A0A0A General Notes:%0d%0A"+usernotes;
location.href=mailto_link;
The easiest solution would be to use a Text variable instead of a True/False variable and use your check box triggers to change the value to "No" or "Yes".
However, if you insist on using a T/F variable, you could do something like the following:
//call the storyline player if you have not already
var player = GetPlayer();
//create a function to get your true-false value, convert it from boolean to text, analyze the value and convert it to yes or no
function myFunction() {
var trueOrFalse = player.GetVar("tf1").toString();
if (trueOrFalse == "true") {
return "YES";
} else {
return "No";
}
};
//run the function and store the value in a variable called userNotes12
var userNotes12 = myFunction();
I'm sure you could shorten this by just evaluating the boolean value rather than converting it to a string but I am not an expert when it comes to working with booleans; I find it easier to just work with strings. :-)
Related Content
- 9 months ago
- 7 months ago
- 8 months ago
- 9 months ago
- 12 months ago