Forum Discussion
JavaScript API
- 2 months ago
For your stated issue, you need to change the value in the third trigger on layer q5 to "Q5" instead of "q5" for Set currentQuestion. That fixes the key response.
Unrelated, but you are also missing a T/F SL variable "Q4Correct".
Another note is that in the second trigger JavaScript, for case 'Q5' you could change event.code to event.key just to be consistent with the other keypress checks. It doesn't change anything as the code and key for Pause are the same, but it makes the code clearer.
For your stated issue, you need to change the value in the third trigger on layer q5 to "Q5" instead of "q5" for Set currentQuestion. That fixes the key response.
Unrelated, but you are also missing a T/F SL variable "Q4Correct".
Another note is that in the second trigger JavaScript, for case 'Q5' you could change event.code to event.key just to be consistent with the other keypress checks. It doesn't change anything as the code and key for Pause are the same, but it makes the code clearer.
That did it! Thanks so much Nathan_Hilliard. You are truly a JavaScript Juggernaut.
Here's the file if anyone ever needs to replicate something like this.
Related Content
- 3 months ago
- 3 years ago