I have a short Q & A system. Just to educate drivers on a specific schools requirements. Pretty basic system. Question comes up, you click on answer and then it show right or wrong and you can click to go to the next question. On all but between the 1st and 2nd questions the next questions answers all display at the same time. I cannot find any differences between questions. Here is a video with the issue.
It works fine, does not affect functionality, but am wondering why it does this or how to fix.
Also the code is the same for every single question card. All that changed is the text and where the correct answer was placed. Of course each element has their own unique element id etc and no conflicts.
Again, it is not a big issue as it all functions fine but just “one of those things”….
It looks like there is a clash going on with your JS.
Probably the hidequestions() is hiding all the questions in the doc clashing with maybe the showquestions() ?
if you change the hidequestions() to this I think it will fix the issue.
var getscenename = document.getElementById(hypeDocument.currentSceneId());
var questionbox = getscenename.getElementsByClassName("ques");
var I;
for (i = 0; i < questionbox.length; i++) {
questionbox[i].style.display = "none";
}
I just uploaded a version with the change I made by adding the 1 to the end of the variable. It now works fine. A good example of not being able to see the forest for the trees.
Non eof you var names are global. They are only local to the individual script executions so having same names will not be an issue in how you have things set up.
The suggested change to hidequestions() , which you made, is making it work.
Yes I know that they are not global on local. So it was strange it make it work but anyway it works now. I am investigating further to find out why a simple change made it work.
Also just to add you can get rid of the js for css display, which is mainly to stop people clicking twice by using the built in keyframe action to do this. I will PM you with this.