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

📄 strk.asp

📁 这是用asp做的一个网上考试题库系统
💻 ASP
字号:
<!--#include file="../db.asp"-->
 
<%
  objConn.Open strConnection
  Set objRS = Server.CreateObject ("ADODB.Recordset")
  Set rs = Server.CreateObject ("ADODB.Recordset")

  Set objRS.ActiveConnection = objConn
   dim nextn 
 objRS.Open "select * from ItemTable",objConn,2,3
 objRS.AddNew 
  objRS("CourseID")=Session("course_id")
  objRS("STNR")=Session("zwnr")
  objRS("STWJ")=Session("zwwj")
  objRS("DAAN")=Session("answer")
  objRS("DAZJ")=Session("dasj")
 select Case Session("tx")
 Case 1  
   objRS("xxA")=Session("stzwA")
   objRS("xxAwj")=Session("stwjA")
   objRS("xxB")=Session("stzwB")
   objRS("xxBwj")=Session("stwjB")
   objRS("xxC")=Session("stzwC")
   objRS("xxCwj")=Session("stwjC")
   objRS("xxD")=Session("stzwD")
   objRS("xxDwj")=Session("stwjD")
   objRS("xxE")=Session("stzwE")
   objRS("xxEwj")=Session("stwjE")
   nextn="下一道单项选择题"
  
 Case 2
   objRS("xxA")=Session("stzwA")
   objRS("xxAwj")=Session("stwjA")
   objRS("xxB")=Session("stzwB")
   objRS("xxBwj")=Session("stwjB")
   objRS("xxC")=Session("stzwC")
   objRS("xxCwj")=Session("stwjC")
   objRS("xxD")=Session("stzwD")
   objRS("xxDwj")=Session("stwjD")
   objRS("xxE")=Session("stzwE")
   objRS("xxEwj")=Session("stwjE")
   objRS("xxE")=Session("stzwF")
   objRS("xxFwj")=Session("stwjF")

 nextn="下一道多项选择题"
  
 Case 3
     
    nextn="下一道填空题"
    
 Case 4
   
    nextn="下一道判断题"
    
 Case 5
    
    nextn="下一道分析题"
   
end select
 

objRS("Itemtype")=Session("tx")
objRS("Difficulty")=Session("nd")
objRS("Division")=Session("qfd")
objRS("CognizeClass")=Session("rzhfl")
objRS("SuggestScore")=Session("jyfsh")
objRS("SuggestTime")=Session("jyshj")
objRS("WriteSubjectID")=Session("chtr")
objRS("WriteSubjectTime")=Session("chtrq")
objRS("WriteSubjectTime")=Session("chtrq")
objRS("ExamineID")=Session("shdr")
objRS("ExamineTime")=Session("shdrq")

objRS.Update
objRS.Close
 
 strQuery="SELECT MAX(ItemID) AS NowID FROM ItemTable"
objRS.Open strQuery,objConn

  id=objRS("NowID") 
  objRS.Close
 
 if request.QueryString("Added")=1 then
   PaperItemID=Session("PaperItemArray")
    FF=1
	 
    Do while FF<=50 and PaperItemID(Session("tx"),FF)<>-1
	    FF=FF+1
	loop
	K=FF	
	PaperItemID(Session("tx"),K)=id
	Session("PaperItemArray")=PaperItemID
	
   elseif request.QueryString("Added")<>"" then
     sql="select * from ItemTable where ItemID="&id
     rs.Open sql,objConn,2,3
     tx=rs("Itemtype")
	 news="select * from Paper_Item where PaperID="&Request.QueryString("Added")&" and Order1="&tx
	 objRS.open news,objConn 
     if objRS.EOF then
       k=1
       objRS.Close
     else 
      objRS.Close 
      news="select MAX(Order2) as order2 from Paper_Item where PaperID="&Request.QueryString("Added")&" and Order1="&tx
	 objRS.open news,objConn
      k=objRS("order2")+1
       objRS.Close
     end if      
    
      news="select * from Paper_Item "
      objRS.open news,objConn,2,3

	 rs("SelectDegree")=rs("SelectDegree")+1 
	 rs("LastExposure")=date() 
	 
	 objRS.AddNew  
	 objRS("PaperID")=request.QueryString("Added") 
	 objRS("ItemID")=rs("ItemID") 
	 objRS("Order1")=tx 
	 
	   objRS("Order2")=k
	 
	 objRS("SelectCourseID")=Session("course_id")
	 objRS("STNR")=rs("STNR")
     objRS("STWJ")=rs("STWJ")
     objRS("DAAN")=rs("DAAN")
     objRS("DAZJ")=rs("DAZJ")
     select Case tx
     Case 1  
     objRS("xxA")=rs("xxA")
     objRS("xxAwj")=rs("xxAwj")
     objRS("xxB")=rs("xxB")
     objRS("xxBwj")=rs("xxBwj")
     objRS("xxC")=rs("xxC")
     objRS("xxCwj")=rs("xxCwj")
     objRS("xxD")=rs("xxD")
     objRS("xxDwj")=rs("xxDwj")
     objRS("xxE")=rs("xxE")
     objRS("xxEwj")=rs("xxEwj")
     Case 2
     objRS("xxA")=rs("xxA")
     objRS("xxAwj")=rs("xxAwj")
     objRS("xxB")=rs("xxB")
     objRS("xxBwj")=rs("xxBwj")
     objRS("xxC")=rs("xxC")
     objRS("xxCwj")=rs("xxCwj")
     objRS("xxD")=rs("xxD")
     objRS("xxDwj")=rs("xxDwj")
     objRS("xxE")=rs("xxE")
     objRS("xxEwj")=rs("xxEwj")
     objRS("xxF")=rs("xxF")
     objRS("xxFwj")=rs("xxFwj")
     end select
	 rs.Update 
	 objRS.Update 
	 rs.Close  
	 objRS.Close 
	 
				 
  sql="Select * from TestPaper where PaperID="&request.QueryString("Added") 
  objRS.open sql,objConn
  dim txfs(5)
   
    txfs(1)=CInt(objRS("selectvalue"))
    txfs(2)=CInt(objRS("multivalue"))
	txfs(3)=CInt(objRS("tkvalue"))
	txfs(4)=CInt(objRS("pdvalue"))
	txfs(5)=CInt(objRS("fxvalue"))
    objRS.Close
   for tx=1 to 5
     sql="select * from Paper_Item where Order1="&tx&" and PaperID="&request.QueryString("Added") 
     objRS.open sql,objConn,1,1
     c=objRS.RecordCount
     objRS.Close 
     if c>0 then
       t_mark=0
       b_mark=CInt(txfs(tx)/c)
       count=1
       objRS.Open sql,objConn,2,3
       while not objRS.EOF 
         if count=c then
           objRS("Score")=txfs(tx)-t_mark
         else
           objRS("Score")=b_mark
           t_mark=t_mark+b_mark
         end if
          count=count+1
          objRS.Update
          objRS.MoveNext
       wend
        objRS.Close
    end if     
  next               
  end if


  objRS.Open "select * from ZSD_ST",objConn,2,3
KID=Session("zsdhu")
if KID="" then
	obj.AddNew 
	 objRS("CourseID")=Session("course_id")
	 objRS("ItemID")=id
	 objRS("KnowledgeID")=0
	 objRS.Update
else 

	begin=instr(KID,";")
    if begin=0 then
	 objRS.AddNew 
	 objRS("CourseID")=Session("course_id")
	 objRS("ItemID")=id
	 objRS("KnowledgeID")=KID
	 objRS.Update
    end if

	 
	while begin<>0 
	 KnowledgeID=left(KID,begin-1)
	 LENKID=Len(KID)
	 KID=Right(KID,(LENKID-Begin))
	 begin=instr(KID,";")

	 objRS.AddNew 
	 objRS("CourseID")=Session("course_id")
	 objRS("ItemID")=id
	 objRS("KnowledgeID")=KnowledgeID
	 objRS.Update
	wend
 

	
end if
 objRS.Close 
  Set objRS=Nothing
  Set objConn=Nothing

%>
 <script language=Javascript>
  
   function Nextt()
   {
     window.clear;
    if(<%=session("tx")%>==1) window.location .href ="Da.asp";
    if(<%=session("tx")%>==2) window.location .href ="Dux.asp";
    if(<%=session("tx")%>==3) window.location .href ="tiankong.asp"
    if(<%=session("tx")%>==4) window.location .href ="pd.asp"
    if(<%=session("tx")%>==5) window.location .href ="fx.asp"
    }

</script> 

<html>
 </script>
<body bgcolor="#FFCCCC">
<table width="100%" border="0" height="30" bgcolor="#FFCCCC">
  <tr>
    <td width="36%" nowrap> </td>
    <td width="22%" nowrap><b><font color="#FF0000">试题已成功入库</font></b></td>
    <td width="42%"> </td>
  </tr>
</table>
<table width="100%" border="0" bgcolor="#FFCCCC" height="37">
  <tr>
    <td width="37%"> </td>
    
    <td width="20%" nowrap> 
     <%if request.QueryString("Added")="" then%>
      <input type="button" name="Button"  value=<%=nextn%> onclick="Nextt()">
      <% elseif  request.QueryString("Added")=1then%>
      <a href="../tjsj/gdsjStep2.asp?time=1">返回</a>
      <%else%>
      <a href="../tjsj/ModPaper1.asp?PaperID=<%=request.QueryString("Added")%>">返回</a>
      <% end if%>
    </td>
    <td width="43%"> </td>
  </tr>
</table>
<p> </p>
<p> </p>
</body>
</html>

⌨️ 快捷键说明

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