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: http://bit.ly/INWKD7
Published Output: http://bit.ly/1gmwbnb
Cheers!
Stephanie
257 Replies
Thanks a million Matthew - I'll give that a try.
Fingers crossed!
Holly
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
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.
player.GetVar("Results.ScorePercent");
You may need to set the value of a custom variable in Storyline and get that.Thanks for the advice...no error messages are appearing in the developer console
- I've been publishing to our LMS for testing
- I removed "Results.ScorePercent" from the code
- I ensured there were no popup blockers enabled
All of this and still no luck :(
Would it be possible to share a link to it with us?
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, I suspect that you are only running into the browser security settings because you are testing this on your local machine. Have you tried uploading this to it's intended environment (LMS, server etc.?)
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."
If the browser security settings are tight enough to keep this from running
(from a server) then most likely the course won't run.
I don't think this is likely to be a problem Jacob. But if you are concerned, just build a sample and test how it works in your environment.
Awesome post Stephanie... Cheers!
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
Hi David,
Yes, that's possible. Rather than hardcoding the email address into the JavaScript, e.g.
You'd use something like this instead:
Then you'd just need to have a text entry field in Storyline where the user can enter their email address. You'd set this text entry field up to use the
Email_Address
variable so that it all works.Does that make sense?
I also have a detailed tutorial here on using email in SL that you might find interesting.
Let me know if you need any further assistance. Thanks.
EDIT: I just realised I answered the exact opposite of your question! Sorry about that.
You can either hard code the email address as shown above, or you may be able to grab the email address from the LMS if your LMS stores the user's email address as a
studentID
. Some do, some don't.Hi Matthew,
Thanks for the information. The solution in your tutorial looks really good. In my module, I currently have three text box variables, each one asking a question for specific feedback from the course. Can I combine these so that they feature in one email, or do I have to create three separate emails?
Regards
David
Hey Dave - they can be combined into the one email quite easily.
In my tutorial, you'll see this line of code:
You could expand that to include your other variables easily. For example:
You'd also need to modify the code to grab the extra variables from SL, but I think you can probably figure out how to do that from the tutorial. If you get stuck, feel free to reach out and I'll help you get it working.
Thanks!
Hi Matthew,
That is great. I adjusted the script as below and all works as hoped.
var player = GetPlayer();
var email = 'my.email@address.com'
var fbk = player.GetVar('Feedback');
var fbk2 = player.GetVar('Feedback2');
var fbk3 = player.GetVar('Feedback3');
var subject = 'Course Feedback';
var emailBody = 'Here is some feedback:' + '\n' + fbk + '\n' + fbk2 + '\n' + fbk3;
var mailto_link = 'mailto:' + email + '?subject=' + subject + '&body=' + encodeURIComponent(emailBody);
win = window.open(mailto_link, 'emailWin');
Two quick questions if I may:
Thanks again Matthew!
Regards
David
Good work David!
Yes, it'll work in an LMS.
No, there isn't a way to stop the blank tab from opening, that's needed to launch the email.
Hi Matthew,
That's great. I really appreciate the help you have given me.
Many thanks
Dave
My pleasure Dave, happy to help where I can.
Hey, this is amazing, but I am having trouble making it work. I am not sure exactly what needs to change in the java script. I am trying to make the email function work. This is what I put in (maybe i changed things i shouldn't have?). Any help would be great:
var player = GetPlayer();
var useremail=player.GetVar("email");
var subject="Trois type de reportage journalistic";
var quoi1=player.GetVar("TextEntry283");
var qui1=player.GetVar("TextEntry268");
var quand1=player.GetVar("Textentry270");
var mailto_link='mailto:'+useremail+'?subject='+subject+'&body=
'+"Notes Description de faits - Quoi:%0d%0A“
+quoi1+"%0d%0A%0d%0A
Notes Description de faits - Qui:%0d%0A“
+qui1+"%0d%0A%0d%0A
Notes Description de faits - Quand:%0d%0A“
+quand1+"%0d%0A%0d%0A
win=window.open(mailto_link,'emailWin');
It looks like some of your quotes are not closed. And there is a mix of different quote types: ',",and “
I am not sure if it is the formating of the post... but typicly you shouldn't break strings into multiple lines. If you do you will need to add a slash (\) at the end of each line.
This might work (untested but formatted better). Note that I just made the mail_to_link all one line and replaced the various quotes.
Hey James thank you so much for your response. I ended up using the following code and it seemed to work (I will also test the one you re-formatted for me thanks you for taking the time to do that [😊] ):
var player = GetPlayer();
var useremail=player.GetVar("TextEntry293");
var subject="Trois type de reportage journalistique";
var usernotes=player.GetVar("notes");
var exercisenotes1=player.GetVar("TextEntry283");
var exercisenotes2=player.GetVar("TextEntry268");
var exercisenotes3=player.GetVar("TextEntry270");
var exercisenotes4=player.GetVar("TextEntry271");
var exercisenotes5=player.GetVar("TextEntry272");
var mailto
This is just what I am looking for, great work, thanks so much for sharing!
This looks awesome Stephanie, and hopefully exactly what i need! Time to tinker with you JS.
Many thanks.
does this store their response in the LMS once they are done to come back to and reference or is this something they have to print and keep?