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

📄 mod modpaper2.asp

📁 这是用asp做的一个网上考试题库系统
💻 ASP
字号:
 
<%
  if request("back")<>"" then
     response.redirect "ModPaper.asp?PaperID="&Request.QueryString("PaperID")
  end if
  if request("backhome")<>"" then
    response.redirect "Paperxg.asp"
  end if  
 

  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")
   sql="Select * from TestPaper where PaperID="&Request.QueryString("PaperID")
 
  objRS.open sql,objConn,2,3 
     Header= objRS("PaperHeader")                                                      
     id=objRS("PaperType")
     TotalScore=0
     
    Session("dxfs")=clng(Request("dxfs"))
    dx=clng(Request("dxfs"))
    TotalScore=TotalScore+clng(Request("dxfs"))
	 
	Session("dufs")=clng(Request("dufs"))
	du=clng(Request("dufs"))
    TotalScore=TotalScore+clng(Request("dufs"))
	 
    Session("tkfs")=clng(Request("tkfs"))
    tk=clng(Request("tkfs"))
    TotalScore=TotalScore+clng(Request("tkfs"))
	 
	Session("pdfs")=clng(Request("pdfs"))
	pd=clng(Request("pdfs"))
    TotalScore=TotalScore+clng(Request("pdfs"))
	 
	Session("fxfs")=clng(Request("fxfs"))
	fx=clng(Request("fxfs"))
    TotalScore=TotalScore+clng(Request("fxfs"))
	 

 
if clng(TotalScore)<>clng(objRS("TotalMark")) then
   objRS.Close
	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=ModPAper.asp?PaperID="&Request.QueryString("PaperID")&">返回组卷页面</a></p>"
	Response.End 
else
    dim txfs(5)
   
    txfs(1)=CInt(Session("dxfs"))
    objRS("selectvalue")=Session("dxfs")
    txfs(2)=CInt(Session("dufs"))
	objRS("multivalue")=Session("dufs")
	txfs(3)=CInt(Session("tkfs"))
	objRS("tkvalue")=Session("tkfs")
	txfs(4)=CInt(Session("pdfs"))
	objRS("pdvalue")=Session("pdfs")
	txfs(5)=CInt(Session("fxfs"))
	objRS("fxvalue")=Session("fxfs") 
    objRS.Update
    objRS.Close
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"><%=Header%></font></p>

 <form method=post action="ModPaper3.asp?PaperID=<%=Request.QueryString("PaperID")%>">
  <table width="100%" border="0" height="54" cellspacing="0" align="center">     
   
  <% if id=1 then
    temp=1
    for tx=1 to 5
      sql="select * from Paper_Item where Order1="&tx&" and PaperID="&Request.QueryString("PaperID")&" order by  Order2"
      objRS.open sql
      if not objRS.EOF then
     
         response.Write "<tr><td colspan=2>"
         WriteTemp
         WriteTx
         Response.Write "</tr></td>"
      end if
      while not objRS.EOF%>
       <tr>
   <%  select case tx
        case 1		
           tt="../tjst/Temp1/"
		case 2		
         tt="../tjst/Temp3/"
		case 3		
            tt="../tjst/Temp2/"
		case 4		
            tt="../tjst/Temp4/"
		case 5	
            tt="../tjst/Temp5/"
		end select 
      %>  
    <td width="12%" height="34" nowrap> <%=objRS("Order2")%>、 </td>
        <%if objRS("STNR")<>"" then%>       
           
    <td width="88%" height="34" nowrap> 
      <table width="95%"><%=objRS("STNR")%></table></td>     
        </tr>     
        <%else%>
          
    <td width="12%" height="34" nowrap> 
      <p align=center>     
          <a href="<%=tt%><%=objRS("STWJ")%> " target="_blank" align="left" > 试题附件</a></p>     
          </td></tr>     
        <%end if%>      
        <%if ((objRS("STNR")<>"") and (objRS("STWJ")<>"")) then%>      
        <tr> 
          
    <td width="12%" height="34" nowrap> </td>    
          
    <td width="88%" height="16"> 
      <p align=center>     
           <a href="<%=tt%><%=objRS("STWJ")%> " target="_blank" align="left" > 试题附件</a></p>            
          </td></tr> 
        <%end if%>      
    
        <%if tx<3 then%>     
   
           
           <tr>      
           <%if (objRS("xxA" )<>"") then%>      
              
    <td width="12%" nowrap height="3"> 
      <div align="center">A</div>     
              </td>     
              
    <td width="88%" height="3"> 
      <table width="90%"><%=objRS("xxA")%></table></td>     
              </tr>     
             <% else%>      
          
              
    <td width="12%" nowrap height="118"> 
      <div align="center">      
            
              A</div>     
             </td>     
             
    <td width="88%" height="118"> 
      <p align=center>    
               <a href="<%=tt%><%=objRS("xxAwj")%>" target="_blank" >选项A附件</a>     
             </p>
             </td></tr>     
            <%end if%>      
           <%if ((objRS("xxA" )<>"")and (objRS("xxAwj")<>"")) then%>      
             <tr>     
               
    <td width="12%" nowrap height="21"> </td>     
               
    <td width="88%" height="21"> 
      <p align=center>  
                  <a href="<%=tt%><%=objRS("xxAwj")%>" target="_blank" >选项A附件</a>   
                </p>   
              </td>     
             </tr>      
             <tr>      
               
    <td width="12%" nowrap height="21"> </td>     
                
    <td width="88%" height="21"> </td>     
             </tr>     
            <%end if%>     
        
           <%if (objRS("xxB" )<>"") then%>      
              <tr>      
                
    <td width="12%" nowrap height="21"> 
      <div align="center">      
             
                B</div>     
                </td>     
                
    <td width="88%" height="21"> 
      <table width="90%"><%=objRS("xxB")%></table></td>     
             </tr>     
             <% elseif (objRS("xxBwj" )<>"") then%>      
              <tr>      
               
    <td width="12%" nowrap height="21"> 
      <div align="center">      
            
                B</div>     
               </td>     
               
    <td width="88%" 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="12%" nowrap height="21"> </td>     
               
    <td width="88%" height="21"> 
      <p align=center>
               <a href="<%=tt%><%=objRS("xxBwj")%>" target="_blank" >选项B附件</a>   
               </p>    
               </td>     
             </tr>     
             <tr>      
               
    <td width="12%" nowrap height="21"> </td>     
               
    <td width="88%" height="21"> </td>     
             </tr>     
           <%end if%>      
           <%if (objRS("xxC" )<>"") then%>      
              <tr>      
              
    <td width="12%" nowrap height="21"> 
      <div align="center">      
           
                C</div>     
              </td>     
             
    <td width="88%" height="21"> 
      <table width="90%"><%=objRS("xxC")%></table></td>     
             </tr>     
            <% elseif (objRS("xxCwj" )<>"") then%>      
             <tr>      
             
    <td width="12%" nowrap height="21"> 
      <div align="center">      
              
               C</div>     
             </td>     
             
    <td width="88%" 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="12%" nowrap height="21"> </td>     
               
    <td width="88%" height="21"> 
      <p align=center>   
                   <a href="<%=tt%><%=objRS("xxCwj")%>" target="_blank" >选项C附件</a>       
                 </p>
               </td>     
              </tr>     
               <tr>      
                 
    <td width="12%" nowrap height="21"> </td>     
                 
    <td width="88%" height="21"> </td>     
               </tr>     
             <%end if%>      
    <%if (objRS("xxD" )<>"") then%>      
    <tr>      
      
    <td width="12%" nowrap height="21"> 
      <div align="center">      
             
          D</div>     
      </td>     
      
    <td width="88%" height="21"> 
      <table width="90%"><%=objRS("xxD")%></table></td>     
    </tr>     
    <% elseif (objRS("xxDwj" )<>"") then%>      
    <tr>      
      
    <td width="12%" nowrap height="21"> 
      <div align="center">      
          
          D</div>     
      </td>     
      
    <td width="88%" 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="12%" nowrap height="21"> </td>     
      
    <td width="88%" height="21"> 
      <p align=center> 
        <a href="<%=tt%><%=objRS("xxDwj")%>" target="_blank" >选项D附件</a>       
          </p>   
      </td>     
    </tr>     
    <tr>     
      
    <td width="12%" nowrap height="21"> </td>     
      
    <td width="88%" height="21"> </td>     
    </tr>     
    <%end if%>      
    <%if (objRS("xxE" )<>"") then%>      
    <tr>      
      
    <td width="12%" nowrap height="21"> 
      <div align="center">      
                
          E</div>     
      </td>     
      
    <td width="88%" height="21"> 
      <table width="90%"><%=objRS("xxE")%></table></td>     
    </tr>     
    <% elseif (objRS("xxEwj" )<>"") then%>      
    <tr>      
      
    <td width="12%" nowrap height="21"> 
      <div align="center">      
           
          E</div>     
      </td>     
      
    <td width="88%" 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="12%" height="21"> </td>     
      
    <td width="88%" height="21"> 
      <p align=center>  
         <a href="<%=tt%><%=objRS("xxEwj")%>" target="_blank" >选项E附件</a>       
           </p>
      </td>     
    </tr>     
    <%end if%>      
  <% if tx=2 then%>     
   <%if (objRS("xxF" )<>"") then%>      
    <tr>      
      
    <td width="12%" nowrap height="21"> 
      <div align="center">      
                
          F</div>     
      </td>     
      
    <td width="88%" height="21"> 
      <table width="90%"><%=objRS("xxF")%></table></td>     
    </tr>     
    <% elseif (objRS("xxFwj" )<>"") then%>      
    <tr>      
      
    <td width="12%" nowrap height="21"> 
      <div align="center">      
           
          F</div>     
      </td>     
      
    <td width="88%" 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="12%" height="36"> </td>     
      
    <td width="88%" height="36"> 
      <p align=center>   
         <a href="<%=tt%><%=objRS("xxFwj")%>" target="_blank" >选项F附件</a>       
          </p>  
    </td>     
    </tr>     
    <%end if%>      
  <%end if%> 
 <%end if%>
 <%objRS.MoveNext%> <%wend%> 
 <%objRS.Close%>

 <%next%>    
       
 </table> 
     
<% end if%>
 
  <table width="100%" border="0" height="24">
    <tr>
      <td> </td>
    </tr>
  </table>
  <table width="75%" border="0" align="center">
    <tr> 
      <td width="32%" nowrap> 
        <div align="right"> 
          <input type="submit" name="del" value="删除试题">
        </div>
      </td>
      <td width="16%" nowrap> 
        <div align="center"> 
          <input type="submit" name="add" value="填加试题">
        </div>
      </td>
      <td width="14%" nowrap> 
        <div align="center"> 
          <input type="reset" name="Submit3" value="重新选择">
        </div>
      </td>
      <td width="38%" nowrap> 
        <input type="submit" name="back" value="返回上一步">
      </td>
      <td width="38%" nowrap> 
        <input type="submit" name="backhome" value="返回修改主页">
      </td>

    </tr>
  </table>
  <p> </p>
  <p> </p>
</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>单项选择题(共 "&dx&" 分)</strong></font>"
		case 2 Response.Write "<font size='4'><strong>多项选择题(共 "&du&" 分)</strong></font>"
		case 3 Response.Write "<font size='4'><strong>填空题(共 "&tk&" 分)</strong></font>"
		case 4 Response.Write "<font size='4'><strong>判断题(共 "&pd&" 分)</strong></font>"
		case 5 Response.Write "<font size='4'><strong>分析题(共 "&fx&" 分)</strong></font>"
	end select
	 
end function

%>
<%
  for tx=1 to 5
     sql="select * from Paper_Item where Order1="&tx&" and PaperID="&Request.QueryString("PaperID")
     objRS.open sql,objConn,1,1
     c=objRS.RecordCount
     objRS.Close 
     if c>0 then
       t_mark=0
       b_mark=CInt(txfs(tx)/c)
       count=1
       objRS.Open sql,objConn,2,3
       while not objRS.EOF 
         if count=c then
           objRS("Score")=txfs(tx)-t_mark
         else
           objRS("Score")=b_mark
           t_mark=t_mark+b_mark
         end if
          count=count+1
          objRS.Update
          objRS.MoveNext
       wend
        objRS.Close
    end if     
next               
         
       
%>

⌨️ 快捷键说明

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