I created this quiz game based on a quiz game that I found here... but when I try to add (or remove) a question it stops working. I added a 5th question and then I edited the "check ansers ()" but then when I click on the 5th "submit" button, I get no reaction. Heres the orignal (CF-teeth-QUIZ) which works properly and my edit (CF-teeth-QUIZ-mod)
You've modified the checkAnswer() function correctly, but the missing part is needing to associate your new scene with the various submitBtn5, a5, b5, and c5 elements IDs it references. To fix this, go to your "5" scene, and on the Rectangle element that has the checkboxes/submit, choose Edit > Edit Element's Inner HTML or click the pencil button. When the code pops up, change the element names or copy/paste this end result:
Thank you Jonathan! That worked. But now for some reason, the polygons (on scenes "5th right" and "5th wrong") won't respond when clicked. Do you know why? CF-teeth-QUIZ-mod3.hype.zip (692.0 KB)
Basically this means transition to the scene that has the name of the value for hypeDocument.page. This is a number, like 1, 2, 3, 4, 5, 6, etc.
There's a variable that keeps track of the hypeDocument.page. This gets incremented by the lines in the checkAnswer() function that look like hypeDocument.page++. (++ means add one to the value).
The issue is that you added a page, page 5. The script goes to that, and you have your additional question. However once you answer it, the page is incremented to 6. But right now there's no scene with the name "6". There's two with the name of "5" which includes the final scene.
So to fix this, you need to rename that final scene from "5" to "6". Then it will work.