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

📄 selectr.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
  
  total=CInt(Session("TotalScore"))
  dim txvalue(6)
  txvalue(1)=CInt(Session("dxfs"))
  txvalue(2)=CInt(Session("dufs"))
  txvalue(3)=CInt(Session("pdfs"))
  txvalue(4)=CInt(Session("tkfs"))
  txvalue(5)=CInt(Session("fxfs"))
  
 ' 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
   rzfb= Session("Rzlist")
  
  for hh=0 to 5
   rzfb(hh)=CInt(rzfb(hh)*total/100)
  
  next 
  txlist=Session("Txlist")
  ndlist=Session("ndlist") 
 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="&Session("course_id")
  s3=s2
  no=0
  max=rzfb(0)
  maxn=1
  
  for ll=0 to 5
   if basemark > rzfb(ll) then
     if max < rzfb(ll) then
       maxn=ll+1
       max=rzfb(ll) 
       
     end if  
     s2=s2&" and CognizeClass <>"&(ll+1)
    no=no+1
   end if
  next 
   if no=6 then
      s3=s3&" and CognizeClass="&maxn
      s2=s3
   end if 
   max=ndlist(1)
   max=1     
   no=0
   s3=s2
  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 
 Session("PaperItemArray")=PaperItemID
 
%>
  
<% if Request.QueryString ("ID")<>"" then%>
<form method="post" action="ShowR_D.asp?ID=<%=Request.QueryString ("ID")%>" name="Form1" id="Form1">
<%else%>
<form method="post" action="ShowR_D.asp" name="Form1" id="Form1">
<%end if%>		
<%

dim Temp
dim k
dim NumberOrder
Temp=1
NumberOrder=1
k=1
'输出%>
 
<%
  for tx=1 to 5 	
	FF=1
	ItemNumber=0
	do while FF<=50 and PaperItemID(tx,FF)<>-1
	   ItemNumber=ItemNumber+1
	   FF=FF+1
	loop 
	if ItemNumber<>0 then
		Response.Write "<font size='4'><strong>"
		WriteTemp
		WriteTx
		select case tx
        case 1		
           Response.Write  "(共有题目&nbsp;" & ItemNumber & "题,共计&nbsp;" & request("dxfs") & "分,测试时间为&nbsp;" & request("dxsj") & "分钟)</strong></font><br><br>"
           tt="../tjst/Temp1/"
		case 2		
           Response.Write  "(共有题目&nbsp;" & ItemNumber & "题,共计&nbsp;" & request("dufs") & "分,测试时间为&nbsp;" & request("dusj") & "分钟)</strong></font><br><br>"
           tt="../tjst/Temp3/"
		case 3		
           Response.Write  "(共有题目&nbsp;" & ItemNumber & "题,共计&nbsp;" & request("tkfs") & "分,测试时间为&nbsp;" & request("tksj") & "分钟)</strong></font><br><br>"
           tt="../tjst/Temp2/"
		case 4		
           Response.Write  "(共有题目&nbsp;" & ItemNumber & "题,共计&nbsp;" & request("pdfs") & "分,测试时间为&nbsp;" & request("pdsj") & "分钟)</strong></font><br><br>"
           tt="../tjst/Temp4/"
		case 5	
           Response.Write  "(共有题目&nbsp;" & ItemNumber & "题,共计&nbsp;" & request("fxfs") & "分,测试时间为&nbsp;" & request("fxsj") & "分钟)</strong></font><br><br>"
           tt="../tjst/Temp5/"
		end select
       'k用来记录小题号
     
		k=1
		FF=1
		do while FF<=50 and PaperItemID(tx,FF)<>-1
		    strQ="Select * from ItemTable where ItemID="&PaperItemID(tx,FF)
            objRS.open strQ,objConn
			Response.Write k & "."
			k=k+1
			%>
 	
<%if not objRS.EOF 	then%>
  <table width="100%" border="0" height="54" cellspacing="0" align="center">     
    <tr>      
      <td width="11%" height="34" nowrap>      
        <div align="left">试题内容:<%=objRS("CognizeClass")%>&<%=objRS("Difficulty")%>**</div>     
      </td>     
      <%if objRS("STNR")<>"" then%>       
      <td align="left" width="89%" height="21"><%=objRS("STNR")%></td>     
      </tr>     
      <%else%>     
      <td width="11%" height="40"> <p align=center>     
       <a href="<%=tt%><%=objRS("STWJ")%>" target="_blank" >试题附件</a> </p>     
      </td>     
       <%end if%>      
   <%if ((objRS("STNR")<>"") and (objRS("STWJ")<>"")) then%>      
         
      <td width="11%" height="16">&nbsp;</td>     
      <td width="89%" height="16"> <p align=center>     
       <a href="<%=tt%><%=objRS("STWJ")%>" target="_blank" >试题附件</a> </p>       
       </td> 
   <%end if%>      
  </table>     
 <%if objRS("Itemtype")<3 then%>     
   
  <table width="100%" border="0"  cellspacing="0" align="center">     
  <tr>      
    <%if (objRS("xxA" )<>"") then%>      
      <td width="10%" nowrap height="3">      
        <div align="center">A</div>     
      </td>     
      <td width="90%" height="3"><%=objRS("xxA")%></td>     
    </tr>     
    <% else%>      
          
      <td width="10%" nowrap height="118">      
        <div align="center">      
            
          A</div>     
      </td>     
      <td width="90%" height="118">      
         <p align=center>    
          <a href="<%=tt%><%=objRS("xxAwj")%>" target="_blank" >选项A附件</a>     
          </p>
      </td>     
    <%end if%>      
   <%if ((objRS("xxA" )<>"")and (objRS("xxAwj")<>"")) then%>      
     <tr>     
      <td width="10%" nowrap height="21"> </td>     
      <td width="90%" height="21">      
         <p align=center>  
          <a href="<%=tt%><%=objRS("xxAwj")%>" target="_blank" >选项A附件</a>       
          </p>   
      </td>     
   </tr>      
     <tr>      
      <td width="10%" nowrap height="21"> </td>     
      <td width="90%" height="21"> </td>     
    </tr>     
    <%end if%>     
        
    <%if (objRS("xxB" )<>"") then%>      
    <tr>      
      <td width="10%" nowrap height="21">      
        <div align="center">      
             
          B</div>     
      </td>     
      <td width="90%" height="21"><%=objRS("xxB")%></td>     
    </tr>     
    <% elseif (objRS("xxBwj" )<>"") then%>      
    <tr>      
      <td width="10%" nowrap height="21">      
        <div align="center">      
            
          B</div>     
      </td>     
      <td width="90%" height="21">      
         <p align=center>    
          <a href="<%=tt%><%=objRS("xxBwj")%>" target="_blank" >选项B附件</a>      
          </p>
      </td>     
    </tr>     
    <%end if%>      
   <%if ((objRS("xxB" )<>"")and (objRS("xxBwj")<>"")) then%>      
    <tr>      
      <td width="10%" nowrap height="21"> </td>     
      <td width="90%" height="21">      
       <p align=center>
          <a href="<%=tt%><%=objRS("xxBwj")%>" target="_blank" >选项B附件</a>     
         </p>    
      </td>     
    </tr>     
    <tr>      
      <td width="10%" nowrap height="21"> </td>     
      <td width="90%" height="21"> </td>     
    </tr>     
    <%end if%>      
    <%if (objRS("xxC" )<>"") then%>      
    <tr>      
      <td width="10%" nowrap height="21">      
        <div align="center">      
           
          C</div>     
      </td>     
      <td width="90%" height="21"><%=objRS("xxC")%></td>     
    </tr>     
    <% elseif (objRS("xxCwj" )<>"") then%>      
    <tr>      
      <td width="10%" nowrap height="21">      
        <div align="center">      
              
          C</div>     
      </td>     
      <td width="90%" height="21">      
         <p align=center>  
           <a href="<%=tt%><%=objRS("xxCwj")%>" target="_blank" >选项C附件</a>     
         </p>
      </td>     
    </tr>     
    <%end if%>      
    <%if ((objRS("xxC" )<>"")and(objRS("xxCwj")<>"")) then%>      
    <tr>      
      <td width="10%" nowrap height="21"> </td>     
      <td width="90%" height="21">      
          <p align=center>   
           <a href="<%=tt%><%=objRS("xxCwj")%>" target="_blank" >选项C附件</a>       
          </p>
      </td>     
    </tr>     
    <tr>      
      <td width="10%" nowrap height="21"> </td>     
      <td width="90%" height="21"> </td>     
    </tr>     
    <%end if%>      
    <%if (objRS("xxD" )<>"") then%>      
    <tr>      
      <td width="10%" nowrap height="21">      
        <div align="center">      
             
          D</div>     
      </td>     
      <td width="90%" height="21"><%=objRS("xxD")%></td>     
    </tr>     
    <% elseif (objRS("xxDwj" )<>"") then%>      
    <tr>      
      <td width="10%" nowrap height="21">      
        <div align="center">      
          
          D</div>     
      </td>     
      <td width="90%" height="21">      
          <p align=center>  
          <a href="<%=tt%><%=objRS("xxDwj")%>" target="_blank" >选项D附件</a>       
           </p>  
      </td>     
    </tr>     
    <%end if%>      
    <%if ((objRS("xxD" )<>"")and(objRS("xxDwj")<>"")) then%>      
    <tr>      
      <td width="10%" nowrap height="21"> </td>     
      <td width="90%" height="21">      
          <p align=center> 
           <a href="<%=tt%><%=objRS("xxDwj")%>" target="_blank" >选项D附件</a>      
          </p>   
      </td>     
    </tr>     
    <tr>     
      <td width="10%" nowrap height="21"> </td>     
      <td width="90%" height="21"> </td>     
    </tr>     
    <%end if%>      
    <%if (objRS("xxE" )<>"") then%>      
    <tr>      
      <td width="10%" nowrap height="21">      
        <div align="center">      
                
          E</div>     
      </td>     
      <td width="90%" height="21"><%=objRS("xxE")%></td>     
    </tr>     
    <% elseif (objRS("xxEwj" )<>"") then%>      
    <tr>      
      <td width="10%" nowrap height="21">      
        <div align="center">      
           
          E</div>     
      </td>     
      <td width="90%" height="21">      
          <p align=center>  
           <a href="<%=tt%><%=objRS("xxEwj")%>" target="_blank" >选项E附件</a>       
           </p> 
      </td>     
    </tr>     
    <%end if%>      
   <%if ((objRS("xxE" )<>"")and(objRS("xxEwj")<>"")) then%>      
    <tr>      
      <td width="10%" height="21"> </td>     
      <td width="90%" height="21">      
          <p align=center>  
          <a href="<%=tt%><%=objRS("xxEwj")%>" target="_blank" >选项E附件</a>    
           </p>
      </td>     
    </tr>     
    <%end if%>      
  <% if (objRS("Itemtype")=2) then%>     
   <%if (objRS("xxF" )<>"") then%>      
    <tr>      
      <td width="10%" nowrap height="21">      
        <div align="center">      
                
          F</div>     
      </td>     
      <td width="90%" height="21"><%=objRS("xxF")%></td>     
    </tr>     
    <% elseif (objRS("xxFwj" )<>"") then%>      
    <tr>      
      <td width="10%" nowrap height="21">      
        <div align="center">      
           
          F</div>     
      </td>     
      <td width="90%" height="21">      
         <p align=center>   
          <a href="<%=tt%><%=objRS("xxFwj")%>" target="_blank" >选项F附件</a>      
          </p>  
      </td>     
    </tr>     
    <%end if%>      
   <%if ((objRS("xxF" )<>"")and(objRS("xxFwj")<>"")) then%>      
    <tr>      
      <td width="10%" height="36"> </td>     
      <td width="90%" height="36">      
         <p align=center>   
          <a href="<%=tt%><%=objRS("xxFwj")%>" target="_blank" >选项F附件</a>      
          </p>     
      </td>     
    </tr>     
    <%end if%>      
  <%end if%>     
  </table>     
  
     
  <% end if%> <%			
		end if 
		objRS.Close
		NumberOrder=NumberOrder+1
	    FF=FF+1
		loop 
	end if
next
Response.Write "<input type='hidden' value='" & NumberOrder-1 & "' name='Number'>"%> 
  <div align="center">
    <input type="submit" name="SaveP" value="保存随机试卷参数">
    <input type="submit" name="ConvertToD" value="转换为固定试卷">
    <input type="submit" name="SavePD" value="保存参数并转换试卷">
    <input type="submit" name="BackToR" value="修改参数">
    <input type="submit" name="BackToM" value="返回主控页">
  </div>
</form>

  
   
  
<%'此函数用来写出去大题号
function WriteTemp
	select case Temp
		case 1 Response.Write "<font size='4'><strong>一、</strong></font>"
		case 2 Response.Write "<font size='4'><strong>二、</strong></font>"
		case 3 Response.Write "<font size='4'><strong>三、</strong></font>"
		case 4 Response.Write "<font size='4'><strong>四、</strong></font>"
		case 5 Response.Write "<font size='4'><strong>五、</strong></font>"
	end select
	Temp=Temp+1
end function

function WriteTx
	select case tx
		case 1 Response.Write "<font size='4'><strong>单项选择题</strong></font>"
		case 2 Response.Write "<font size='4'><strong>多项选择题</strong></font>"
		case 3 Response.Write "<font size='4'><strong>填空题</strong></font>"
		case 4 Response.Write "<font size='4'><strong>判断题</strong></font>"
		case 5 Response.Write "<font size='4'><strong>分析题</strong></font>"
	end select
	 
end function

%> 

⌨️ 快捷键说明

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