I am currently doing some research into creating a new math game for elementary school children, where divs from 0-9 appear randomly in a container.
The question is asked at the beginning. Something like a multiple of 20. Then the user will need to click on the correct ones, and then they will be counted at the end, and an assessment will be given.
So, at the moment I have a basic structure, divs appear, and you click on them, and this adds the correct answer, which means that at this moment there is no wrong answer.
I want to know what is the best way to determine the correct and incorrect answers. Is there an algorithm that I can use that will determine if the answers are right or wrong, and how would I link it to a div?
<div id="container"> <div id="char1" class="character right1" vaule="1"></div> <div id="char2" class="character right2" vaule="2"></div> <div id="char3" class="character right3" vaule="3"></div> <div id="char4" class="character right4" vaule="4"></div> <div id="char5" class="character right5" vaule="5"></div> <div id="char6" class="character right6" vaule="6"></div> <div id="char7" class="character right7" vaule="7"></div> <div id="char8" class="character right8" vaule="8"></div> <div id="char9" class="character right9" vaule="9"></div> <div id="char9" class="character right0" vaule="0"></div> </div>
incorrect answers will be assigned the class ".wrong", which was added to ".right"
Fiddle: http://jsfiddle.net/SKB3Q/10/
source share