Forum Discussion
Help getting "clicked" options from list on other slides
An interesting puzzle to be sure. You don't mention any randomization, which is good because that would complicate things more, but if you need those 10-20 to be shuffled or something, that's a whole other aspect of design.
Moving ahead with the assumption of no randomization, the next obstacle is getting the info from one slide to the next. I can imagine you creating a variable for each button to carry over the information of whether or not it was clicked, but that would be a lot of variables.
A more streamlined method would be to leverage JavaScript. The first slide learners visit could contain something like
window.choices = [];
That would create a JavaScript array/list called choices, accessible by any other JavaScript code on any slide so long as the learner doesn't clear their cache.
Then each of your buttons could have a simple line of code that runs when they're clicked, adding their pushed value to the list.
window.choices.push('word12');
If you want learners to be able to de-select, you'll need logic for a splice() trigger as well. It'd be easier on you to just make it so when people click a word, they better be sure. If they really need to be able to take back a selection, then splice will do that.
That array of values/choices can then be read by a subsequent slide and assigned out to variables that sit in buttons. If slide 3 has five buttons, the text of the buttons can be variables like slide3Word1, slide3Word2, and so on. And then your slide's script can loop through the array and use the setVar() method to transfer those array values into the sequence of button label variables. In other words, the text that buttons show can be dynamically changed at runtime.
This is a lot and can become bigger, so I wonder if there's not a way to simply reuse the one slide that starts with all of the words? If I'm looking at a slide of 40 and I need to click 15, when I'm done, can't the unselected ones be set to a Hidden state? Use a layer to prompt the learner about what comes next, and then use the end of that layer to reset all of the word buttons that weren't hidden (because they had the selected state), and the learner goes again with the buttons that remain. I feel like this way would save a lot of duplication and cross-slide interfacing.
AndrewBlemings- Thank you!
I'm unfamiliar with JavaScript, so that makes me somewhat nervous; the margin of error seems large for me.
I do like the idea of using the same slide and then hiding the words that weren't selected, triggered by a button. I'm going to play with this but any advice would also be appreciated!
- AndrewBlemings-4 months agoCommunity Member
I mocked up a simple prototype to better concrete what I was thinking of: https://360.articulate.com/review/content/9b021789-5f9f-421f-a63f-42b30cbbeccc/review
The .story file is downloadable from the Versions dropdown. I didn't do the final loop/layer that responds after someone clicks the final, top one, but just because I think the idea comes through. Having 40-50 buttons will require a large amount of triggers, but this seems like a project that can benefit from a lot of copying and pasting.
To speed up development, I'd recommend designing one button how you want it color-wise and shapes and font and such, and then copying and pasting it out to 50. That'll save you from, for instance, needing to delete the unused states for each button individually. Delete them with the first button, and then just duplicate it out.
The same works with triggers too. I created the one trigger that resets the Avocado button at the end of loop 1 if its state is Selected, and then duplicated that trigger and just changed the button references for each one. Much faster than creating each trigger manually.
And then I duplicated the loops too. Once I completed all of the loop 1 layer, I copied and pasted it into loop 2, only needing to change the Set loop1Complete trigger to Set loop2Complete instead.
Let me know if you have any questions! :)
- KaelaSchommer4 months agoCommunity Member
This is really close to what I was hoping to accomplish - I was going to try to download it to see what the settings were of the buttons you created, but I wasn't able to. I do have a few questions:
What are the states you used/created for each button?
What did you set up in terms of the loops?
Did you end up with 2 layers, or just the original slide with 2 loops?
Sorry for all the questions; this is the most complex interaction I've attempted.
- AndrewBlemings-4 months agoCommunity Member
Most definitely!
I made the buttons only have two states: Normal and Visited. I deleted all of the others.
I created a variable called numberChosen, and then added a trigger to the initial button to add 1 to the variable when the state of that button is/becomes Visited. This ensures the trigger only fires once. If we use a "when the button is clicked" trigger, someone would be able to increase the numberChosen variable by repeatedly clicking one button, breaking the interaction.
Then that button can be copied and pasted out as many times as you need it, and the trigger will duplicate with it.
In addition to the button triggers, my base layer also contains "listeners" that trigger the loop layers to appear:
Each of my loop layers resets the numberChosen variable to zero, sets its loopComplete variable to true (so the above triggers can choose the right loop), and then has a trigger for each button that either resets it or hides it:
You'll need 50 or so triggers similar to the one immediately above, but they'll be the same across all layers. This is why, if I were you, I'd nail down one entire loop-layer first before working on any subsequent layers. Once you've got one layer complete, you can just copy and paste it.
Don't let my use of the word loop confuse you either. I just mean layer:
I'm calling it a loop because I imagine the learner completing the Intro Slide, hopping "up" to the first layer, running through it, and then looping back to the base intro slide. Then they complete that new version of the intro slide, jump up to the second layer, run through that, and then loop back down to the base slide. In the course you described, learners would do it a third time too.
Related Content
- 2 months ago
- 1 year ago