Forum Discussion
Help! I can't get Submit Button Triggers to Work Correctly!
I've been trying without luck for HOURS to get this to work and I just can't. I also have the AI feature and worked with it for a LONG time trying to use it's functionality to write javascript triggers to replace the manual triggers I was using that wouldn't work - but without any luck. I'm hoping someone knows what I need to do. I'll attach my file if I can. Here's the situation:
This is for a training evaluation that requires branching based on how the learner answers. Everything is super simple until slide 1.15 LQ14 - on this slide if the learner:
- Selects no radio button and clicks Submit, they should see the Invalid Answer layer telling them they must make a selection.
- Selects radio button 1 (MD) or radio button 2 (DO), they should jump to Slide 2.1.
- Selects any other radio button (radio buttons 3-9), they should jump to the Results slide - 3.2.
- This slide *seems to be working for me now although I haven't tested every scenario yet.
IF the learner selected radio button 1 or 2 (MD or DO) on Slide 1.15, they go to Slide 2.1. On Slide 2.1 I want similar branching functionality.
- IF the learner selects Radio button 1, they should proceed to slide 2.2.
- If the leaner selects Radio button 2, they should proceed to the results slide - Slide 3.2.
- If the learner makes no selection, they should see the Invalid Answer layer telling them to make a selection before clicking Submit.
I hope someone can figure out what needs to change on this because I've tried a million tiny tweaks and just can't get it to work!
3 Replies
- JudyNolletSuper Hero
Here's an important fact about triggers: Triggers run in order. Thus, if the user clicks Submit before selecting any response, the program will briefly show the Invalid Answer layer. But it will also immediately run your trigger for jumping to another slide based on what's selected. So those triggers need to be deleted.
And here's an important fact about the Submit button: For survey questions (and for graded questions without immediate feedback), the "Submit [interaction]" trigger includes a command to jump to the next slide.
If the slide is the last one in a scene, it can't do that. And even if there is a "next slide," there's no way to tell it to jump to a different slide based on the response.
Fortunately, there are workarounds to do what you want. The attached file shows how.
- I added two T/F variables: one to track whether the user was an MD or DO (as per response on 1.15) and the other to track whether they granted permission (as per response on 2.1)
- On slide 1.15 (LQ14), I added a trigger to change the branch_MD_DO variable to True when the user clicks Submit, with conditions that MD or DO is selected. Note that this trigger comes before the "Submit [interaction]" trigger.
- Because 1.15 was the end of your scene, the "Submit [interaction]" trigger had no "next slide" to jump to. So I added one.
- On the new slide 1.16, I added a trigger that branches to the appropriate slide in scene 2 based on the value of the branch_MD_DO variable. That runs when the timeline starts on the slide. There is a quick flash before the user lands where you want them to be, but at least they land where you want them to be.
- On slide 2.1, I added a trigger to change the branch_Permission variable to True when the user clicks Submit, based on which button is selected. Again, this trigger comes before the "Submit [interaction]" trigger.
- On slide 2.2, I added a trigger to jump to the results slide in scene 3 if the branch_Permission variable is False. That runs when the timeline starts on the slide, so there is a quick flash for users who branch to 3.2.
- PhilMayorSuper Hero
I would probably simplify it, you don't care if they are MD or DO as the first question handles that branch. In both slides if you have a survey question and select feedback by choice and then press the more button you can choose to branch based on their selection, this is how I would do it.
- JudyNolletSuper Hero
AmyHand-e6b6d76: A simple solution occurred to me: Don't use the Submit button at all. Switch the Slide Properties for all the questions so they include the Next button instead. That will let you adjust the "jump to" triggers as needed for branching.
As long as the questions are associated with the Results slide, the data will still be submitted. (How you pull the data depends on the LMS.)
For details, see this User Guide article:
PhilMayor's solution is also simple, and it allows you to keep the Submit button. Here's a screenshot to show what he's suggesting:
- For Feedback, select "By Choice." Storyline automatically adds a "More..." button next to each response.
- Click "More..." to open a Feedback window. If you leave the prompt field blank, the program will jump to the slide selected in the "Branch to the following" field when the user clicks the Submit button.
Note that the Display options also include a "Require" field. When that is set to "User must answer," Storyline will display the built-in Invalid Answer dialog if the user clicks Submit before selecting a response. Thus, it avoids the need to create and program a custom Invalid Answer layer.
Related Content
- 10 months ago
- 1 month ago
- 1 month ago
- 10 months ago