中国网站美工网!网页设计者的天堂!
本站特色:HTML网页模版下载    
  您的位置:

首页 >> 网页特效 >> 测试搜索 >> 正文

相关信息

不错的页面搜索脚本
在跳出的对话框中输入关键字然后
较为简单的搜索器
这个脚本将查询的结果显示在了文
再一个不错的搜索脚本
若干道试题,自动给出成绩,并MA
同样是搜索脚本,好像这个界面好
又一不错的搜索引擎...
健康值测试
超级酷搜索引擎
测试网站进入速度很实用
测试网页的链接速度
一个很普通的综合搜索引擎,你也可
这个用来做调查很好
在选题的同时跳出对话框提示
一个选题,完成后给出结论
问卷调查脚本
这是EQ测试题 (也可以用来测试做
搜索引擎登记脚本
在你的网页上加上多个搜索引擎的

加减乘除的运算测试

加减乘除的运算测试


来源: 不详 | 时间: 2006-1-15 18:22:17 | 人气:

 

加减乘除的运算测试

要完成此效果需要两个步骤

第一步:把如下代码加入到<head>区域中

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
correct=0;
wrong=0;

function random(maxValue) {
day= new Date();
hour= day.getHours();
min=day.getMinutes();
sec=day.getSeconds();
mili=day.getTime()
return(((hour*3600)+(min*60)+(sec)+mili) % maxValue);
}
function ranom(maxValue) {
day= new Date();
mil=day.getTime();
return((mil) % maxValue);
}

function add() {
if(document.quizform.arithmetic[0].checked)
maxValue=10;
else {
if(document.quizform.arithmetic[1].checked)
maxValue=30;
else {
maxValue=60;
   }
}
numA=random(maxValue);
numB=ranom(maxValue);
numC=numA + numB;
Answer=window.prompt(  numA + "+"  + numB +  " = ", "");
ans();
}
function subtract() {
if(document.quizform.arithmetic[0].checked)
maxValue=10;
else
{if(document.quizform.arithmetic[1].checked)
maxValue=30;
else {
maxValue=60
   }
}
numA=random(maxValue);
numB=ranom(maxValue);
numC=numA - numB;
Answer=window.prompt(  numA + "-"  + numB+  " = ", 0);
ans()
}
function divide() {
if(document.quizform.arithmetic[0].checked)
maxValue=10;
else {
if(document.quizform.arithmetic[1].checked)
maxValue=30;
else {
maxValue=60
   }
}
numA=random(maxValue)+1;
numB=ranom(maxValue)+1;
numC=numA / numB;
numC=Math.round(numC)
window.alert("Please round your answer off:\n"
+".5 or higher rounds one number up\n"
+".4 or lower rounds one number down");
Answer=window.prompt(  numA + "/"  + numB +  " = ", 0);
ans()
}
function multiply() {
if(document.quizform.arithmetic[0].checked)
maxValue=10;
else {
if(document.quizform.arithmetic[1].checked)
maxValue=30;
else {
maxValue=60
   }
}
numA=random(maxValue);
numB=ranom(maxValue);
numC=numA * numB;
Answer=window.prompt(  numA + "*"  + numB +  " = ", 0);
ans();
}
function check() {
if ((correct+wrong) != 0) {
score = "" + ((correct / (correct + wrong)) * 100);
score = score.substring(0,4) + "%";
alert("你的答题正确率是:  " + score + "\n"
+ correct + " 次答对\n"
+ wrong + " 次答错")
}
else alert("你还未完成任一习题.");
}
function ans() {
if (Answer == numC) {
correct++;
msg = "恭喜, 你回答正确.";
}
else {
wrong++;
msg = "回答错误!  " + Answer + " 这个答案不对.\n\n"
+ "正确答案应该是 " +numC + ".";
   }
score = "" + ((correct / (correct + wrong)) * 100);
score = score.substring(0,4) + "%";
alert(msg + "\n\n你的正确率:  " + score + "\n"
+ correct + " 次答对\n"
+ wrong + " 次答错")
}
//  End -->
</script>


第二步:把如下代码加入到<body>区域中

<center>
<form name=quizform>
    <input type=button value="加法运算" onClick="add()">
    <input type=button value="减法运算" onClick="subtract()">
    <input type=button value="乘法运算" onClick="multiply()">
    <input type=button value="除法运算" onClick="divide()">
<br>
<br>
<input type="radio" name="arithmetic">
    低级难度
    <input type="radio" name="arithmetic" checked>

本新闻共2页,当前在第1页  1  2  

 
  上一篇:在选题的同时跳出对话框提示  下一篇:这个用来做调查很好
Copyright © 2005 - 2006 WEB600.Net,All Rights Reserved
业务联系 QQ 站长:106324307 美工:270348300 程序:63888546
E-mail: 3235183@163.com MSN: fuqiyangru@hotmail.com
中国网站美工网--网页设计者的天堂! 陕ICP备06005517号
本站资源来自互联网 如果侵犯您的权利 请通知我们 我们会尽快删除