I was playing around with some of the "Random Number" generator projects recently posted and wondered if there was a way to remove numbers previously generated, based on certain conditions, so that they would not appear again. As it turns out, you can do this fairly simply with JavaScript. The key is to use an array and then create a new array from it after filtering out zero values. You then generate a random number from the remaining values.
I used this concept to create a trivia quiz that 1st, randomly selects from 5 categories and then, displays a random question from that category. If you miss a question, it will appear again. If you get a question right, it is removed from the available options. Once all the questions in a category have been answered correctly, the category will no longer be selected.
Here is the published file:
http://articulate-heroes-authoring.s3.amazonaws.com/Examples/Storyline/SL2/TriviaGameArray/publish/story_html5.htmlThe .story file can be found in my post here:
https://community.articulate.com/discussions/building-better-courses/trivia-game-using-variables-and-javascript-to-remove-answered-questions-from-the-deck