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

📄 checktestpaper.asp

📁 在线考试系统
💻 ASP
字号:
<?xml version="1.0" encoding="gb2312"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!---#include file="conn.asp"--->
<link href="main.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<%
if(request.QueryString("oper")="over") then
'修改分数
Score=request.form("Score")
StuTestPaperId=request.form("StuTestPaperId")
sql="update StuTestPaper set ZhuGuanScore="&Score&" where Id="&StuTestPaperId
conn.execute(sql)
sql="update StuTestPaper set Score=ZhuGuanScore+KeGuanScore,IsCheck='1' where id="&StuTestPaperId
conn.execute(sql)
response.write("<script>window.close();</script>")
response.end()
end if
'从学生简答表中获取指定学生试卷的简答题
StuTestPaperId=request.QueryString("id")
set rst=conn.execute("select IsCheck from StuTestPaper where id="&StuTestPaperId)
if(rst("IsCheck")=1) then
'若是已经阅过的,则返回
response.write("<script>alert('此生试卷为已阅!');window.close();</script>")
end if
JianDaNum=rst("JianDaNum")
set rst=conn.execute("select count(*) as c from StuTestPaperJianDa where StuTestPaperId="&StuTestPaperId)
JianDaCount=rst("c")
if(JianDaCount<=0) then
response.Write("获取考生简答题有误或此次考试无简答,如有问题请联系管理员!"&StuTestPaperId)
response.end()
end if
set rst=conn.execute("select * from StuTestPaperJianDa where StuTestPaperId="&StuTestPaperId)
%>
<script language="javascript">
function SumScore(){
	var n=<%=JianDaCount%>,score,i;
	score=0;
	for(i=1;i<=n;i++){
	score=score+parseInt(document.getElementById("score"+i).value)
	}
	document.form1.score.value=score;
}

</script>
</head>

<body>

<form name="form1" action="CheckTestPaper.asp?oper=over" method="post" onSubmit="javascript:return confirm('确认提交吗?');">
  <table width="663" border="1" align="center" cellpadding="1" cellspacing="1" >
  <INPUT name="StuTestPaperId" type="hidden" value="<%=StuTestPaperId%>" />
    <%
	n=1
	while not rst.eof
	%>
    <tr align="left"> 
      <td colspan="5">问题:&nbsp;&nbsp;&nbsp;<%=rst("Question")%></td>
    </tr>
    <tr align="center"> 
      <td width="67" align="center"> 参考答案:</td>
      <td width="583" colspan="4" align="center"> <TEXTAREA name="question" cols="80" rows="11" class="line" ><%=rst("Answer")%></TEXTAREA> 
      </td>
    </tr>
    <tr align="center"> 
      <td align="center"> 学生答案: <br> &nbsp;&nbsp; &nbsp;&nbsp;</td>
      <td colspan="4" align="center"> <TEXTAREA name="answer" cols="80" rows="11" class="line" ><%=rst("StuAnswer")%></TEXTAREA> 
      </td>
    </tr>
 
    <tr align="center" bgcolor="#CCCCCC"> 
      <td colspan="5">得分: 
        <input name="score<%=n%>" type="text" id="score<%=n%>" value="0" size="5"  onchange="SumScore();"/>
      </td>
    </tr>
	   <%
	rst.movenext
	n=n+1
	wend
	  rst.close()
  conn.close()
  set rst=nothing
  set conn=nothing
	%>
    <tr align="center">
      <td colspan="5">此生简答题总分:
        <input name="score" type="text" id="score" size="5" /></td>
    </tr>
    <tr align="center"> 
      <td colspan="5"> <input type="submit" value="提交" name="B12" onClick="return checkform();"> 
        &nbsp; <input type="reset" value="重置" name="B22"> </td>
    </tr>
  </table>

  </form>
</body>

</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -