User notes that they can print and email

Dec 10, 2013

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: https://bit.ly/3Kd96as

Published Output: https://bit.ly/3Z0hj5X

Cheers!

Stephanie

238 Replies
Kathy Lee

Hi Everyone,

First, this is amazing! This is exactly what we need in our course to make it interactive and reflective for the learner.

Now, my question: I've seen two other people say that nothing happens when they click the icons. Anyone have any idea why?

I published Stephanie's source file and put it on SCORMCloud, the buttons work. 

I imported the screens onto the template of my file in SL2, put it on SCORMCloud, and it works. 

But when I create the triggers myself and copy-paste the code (making adjustments to only the title of sections, etc), NOTHING HAPPENS!

Any help or insight is greatly appreciated!

UPDATE: My course works now - I just copy-pasted the code and modified them for my course again. I still don't know why it didn't work before, so am very interested if anyone has any ideas of why it didn't work the first time I copy-pasted it (see the code attached). Thanks!

Kathy Lee
Kristine W

2. While my email function works perfectly, I am having issues with the Print and Print Preview function.  The Title and Date won't display on my course's print preview. It only shows "Null" for each title and date.  The rest of the notes are working just fine on the print preview. I have an Execute JavaScript trigger on slide 1 and used the System Date JS exactly as it was presented on the PPT slide provided above.  I made sure SystemDate matched in both places as JS is case sensitive.  I'm also a little unclear if I need to add more to have the code retrieve a title/headline for the print preview.  Is there a step I'm missing to make these work?

This was my first time using Javascript in Storyline2, and I was experiencing the same problem. It turns out I needed to create a variable for the title and the date. It may be a given for super users out there, but definitely need-to-know new information for beginners like me.

In the image attached, see the variables "PrintTitle" with set default value of the title you want to appear and "SystemDate".

Now my course works! Thanks Stephanie for the great idea!

~Kathy

 

tin C

 

Hi Everyone,

I just found this great resource yesterday and I cannot get it to work, 

What I want is that users can take notes throughout the course, so I created a My Notes in the player in the top right hand corner and when users click it will appear as a light box slide.

 

Now I have made a separate scene which I call mynotes and put in the notepad, the email field  as a text box and also the email and print icons.

 

I created two text variables, 1. coursenotes 2. coursedate (systemdate)

I tried to clean up the JS that stepahnie had and replaced it where appropriate and published it to web and testing on IE locally on my computer but its not working.

 

I am sure the print option is also not working, but I want to get the email option working first.

 

Nick Wilson

Having utilized a variation of this script in a course, we have found that the e-mail function breaks down in IE 11 due to a character limit on mailto: links.  Unfortunately, for the course we are creating, we need to find an alternate solution that will allow the e-mail notes functionality but without the character limit.  Can anyone suggest an alternative that has been successful?  Anyone have experience with server-side scripting?

Jilly Dutton

Hi all,

I stumbled on this thread last week and found myself totally inspired to give Javascript a go using Stephanie's very generous notes... then I realised I'm a newbie to coding and am well out of my depth!

I was wanting to use Stephanie's code for sending an email that includes text inputs pulled from Storyline into the message body. I fear I have mangled the code entirely, but am hopeful I have merely managed to name things incorrectly and it's a quick fix.

If anyone has the time or inclination to have a look over my code I'd appreciate it... I have attached an outline that shows what I have so far and what I hope for it to be.

Thanks in advance!

Jilly

 

Jilly Dutton

Wow, Matthew - thanks so much! This has been uber helpful, and now my test module is working the same as yours!

As a tricky workaround I was going to use a pre-populated Stage1_Notes text entry to pull content into the email, but I can't get that bit to work (possibly because I'm making this bit more difficult than it needs to be).

Any ideas how to get this variable to pull through to the email body? I have attached a zipped source file to tinker with if you need. My ultimate goal is to get the notes and functionality for Stage One right and then to dupe the scene for all four stages, changing the Javascript to pull the relevant notes variable into the email.

Thanks again, this is going to make the module so much more engaging for my audience :)

Holly MacDonald

I am also out of my depth when it comes to javascript. I have the following page set up and the email function didn't execute. I added a trigger to adjust the variable, but I'm not sure it is the right thing to do. Anyone want to help a non-coder with this?

the triggers

Here's the javascript I have

var player = GetPlayer();

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

var subject="Journal Entries";

var Thoughts9=player.GetVar("Thoughts9");
var Thoughts1=player.GetVar("Thoughts1");
var Thoughts2=player.GetVar("Thoughts2");
var Thoughts3=player.GetVar("Thoughts3");
var Thoughts4=player.GetVar("Thoughts4");
var Thoughts5=player.GetVar("Thoughts5");
var Thoughts6=player.GetVar("Thoughts6");
var Thoughts7=player.GetVar("Thoughts7");
var Thoughts8=player.GetVar("Thoughts8");

var mailto_link='mailto:'+useremail+'?subject='+subject+'&body='
+"Journal Entry 1:%0d%0A“
+Thoughts9+"%0d%0A%0d%0A
Journal Entry 2:%0d%0A“
+Thoughts1+"%0d%0A%0d%0A
Journal Entry 3:%0d%0A“
+Thoughts2+"%0d%0A%0d%0A
Journal Entry 4:%0d%0A“
+Thoughts3+"%0d%0A%0d%0A
Journal Entry 5:%0d%0A“
+Thoughts4+"%0d%0A%0d%0A
Journal Entry 6:%0d%0A“
+Thoughts5+"%0d%0A%0d%0A
Journal Entry 7:%0d%0A“
+Thoughts6+"%0d%0A%0d%0A
Journal Entry 8:%0d%0A“
+Thoughts7+"%0d%0A%0d%0A
Journal Entry 9:%0d%0A“
+Thoughts8+"%0d%0A%0d%0A"

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

Many thanks if you can pinpoint what I'm missing (javascript, trigger, variable???)

 

Holly MacDonald

Hi Matthew, I tried that, but it still didn't execute.

I think it's a trigger/variable problem. Where I have var useremail=player.GetVar("email"); I am not sure I have the right variable and/or trigger.

The variable type I have is text entry, but not sure if I should have a trigger that adjusts the variable and if so to what. 

Any other ideas?

onEnterFrame (James Kingsley)

Hi Holly,

A few thoughts from just taking a glance at your code. But I am not sure if your actual code is just like what is above? Or maybe the forum reformatted it?

Generally speaking you shouldn't have a hard line break in the middle of a variable. Your var mailto_link= has a line break after '&body='. And then a bunch more breaks after each entry. You should either make that one long line or append those to the end of the var like this:

var mailto_link='mailto:'+useremail+'?subject='+subject+'&body='
mailto_link += 'Journal Entry 1:%0d%0A'

There are a few other ways to handle that but the solution above should be fine for what you are doing. 

Some of your strings have opening quote marks but no closing quote marks. 

Also some of those quotes in your code are not the normal quotes. This is OK: " this is not “ . I know... they look almost identical. Avoid the curly looking ones.  Using a code editor (like Sublime) will help you see those. 

It is generally best practice to use double quotes around strings and to mix them with single quotes. You have some lines that start with single quotes append values in double quotes. 

I think this may work for you:

var player = GetPlayer();
var useremail=player.GetVar("email");
var subject="Journal Entries";
var Thoughts9=player.GetVar("Thoughts9");
var Thoughts1=player.GetVar("Thoughts1");
var Thoughts2=player.GetVar("Thoughts2");
var Thoughts3=player.GetVar("Thoughts3");
var Thoughts4=player.GetVar("Thoughts4");
var Thoughts5=player.GetVar("Thoughts5");
var Thoughts6=player.GetVar("Thoughts6");
var Thoughts7=player.GetVar("Thoughts7");
var Thoughts8=player.GetVar("Thoughts8");
var mailto_link="mailto:"+useremail+"?subject="+subject+"&body="
mailto_link += "Journal Entry 1:%0d%0A"
mailto_link += Thoughts9+"%0d%0A%0d%0A"
mailto_link += "Journal Entry 2:%0d%0A"
mailto_link += Thoughts1+"%0d%0A%0d%0A"
mailto_link += "Journal Entry 3:%0d%0A"
mailto_link += Thoughts2+"%0d%0A%0d%0A"
mailto_link += "Journal Entry 4:%0d%0A"
mailto_link += Thoughts3+"%0d%0A%0d%0A"
mailto_link += "Journal Entry 5:%0d%0A"
mailto_link += Thoughts4+"%0d%0A%0d%0A"
mailto_link += "Journal Entry 6:%0d%0A"
mailto_link += Thoughts5+"%0d%0A%0d%0A"
mailto_link += "Journal Entry 7:%0d%0A"
mailto_link += Thoughts6+"%0d%0A%0d%0A"
mailto_link += "Journal Entry 8:%0d%0A"
mailto_link += Thoughts7+"%0d%0A%0d%0A"
mailto_link += "Journal Entry 9:%0d%0A"
mailto_link += Thoughts8+"%0d%0A%0d%0A"
win=window.open(mailto_link,"emailWin");

 

Hope that help!

 

Holly MacDonald

Going back to square one. I've used Matthew's sample file and while his works, it doesn't work when I try to copy elements onto the slide. I've used James' javascript and no luck. I used someone else's suggested javascript and no luck.

Can someone please let me know if my logic is right/wrong.

1. Create text entry box for user to enter email. Automatic variable is created.

2. Create text variable called useremail

3. Change name of text entry variable to "useremail"

4. Add button

5. Add trigger to execute javascript when user clicks button

6. Enter javascript that starts with 

var player = GetPlayer();

...and ends with ...

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

Thanks!

Lisa Treece

Hi Everyone!

I ran across this post last week when trying to figure out this whole Java thing (I have zero experience), and I'm hoping to get some advice :)

I am attempting to have an email populate with different variables in the body of the email The variables are numbers, not text, so I'm not sure if that makes a difference. I've tried adjusting a few of the different scripts I've found in this thread, but I can't seem to get any of them to work. Here is my most recent attempt:

var player = GetPlayer();
var email= "dbs_training@cscglobal.com";
var subject= "DNS Certification Assessment Results";
var score = player.GetVar("Results.ScorePercent");
var dnsbasics = player.GetVar("dnsbasics");
var zonebasics = player.GetVar("zonebasics");
var digsandzonechecks = player.GetVar("disandrcz");
var zonemanagement = player.GetVar("zonemngmt");
var reportingtools = player.GetVar("reportingtool");
var troubleshooting = player.GetVar("trblshooting");
var advancedzones = player.GetVar("advancedzones");
var urlf = player.GetVar("urlf");
var dnsa = player.GetVar("dnsa");
var emailbody = "End Score:\n\n"+score+"\n\nDNS Basics:\n\n"+dnsbasics+"\n\nZone Basics:\n\n"+zonebasics+"\n\nDigs and Registry Zone Checks:\n\n"+digsandzonechecks+"\n\nZone Management in Domain Manager:\n\n"+zonemanagement+"\n\nDNS Reporting Tools:\n\n"+reportingtools+"\n\nZone Troubleshooting:\n\n"+troubleshooting+"\n\nAdvanced Zones:\n\n"+advancedzones+"\n\nURL Forwarding:\n\n"+urlf+"\n\nDNS Advanced:\n\n"+dnsa;
var mailto_link='mailto: '+email+'?subject='+subject+'&body='+emailbody;
win=window.open(mailto_link,'emailWin');

Any advice would be much much much appreciated!

Thanks, Lisa

onEnterFrame (James Kingsley)

It is hard to trouble shoot without access to the course. 

One thing you could to help would be to open up your browser's developer console (press F12) and see if there are any error messages there. It will usually even direct you to the problematic line and might give a hint about what is wrong. 

In the meantime... a few things to check. 

  • This probably when run locally so make sure you testing from a web server.
  • I'm not sure you can access quiz results like this player.GetVar("Results.ScorePercent");  You may need to set the value of a custom variable in Storyline and get that. 
  • Since this solution is popping up a new window the browser could be blocking poppups. 
Jacob Visovatti

Hi Stephanie and others. I love this design!

I would like to provide users a workaround in case their browser's security settings prevent the Javascript from executing. I hoped to compile all the notes in a scrolling panel so that users could copy and paste, but now I realize that player text is not select-able.

Is there a way to enable copy and paste for on-screen content?

Jacob Visovatti

Hi Matthew - thanks for replying on a two-year-old thread!

My concern about browser security settings is entirely pre-emptive. I haven't finished building the functionality in my project yet, actually. I am trying to be robust in design, but I guess there's the Knuth quote - "premature optimization is the root of all evil."

Dave Galvin

Hi all,

This method for capturing notes during a course and emailing them, has really helped me in a few of my recent modules, thank you Stephanie!

I do have a question:

Instead of typing the target email address in a text field, and then executing the JavaScript, is there a way to use the email trigger in a button for instance, where you can add the email address upfront? In the course I am working on now, I have been asked if there is a way to do this, where the learner doesn't have to type an email address in a text box. If I can pre-populate that address, that would be great.

Thanks in advance

Regards

David