📄 exam.asp
字号:
<!--#include file="top.asp"-->
<%
Call HeadHTML
Call HeadJS
Call NormalTOP
%>
<TABLE width=623 height=70% border=0 align="center" cellPadding=0 cellSpacing=0 bgcolor="#FFFFFF">
<TR>
<TD width="623" height="13" valign=top> </TD>
</TR>
<TR>
<TD height="30" valign=top><div align="center"><img src=image/exam.gif width="579" height="30"></div></TD>
</TR>
<TR>
<TD height="24" valign=top> </TD>
</TR>
<TR>
<TD height="344" valign=top>
<script language="JavaScript">
var Total_Question = 4 // 修改这里与题目数量一致
var msg = ""
// 正确答案
var Solution = new Array(Total_Question)
Solution[0] = "WAV"
Solution[1] = "65536级"
Solution[2] = "20uPa"
Solution[3] = "RM"
//
function GetSelectedButton(ButtonGroup)
{
for (var x=0; x < ButtonGroup.length; x++)
if (ButtonGroup[x].checked) return x
return 0
}
function ReportScore(correct)
{
var SecWin =
window.open("","scorewin","scrollbars,width=300,height=220")
var MustHave1 = "<HTML><HEAD><TITLE>测验成绩报告</TITLE></HEAD><BODY>"
var Percent = "<H2>测验成绩 : "+Math.round(correct/Total_Question*100)
+ "</H2><HR>"
lastscore=Math.round(correct/Total_Question*100)
if (lastscore == "100"){
msg = MustHave1 +Percent + "<font color='red'>恭喜,全部答对了!</font><p>" + msg + "<input type='button' value='close' onclick=javascript:window.close()></BODY></HTML>"}
else {
msg = MustHave1 +Percent + "<font color='red'>正确答案:</font><p>" + msg + "<input type='button' value='close' onclick=javascript:window.close()></BODY></HTML>"
}
SecWin.document.write(msg)
msg = "" //清空msg
}
function Grade()
{
var correct = 0
var wrong = 0
for (number=0; number < Total_Question; number++)
{
var form = document.forms[number] // Question #
var i = GetSelectedButton(form.q1)
if (form.q1[i].value == "1")
{ correct++ }
else
{ wrong++
msg += "Question "+(number+1)+"."
+Solution[number]+"<BR>"
}
}
ReportScore(correct)
}
</script>
<table width="579" border="0" align="center" bgcolor=#FFFFFF>
<tr>
<td>
<form>
<p>本练习采用的是JAVE脚本,原理如源码,下面是三道范例。</p>
<p>三个非常简单的问题:</p>
<p>
(1)音质最好的数字音频格式为:__________
<br>
<input type="radio" name="q1" value="0" checked>
MP3
<input type="radio" name="q1" value="1">
WAV
<input type="radio" name="q1" value="0">
WMA
<br>
<br> </form>
<form>
(2)十六位A/D转换器可把采用样信号分为:__________
<br>
<input type="radio" name="q1" value="0" checked>
16级
<input type="radio" name="q1" value="1">
65536级
<input type="radio" name="q1" value="0">
256级
<input type="radio" name="q1" value="0">
32级<br>
<Br> </form>
<form>
(3)人耳能听到的最低声压:__________
<br>
<input type="radio" name="q1" value="0" checked>
30uPa
<input type="radio" name="q1" value="0">
10uPa
<input type="radio" name="q1" value="1">
20
uPa<br>
<Br> </form>
<form>
(4)网络上支持实时传输的视频格式为:__________
<br>
<input type="radio" name="q1" value="0" checked>
MPEG
<input type="radio" name="q1" value="1">
RM
<input type="radio" name="q1" value="0">
AVI
<br>
<Br> </form>
<form>
<div align="center">
<input type="button" name="Submit" value="看看成绩"
onClick="Grade()" class="pt9">
</div>
</form>
</td>
</tr>
</table>
</TD>
</TR>
</TABLE>
<!------------------------------------------------Main Over--------------------------------------------->
<%
Call FootHTML
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -