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

📄 student_lx.asp

📁 在线考试系统源码实现远程判卷
💻 ASP
字号:
<!--#include file="inc/open.asp" -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>学生练习</title>
<!--#include file="inc/css.css" -->
</head>

<body>
<!--#include file="top.asp" -->
<!--#include file="menu.asp" -->
<%
  lx=request("lx_id")
  lx_da=request.form("lx_da")
  str="select * from test_tm"
  set rs=conn.execute(str)
  do while not rs.eof
     bott_id=rs("id")
  rs.movenext
  loop
  if lx="" then
     lx=1
  end if
  if isnumeric(lx)=false then
     lx=1
  end if
  
  lx=int(lx)     '规范所得题数
  if lx>bott_id or lx<=0 then
     lx=1
  end if

 if lx=0 then   '如果是第一次进入从第一题开始
    str="select * from test_tm where id=1"
    set rs=conn.execute(str)
 else
    str="select * from test_tm where id="&lx&""	
	set rs=conn.execute(str)
 end if
%>
<table width="768" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#edebeb">
  <tr> 
    <td width="1" height="1" bgcolor="#FF99CC" class="unnamed1"> </td>
    <td height="1" colspan="3" bgcolor="#FF99CC" class="unnamed1"> </td>
    <td width="1" height="1" bgcolor="#FF99CC" class="unnamed1"> </td>
  </tr>
  <tr> 
    <td width="1" bgcolor="#FF99CC" class="unnamed1"> </td>
    <td width="200" rowspan="2" valign="top"> <table width="163" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr> 
          <td class="unnamed6"> </td>
        </tr>
        <tr> 
          <td background="images/nxmt_lj_46.gif" class="unnamed6"> </td>
        </tr>
        <tr> 
          <td background="images/nxmt_lj_44.gif" class="unnamed12"><div align="center"><font color="#0000FF">正确答案</font></div></td>
        </tr>
        <tr> 
          <td background="images/nxmt_lj_44.gif" class="unnamed6"> </td>
        </tr>
        <tr> 
          <td background="images/nxmt_lj_44.gif" class="unnamed12"> 
            <!--显示正确答案-->
            <div align="center"> 
              <%
  if lx_da<>"" then
     response.write "是: "&rs("da")
  end if
%>
            </div></td>
        </tr>
        <tr> 
          <td background="images/nxmt_lj_44.gif" class="unnamed12">&nbsp;</td>
        </tr>
        <tr> 
          <td background="images/nxmt_lj_44.gif" class="unnamed12">   你选择的是: 
            <%response.write lx_da%></td>
        </tr>
        <tr> 
          <td background="images/nxmt_lj_44.gif" class="unnamed6"><font color="#FF0000"> </font></td>
        </tr>
        <tr> 
          <td background="images/nxmt_lj_44.gif" class="unnamed12"> <div align="center"> 
              <font color="#0000FF"> 
              <%
  if lx_da<>"" then
   if ucase(lx_da)=ucase(rs("da")) then
     response.write "恭喜你,答对了!"
   else
     response.write "答错了,努力啊!"
   end if
  end if
%>
              </font></div></td>
        </tr>
        <tr> 
          <td height="12" background="images/nxmt_lj_45.gif" class="unnamed10"> </td>
        </tr>
      </table>
      <table width="163" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr> 
          <td>&nbsp;</td>
        </tr>
        <tr> 
          <td background="images/nxmt_lj_46.gif" class="unnamed6"> </td>
        </tr>
        <tr> 
          <td background="images/nxmt_lj_44.gif">&nbsp;</td>
        </tr>
        <tr> 
          <td background="images/nxmt_lj_44.gif"><form action="student_lx.asp" method="post" name="lx_id" class="unnamed12" id="lx_id">
              <div align="center">到第 
                <input name="lx_id" type="text" id="lx_id" size="4">
                <input type="submit" name="Submit2" value="去">
                <br>
                <br>
                共有<%=bott_id%>题 </div>
            </form></td>
        </tr>
        <tr> 
          <td background="images/nxmt_lj_45.gif" class="unnamed10"> </td>
        </tr>
      </table></td>
    <td width="1" bgcolor="#FF99CC" class="unnamed1"> </td>
    <td width="570" valign="top" class="unnamed4"> </td>
    <td width="1" bgcolor="#FF99CC" class="unnamed1"> </td>
  </tr>
  <tr> 
    <td bgcolor="#FF99CC" class="unnamed1">&nbsp;</td>
    <td width="1" height="1" bgcolor="#FF99CC">&nbsp;</td>
    <td width="570" height="1"> <table width="100%" border="0">
        <tr class="unnamed12"> 
          <td width="5%">&nbsp;</td>
          <td width="90%" height="25" class="unnamed14">      
            <%
      response.write "第 "&rs("id")&" 题"
%> </td>
          <td width="5%"></td>
        </tr>
        <tr class="unnamed12"> 
          <td width="5%">&nbsp;</td>
          <td width="90%">    
<%
	  response.write rs("tm_text")
      Dim fs,strFileNameAndPath   '检测文件是否存在
	  strFileNameAndPath=rs("img_name")
	  strFileNameAndPath="testimages/"&strFileNameAndPath
      strFileNameAndPath=Server.MapPath(strFileNameAndPath) '你的文件及路径
      set fs=CreateObject("Scripting.FileSystemObject")
    if fs.FileExists(strFileNameAndPath) then	  
	    response.write "<br>"
		response.write "<img src=testimages/"&rs("img_name")&">"
	 end if
%> </td>
          <td width="5%">&nbsp;</td>
        </tr>
        <tr class="unnamed12"> 
          <td width="5%">&nbsp;</td>
          <td width="90%"><form name="form1" method="post" action=student_lx.asp?lx_id=<%=rs("id")%>>
              <table width="100%" border="0">
                <tr> 
                  <td width="5%"> <div align="center"> 
                      <input name="lx_da" type="radio" value="A">
                    </div></td>
                  <td width="5%" class="unnamed12"> <div align="center">A</div></td>
                  <td width="90%" class="unnamed12"><%=rs("da_a")%></td>
                </tr>
                <tr> 
                  <td width="5%"> <div align="center"> 
                      <input type="radio" name="lx_da" value="B">
                    </div></td>
                  <td width="5%" class="unnamed12"> <div align="center">B</div></td>
                  <td width="90%" class="unnamed12"><%=rs("da_b")%></td>
                </tr>
                <tr> 
                  <td width="5%" height="17"> <div align="center"> 
                      <input type="radio" name="lx_da" value="C">
                    </div></td>
                  <td width="5%" class="unnamed12"> <div align="center">C</div></td>
                  <td width="90%" class="unnamed12"><%=rs("da_c")%></td>
                </tr>
                <tr> 
                  <td width="5%"> <div align="center"> 
                      <input type="radio" name="lx_da" value="D">
                    </div></td>
                  <td width="5%" class="unnamed12"> <div align="center">D</div></td>
                  <td width="90%" class="unnamed12"><%=rs("da_d")%></td>
                </tr>
                <tr class="unnamed12"> 
                  <td>&nbsp;</td>
                  <td>&nbsp;</td>
                  <td> <input type="submit" name="Submit" value=" 选 好 了 ">
                      
<%
    m1=rs("id")
    str="select * from test_tm"
    set rs=conn.execute(str)
    if m1=1 then
	  lx_id2=bott_id
	  rs.movenext
	  lx_id1=rs("id")
	else
	  do while rs("id")<m1
	     lx_id2=rs("id")
		 rs.movenext
	  loop
	     rs.movenext
	  if not rs.eof then
	     lx_id1=rs("id")
	  else
	     lx_id1=1
	  end if
	end if

  response.write "<a href=student_lx.asp?lx_id="&lx_id2&"><span class=unnamed12>上一题</span></a>"
  response.write "  "
  response.write "<a href=student_lx.asp?lx_id="&lx_id1&"><span class=unnamed12>下一题</span></a>"
%></td>
                </tr>
              </table>
            </form></td>
          <td width="5%">&nbsp;</td>
        </tr>
      </table></td>
    <td bgcolor="#FF99CC" class="unnamed1">&nbsp;</td>
  </tr>
  <tr> 
    <td width="1" bgcolor="#FF99CC" class="unnamed1"> </td>
    <td height="1" colspan="3" bgcolor="#FF99CC" class="unnamed1"> </td>
    <td width="1" bgcolor="#FF99CC" class="unnamed1"> </td>
  </tr>
</table>
<!--#include file="inc/bottom.inc" -->
<%
  conn.close
%>
</body>
</html>

⌨️ 快捷键说明

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