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

📄 cover2.asp

📁 这是一个校园考试系统
💻 ASP
📖 第 1 页 / 共 5 页
字号:
   rsno1.open sqlno1,conn,3,2
   
   
    randomize
    i=1
    
   for i=1 to rsno1("datano") 

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

    if ( a>0 and a<(rs11.RecordCount+1)) then 
       rs11.absoluteposition=a
    
    	set rs22=conn.execute("select * from userdata where username='"&username&"' and  tmid="&rs11("tmid")&" and paperno="&paperno)
 	
     	 if  rs22.eof  then
	   
     rs00.addnew
     rs00("username")=username
     rs00("tmid")=cint(rs11("tmid"))
     rs00("ans")=rs11("ans")
     rs00("paperno")=paperno
     rs00.update
     
     else
     
     i=i-1
          
          end if 
    end if 
     next
     
   '-------
    Set rscheck11=Server.CreateObject("Adodb.RecordSet")
    sqlcheck11="select distinct userdata.tmid from userdata,tbtk  where userdata.tmid=tbtk.tmid and userdata.username='"&username&"' and  tbtk.kao=1 and tbtk.category=1 and tbtk.kcid="&kcid&" and (tbtk.chapter Between "&schap&" And "&echap&")  and userdata.paperno="&paperno&" order by userdata.tmid"
    rscheck11.open sqlcheck11,conn,3,2
      
      if rscheck11.RecordCount < rsno1("datano")  then
    
      wrong1=rsno1("datano")-rscheck11.RecordCount
    ' response.write  "<br>wrong1="&wrong1
    '  response.write rscheck11.RecordCount&"<"& rsno1("datano")
      rs11.movefirst
        for k1=1 to wrong1
          you1=0
        
        if not rscheck11.eof then
          rscheck11.movefirst
      
          
         do while not rscheck11.eof  
    '     response.write  "<br>rs11="&rs11("tmid")
     '     response.write  "==rscheck11="&rscheck11("tmid")
          
            if  cint(rs11("tmid"))=cint(rscheck11("tmid")) then
              you1=1
            end if            
          rscheck11.movenext
          loop      
         end  if 
          
      '    response.write "<br>---you1="&you1
           
          if you1=1 then
            if not  rs11.eof then
            rs11.movenext
            end if 
            k1=k1-1
       '     response.write  "<br>k1="&k1&"下一个<br>"
          else   
            
            rs00.addnew
     		rs00("username")=username
     		rs00("tmid")=cint(rs11("tmid"))
     		rs00("ans")=rs11("ans")
     		rs00("paperno")=paperno
            rs00.update
              
            if not rs11.eof then
            rs11.movenext
            end if 
        '     response.write  "<br>k1="&k1&"加入一个<br>"
          
          end if
                   
        next
      end if 
      
   '---------- 
end if
 '------------------随机选6题填空题,防止漏选
    Set rs12=Server.CreateObject("Adodb.RecordSet")
    sql12="select * from tbtk where kao=1 and category=2 and kcid="&kcid&" and (chapter Between "&schap&" And "&echap&")"
      rs12.open sql12,conn,3,2
     
 if not rs12.eof then  
    Set rsno2=Server.CreateObject("Adodb.RecordSet")
    sqlno2="select * from tbkcconfig where kcid="&kcid&" and category=2 and paperno="&paperno
   rsno2.open sqlno2,conn,3,2
   
   
    randomize
    i=1
    
   for i=1 to rsno2("datano") 

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

    if ( a>0 and a<(rs12.RecordCount+1)) then 
       rs12.absoluteposition=a
    
    	set rs22=conn.execute("select * from userdata where username='"&username&"' and  tmid="&rs12("tmid")&" and paperno="&paperno)
 	
     	 if  rs22.eof  then
	   
     rs00.addnew
     rs00("username")=username
     rs00("tmid")=cint(rs12("tmid"))
     rs00("ans")=rs12("ans")
     rs00("paperno")=paperno
     rs00.update
     
     else
     
     i=i-1
          
          end if 
    end if 
     next
     
   '-------
    Set rscheck12=Server.CreateObject("Adodb.RecordSet")
    sqlcheck12="select distinct userdata.tmid from userdata,tbtk  where  userdata.tmid=tbtk.tmid and userdata.username='"&username&"' and  tbtk.kao=1 and tbtk.category=2 and tbtk.kcid="&kcid&" and (tbtk.chapter Between "&schap&" And "&echap&")  and userdata.paperno="&paperno&" order by userdata.tmid"
    rscheck12.open sqlcheck12,conn,3,2
    
     
        
      if rscheck12.RecordCount < rsno2("datano")  then
      
      
      wrong2=rsno2("datano")-rscheck12.RecordCount
     'response.write  "<br>wrong2="&wrong2
     ' response.write rscheck12.RecordCount&"<"& rsno2("datano")
      rs12.movefirst
        for k2=1 to wrong2
          you2=0
        
        
        if not rscheck12.eof then
          rscheck12.movefirst
         do while not rscheck12.eof  
      '   response.write  "<br>rs12="&rs12("tmid")
      '    response.write  "==rscheck12="&rscheck12("tmid")
          
            if  cint(rs12("tmid"))=cint(rscheck12("tmid")) then
              you2=1
            end if            
          rscheck12.movenext
          loop      
       end if
       
        '  response.write "<br>---you2="&you2
           
          if you2=1 then
            if not  rs12.eof then
            rs12.movenext
            end if 
            k2=k2-1
        '    response.write  "<br>k2="&k2&"下一个<br>"
          else   
            
            rs00.addnew
     		rs00("username")=username
     		rs00("tmid")=cint(rs12("tmid"))
     		rs00("ans")=rs12("ans")
     		rs00("paperno")=paperno
            rs00.update
              
            if not rs12.eof then
            rs12.movenext
            end if 
    '         response.write  "<br>k2="&k2&"加入一个<br>"
          
          end if
                   
        next
      end if 
      
   '---------- 
end if
 
         
 
'--------------------------------随机选11题判断题,防止漏选

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


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

    if ( a>0 and a<(rs13.RecordCount+1)) then 
       rs13.absoluteposition=a
    
    	set rs22=conn.execute("select * from userdata where username='"&username&"' and tmid="&rs13("tmid")&" and paperno="&paperno)

 	
     	 if  rs22.eof  then
	   
     rs00.addnew
     rs00("username")=username
     rs00("tmid")=cint(rs13("tmid"))
     rs00("ans")=rs13("ans")
  rs00("paperno")=paperno
     rs00.update
     
     else
     
     i=i-1
          
          end if 
    end if 
     next

   '-------
    Set rscheck13=Server.CreateObject("Adodb.RecordSet")
    sqlcheck13="select distinct userdata.tmid from userdata,tbtk  where  userdata.tmid=tbtk.tmid and  userdata.username='"&username&"' and  tbtk.kao=1 and tbtk.category=3 and tbtk.kcid="&kcid&" and (tbtk.chapter Between "&schap&" And "&echap&")  and userdata.paperno="&paperno&" order by userdata.tmid"
    rscheck13.open sqlcheck13,conn,3,2
      

      if rscheck13.RecordCount < rsno3("datano")  then
      wrong3=rsno3("datano")-rscheck13.RecordCount
    ' response.write  "<br>wrong3="&wrong3
    '  response.write rscheck13.RecordCount&"<"& rsno3("datano")
      rs13.movefirst
        for k3=1 to wrong3
          you3=0
 
    if not rscheck13.eof then
         rscheck13.movefirst
          
         do while not rscheck13.eof  
     '    response.write  "<br>rs13="&rs13("tmid")
     '    response.write  "==rscheck13="&rscheck13("tmid")
          
            if  cint(rs13("tmid"))=cint(rscheck13("tmid")) then
              you3=1
            end if            
          rscheck13.movenext
          loop      
     end  if
     
 '        response.write "<br>---you3="&you1
           
          if you3=1 then
            if not  rs13.eof then
            rs13.movenext
            end if 
            k3=k3-1
    '       response.write  "<br>k3="&k3&"下一个<br>"
          else   
            
            rs00.addnew
     		rs00("username")=username
     		rs00("tmid")=cint(rs13("tmid"))
     		rs00("ans")=rs13("ans")
     		rs00("paperno")=paperno
            rs00.update
              
            if not rs13.eof then
            rs13.movenext
            end if 
      '      response.write  "<br>k3="&k3&"加入一个<br>"
          
          end if
                   
        next
      end if 
      
   '---------- 
   
 end if
 '---------------------------随机选11题单选题,防止漏选

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

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

    if ( a>0 and a<(rs14.RecordCount+1)) then 
       rs14.absoluteposition=a
    
    	set rs22=conn.execute("select * from userdata where username='"&username&"' and  tmid="&rs14("tmid")&" and paperno="&paperno)
 	
     	 if  rs22.eof  then
	   
     rs00.addnew
     rs00("username")=username
     rs00("tmid")=cint(rs14("tmid"))
     rs00("ans")=rs14("ans")
      rs00("paperno")=paperno
 
     rs00.update
     
     else
     
     i=i-1
          
          end if 
    end if 
     next
     
        '-------
    Set rscheck14=Server.CreateObject("Adodb.RecordSet")
    sqlcheck14="select distinct userdata.tmid from userdata,tbtk  where userdata.tmid=tbtk.tmid and  userdata.username='"&username&"' and  tbtk.kao=1 and tbtk.category=4 and tbtk.kcid="&kcid&" and (tbtk.chapter Between "&schap&" And "&echap&")  and userdata.paperno="&paperno&" order by userdata.tmid"
    rscheck14.open sqlcheck14,conn,3,2
       

      if rscheck14.RecordCount < rsno4("datano")  then
     wrong4=rsno4("datano")-rscheck14.RecordCount
     'response.write  "<br>wrong4="&wrong4
     ' response.write rscheck14.RecordCount&"<"& rsno4("datano")
      rs14.movefirst
        for k4=1 to wrong4
          you4=0
        
        if not rscheck14.eof then
          rscheck14.movefirst
         do while not rscheck14.eof  
     '    response.write  "<br>rs14="&rs14("tmid")
     '    response.write  "==rscheck14="&rscheck14("tmid")
          
            if  cint(rs14("tmid"))=cint(rscheck14("tmid")) then
              you4=1
            end if            
          rscheck14.movenext
          loop      
        end  if
          
    '     response.write "<br>---you4="&you4
           
          if you4=1 then
            if not  rs14.eof then
            rs14.movenext
            end if 
            k4=k4-1
    '        response.write  "<br>k4="&k4&"下一个<br>"
          else   
            
            rs00.addnew
     		rs00("username")=username
     		rs00("tmid")=cint(rs14("tmid"))
     		rs00("ans")=rs14("ans")
     		rs00("paperno")=paperno
            rs00.update
              
            if not rs14.eof then
            rs14.movenext
            end if 
    '         response.write  "<br>k4="&k4&"加入一个<br>"
          
          end if
                   
        next
      end if 
      
   '---------- 
end if
 '------------------------------随机选6题多选题,防止漏选

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

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

    if ( a>0 and a<(rs15.RecordCount+1)) then 
       rs15.absoluteposition=a
    
    	set rs22=conn.execute("select * from userdata where username='"&username&"' and  tmid="&rs15("tmid")&" and paperno="&paperno)

⌨️ 快捷键说明

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