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

📄 showpaper.asp

📁 这是用asp做的一个网上考试题库系统
💻 ASP
字号:
<%
if Request.QueryString ("time")<>3 then
TotalScore=0
TotalTime=0
    Session("dxfs")=clng(Request("dxfs"))
	TotalScore=TotalScore+clng(Request("dxfs"))
	TotalTime=TotalTime+clng(Request("dxsj"))
	Session("dufs")=clng(Request("dufs"))
    TotalScore=TotalScore+clng(Request("dufs"))
	TotalTime=TotalTime+clng(Request("dusj"))
    Session("tkfs")=clng(Request("tkfs"))
    TotalScore=TotalScore+clng(Request("tkfs"))
	TotalTime=TotalTime+clng(Request("tksj"))
	Session("pdfs")=clng(Request("pdfs"))
    TotalScore=TotalScore+clng(Request("pdfs"))
	TotalTime=TotalTime+clng(Request("pdsj"))
	Session("fxfs")=clng(Request("fxfs"))
	TotalScore=TotalScore+clng(Request("fxfs"))
	TotalTime=TotalTime+clng(Request("fxsj"))

 
if clng(TotalScore)<>clng(Session("TotalScore")) then
	Response.Write "<p align='left'><font color='red'>系统信息:</font></p>"
	Response.Write "<p align='center'><font size='3'>对不起,您所输入的各类试题要测验的分数之和不等于您在第一步骤中所输入的试卷/作业的总分数,请返回重新输入!</font></p>"
	Response.Write "<p align='center'><a href='gdsj.asp'>返回手工组卷页面</a></p>"
	Response.End 
else
	if clng(TotalTime)>clng(Session("TotalTime")) then
		Response.Write "<p align='left'><font color='red'>系统信息:</font></p>"
		Response.Write "<p align='center'><font size='3'>对不起,您所输入的各类试题要测验的时间之和不等于您在第一步骤中所输入的试卷/作业的总的测验时间,请返回重新输入!</font></p>"
		Response.Write "<p align='center'><a href='gdsj.asp'>返回手工组卷页面</a></p>"
		Response.End 
    end if
end if   
end if
%> 
<%PaperItemID=Session("PaperItemArray")%>
<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" align="left" > 试题附件</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" align="left" > 试题附件</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%>
 


<%			
		objRS.Close
		end if
		NumberOrder=NumberOrder+1
	    FF=FF+1
		loop 
	end if
next
Response.Write "<input type='hidden' value='" & NumberOrder-1 & "' name='Number'>"%>

  <p align="center"><font color='red'>如要添加新试题,请点击下列相应连接</font></p>
<center>
    <table border=1 align="center" bordercolor=#ffffff bordercolorlight=#0066cc cellspacing=0 width="750">
      <tr align="center">
        <td><font color="#FF0000">添加试题到数据库和该试卷</font></td>
        <td align="center"><a href="../tjst/Dah.asp?tx=1&Added=1&BackTo=gdsjStep2.asp">单选题</a></td>
        <td align="center"><a href="../tjst/Duh.asp?tx=2&Added=1&BackTo=gdsjStep2.asp">多选题</a></td>
        <td align="center"><a href="../tjst/tiankongh.asp?tx=3&Added=1&BackTo=gdsjStep2.asp">填空题</a></td>
        <td align="center"><a href="../tjst/pdh.asp?tx=4&Added=1&BackTo=gdjsStep2.asp">判断题</a></td>
    
        <td align="center"><a href="../tjst/fxh.asp?tx=5&Added=1&BackTo=gdjsStep2.asp">分析题</a></td>
        <tr>
  <tr align="center">
        <td><font color="#FF0000">只是添加试题到该试卷中</font></td>
        <td align="center"><a href="selItem.asp?tx=1">单选题</a></td>
        <td align="center"><a href="selItem.asp?tx=2">多选题</a></td>
        <td align="center"><a href="selItem.asp?tx=3">填空题</a></td>
        <td align="center"><a href="selItem.asp?tx=4">判断题</a></td>
    
        <td align="center"><a href="selItem.asp?tx=5">简答题</a></td>
    </tr>
</table></center>
  <p align="center">
    <input type="submit" name="Save" value="&nbsp;&nbsp;保存该试卷&nbsp;&nbsp;">
    <small><small><font size="2"></font></small></small> 
    <input type="submit" name="ShanChu" value="删除选中的试题">
  </p>
  <%'此函数用来写出去大题号
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

%>
 </form>

⌨️ 快捷键说明

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