脑筋急转弯 你答对了几个?(需要用IE浏览器)
作者: 王天平
//var problem= new object(11);
var problem1 = 0;
var problem2 = 0;
var problem3 = 0;
var problem4 = 0;
var problem5 = 0;
var problem6 = 0;
var problem7 = 0;
var problem8 = 0;
var problem9 = 0;
var problem10 = 0;
var problem11 = 0;
var TimeRemain = 0;
var TimerID = 0;
function ShowResult()
{
var totalSuccess =
problem1+problem2+problem3+
problem4+problem5+problem6+
problem7+problem8+problem9+
problem10+problem11;
if(TimerID >0)
{
clearInterval(TimerID);
}
if(totalSuccess < 4)
alert("不错,你已经不是很正常了,你答对了"+totalSuccess+"个问题");
else if(totalSuccess < 6)
alert("ok,您还正常,你答对了"+totalSuccess+"个问题");
else if(totalSuccess < 9)
alert("很好,你很聪明的啦,真看不出来,你答对了"+totalSuccess+"个问题");
else
alert("恐怖,您不正常吧,太强了,你答对了"+totalSuccess+"个问题");
}
function DisplayTimeRemain()
{
document.all["TimeContrl"].innerHTML=TimeRemain;
}
function callbackTimeRemain()
{
TimeRemain--;
DisplayTimeRemain();
if(TimeRemain<=0)
{
clearInterval(TimerID);
alert("时间到了,不好意思的啦");
ShowResult();
}
else
{
//--------
}
}
function ResetTime()
{
TimeRemain = 44;
}
function StartTest()
{
ResetTime();
DisplayTimeRemain();
TimerID = setInterval(callbackTimeRemain,1000);
}
function OnLoad()
{
ResetTime();
DisplayTimeRemain();
}