<!--
var varA;
var varB;
var varC;
var varD;
var varX;

var NumberCorrect=0;
var NumberIncorrect=0;
var NumberAttempted=0;

function NewProblem() {
varA = eval(Math.floor(Math.random()*20)+"-10");
varB = eval(Math.floor(Math.random()*20)+"-10");
varC = eval(Math.floor(Math.random()*20)+"-10");
varX = eval(Math.floor(Math.random()*20)+"-10");
varD = varX*(varA - varC);

do {
varA = eval(Math.floor(Math.random()*20)+"-10");
varB = eval(Math.floor(Math.random()*20)+"-10");
varC = eval(Math.floor(Math.random()*20)+"-10");
varX = eval(Math.floor(Math.random()*20)+"-10");
varD = eval(eval(varX*(varA - varC)) + eval(varB));
} while ((varA==0 || varB==0 || varC==0 || varD==0 || varX==0) ||
         (varA==varC || varB==varD));

txtProblem.innerHTML = "<p>"+varA+"x + "+varB+" = "+varC+"x + "+varD+"</p>"
//txtProblem.innerHTML += "<p>"+eval(eval(varA)-eval(varC))+"x = "+eval(eval(varD)-eval(varB))+"</p>"
//txtProblem.innerHTML += "<p>x = "+varX+"</p>"
txtAnswer.value="";
txtAnswer.style.backgroundColor='white';
txtAnswer.style.color='black';

btnCheck.disabled=false;

}

function Check(){
NumberAttempted++;
var studentAnswer = eval(txtAnswer.value)
if (studentAnswer==varX) NumberCorrect++;
else { NumberIncorrect++; txtAnswer.style.backgroundColor='red'; txtAnswer.style.color='white'; txtAnswer.value=varX; }

if (NumberAttempted>=10) btnNew.disabled=true;
btnCheck.disabled=true;
txtResults.innerHTML = "<p><b>Correct: </b>"+NumberCorrect+"&nbsp;&nbsp; <b>Incorrect: </b>"+NumberIncorrect+"&nbsp;&nbsp; <b>Number Attempted: </b>"+NumberAttempted+"</p>"

}



-->
