jsp打字速度测试 源代码
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
脚本说明:
第一步:将如下代码加到
区域中.textinp{font-family:ms sans serif;font-size:9pt}
.textreadable{font-family:arial;font-size:11pt;font-weight:bold}
a{text-decoration:none}
function yeahok()
{
alert("Copyright of yiming");
}
function restartest()
{
history.go(0);
document.testform.test.value="";
.value="";
document.testform.scnds.value="60";
}
done="no";
function writedown()
{
var name=.value;
if(name.length!=0)
{
correctname=name;
}
else
{
correctname="you";
}
if(done=="yes")
{
your_results=window.open("","","resizable=1;width=400,height=400");
your_results.document.write("
your_results.document.write("
Results for "+correctname+"
");
your_results.document.write("
Percentage Accuracy : "+accuracy+"%
Percentage Inaccuracy : "+inaccuracy+"%
Characters per minute : "+cpm+" cpm
Characters per second : "+cps+" cps
Words
per minute : "+wpm+" wpm
Words per second : "+wps+" wps
Total Speed status : "+status+"
Overall Accuracy : "+accstats+"
NOTE : Characters per minute is important");
}
else
{
alert("You didn't start a test.");
}
}
function graph()
{
var name=.value;
if(name.length!=0)
{
correctname=name;
}
else
{
correctname="you";
}
if(done=="yes")
{
var c=parseInt(accuracy+cps/2);
var a=parseInt(accuracy*100/c);
var b=parseInt(cps*100/c);
your_results=window.open("","","resizable=1;width=400,height=400");
your_results.document.write("
your_results.document.write("
Graph for "+correctname+"
");
your_results.document.write("Accuracy
your_results.document.write("Speed
Note : This will not be very accurate sometimes.");
}
else
{
alert("You didn't start a test.");
}
}