www.pudn.com > Xiao5u_Exam_v2011627.rar > submit.asp, change:2011-06-25,size:2807b


<!--#include file="inc/conn.asp"--> 
<!--#include file="inc/config.asp"--> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> 
<title>提交试卷_校无忧科技</title> 
<link href="images/index.css" rel="stylesheet" type="text/css"> 
</head> 
<body> 
<% 
NumC=ChoiceNum 
NumM=MChoiceNum 
NumJ=JudgeNum 
NumB=BlankNum 
NumA=AnswerNum 
sclass =trim(request.form("sclass")) 
sname =trim(request.form("sname")) 
sno =trim(request.form("sno")) 
 
if sclass="" or sname="" or sno="" then 
   response.write "<div id='Notice'><div id='Noticeb'>错误:<p>班级、姓名、学号不能为空!<p><a href='javascript:history.go(-1)'>返回检查</a></div></div>" 
end if 
 
if sclass<>"" and sname<>"" and sno<>"" then 
   Set rs = Server.CreateObject( "ADODB.Recordset" ) 
   sql = "select * from Result where sname='" & sname & "' and sno='" & sno & "' " 
   rs.open sql,conn,1,3 
   if not (rs.bof and rs.eof) then 
      response.write "<div id='Notice'><div id='Noticeb'>错误:<p>请勿重复提交您的试卷!<p><a href='javascript:history.go(-1)'>返回试卷</a></div></div>" 
   else 
      rs.addnew 
      rs("sclass") =sclass 
      rs("sname") =sname 
      rs("sno") =sno 
      '由题目序号逐一添加单选题答案 
      rsChoiceCount=request.form("ChoiceCount") 
      For i = 1 to NumC 
      if i=NumC+1 then      
      Exit For  
      end if 
      rs("Choice"&i) = request.form("Choice"&i) 
      next 
      '添加单选题答案结束 
      '由题目序号逐一添加多选题答案 
      rsMChoiceCount=request.form("MChoiceCount") 
      For j = 1 to NumM 
      if j=NumM+1 then      
      Exit For  
      end if 
      rs("MChoice"&j) = request.form("MChoice"&j) 
      next 
      '添加多选题答案结束 
      '由题目序号逐一添加判断题答案 
      rsJudgeCount=request.form("JudgeCount") 
      For l = 1 to NumJ 
      if l=NumJ+1 then      
      Exit For  
      end if 
      rs("Judge"&l) = request.form("Judge"&l) 
      next 
      '添加判断答案结束 
      '由题目序号逐一添加填空题答案 
      rsBlankCount=request.form("BlankCount") 
      For m = 1 to NumB 
      if m=NumB+1 then      
      Exit For  
      end if 
      rs("Blank"&m) = request.form("Blank"&m) 
      next 
      '添加填空题答案结束 
      '由题目序号逐一添加问答题答案 
      rsAnswerCount=request.form("AnswerCount") 
      For n = 1 to NumA 
      if n=NumA+1 then      
      Exit For  
      end if 
      rs("Answer"&n) = request.form("Answer"&n) 
      next 
      '添加问答题答案结束 
      rs("addip")=request.ServerVariables("REMOTE_ADDR") 
      rs.update 
      rs.close 
      Set rs=nothing 
      response.write"<div id='Notice'><div id='Noticeb'>恭喜:<p>您的试卷提交成功!<p><a href='javascript:window.close()'>关闭窗口</a></div></div>" 
   end if 
end if 
%> 
</body> 
</html>