Enable user to save contents of a text box w/ multiple variable entries?

I'm working on a course where users enter reflective responses to a number of questions throughout the course. All of the questions are Text Entry questions. After they've completed everything, they can see all of their entries, all in one place. To do that, I just created a text box with some text and a bunch of references in it. For example:

Lorem ipsum this and that
%TextEntry1%
Lorem ipsum and the other thing
%TextEntry2%

That all works great. But is there any possibility to make it so they can somehow save it to their own personal documents? Based on other discussions, here's what I've considered or tried so far:

  1. Text Box: Shows their responses, but can't select/copy.
  2. Text entry box: Doesn't display variable info, just the "%textentry#%" actual text. Also couldn't select the text.
  3. Web object with text: Didn't think this would work due to variable-based text, so didn't try.
  4. JavaScript to send email. I've gotten the farthest with this method, but for the life of me, I can't get it to work.

Any ideas? As much as I want users to come back to the course for reference / refresher, I don't want to force them to in order to review their own reflections.

I've also attached a .txt file of what I've done for the JavaScript. I think it's somewhere in the mailto portion, but I'm not a pro on it, so maybe I missed something.

 

1 Reply
Bridget O'Dell

Hey Dan,

I recently posted an article about how to export variable values using JavaScript. Seems like this may be helpful to you in figuring out your programming issues.

https://community.articulate.com/discussions/building-better-courses/export-variable-values-via-email-message-using-javascript

By looking at your code, here are some possible areas where issues may be occurring:

- try changing var useremail to var email - email is what is read by the system as email address

- looks like you're missing your body_start aspect of the code 

- To put all variables in a string, you need to use +

 

See below for my recommendations on how the JavaScript code should read:

Note: You would need to add all of the variables to the body_start section.

 

var player = GetPlayer();

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

var subject = "Developing Your Leadership Plan Responses";

var body_start= player.GetVar("TextEntry1") + player.GetVar("TextEntry2") + player.GetVar("TextEntry3');

var mailto_link='mailto:'+email+'?subject='+subject+'&body='+body_start;
win=window.open(mailto_link,'emailWin');

 

 Also, if you want to add plain text between the variables, you can do so:

var body_start= "Variable 1" + player.GetVar("TextEntry1");

 

If you want to add a line break between variables:

var body_start= "%0D%0A Variable 1" + player.GetVar("TextEntry1");

 

Hope this helps! Happy Programmming!