Saving data with triggers in Articulate Storyline examples
Can you provide examples of saving data with triggers in Articulate Storyline? July 22, 2019, 6:18 pm |
Example 1. I set up a field called “status” and want to set it to either “pass” or “fail” depending on the situation. I will create a JavaScript trigger with the following code to set the status to “pass”: CloudSet('status', 'pass'); And the following JavaScript trigger to set the status to “fail”: CloudSet('status', 'fail'); I will use conditional triggers in Storyline to run the script: Example 2. I want to track whether the learner answered the question correctly. I set up a field called “quiz” and want to use values “correct” or “incorrect” depending on the answer provided. I will add this JavaScript trigger to execute when the timeline of the Correct layer starts: CloudSet('quiz', 'correct'); And this JavaScript trigger on the Incorrect layer: CloudSet('quiz', 'incorrect'); Example 3. I want to save the response entered by the learner in the module. I set up a field called “reflection” in the data table. In Storyline, I will add a text entry box for the learner to type their response: Then I will add the following trigger when the Submit button is clicked: var player = GetPlayer(); var entry = player.GetVar("TextEntry1"); CloudSet('reflection', entry);
July 22, 2019, 6:25 pm |
Great looking set of widgets! I am new to this but getting there. A question about Example 3 where the content of a text entry variable is saved; can I also use this method to save the content of a numeric variable? John.a. March 6, 2020, 6:15 pm |
Hi John. You should be able to, I don't see why not. March 6, 2020, 9:06 pm |
Is there a way to record multiple text entry fields with a single submit button? April 2, 2020, 12:47 pm |
I have successfully saved some data from storyline variables following example 3 above. However I would like to store the value of a storyline built-in variable: 'Menu.SlidesViewed'. This is numeric I believe. Thanks May 28, 2020, 10:53 am |
John, according to this page: https://articulate.com/support/article/accessing-system-variables-in-articulate-storyline-javascript-triggers "Storyline isn't currently designed to expose system variables for user interaction." May 28, 2020, 12:13 pm |
Is there a way to save test score in Articulate via Stencil? June 3, 2020, 9:18 pm |
Is there a way to save test score in Articulate via Stencil? June 3, 2020, 9:19 pm |
Is there a way to save test score in Articulate via Stencil? June 3, 2020, 9:20 pm |
@johnhambrcluelabssupport I am struggling mightily to get any data at all collected from my Storyline file and reflecting in my data table using the widget instructions. All I want to do is capture a True False variable. So when a user starts on the first slide of my Storyline course, it sends 'True' to my Data Cloud table. How do I do this? I've followed the instructions when creating a new data table, but it's not working for me at all. Once I know it works for my needs, I then need to collect slightly more complex data, e.g. when a user clicks on a download link, this data needs to be collected. And what option a user selects from a multiple choice question. Thus far, however, I can't get anything out of my Storyline file – either when I publish and run it locally, or when I upload it to my LMS (Matrix). Please advise. August 3, 2020, 4:24 pm |
@johnhambrcluelabssupport I am struggling mightily to get any data at all collected from my Storyline file and reflecting in my data table using the widget instructions. All I want to do is capture a True False variable. So when a user starts on the first slide of my Storyline course, it sends 'True' to my Data Cloud table. How do I do this? I've followed the instructions when creating a new data table, but it's not working for me at all. Once I know it works for my needs, I then need to collect slightly more complex data, e.g. when a user clicks on a download link, this data needs to be collected. And what option a user selects from a multiple choice question. Thus far, however, I can't get anything out of my Storyline file – either when I publish and run it locally, or when I upload it to my LMS (Matrix). Please advise. August 3, 2020, 4:24 pm |
Hello. If you followed the how-to instructions and the widget is initiated properly, this code will set the value to true: CloudSet('field', 'true'); //replace field with the name of the field you defined in the table August 3, 2020, 4:29 pm |
@johnhambrcluelabssupport Thanks for coming back to me so quickly. I did this, but no data is pulling through to the table at all. Will it pull through only if it is published and hosted online (e.g. on an LMS), or can I test it by running it locally on my PC? Also, the two Execute Javascript triggers I've created are on the opening slide of the course. Is this all right? (The instructions talk about 'the main Master Slide in your course'). August 3, 2020, 4:34 pm |
@johnhambrcluelabssupport I guess I'm not initiating the widget properly, John, but I can't tell what I've done wrong based on the instructions provided. In the example I cited, I guess when I create a new data table, I fill in the Field Name, and then make the Field Type True/False – correct? Do I leave the default value field blank? I then created the blank text variable 'stencilusertoken' in my Storyline file, created an Execute Javascript trigger and pasted in that long script. Then I created another to Execute the CloudSet script, making the necessary change to the 'field' section. What am I missing? August 3, 2020, 4:49 pm |
Hi- var player = GetPlayer(); CloudSet('supplies the goods/services', entry1); October 12, 2020, 9:48 pm |
Hi- var player = GetPlayer(); CloudSet('supplies the goods/services', entry1); October 12, 2020, 9:48 pm |
Actually, I've got 99% of this working. There is just one field (CloudSet('what', entry16);) that does not populate. I've gone over all of my variables in SL, as well as the javascript that loads when the Submit button is clicked, but can't see where the problem is. var player = GetPlayer(); var entry1 = player.GetVar("WS1"); CloudSet('supplies', entry1); October 13, 2020, 1:09 pm |