?? paper_add.asp
字號:
<!--#include file="db.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>在線考試系統</title>
<script language="javascript">
function checktotal(){
var myform=document.firstform;
var a=myform.singlecount.value;
var b=myform.singleper.value;
var c=myform.multicount.value;
var d=myform.multiper.value;
var e=myform.judgecount.value;
var f=myform.judgeper.value;
var i=myform.totalper.value;
var j=a*b+c*d+e*f;
if (j!=i){
document.all.tishi.innerText=" 當前卷面總分:"+ j +",卷面總分與設定的不相符,請修改卷面總分或者調整題型分布和分值分布!";
}
else
document.all.tishi.innerText=" 當前卷面總分:"+ j;
}
function submitit(){
var myform;
myform=document.firstform;
if (myform.subject.value==""){
alert("請選擇考試科目!")
myform.subject.focus();
return false;
}
else
return true;
if (j!=i){
alert("設定的總分和卷面總分不相符,請修改卷面總分或者調整題型分布和分值分布!");
return false;
}
else
return true;
}
</script>
<link href="../Style.css" rel="stylesheet" type="text/css">
</head>
<body onload="checktotal();">
<table border="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber2" height="25">
<tr>
<td width="100%">當前位置:在線考試系統 -> 生成試卷
<hr></td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber3">
<tr>
<td width="80"> </td>
<td> </td>
</tr>
</table>
<table height="98" border="0" cellpadding="5" cellspacing="1" bgcolor="#5A8BCE" id="AutoNumber1" style="border-collapse: collapse">
<form method="POST" action="paper_save.asp" name="firstform" onsubmit="return submitit();">
<tr bgcolor="#E6F7FF" height="30">
<td colspan="4" style="font-size: 9pt; color: #000000">
<p align="center"><font size="3"><b>試卷基本信息</b></font></td>
</tr>
<tr height="20">
<td width="128" style="font-size: 9pt; color: #000000" bgcolor="#EFEFEF">
<p align="center"><b>選擇科目</b></td>
<td width="855" colspan="3" bgcolor="#FFFFFF" style="font-size: 9pt; color: #000000">
<select size="1" name="subject">
<option selected>--選擇科目--</option>
<% sql="select * from subject"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,3,2
do while not rs.eof %>
<option value="<%=rs("subject")%>"><%=rs("subject")%></option>
<% rs.movenext
loop
rs.close %></select></td>
</tr>
<tr bgcolor="#E6F7FF" height="20">
<td colspan="4" style="font-size: 9pt; color: #000000">
<p align="center"><b>試卷信息</b></td>
</tr>
<tr height="20">
<td width="128" style="font-size: 9pt; color: #000000" align="center" bgcolor="#EFEFEF">
<b>卷面總分(<font color="#FF0000">分</font>)</b></td>
<td bgcolor="#FFFFFF" style="font-size: 9pt; color: #000000">
<p align="center">
<input type="text" name="totalper" size="18" class="inputnormal" onkeyup="if(isNaN(this.value)) this.value='10';" onblur="this.className='inputnormal'" onfocus="this.className='inputedit';this.select()" value="100"></td>
<td colspan="2" bgcolor="#FFFFFF" id="tishi" style="font-size: 9pt; color: #000000"> </td>
</tr>
<tr bgcolor="#E6F7FF" height="20">
<td width="128" style="font-size: 9pt; color: #000000" align="center"> </td>
<td style="font-size: 9pt; color: #000000">
<p align="center"><b>單選題</b></td>
<td style="font-size: 9pt; color: #000000">
<p align="center"><b>多選題</b></td>
<td style="font-size: 9pt; color: #000000">
<p align="center"><b>判斷題</b></td>
</tr>
<tr height="20">
<td width="128" style="font-size: 9pt; color: #000000" align="center" bgcolor="#EFEFEF">
<b>題型分布(<font color="#FF0000">個</font>)</b></td>
<td width="195" bgcolor="#FFFFFF" style="font-size: 9pt; color: #000000">
<p align="center">
<input type="text" name="singlecount" size="18" class="inputnormal" onkeyup="if(isNaN(this.value)) this.value='10';" onblur="this.className='inputnormal';checktotal();" onfocus="this.className='inputedit';this.select()" value="10"></td>
<td width="330" bgcolor="#FFFFFF" style="font-size: 9pt; color: #000000">
<p align="center">
<input type="text" name="multicount" size="18" class="inputnormal" onkeyup="if(isNaN(this.value)) this.value='15';" onblur="this.className='inputnormal';checktotal();" onfocus="this.className='inputedit';this.select()" value="15"></td>
<td width="328" bgcolor="#FFFFFF" style="font-size: 9pt; color: #000000">
<p align="center">
<input type="text" name="judgecount" size="18" class="inputnormal" onkeyup="if(isNaN(this.value)) this.value='10';" onblur="this.className='inputnormal';checktotal();" onfocus="this.className='inputedit';this.select()" value="10"></td>
</tr>
<tr height="20">
<td width="128" style="font-size: 9pt; color: #000000" align="center" bgcolor="#EFEFEF">
<b>分值分布(<font color="#FF0000">分</font>)</b></td>
<td width="195" bgcolor="#FFFFFF" style="font-size: 9pt; color: #000000">
<p align="center">
<input name="singleper" size="18" class="inputnormal" onkeyup="if(isNaN(this.value)) this.value='2';" onblur="this.className='inputnormal';checktotal();" onfocus="this.className='inputedit';this.select()" value="2"></td>
<td width="330" bgcolor="#FFFFFF" style="font-size: 9pt; color: #000000">
<p align="center">
<input type="text" name="multiper" size="18" class="inputnormal" onkeyup="if(isNaN(this.value)) this.value='4';" onblur="this.className='inputnormal';checktotal();" onfocus="this.className='inputedit';this.select()" value="4"></td>
<td width="328" bgcolor="#FFFFFF" style="font-size: 9pt; color: #000000">
<p align="center">
<input type="text" name="judgeper" size="18" class="inputnormal" onkeyup="if(isNaN(this.value)) this.value='2';" onblur="this.className='inputnormal';checktotal();" onfocus="this.className='inputedit';this.select()" value="2"></td>
</tr>
<tr bgcolor="#E6F7FF" height="20">
<td style="font-size: 9pt; color: #000000" align="center" colspan="4">
<b>考試時間設定</b></td>
</tr>
<tr height="20">
<td width="128" style="font-size: 9pt; color: #000000" align="center" bgcolor="#EFEFEF">
<b>考試時間(<font color="#FF0000">小時</font>)</b></td>
<td width="855" colspan="3" bgcolor="#FFFFFF" style="font-size: 9pt; color: #000000">
<p align="center">
<input type="text" name="testtime" size="18" class="inputnormal" onkeyup="if(isNaN(this.value)) this.value='2';" onblur="this.className='inputnormal'" onfocus="this.className='inputedit';this.select()" value="2"></td>
</tr>
<tr height="20">
<td width="128" style="font-size: 9pt; color: #000000" align="center" bgcolor="#EFEFEF">
<b>有效期</b></td>
<td width="855" colspan="3" bgcolor="#FFFFFF" style="font-size: 9pt; color: #000000">
<p align="center">
<input type="text" name="starttime" size="18" class="inputnormal" onblur="javascript:this.className='inputnormal';vbscript:checkstarttime()" onfocus="this.className='inputedit';this.select()" value="<%=date()%>">—<input type="text" name="endtime" size="18" class="inputnormal" onblur="this.className='inputnormal'" onfocus="this.className='inputedit';this.select()" value="<%=date()%>"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="100%" colspan="5">
<p align="right">
<input type="submit" value="提交" name="B1" class="smallInput"></td>
</tr>
</form>
</table>
<script language="vbscript" id="clientEventHandlersVBS">
function checkstarttime()
if isDate(firstform.starttime.value)=false then
msgbox "非法的開始日期格式!"
firstform.starttime.focus
elseif firstform.starttime.value > firstform.endtime.value then
msgbox "開始日期不能大于結束日期!"
firstform.starttime.focus
end if
end function
function checkendtime()
if isDate(firstform.endtime.value)=false then
msgbox "非法的開始日期格式!"
firstform.endtime.focus
elseif firstform.starttime.value > firstform.endtime.value then
msgbox "開始日期不能大于結束日期!"
firstform.endtime.focus
end if
end function
</script>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -