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

📄 cover2.asp

📁 这是一个校园考试系统
💻 ASP
📖 第 1 页 / 共 5 页
字号:
            rs16.movenext
            end if 
      '       response.write  "<br>k6="&k6&"加入一个<br>"
          
          end if
        
                   
        next
    
      end if 
      
   '---------- 
   end if
 '-------------随机选3题论述题,防止漏选

   Set rs17=Server.CreateObject("Adodb.RecordSet")
         sql17="select * from tbtk where kao=1 and category=7 and kcid="&kcid&" and (chapter Between "&schap&" And "&echap&")"
         rs17.open sql17,conn,3,2
   
 if not rs17.eof then  
      Set rsno7=Server.CreateObject("Adodb.RecordSet")
    sqlno7="select * from tbkcconfig where kcid="&kcid&" and category=7  and paperno="&paperno
   rsno7.open sqlno7,conn,3,2
   
    randomize
    i=1
    
   for i=1 to rsno7("datano") 

    a=int((rs17.RecordCount-0)*rnd+0)

    if ( a>0 and a<(rs17.RecordCount+1)) then 
       rs17.absoluteposition=a
    
    	set rs22=conn.execute("select * from userdata where username='"&username&"' and  tmid="&rs17("tmid")&" and paperno="&paperno)
 	
     	 if  rs22.eof  then
	   
     rs00.addnew
     rs00("username")=username
     rs00("tmid")=cint(rs17("tmid"))
     rs00("ans")=rs17("ans")
      rs00("paperno")=paperno
 
     rs00.update
     
     else
     
     i=i-1
          
          end if 
    end if 
     next
     
       '-------
    Set rscheck17=Server.CreateObject("Adodb.RecordSet")
    sqlcheck17="select distinct userdata.tmid from userdata,tbtk  where  userdata.tmid=tbtk.tmid and userdata.username='"&username&"' and  tbtk.kao=1 and tbtk.category=7 and tbtk.kcid="&kcid&" and (tbtk.chapter Between "&schap&" And "&echap&")  and userdata.paperno="&paperno&" order by userdata.tmid"
    rscheck17.open sqlcheck17,conn,3,2
       
      if rscheck17.RecordCount < rsno7("datano")  then
      wrong7=rsno7("datano")-rscheck17.RecordCount
    '  response.write  "<br>wrong7="&wrong7
   '  response.write rscheck17.RecordCount&"<"& rsno7("datano")
      rs17.movefirst
        for k7=1 to wrong7
          you7=0
          
        if not rscheck17.eof then
          rscheck17.movefirst
       
        
         do while not rscheck17.eof  
      '   response.write  "<br>rs17="&rs17("tmid")
      '   response.write  "==rscheck17="&rscheck17("tmid")
          
            if  cint(rs17("tmid"))=cint(rscheck17("tmid")) then
              you7=1
            end if            
          rscheck17.movenext
          loop      
        end if
     '     response.write "<br>---you7="&you7
           
          if you7=1 then
            if not  rs17.eof then
            rs17.movenext
            end if 
            k7=k7-1
     '       response.write  "<br>k7="&k7&"下一个<br>"
          else   
            
            rs00.addnew
     		rs00("username")=username
     		rs00("tmid")=cint(rs17("tmid"))
     		rs00("ans")=rs17("ans")
     		rs00("paperno")=paperno
            rs00.update
              
            if not rs17.eof then
            rs17.movenext
            end if 
     '        response.write  "<br>k7="&k7&"加入一个<br>"
          
          end if
                   
        next
      end if 
      
   '---------- 
end if

 '--------------------------------------
  '-------------随机选阅读理解题,防止漏选

   Set rs18=Server.CreateObject("Adodb.RecordSet")
         sql18="select * from tbtk where kao=1 and category=8 and kcid="&kcid&" and (chapter Between "&schap&" And "&echap&")"
         rs18.open sql18,conn,3,2
   
 if not rs18.eof then  
      Set rsno8=Server.CreateObject("Adodb.RecordSet")
    sqlno8="select * from tbkcconfig where kcid="&kcid&" and category=8  and paperno="&paperno
   rsno8.open sqlno8,conn,3,2
   
    randomize
    i=1
    
   for i=1 to rsno8("datano") 

    a=int((rs18.RecordCount-0)*rnd+0)

    if ( a>0 and a<(rs18.RecordCount+1)) then 
       rs18.absoluteposition=a
    
    	set rs22=conn.execute("select * from userdata where username='"&username&"' and  tmid="&rs18("tmid")&" and paperno="&paperno)
 	
     	 if  rs22.eof  then
	   
     rs00.addnew
     rs00("username")=username
     rs00("tmid")=cint(rs18("tmid"))
     rs00("ans")=rs18("ans")
     rs00("paperno")=paperno
     rs00("isread")=rs18("isread")
     rs00.update
     
          '--------------------------阅读题肢
       if rs18("isread")=1 then
       sqlkaoshi0="select * from tbread  where  tmid="&rs18("tmid")
       set rskaoshi0=server.createobject("adodb.recordset")
       rskaoshi0.open sqlkaoshi0,conn,3,2
       
          do while not rskaoshi0.eof
          
          sqlkaoshi1="select * from userdataread  where username='"&username&"' and paperno<>0 and  tmid="&rs18("tmid")
          set rskaoshi1=server.createobject("adodb.recordset")
          rskaoshi1.open sqlkaoshi1,conn,3,2
             
             sqldatashi1="select top 1 * from userdata where username='"&username&"' and paperno="&paperno&" and tmid="&rs18("tmid")&" order by dataid desc"
 			 set rsdatashi1=server.createobject("adodb.recordset")
			 rsdatashi1.open sqldatashi1,conn,3,2
             
              
              rskaoshi1.addnew
              rskaoshi1("username")=username
              rskaoshi1("dataid")=rsdatashi1("dataid")
              rskaoshi1("tmid")=rskaoshi0("tmid")
              rskaoshi1("paperno")=paperno
              rskaoshi1("noid")=rskaoshi0("noid")
              rskaoshi1("readno")=rskaoshi0("readno")
              rskaoshi1("rans")=rskaoshi0("readans")
              rskaoshi1("fen")=0 
              rskaoshi1.update
           
           
           rskaoshi0.movenext
          loop
       
       end if
     '--------------------------阅读题肢
     
     else
     
     i=i-1
          
          end if 
    end if 
     next
     
       '-------
    Set rscheck18=Server.CreateObject("Adodb.RecordSet")
    sqlcheck18="select distinct userdata.tmid from userdata,tbtk  where  userdata.tmid=tbtk.tmid and userdata.username='"&username&"' and  tbtk.kao=1 and tbtk.category=8 and tbtk.kcid="&kcid&" and (tbtk.chapter Between "&schap&" And "&echap&")  and userdata.paperno="&paperno&" order by userdata.tmid"
    rscheck18.open sqlcheck18,conn,3,2
       
      if rscheck18.RecordCount < rsno8("datano")  then
      wrong8=rsno8("datano")-rscheck18.RecordCount
    '  response.write  "<br>wrong8="&wrong8
   '  response.write rscheck18.RecordCount&"<"& rsno8("datano")
      rs18.movefirst
        for k8=1 to wrong8
          you8=0
          
        if not rscheck18.eof then
          rscheck18.movefirst
       
        
         do while not rscheck18.eof  
      '   response.write  "<br>rs18="&rs18("tmid")
      '   response.write  "==rscheck18="&rscheck18("tmid")
          
            if  cint(rs18("tmid"))=cint(rscheck18("tmid")) then
              you8=1
            end if            
          rscheck18.movenext
          loop      
        end if
     '     response.write "<br>---you8="&you8
           
          if you8=1 then
            if not  rs18.eof then
            rs18.movenext
            end if 
            k8=k8-1
     '       response.write  "<br>k8="&k8&"下一个<br>"
          else   
            
            rs00.addnew
     		rs00("username")=username
     		rs00("tmid")=cint(rs18("tmid"))
     		rs00("ans")=rs18("ans")
     		rs00("paperno")=paperno
     		rs00("isread")=rs18("isread")
            rs00.update
              
        '--------------------------阅读题肢
       if rs18("isread")=1 then
       sqlkaoshi0="select * from tbread  where  tmid="&rs18("tmid")
       set rskaoshi0=server.createobject("adodb.recordset")
       rskaoshi0.open sqlkaoshi0,conn,3,2
       
          do while not rskaoshi0.eof
          
          sqlkaoshi1="select * from userdataread  where username='"&username&"' and paperno<>0 and  tmid="&rs18("tmid")
          set rskaoshi1=server.createobject("adodb.recordset")
          rskaoshi1.open sqlkaoshi1,conn,3,2
             
             sqldatashi1="select top 1 * from userdata where username='"&username&"' and paperno="&paperno&" and tmid="&rs18("tmid")&" order by dataid desc"
 			 set rsdatashi1=server.createobject("adodb.recordset")
			 rsdatashi1.open sqldatashi1,conn,3,2
             
              
              rskaoshi1.addnew
              rskaoshi1("username")=username
              rskaoshi1("dataid")=rsdatashi1("dataid")
              rskaoshi1("tmid")=rskaoshi0("tmid")
              rskaoshi1("readno")=rskaoshi0("readno")
              rskaoshi1("noid")=rskaoshi0("noid")
              rskaoshi1("paperno")=paperno
              rskaoshi1("rans")=rskaoshi0("readans")
              rskaoshi1("fen")=0 
              rskaoshi1.update
           
           
           rskaoshi0.movenext
          loop
       
       end if
     '--------------------------阅读题肢
              
            if not rs18.eof then
            rs18.movenext
            end if 
     '        response.write  "<br>k8="&k8&"加入一个<br>"
          
          end if
                   
        next
      end if 
      
   '---------- 
end if

 '--------------------------------------
     end if   '-----固定试题
         

   			'---------------------------------
   				
   				
	       	
  	end if
end if
end if

	       '-------------------------试卷抽题完毕
		    next
		    
		   else
		   
		      	if idlistt="0" then
		    '-----------------------------当没有考试卷
		    '-----------------------------	
		   		else
		   			paperno=power
		   	'----------------------------paperno是试卷号,只有一张试卷
		   
		   	
      	'--------------------添加考试信息
	       	
	 sqlpaper="select * from tbpaper where paperno="&paperno
 	set rspaper=server.createobject("adodb.recordset")
	rspaper.open sqlpaper,conn,3,2

	kcid=rspaper("kcid")
	
  	sql5="select  * from tbscore where username='"&username&"' and paperno="&paperno
	set rs5=server.createobject("adodb.recordset")
	rs5.open sql5,conn,3,2
	
	sqlkc="select  * from tbkc where kcid="&kcid
	set rskc=server.createobject("adodb.recordset")
	rskc.open sqlkc,conn,3,2
	
if rskc("isopen")=1 then
if rspaper("isopen")=1 then  '---------如果试卷打开\关闭
   if  rs5.eof then   
   	rs5.addnew
   	rs5("username")=username
    rs5("kcid")=kcid
    rs5("paperno")=paperno
    rs5("lasttime")=rspaper("paperdatetime")
    rs5.update
   
			'----------------------------
	       	   	Set rs00=Server.CreateObject("Adodb.RecordSet")
   				sql00="select * from userdata "
   				rs00.open sql00,conn,3,2
   				
   				if rspaper("ischoose")=1 then '------------------固定试题
   				
   				    Set rssel=Server.CreateObject("Adodb.RecordSet")
                    sqlsel="select * from tbselectpaper  where paperno="&paperno
                    rssel.open sqlsel,conn,3,2
   				    
   				    do while not rssel.eof
   				    
   				        Set rsistm=Server.CreateObject("Adodb.RecordSet")
    					sqlistm="select * from userdata where  username='"&username&"' and tmid="&rssel("tmid")&" and  paperno="&paperno
   						rsistm.open sqlistm,conn,3,2
   				    
   				    if  rsistm.eof  then
	   
     				rs00.addnew
     				rs00("username")=username
     				rs00("tmid")=rssel("tmid")
     				rs00("ans")=rssel("ans")
     				rs00("isread")=rssel("isread")
     				rs00("paperno")=paperno
     				rs00.update
     				
     								     
          '--------------------------阅读题肢
       if rssel("isread")=1 then
       sqlkaoshi0="select * from tbread  where  tmid="&rssel("tmid")
       set rskaoshi0=server.createobject("adodb.recordset")
       rskaoshi0.open sqlkaoshi0,conn,3,2
       
          do while not rskaoshi0.eof
          
          sqlkaoshi1="select * from userdataread  where username='"&username&"' and paperno<>0 and  tmid="&rssel("tmid")
          set rskaoshi1=server.createobject("adodb.recordset")
          rskaoshi1.open sqlkaoshi1,conn,3,2
             
             sqldatashi1="select top 1 * from userdata where username='"&username&"' and paperno="&paperno&" and tmid="&rssel("tmid")&" order by dataid desc"
 			 set rsdatashi1=server.createobject("adodb.recordset")
			 rsdatashi1.open sqldatashi1,conn,3,2
             
              
              rskaoshi1.addnew
              rskaoshi1("username")=username
              rskaoshi1("dataid")=rsdatashi1("dataid")
              rskaoshi1("tmid")=rskaoshi0("tmid")
              rskaoshi1("paperno")=paperno
              rskaoshi1("noid")=rskaoshi0("noid")
              rskaoshi1("readno")=rskaoshi0("readno")
              rskaoshi1("rans")=rskaoshi0("readans")
              rskaoshi1("fen")=0 
              rskaoshi1.update
           
           
           rskaoshi0.movenext
          loop
       
       end if
     '--------------------------阅读题肢

     				
     				end if
     				
                    rssel.movenext
   				    loop
   				else

   				
   				
   			'-----------------------------试卷参数'kcid,schap,echap
   			   	schap=rspaper("schap")
				echap=rspaper("echap")
   		 			'-----------------------随机选6题名词解释,防止漏选
    Set rs11=Server.CreateObject("Adodb.RecordSet")
    sql11="select * from tbtk where kao=1 and category=1 and kcid="&kcid&" and (chapter Between "&schap&" And "&echap&")"
      rs11.open sql11,conn,3,2
      
 if not rs11.eof then  
    Set rsno1=Server.CreateObject("Adodb.RecordSet")
    sqlno1="select * from tbkcconfig where kcid="&kcid&" and category=1 and paperno="&paperno

⌨️ 快捷键说明

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