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

📄 selectrc1.asp

📁 这是用asp做的一个网上考试题库系统
💻 ASP
字号:
<!--#include file="../db.asp"-->
 
<%
  objConn.Open strConnection
  Set objRS1 = Server.CreateObject ("ADODB.Recordset")
  Set objRS = Server.CreateObject ("ADODB.Recordset")
  Set rs= Server.CreateObject ("ADODB.Recordset")
  Set rs1= Server.CreateObject ("ADODB.Recordset")
  Set rs2= Server.CreateObject ("ADODB.Recordset") 
  dim PaperItemID(5,50)
   for i=1 to 5
   for j=1 to 50
     PaperItemID(i,j)=-1
   next
  next   
 ' sql="select MAX(KnowledgeID) as max from knowledge where CourseID=1"
 ' objRS.Open sql,objConn
 ' max=objRS("max")
'  objRS.Close
 ID=195'Request.QueryString ("PaperID")'输入试卷ID
 CourseID=1'=Request.QueryString ("CourseID")
 RandomID=1'Request.QueryString ("RandomID")
 Stu_UserID=1'Request.QueryString ("Stu_UserID")
 sql="select * from TestPaper where PaperID="&ID
 objRS.Open sql,objConn

 total=CInt(objRS("TotalMark"))
  dim txvalue(6)
  txvalue(1)=CInt(objRS("selectvalue"))
  txvalue(2)=CInt(objRS("multivalue"))
  txvalue(3)=CInt(objRS("pdvalue"))
  txvalue(4)=CInt(objRS("tkvalue"))
  txvalue(5)=CInt(objRS("fxvalue"))
  CourseID=objRS("SelectCourseID")
  objRS.Close 
  
  dim ndlist(5)
  dim txlist(5)
  sql="select * from RandomPara where PaperID="&ID
  objRS.Open sql,objConn
  ndlist(1)=objRS("nd1")
  ndlist(2)=objRS("nd2")
  ndlist(3)=objRS("nd3")
  ndlist(4)=objRS("nd4")
  ndlist(5)=objRS("nd5")
   
  txlist(1)=objRS("dxCount")
  txlist(2)=objRS("duCount")
  txlist(3)=objRS("tkCount")
  txlist(4)=objRS("pdCount")
  txlist(5)=objRS("fxCount")
  
 ' b=0
 ' b=b+Clng(rs("dxCount"))
 ' b=b+Clng(rs("duCount"))
 ' b=b+Clng(rs("pdCount"))
 ' b=b+Clng(rs("tkCount"))
 ' b=b+Clng(rs("fxCount"))
 ' r=b/max
  dim rzfb(6)
  rzfb(0)=CInt(objRS("Know"))
  rzfb(1)=CInt(objRS("Grasp"))
  rzfb(2)=Cint(objRS("Applicate"))
  rzfb(3)=Cint(objRS("Evaluate"))
  rzfb(4)=CInt(objRS("Synthetize"))
  rzfb(5)=CInt(objRS("Analyse"))
  objRS.Close 
  for hh=0 to 5
   rzfb(hh)=CInt(rzfb(hh)*total/100)
  
  next 
   
 dim ndv(5)
 ndv(1)=0.9
 ndv(2)=0.7
 ndv(3)=0.5
 ndv(4)=0.3
 ndv(5)=0.1

  dim knowlist(100)
  dim st(50)
  for i=0 to b
      knowlist(i)=""
  next
  base=0
  
  for i=1 to 5
  if txlist(i)>0 then
  basemark=CInt(txvalue(i)/txlist(i))
  end if
  FF=1
  for jj=1 to 50
   st(jj)=0
  next 
  Randomize 

  while FF<=txlist(i)
   
  kk=0
  qq=0
  tt=0
  mm=0
   
 
  s2="Select * from ItemTable where Itemtype="&i&" and CourseID="&CourseID
  s3=s2
  no=0
  max=rzfb(0)
  maxn=1
  
   for ll=1 to 5
   if basemark >ndlist(ll) then
       if max < ndlist(ll) then
         maxn=ll
         max=ndlist(ll)
       end if
       s2=s2&" and Difficulty<>"&ndv(ll)
       no=no+1
  end if
  next
  if no=6 then
     s3=s3&" and Difficulty="&ndv(maxn)
     s2=s3
  end if      
  
  for ll=1 to FF-1
   if st(ll)<>0 then
     s2=s2&" and ItemID<>"&st(ll)
   end if
  next     
         
  rs2.Open s2,objConn,1,1
  
  c=CInt(rs2.RecordCount)

 if not rs2.EOF then
   
  itemid=Int((c *Rnd))

  rs2.MoveFirst 
  rs2.Move(itemid)
  if not rs2.EOF then
     
      tt=rs2("ItemID")
      
      te=CInt(rs2("CognizeClass"))-1
      rzfb(te)=rzfb(te)-basemark
      nd=CInt(CDbl(rs2("Difficulty"))*10)
      select case nd
      case 9 ndlist(1)=ndlist(1)-basemark
      case 7 ndlist(2)=ndlist(2)-basemark
      case 5 ndlist(3)=ndlist(3)-basemark
      case 3 ndlist(4)=ndlist(4)-basemark
      case 1 ndlist(5)=ndlist(5)-basemark
      end select
  

     end if  
   end if
     K=FF
     PaperItemID(i,K)=tt
   
     'knowlist(base)=temp
     st(FF)=tt
     base=base+1
  
     FF=FF+1
 '  end if
 ' end if
  rs2.Close 
wend
	 
next 

'PaperItemID为抽出的题
 
	for tx=1 to 5
	   'Update=false 
		FF=1 
		k=1
		ItemNumber=0 
		do while FF<=50 and PaperItemID(tx,FF)<>-1 
			 if PaperItemID(tx,FF)<>0 then
				ItemNumber=ItemNumber+1 
			 end if
			FF=FF+1 
		loop  
		if ItemNumber<>0 then 
			'Update=true 
			FF=1 
			'k记录小题号 
		 
			do while k<=ItemNumber
			 if PaperItemID(tx,k)<>0 then     
			 sql="select * from ItemTable where ItemID="&PaperItemID(tx,k) 
			     news="select * from RandomPaperItem "
					rs.Open sql,objConn,2,3 
	                   			
					objRS.open news,objConn,2,3
					rs("SelectDegree")=rs("SelectDegree")+1 
					rs("LastExposure")=NowTime 
					objRS.AddNew  
					objRS("PaperID")=ID
					objRS("RandomItemID")=rs("ItemID") 
					objRS("Order1")=tx 
					objRS("Order2")=k 
					objRS("SelectCourseID")=CourseID
					objRS("Stu_UserID")=Stu_UserID
					objRS("RandomID")=RandomID 
					 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
						k=k+1 

			loop 
		end if	
		 next
 
 
 objConn.Close

	 
for tx=1 to 5
	FF=1 
	do while FF<=50 and PaperItemID(tx,FF)<>-1
		PaperItemID(tx,FF)=-1 
		FF=FF+1 
	loop 
	next
	Session("PaperItemArray")=PaperItemID 	 
	
 
%>
 

⌨️ 快捷键说明

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