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

📄 showr_d.asp

📁 这是用asp做的一个网上考试题库系统
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<!--#include file="../db.asp"-->
<%
  if request("BackToR")<>"" then
    Response.Redirect ("./randomsj.asp")
  end if
  if request("BackToM")<>"" then
    Response.Redirect ("../teacherroom.asp")
  end if
  if request("SaveP")<>"" or request("SavePD")<>"" then
    objConn.Open strConnection
    Set objRS = Server.CreateObject ("ADODB.Recordset") 
    if request.QueryString("ID")<>"" then
       sql="Select * from TestPaper where PaperID="&request.QueryString("ID")
    else
        sql="Select * from TestPaper"
    end if     
	objRS.Open sql,objConn,2,3
   if request.QueryString("ID")="" then
     objRS.AddNew
   end if  
   objRS("SelectCourseID")=Session("course_id")
   objRS("PaperType")=2
   objRS("PaperHeader")=Session("Title")
   objRS("StartDate")=Session("csjtime")
   objRS("TotalMark")=Session("TotalScore")
   objRS("TotalTime")=Session("TotalTime")
   objRS("Author")= Session("csjr") 
   objRS("selectvalue")=Session("dxfs")
   objRS("multivalue")=Session("dufs")
   objRS("tkvalue")=Session("tkfs")
   objRS("pdvalue")=Session("pdfs")
   objRS("fxvalue")=Session("fxfs")
   objRS.Update
   objRS.Close
  
  if request.QueryString("ID")="" then
     sql="Select MAX(PaperID) as id from TestPaper"
  end if       
  objRS.Open sql,objConn
  if request.QueryString("ID")="" then
    id=objRS("id")
  end if  
  objRS.Close
    if request.QueryString("ID")<>"" then
       sql="Select * from RandomPara where PaperID="&request.QueryString("ID")
    else
        sql="Select * from RandomPara"
    end if       
	objRS.Open sql,objConn,2,3
    if request.QueryString("ID")="" then
      objRS.AddNew
      objRS("PaperID")=id
    end if 
    TxCount=Session("Txlist")
   objRS("dxCount")=TxCount(1)
   objRS("duCount")=TxCount(2)
   objRS("tkCount")=TxCount(3)
   objRS("pdCount")=TxCount(4)
   objRS("fxCount")=TxCount(5)
   ndlist=Session("ndlist")
   objRS("nd1")=ndlist(1)
   objRS("nd2")=ndlist(2)
   objRS("nd3")=ndlist(3)
   objRS("nd4")=ndlist(4)
   objRS("nd5")=ndlist(5)
   RzArray=Session("Rzlist")   
   objRS("Know")=RzArray(0)
   objRS("Grasp")=RzArray(1)
   objRS("Applicate")=RzArray(2)
   objRS("Evaluate")=RzArray(3)
   objRS("Synthetize")=RzArray(4)
   objRS("Analyse")=RzArray(5)
   objRS("Checkman")=Session("ssjr")
   objRS("Checktime")=Session("ssjtime")
   objRS.Update
   objRS.Close
   
   if request("SaveP")<>"" then
    Response.Redirect ("../teacherroom.asp")
   end if
  end if
 if request("ConvertToD")<>"" or request("SavePD")<>"" then
PaperItemID=Session("PaperItemArray")
if request("SavePD")<>""then%>
<p align="right"><font size="4" color="red">随机试卷参数已保存</font></p>
<% end if%>
<p align="center"><font size="4" color="red">试卷预览</font></p>
<p align="left"><font size="4" color="red">试卷标题:</font><font size="4" color="blue"><%Response.Write Session("Title")%></font></p>
<form method="post" action="PaperMod.asp" name="Form1" id="Form1">
<%
  Set objConn = Server.CreateObject ("ADODB.Connection")
  strConnection = "Data Source = ks;"
  strConnection = strConnection & "User ID =lili;Password=;" 
  objConn.Open strConnection
  Set objRS = Server.CreateObject ("ADODB.Recordset")
  Set objRS.ActiveConnection = objConn


'Temp用来纪录大题号,NumberOrder用来纪录总的题号
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
	  if PaperItemID(tx,FF)<>0 then
	   ItemNumber=ItemNumber+1
	  end if 
	   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
		   if PaperItemID(tx,FF)<>0 then
		    strQ="Select * from ItemTable where ItemID="&PaperItemID(tx,FF)
            objRS.open strQ
			Response.Write k & "."
			k=k+1
			
			Response.Write "<input type='checkbox' value='"& objRS("ItemID") &"' name='CheckBox'>"
			 
			%>
			
			
  <table width="100%" border="0" height="54" cellspacing="0" align="center">     
    <tr>      
      <td width="11%" height="34" nowrap>      
        <div align="left">试题内容:</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>

⌨️ 快捷键说明

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