<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Untitled Page</title>
<script type="text/javascript">
window.onload = function () {
document.onmousedown = function () {
if (event.button == 1) {
alert("您好")
}
else if (event.button == 2) {
alert("禁止右键")
}
}
setTimeout(function () {
window.close()
}, 2 * 60 * 1000)
}
</script>
</head>
<body>
</body>
</html>
<!doctype html><html>
<head>
<meta charset="UTF-8">
<title>多项选择题</title>
<style type="text/css">
label{background:#ccffff}
</style>
</head>
<body>
<h1>测试题</h1><hr>
<h2>一、单项选择题</h2>
<div id="dan1">
<p>1.世界上谁最帅?</p>
<p><input type="radio" id="dA1" name="dan1"><label for="dA1">A.李小龙</p>
<p><input type="radio" id="dB1" name="dan1"><label for="dB1">B.李连杰</p>
<p><input type="radio" id="dC1" name="dan1"><label for="dC1">C.陈小春</p>
<p><input type="radio" id="dD1" name="dan1"><label for="dD1">D.刘德华</p>
<input type="button" value="提交答案" onclick="dan1_answer()"><hr>
<span id="d1_tetion"></span>
</div>
<div id="dan2">
<p>2.世界上谁最帅?</p>
<p><input type="radio" id="dA2" name="dan2"><label for="dA2">A.李小龙</p>
<p><input type="radio" id="dB2" name="dan2"><label for="dB2">B.李连杰</p>
<p><input type="radio" id="dC2" name="dan2"><label for="dC2">C.陈小春</p>
<p><input type="radio" id="dD2" name="dan2"><label for="dD2">D.刘德华</p>
<input type="button" value="提交答案" onclick="dan2_answer()"><hr>
<span id="d2_tetion"></span>
</div>
<div id="dan3">
<p>3.世界上谁最帅?</p>
<p><input type="radio" id="dA3" name="dan3"><label for="dA3">A.李小龙</p>
<p><input type="radio" id="dB3" name="dan3"><label for="dB3">B.李连杰</p>
<p><input type="radio" id="dC3" name="dan3"><label for="dC3">C.陈小春</p>
<p><input type="radio" id="dD3" name="dan3"><label for="dD3">D.刘德华</p>
<input type="button" value="提交答案" onclick="dan3_answer()"><hr>
<span id="d3_tetion"></span>
</div>
<div id="dan4">
<p>4.世界上谁最帅?</p>
<p><input type="radio" id="dA4" name="dan4"><label for="dA4">A.李小龙</p>
<p><input type="radio" id="dB4" name="dan4"><label for="dB4">B.李连杰</p>
<p><input type="radio" id="dC4" name="dan4"><label for="dC4">C.陈小春</p>
<p><input type="radio" id="dD4" name="dan4"><label for="dD4">D.刘德华</p>
<input type="button" value="提交答案" onclick="dan4_answer()"><hr>
<span id="d4_tetion"></span>
</div>
<div id="dan5">
<p>5.世界上谁最帅?</p>
<p><input type="radio" id="dA5" name="dan5"><label for="dA5">A.李小龙</p>
<p><input type="radio" id="dB5" name="dan5"><label for="dB5">B.李连杰</p>
<p><input type="radio" id="dC5" name="dan5"><label for="dC5">C.陈小春</p>
<p><input type="radio" id="dD5" name="dan5"><label for="dD5">D.刘德华</p>
<input type="button" value="提交答案" onclick="dan5_answer()"><hr>
<span id="d5_tetion"></span>
</div>
<h2>二、多项选择题</h2>
<div id="box">
<p>1.一栋房子由哪几部分组成?</p>
<p><input type="checkbox" id="A"><label for="A">A.地基与基础,主体结构,屋面工程</label></p>
<p><input type="checkbox" id="B"><label for="B">B.装饰装修、给排水及采暖工程</label></p>
<p><input type="checkbox" id="C"><label for="C">C.空调与通风工程</label></p>
<p><input type="checkbox" id="D"><label for="D">D.智能化建筑工程</label></p>
<p><input type="checkbox" id="E"><label for="E">E.电梯工程、电气工程、节能工程</label></p>
<input type="button" value="提交答案" onclick="answer()"><hr>
<span id="tetion"></span>
</div>
<div id="box2">
<p>2.一栋房子由哪几部分组成?</p>
<p><input type="checkbox" id="A2"><label for="A2">A.地基与基础,主体结构,屋面工程</label></p>
<p><input type="checkbox" id="B2"><label for="B2">B.装饰装修、给排水及采暖工程</label></p>
<p><input type="checkbox" id="C2"><label for="C2">C.空调与通风工程</label></p>
<p><input type="checkbox" id="D2"><label for="D2">D.智能化建筑工程</label></p>
<p><input type="checkbox" id="E2"><label for="E2">E.电梯工程、电气工程、节能工程</label></p>
<input type="button" value="提交答案" onclick="answer2()"><hr>
<span id="tetion2"></span>
</div>
<div id="box3">
<p>3.一栋房子由哪几部分组成?</p>
<p><input type="checkbox" id="A3"><label for="A3">A.地基与基础,主体结构,屋面工程</label></p>
<p><input type="checkbox" id="B3"><label for="B3">B.装饰装修、给排水及采暖工程</label></p>
<p><input type="checkbox" id="C3"><label for="C3">C.空调与通风工程</label></p>
<p><input type="checkbox" id="D3"><label for="D3">D.智能化建筑工程</label></p>
<p><input type="checkbox" id="E3"><label for="E3">E.电梯工程、电气工程、节能工程</label></p>
<input type="button" value="提交答案" onclick="answer3()"><hr>
<span id="tetion3"></span>
</div>
<div id="box4">
<p>4.一栋房子由哪几部分组成?</p>
<p><input type="checkbox" id="A4"><label for="A4">A.地基与基础,主体结构,屋面工程</label></p>
<p><input type="checkbox" id="B4"><label for="B4">B.装饰装修、给排水及采暖工程</label></p>
<p><input type="checkbox" id="C4"><label for="C4">C.空调与通风工程</label></p>
<p><input type="checkbox" id="D4"><label for="D4">D.智能化建筑工程</label></p>
<p><input type="checkbox" id="E4"><label for="E4">E.电梯工程、电气工程、节能工程</label></p>
<input type="button" value="提交答案" onclick="answer4()"><hr>
<span id="tetion4"></span>
</div>
<div id="box5">
<p>5.一栋房子由哪几部分组成?</p>
<p><input type="checkbox" id="A5"><label for="A5">A.地基与基础,主体结构,屋面工程</label></p>
<p><input type="checkbox" id="B5"><label for="B5">B.装饰装修、给排水及采暖工程</label></p>
<p><input type="checkbox" id="C5"><label for="C5">C.空调与通风工程</label></p>
<p><input type="checkbox" id="D5"><label for="D5">D.智能化建筑工程</label></p>
<p><input type="checkbox" id="E5"><label for="E5">E.电梯工程、电气工程、节能工程</label></p>
<input type="button" value="提交答案" onclick="answer5()"><hr>
<span id="tetion5"></span>
</div>
<script type="text/javascript">
function dan1_answer(){dan_answer("dA1","dB1","dC1","dD1","dan1","d1_tetion","A")}
function dan2_answer(){dan_answer("dA2","dB2","dC2","dD2","dan2","d2_tetion","B")}
function dan3_answer(){dan_answer("dA3","dB3","dC3","dD3","dan3","d3_tetion","B")}
function dan4_answer(){dan_answer("dA4","dB4","dC4","dD4","dan4","d4_tetion","C")}
function dan5_answer(){dan_answer("dA5","dB5","dC5","dD5","dan5","d5_tetion","C")}
function dan_answer(da,db,dc,dd,dan,d_tetion,pd){
var A=document.getElementById(da).checked//alert(A)
var B=document.getElementById(db).checked
var C=document.getElementById(dc).checked
var D=document.getElementById(dd).checked
var d_Rightanswer=pd
var passW=saot(d_Rightanswer)//alert(passW)
var youW=saot([A,B,C,D])//alert(youW)
var youD=transABCDE([A,B,C,D])//你的答案
if(passW==youW){
document.getElementById(dan).innerHTML+="<style>#"+d_tetion+"{color:yellowbackground:red}</style>"
document.getElementById(d_tetion).innerHTML="你的答案:"+youD+"<br>---恭喜您,答对了!"}else{
document.getElementById(dan).innerHTML+="<style>#"+d_tetion+"{color:redbackground:#ccc}</style>"
document.getElementById(d_tetion).innerHTML="你的答案:"+youD+"<br>---回答错误!正确答案是:"+d_Rightanswer
}
}
function answer(){answerALL("A","B","C","D","E","box","tetion","ABCDE")}
function answer2(){answerALL("A2","B2","C2","D2","E2","box2","tetion2","ABCDE")}
function answer3(){answerALL("A3","B3","C3","D3","E3","box3","tetion3","ABCDE")}
function answer4(){answerALL("A4","B4","C4","D4","E4","box4","tetion4","ABCDE")}
function answer5(){answerALL("A5","B5","C5","D5","E5","box5","tetion5","ABCDE")}
function answerALL(a,b,c,d,e,box,tetion,RT){
var A=document.getElementById(a).checked
var B=document.getElementById(b).checked
var C=document.getElementById(c).checked
var D=document.getElementById(d).checked
var E=document.getElementById(e).checked
var arr=[A,B,C,D,E]
var youD=transABCDE(arr)//你的答案
var numA=saot(arr)
var Rightanswer=RT//将正确答案填在这里
var numB=saot(Rightanswer)
if(numA==numB){
document.getElementById(box).innerHTML+="<style>#"+tetion+"{color:yellowbackground:red}</style>"
document.getElementById(tetion).innerHTML="你的答案:"+youD+"<br>---恭喜您,答对了!"
}else{
document.getElementById(box).innerHTML+="<style>#"+tetion+"{color:redbackground:#ccc}</style>"
document.getElementById(tetion).innerHTML="你的答案:"+youD+"<br>---回答错误!正确答案是:"+Rightanswer
}
}
function transAtoN(answer){//将正确答案字母组成的字符串转换成一串0和1的数字
var arr=answer
var c=arr.split("")//分割字符串变成数组
//alert(c)
var num=0
for(var i in c){
if(c[i]=="A" || c[i]=="a"){num+=10000}
if(c[i]=="B" || c[i]=="b"){num+=1000}
if(c[i]=="C" || c[i]=="c"){num+=100}
if(c[i]=="D" || c[i]=="d"){num+=10}
if(c[i]=="E" || c[i]=="e"){num+=1}
}
return num
}
function transBER(arr){//将在多项选择中获得的选择布尔值转换成一串0和1的数字
var num=0
if(arr[0]){num+=10000}
if(arr[1]){num+=1000}
if(arr[2]){num+=100}
if(arr[3]){num+=10}
if(arr[4]){num+=1}
return num
}
function saot(t){//合并布尔值和字符串转成数字,自动选择适应程序!
if(typeof t=="string"){
var geta=transAtoN(t)
return geta
}else{
var getb=transBER(t)
return getb
}
}
function transABCDE(arr){
var chara=""
if(arr[0]){chara+="A"}
if(arr[1]){chara+="B"}
if(arr[2]){chara+="C"}
if(arr[3]){chara+="D"}
if(arr[4]){chara+="E"}
return chara
}
//alert(transABCDE([true,false,true]))
</script>
</body>
</html>
<!DOCTYPE iframe PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "<html>
<head>
<style type="text/css">
ul { list-style:none
}
</style>
</head>
<body>
<!-- 计时按钮 -->
<div align="center" id="" class="">
<input type="button" value="开始答题"/>
<input type="text" id="">
</div>
<!-- 1~3题 单选 -->
<div id="" class="">
<ul>
<li>
1、吉泽明步漂亮不漂亮?
</li>
<li>&nbsp&nbsp&nbsp&nbsp
A. 好<input type="radio" name="timu1" value="A">&nbsp
B. 不好<input type="radio" name="timu1" value="B">&nbsp
C. 都行<input type="radio" name="timu1" value="C">&nbsp
D. 嗯<input type="radio" name="timu1" value="D">
</li>
</ul>
<ul>
<li>
2、吉泽明步漂亮不漂亮?
</li>
<li>&nbsp&nbsp&nbsp&nbsp
A. 好<input type="radio" name="timu2" value="A">&nbsp
B. 不好<input type="radio" name="timu2" value="B">&nbsp
C. 都行<input type="radio" name="timu2" value="C">&nbsp
D. 嗯<input type="radio" name="timu2" value="D">
</li>
</ul>
<ul>
<li>
3、吉泽明步漂亮不漂亮?
</li>
<li>&nbsp&nbsp&nbsp&nbsp
A. 好<input type="radio" name="timu3" value="A">&nbsp
B. 不好<input type="radio" name="timu3" value="B">&nbsp
C. 都行<input type="radio" name="timu3" value="C">&nbsp
D. 嗯<input type="radio" name="timu3" value="D">
</li>
</ul>
</div>
<!-- 4~6题 多选 -->
<div>
<ul>
<li>
4、以下明星你认识几个?(多选题)
</li>
<li>&nbsp&nbsp&nbsp&nbsp
A. 小泽玛利亚<input type="checkbox" name="timu4" value="A">&nbsp
B. 苍井空<input type="checkbox" name="timu4" value="B">&nbsp
C. 泷泽萝拉<input type="checkbox" name="timu4" value="C">&nbsp
D. 天海翼<input type="checkbox" name="timu4" value="D">&nbsp
</li>
</ul>
<ul>
<li>
5、以下明星你认识几个?(多选题)
</li>
<li>&nbsp&nbsp&nbsp&nbsp
A. 小泽玛利亚<input type="checkbox" name="timu5" value="A">&nbsp
B. 苍井空<input type="checkbox" name="timu5" value="B">&nbsp
C. 泷泽萝拉<input type="checkbox" name="timu5" value="C">&nbsp
D. 天海翼<input type="checkbox" name="timu5" value="D">&nbsp
</li>
</ul>
<ul>
<li>
6、以下明星你认识几个?(多选题)
</li>
<li>&nbsp&nbsp&nbsp&nbsp
A. 小泽玛利亚<input type="checkbox" name="timu6" value="A">&nbsp
B. 苍井空<input type="checkbox" name="timu6" value="B">&nbsp
C. 泷泽萝拉<input type="checkbox" name="timu6" value="C">&nbsp
D. 天海翼<input type="checkbox" name="timu6" value="D">&nbsp
</li>
</ul>
</div>
<!-- 7~9题 填空 -->
<div>
<ul >
<li>
7、你最喜欢的明星是哪些?<INPUT TYPE="text" id="timu7" style="width:300border:noneborder-bottom:1px solid #005background:transparent">
</li>
<li>
8、你最喜欢的明星是哪些?<INPUT TYPE="text" id="timu8" style="width:300border:noneborder-bottom:1px solid #005background:transparent">
</li>
<li>
9、你最喜欢的明星是哪些?<INPUT TYPE="text" id="timu9" style="width:300border:noneborder-bottom:1px solid #005background:transparent">
</li>
</ul>
</div>
<!-- 10题 简答 一题12分,超过10个字给三分,有三个符合答案的关键词给12分 -->
<div>
<ul>
<li>
10、你对以上明星的评价如何
</li>
<li>
<textarea id="timu10" style="resize:nonewidth:500pxheight:100px" ></textarea>
</li>
</ul>
</div>
<!-- 提交按钮和自动判分对话框 -->
<div align="center">
<input type="button" value="提交" onclick="sub()"/>
<script type="text/javascript">
function sub(){
var key = new Array()
key.push("")
var grade = 0
key.push("A")
key.push("B")
key.push("D")
var timu1 = document.getElementsByName("timu1")
for(var i=0 i<timu1.length i ++){
if(timu1[i].checked){
timu1 = timu1[i].value
}
}
if(timu1==key[1]){
grade = grade+2
}
alert(grade)
}
</script>
</div>
</body>
</html>
剩下的都差不多,不懂再追
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)