math.js
// and increment their total points by 1.
and increment their total points by 1.
and increment their total points by 1 .
function answer() {
		if (answer != null) {
			if ($("answer").value == answer) {
				$("result").innerHTML = "You got it right!";
				$("points").innerHTML = parseInt($("points").innerHTML) + 1; 
				answer = null;
			} else {
				$("result").innerHTML = ("Try again. If you're stuck you can generate a new problem")
			}
		}
	}
function answer ( ) { if ( answer != null ) { if ( $ ( "answer" ) . value == answer ) { $ ( "result" ) . innerHTML = "You got it right!" ; $ ( "points" ) . innerHTML = parseInt ( $ ( "points" ) . innerHTML ) + 1 ; answer = null ; } else { $ ( "result" ) . innerHTML = ( "Try again. If you're stuck you can generate a new problem" ) } } }
and increment their total points by 1.
and increment their total points by 1 .
// Prevent user from submitting same correct answer twice