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

📄 additem.asp

📁 这是用asp做的一个网上考试题库系统
💻 ASP
字号:
<!--#include file="../db.asp"-->
 
<%
  objConn.Open strConnection
  Set objRS = Server.CreateObject ("ADODB.Recordset")
  Set rs= Server.CreateObject ("ADODB.Recordset")
  tx=Session("sjtx")
  if request.QueryString("mod")<>"" then
    PaperItemID=Session("PaperItemArray")
    FF=1
    do while FF<=50 and PaperItemID(tx,FF)<>-1
	  FF=FF+1
    loop
     KK=FF
     for i=1 to Request("xx").Count
        news="select * from Paper_Item where ItemID="&request("xx")(i)&" and PaperID="&Request.QueryString ("mod")
        objRS.open news,objConn
        if not objRS.EOF then
           mm=1
        else
           mm=0
        end if
        objRS.Close
        if mm=0 then    
          sql="select * from ItemTable where ItemID="&request("xx")(i)
          rs.Open sql,objConn,2,3
          tx=rs("Itemtype")
	      news="select * from Paper_Item where PaperID="&Request.QueryString("mod")&" 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("mod")&" and Order1="&tx
	         objRS.open news,objConn
             k=objRS("order2")+1
             objRS.Close
          end if      
          PaperItemID(tx,KK)=Request("xx")(i)
	      KK=KK+1
          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("mod") 
	      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 
	 end if
	  
   next 
  
  sql="Select * from TestPaper where PaperID="&Request.QueryString("mod")
  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("mod")
     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               
  
   Session("PaperItemArray")=PaperItemID
    response.redirect "ModPaper1.asp?PaperID="&request.QueryString("mod")
  else
    PaperItemID=Session("PaperItemArray")
 
  FF=1
  while FF<=50 and PaperItemID(tx,FF)<>-1
	FF=FF+1
  wend 
 K=FF

   for i=1 to Request("xx").Count
        FF=1
		have=false
		Do while FF<=50 and PaperItemID(tx,FF)<>-1
			if Clng(PaperItemID(tx,FF))=Clng(Request("xx")(i)) then
				have=true
				exit do
			end if
			FF=FF+1
		loop
		
		if have<>true then
		   PaperItemID(tx,K)=Request("xx")(i)
		 
           K=K+1
		end if
 next
Session("PaperItemArray")=PaperItemID
Response.redirect("gdsjStep2.asp?time=2")
end if
%>
  

⌨️ 快捷键说明

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