User notes that they can print and email

Hi all. I built a course earlier this year that contains a "notes" function to allow users to take a moment to reflect and type their thoughts on certain questions. This is used in place of a typical multiple response/choice type question. Thought I'd share it here with you!

Here are the files:

Screenr Part 1: Demonstration - https://player.vimeo.com/video/204928444

Screenr Part 2: How It Was Built - https://player.vimeo.com/video/204928450

Storyline Source: http://bit.ly/INWKD7

Published Output: http://bit.ly/1gmwbnb

Cheers!

Stephanie

243 Replies
Joe Zhou

Thanks for Stephanie and Owen contributions! It's never too late to say so until I recently find this page which helps me to develop the emailing and printing function!  ;)

Just wonder if there is a way to insert the specific email address/educator under the CC field in the email? By that means not only can learner receive the email with their reflections but also the educator.

Of course there is another way around this is that I can make another separate button which prompts another email window with educator's name on the receipiant field, however it compromises the user experience...

justin kliegman

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; 

Madelaine Whalen

Not entirely sure if this answers your question, but here's something I made that allows users to print notes. http://s3.amazonaws.com/tempshare-stage.storyline.articulate.com/sto_1c7bm1u8mmlssj61rb2mq812d99/story.html 

The user goes through a series of buttons and clicks the options that appeal to them, then types accompanying notes in a text entry field. These selections and notes appear on the final slide through a series of variable references, and a JavaScript command collates them for printing. 

OWEN HOLT

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. :-)

Len Taylor

Hello there. I modified and used Madelaine's example and in it's own scene within the project it works perfectly.  However, when I copy those two slides to the correct scene, the typed in text does not appear at all. I have made sure several different times about the code and variables and even published, but there is no change. Ideas? I have attached. Scene 8 is my test bed, the scene not working is the last two slides in scene 1. Thanks in advance!

Madelaine Whalen

It looks like you are referencing the wrong variables on slide 1.9, and potentially reusing the same variable too many times within the course. You need to have a unique variable assigned to each interaction/entry you want the learner to complete and be able to print, does that make sense?

Madelaine Whalen

I adjusted the interaction in Scene 1 a bit - let me know if this works the way you wanted it to. I renamed the variables to make it easier to tell that they belong to scene 1 and to make it easier to check your Java to ensure it all fits where it is supposed to. 

Wilson Santiago

Hi Folks.

I know this is an old thread, but it has proven quite helpful in my current project.  I have been able to modify this to my current project, but I have an additional function I cannot figure out.  I would like to be able to also print the username that the student will type in at the beginning of the module.  Everything I have tried so far has failed, although I do admit I am nearly illiterate in JavaScript.  Does anyone know a way to do this?

G G

I know this is an old thread, but hoping there are still some followers...

I modified Stephanie's Javascript for a course I'm developing in which I want to compile several variable values into an email at the end of the module. Most are text variables, which seem to be working fine, but I'd also like to include the learner's score on the assessment in the module (using the system variable Results.ScorePoints). No matter what the actual score is, when I compile the JavaScript email at the end of the course, it says "null" where that point value should be.

This is my first attempt at doing anything with JavaScript so I'm just guessing here, but maybe it's because it's a numeric variable rather than text? Is there a way to convert numeric variables to string in the JavaScript that someone would be able to show me?

Below is the JavaScript code I'm using, followed by the text of the email it compiles:

var player = GetPlayer();
 

var useremail=player.GetVar("UserEmail");

var username=player.GetVar("UserName");

var usernamepledge=player.GetVar("UserNamePledge");

var subject="Module 1 Portfolio Notes";

var exercisenotes1=player.GetVar("Reasons");

var exercisenotes2=player.GetVar("FirstMgtDescrpt");

var mgmtscore=player.GetVar("Results.ScorePoints");

var mgmtdescrpt=player.GetVar("MgmtDescrpt");

var systemdate=player.GetVar("SystemDate");

 
var mailto_link='mailto:'+'hello@graciagoldberg.com'+'?subject='+subject+'&body='+"Module 1 Portfolio Notes for:"+username+"("+useremail+")%0d%0A%0d%0AReflection 1 - Top Reasons For Going into Business:%0d%0A%0d%0A"+exercisenotes1+"%0d%0A%0d%0AReflection 2 - The Role of Manager in My Organization:%0d%0A%0d%0A"+exercisenotes2+"%0d%0A%0d%0AManagement Inventory Assessment Score:"+mgmtscore+"%0d%0AWhat your score means:"+mgmtdescrpt+"%0d%0A%0d%0A"+usernamepledge+" signed the Course Commitment Pledge on"+systemdate;

win=window.open(mailto_link,'emailWin');

Here is the email currently being created (variable values are in bold):

Module 1 Portfolio Notes for:Gracia(hello@graciagoldberg.com)

Reflection 1 - Top Reasons For Going into Business:

example text 1

Reflection 2 - The Role of Manager in My Organization:

example text 2

Management Inventory Assessment Score:null

What your score means:You may be foundationally strong in most areas, but the areas in which you are weak may prove to be fatal. A score in this range means that there are several areas that pose a threat to the well-being of the business. Focus on becoming a better manager than is called for.

Gracia signed the Course Commitment Pledge on8/10/2018

 

I also can't seem to get it to include spaces in there if you noticed... I tried using "&nbsp" and it seemed to break everything...

Margaret Hiatt

Hello All,

For the life of me, I can't get this to work. Stephanie's file works fine but when I recreate the java in my own file it won't work.

I also am having a problem where the variables won't update when the control loses focus. Right now I am updating the variables by tabbing through.

Any help would be appreciated.

 

OWEN HOLT

StoryLine protects the score variables to protect them from direct manipulation. Try adding an additional variable in StoryLine and setting its value equal to the Results.ScorePoints variable prior to executing the JavaScript. Then pull in that variable's value.  There is no need to convert from numeric value to text.

Rally Kantcheva

Hello all,

I'm having issues trying to get the email to be sent. I have followed Stephanie's example and tried some of the later suggestions by Matthew, but for some reason my LMS does not want to open a new window and to sent the e-mail. Can anybody help, please?  Here is the code I'm trying to use:

var player = GetPlayer();
var useremail = player.GetVar('EmailN');
var pnotes1 = player.GetVar('Notes1');
var pnotes2 = player.GetVar('Notes2');
var pnotes3 = player.GetVar('Notes3');
var pnotes4 = player.GetVar('Notes4');
var pnotes5 = player.GetVar('Notes5');
var pnotes6 = player.GetVar('Notes6');
var pnotes7 = player.GetVar('Notes7');
var subject = 'Notes from Your Dissertation Topic Tutorial';
var emailBody = 'Research:' + pnotes1 + '\n' + 'Two Important Questions:' + pnotes2 + '\n' + 'What is a research question:' + pnotes3 + '\n' + 'Why is a research question needed:' + pnotes4 + '\n' + 'How and Why:' + pnotes5 + '\n' + 'Answering Why X should be done:' + pnotes6 + '\n' + 'A good research question:' + pnotes7;
var mailto_link = 'mailto:' + useremail + '?subject=' + subject + '&body=' + encodeURIComponent(emailBody);
win = window.open(mailto_link, 'emailWin');

Thanks!

onEnterFrame (James Kingsley)
  1. You probably checked this already... but is the browser blocking the popup window?
  2. You might try opening the Developer Console and seeing if any errors are shown. 
  3. There is a limit to how many characters you can put in a URL (~2000 depending on the browser). Is it possible you are hitting that limit?