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

📄 list_chengji.asp

📁 本系统适用于选择题(单选和多选)的练习和考试.主要有七大模块:学习信息、经验交流、学生练习、学生考试、试卷管理、题库操作、身份 资料、成绩查询、系统帮助。超级管理员还可进行系统设置
💻 ASP
字号:
<!--#include file="open.asp" -->
<!--#include file="inc/md5.inc" -->
<%path_name=request.servervariables("SCRIPT_NAME")
strnum=len(path_name)-instrrev(path_name,"/")
self_name=right(path_name,strnum)%>
<%
  doing=request.querystring("doing")
  if doing="login" then  '用户登录
      user_id=trim(request.form("user_id"))
	  pass=trim(request.form("pass"))
	  if user_id<>"" and pass<>"" and instr(user_id,"'")=0 and instr(user_id,"&")=0 then
	      pass=ucase(md5(pass))
		  str="select * from user_teacher where teacher_user='"&user_id&"' and teacher_pass='"&pass&"'"
		  set rs=conn.execute(str)
		  if not rs.eof then
		      session("zzteacher")=true
			  session("name")=rs("teacher_name")
			  if rs("teacher_class")="超级管理员" then session("zzadmin")=true end if
		  else
		      str="select * from user_student where 学籍号='"&user_id&"' and 密码='"&pass&"'"
		      set rs=conn.execute(str)
			  if not rs.eof then
			     session("zzstudent")=true
				 session("student_id")=user_id
				 session("name")=rs("姓名")
				 session("student_bj")=rs("班级")
			  end if
		  end if
	  end if
  end if
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head><!--#include file="inc/css.css" -->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>留溪在线考试</title>
</head>

<body topmargin="1">
<!--#include file="top.asp" -->
<!--#include file="menu.asp" -->
<table width="770" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#ff99cc" bgcolor="#edebdb">
<%if session("zzteacher")=true or session("zzstudent")=true then%>
  <tr> 
    <td height="20" class="unnamed12"><div align="center">用户已登录 用户类别:
	<%if session("zzstudent")=true then%>学生 学籍号:<%=session("student_id")%> 姓名:<%=session("name")%> 班级:<%=session("student_bj")%><%end if%>
	<%if session("zzteacher")=true then%>教师 姓名:<%=session("name")%><%end if%>
	 <%if session("zzadmin")=true then%><a href=system_setup.asp>系统设置</a><%end if%>
		 <a href="quit.asp?back=<%=self_name%>">退出</a></div></td>
  </tr>
<%else%>
  <tr> 
    <td height="20" class="unnamed12"> <form name="form1" method="post" action="<%=self_name%>?doing=login">
        <div align="center">用户登录 输入学籍号或用户名: 
          <input name="user_id" type="text" id="user_id" value=<%=id_disp%> size="20">
           密码: 
          <input name="pass" type="password" id="pass" size="16">
            
          <input type="submit" name="Submit" class="unnamed12" value="登录">
            
          <input type="reset" name="Submit2" class="unnamed12" value="重填">
            <a href="reg.asp?back=<%=self_name%>">注册</a> <a href="rereg.asp">忘记密码</a></div>
      </td></form>
  </tr>
<%end if%>
</table>
<table width="770" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td class="unnamed4"> </td>
  </tr>
</table>

<%if session("zzteacher")=true then%>

<%   '计算成绩
list_name=request.querystring("list_name")
str="select 学籍号,正确答案,完成答案,试题数,正确数,错误数,得分 from "&list_name&""
set rs=conn.execute(str)
do while not rs.eof
  ok=0
  notok=0
  temp1=rs("正确答案")
  temp2=rs("完成答案")
  for m=1 to rs("试题数")
     daok=mid(temp1,m*6-5,6)
	 da=mid(temp2,m*6-5,6)
	 if daok=da then ok=ok+1 else notok=notok+1 end if
  next
  the_id=rs("学籍号")
  cj=ok*100/rs("试题数")
  str="update "&list_name&" set 正确数="&ok&",错误数="&notok&",得分="&cj&" where 学籍号='"&the_id&"'"
  conn.execute(str)
rs.movenext
loop
%>


<table width="770" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#ff99cc" bgcolor="#edebdb">
  <tr>
    <td valign="top"> <table width="600" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td class="unnamed6"> </td>
        </tr>
      </table> 
<%
  str="select * from test_gl where 数据表名='"&list_name&"'"
  set rs=conn.execute(str)
%>
      <table width="680" border="1" align="center" cellpadding="0" cellspacing="0">
        <tr> 
          <td height="30" colspan="4" bgcolor="#CCCCCC"> <div align="center" class="unnamed18"><strong><%=rs("考试名称")%></strong><span class="unnamed12">   考试科目:<%=rs("题库名称")%></span></div></td>
        </tr>
        <tr class="unnamed14"> 
          <td width="20%" height="20"> 
            <div align="center">考试班级</div></td>
          <td width="20%" height="20"> 
            <div align="center"><%=rs("考试班级")%></div></td>
          <td width="20%" height="20"> 
            <div align="center">开始时间</div></td>
          <td width="40%" height="20"> 
            <div align="center"><%=rs("开考时间")%></div></td>
        </tr>
        <tr class="unnamed14"> 
          <td width="20%" height="20"> 
            <div align="center">试题数量</div></td>
          <td width="20%" height="20"> 
            <div align="center"><%=rs("试题数量")%></div></td>
          <td width="20%" height="20"> 
            <div align="center">结束时间</div></td>
          <td width="40%" height="20"> 
            <div align="center"><%=rs("结束时间")%></div></td>
        </tr>
      </table>
<%sorter=request.querystring("sorter")%>
      <table width="560" border="0" align="center" cellpadding="0" cellspacing="0" class="unnamed14">
        <tr> 
          <td height="30"> <div align="left"><a href="test_message.asp">返回</a> 
            </div></td>
          <td><div align="right">
<%if sorter="dcba" then%>
              <a href="list_chengji.asp?list_name=<%=list_name%>">按学籍号排序</a> 
              <%else%>
              <a href="list_chengji.asp?list_name=<%=list_name%>&sorter=dcba">按成绩高低排序</a> 
              <%end if%>
            </div></td>
        </tr>
      </table>
      <table width="680" border="1" align="center" cellpadding="0" cellspacing="0">
        <tr bgcolor="#CCCCCC" class="unnamed12H"> 
          <td> 
            <div align="center">学籍号</div></td>
          <td> 
            <div align="center">姓名</div></td>
          <td> 
            <div align="center">答对数量</div></td>
          <td> 
            <div align="center">答错数量</div></td>
          <td> 
            <div align="center">总得分</div></td>
        </tr>
<%
if sorter="dcba" then
    str="select * from "&list_name&" order by 得分 desc"
else
    str="select * from "&list_name&""
end if
set rs=conn.execute(str)
do while not rs.eof
%>
        <tr class="unnamed12H"> 
          <td><div align="center"><%=rs("学籍号")%></div></td>
          <td><div align="center"><%=rs("姓名")%></div></td>
          <td><div align="center"><%=rs("正确数")%></div></td>
          <td><div align="center"><%=rs("错误数")%></div></td>
          <td><div align="center"><%=rs("得分")%></div></td>
        </tr>
<%rs.movenext
  loop%>
      </table>
      <table width="600" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td class="unnamed6"> </td>
        </tr>
      </table>
      <div align="center" class="unnamed14h20"> <font color="#FF0000"> </font> 
      </div></td>
  </tr>
</table>

<%else%>

<!--#include file="index01.asp" -->

<%end if%>
<!--#include file="inc/bottom.asp" -->
<%conn.close%>
</body>
</html>

⌨️ 快捷键说明

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