⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 admincreatepaper1.asp

📁 在根目录下存放着系统登陆以及实现用户功能的网页文件
💻 ASP
字号:
<!--#include file="conn.inc"-->
<html>

<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<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 rel="stylesheet" type="text/css" href="css.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%">当前位置:<a href="news.asp">系统管理</a> &gt; 生成试卷</td>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber3">
  <tr>
    <td width="80"><img border="0" src="images/1.jpg" width="80" height="30"></td>
    <td> </td>
  </tr>
</table>
<table border="1" cellspacing="1" style="border-collapse: collapse" id="AutoNumber1" height="98" bordercolor="#C0C0C0" cellpadding="0">
  <form method="POST" action="admincreatepaper2.asp" name="firstform" onsubmit="return submitit();">
    <tr height="30">
      <td style="font-size: 9pt; color: #000000" colspan="4" bgcolor="#E1E1E1">
      <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" style="font-size: 9pt; color: #000000">
      <select size="1" name="subject">
      <option selected>--选择科目--</option>
      <% sql="select * from exam_subject"
      set rs=server.createobject("adodb.recordset")
      rs.open sql,conn,3,2
      do while not rs.eof %>
      <option value="<%=rs("exam_subject")%>"><%=rs("exam_subject")%></option>
      <% rs.movenext
      loop
      rs.close %></select></td>
    </tr>
    <tr height="20">
      <td colspan="4" style="font-size: 9pt; color: #000000" bgcolor="#E1E1E1">
      <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 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 style="font-size: 9pt; color: #000000" colspan="2" id="tishi"> </td>
    </tr>
    <tr height="20">
      <td width="128" style="font-size: 9pt; color: #000000" align="center" bgcolor="#E1E1E1"> </td>
      <td style="font-size: 9pt; color: #000000" bgcolor="#E1E1E1">
      <p align="center"><b>单选题</b></td>
      <td style="font-size: 9pt; color: #000000" bgcolor="#E1E1E1">
      <p align="center"><b>多选题</b></td>
      <td style="font-size: 9pt; color: #000000" bgcolor="#E1E1E1">
      <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 style="font-size: 9pt; color: #000000" width="195">
      <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 style="font-size: 9pt; color: #000000" width="330">
      <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 style="font-size: 9pt; color: #000000" width="328">
      <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 style="font-size: 9pt; color: #000000" width="195">
      <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 style="font-size: 9pt; color: #000000" width="330">
      <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 style="font-size: 9pt; color: #000000" width="328">
      <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 height="20">
      <td style="font-size: 9pt; color: #000000" align="center" bgcolor="#E1E1E1" 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 style="font-size: 9pt; color: #000000" colspan="3" width="855">
      <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 style="font-size: 9pt; color: #000000" colspan="3" width="855">
      <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>
      <td width="100%" colspan="5">
      <p align="right">
      <input type="submit" value="下一步&gt;&gt;" name="B1" class="s02"></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 + -