www.gusucode.com > ASP毕业设计在线考试管理系统源码 > ASP毕业设计在线考试管理系统源码\code\admin\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%">当前位置:在线考试系统 -&gt; 生成试卷
      <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">&nbsp;</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>