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

📄 date_brow.asp

📁 本系统适用于选择题(单选和多选)的练习和考试.主要有七大模块:学习信息、经验交流、学生练习、学生考试、试卷管理、题库操作、身份 资料、成绩查询、系统帮助。超级管理员还可进行系统设置
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<!--#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>
<%if session("zzteacher")=true then%>

<%'修改试题操作
if doing="change" then
     test_text=request.form("test_text")
     test_text=replace(test_text,chr(13),"<br>")
     test_text=replace(test_text," ","&nbsp;")
	 if test_text="" then test_text=" " end if
	 da_a=trim(request.form("da_a"))
	 da_b=trim(request.form("da_b"))
	 if da_a="" or da_b="" then
	      msg="答案A和答案B不能为空"
	 else
	     if session("up_file_name")<>"" then image=session("up_file_name") else image=" " end if
             session("up_file_name")=""
		   da_c=trim(request.form("da_c"))
		   if da_c="" then da_c=" " end if
		   da_d=trim(request.form("da_d"))
		   if da_d="" then da_d=" " end if
		   da_e=trim(request.form("da_e"))
		   if da_e="" then da_e=" " end if
		   da_f=trim(request.form("da_f"))
		   if da_f="" then da_f=" " end if
		   test_no=request.querystring("test_no")
		   in_test=request.querystring("in_test")
		   if in_test="many" then     '为多项选择题
		       sa=request.form("sa")
		       sb=request.form("sb")
		       sc=request.form("sc")
		       sd=request.form("sd")
		       se=request.form("se")
		       sf=request.form("sf")
		       if sa="a" then sa="1" else sa="0" end if
		       if sb="b" then sb="1" else sb="0" end if
		       if sc="c" then sc="1" else sc="0" end if
		       if sd="d" then sd="1" else sd="0" end if
		       if se="e" then se="1" else se="0" end if
		       if sf="f" then sf="1" else sf="0" end if
		       daok=sa&sb&sc&sd&se&sf
			   if image<>" " then
			      str="update "&session("select_tk")&" set tm_text='"&test_text&"',img_name='"&image&"',da_a='"&da_a&"',da_b='"&da_b&"',da_c='"&da_c&"',da_d='"&da_d&"',da_e='"&da_e&"',da_f='"&da_f&"',da='"&daok&"',select_only=0 where id="&test_no&""
			   else
			      str="update "&session("select_tk")&" set tm_text='"&test_text&"',da_a='"&da_a&"',da_b='"&da_b&"',da_c='"&da_c&"',da_d='"&da_d&"',da_e='"&da_e&"',da_f='"&da_f&"',da='"&daok&"',select_only=0 where id="&test_no&""
			   end if
			   conn.execute(str)
			   
		   end if
		   if in_test="onlyone" then   '为单项选择题
		       da_ok=request.form("da_ok")
		       if da_ok="a" then daok="100000" end if
		       if da_ok="b" then daok="010000" end if
		       if da_ok="c" then daok="001000" end if
		       if da_ok="d" then daok="000100" end if
		       if da_ok="e" then daok="000010" end if
		       if da_ok="f" then daok="000001" end if
			   if image<>" " then
			      str="update "&session("select_tk")&" set tm_text='"&test_text&"',img_name='"&image&"',da_a='"&da_a&"',da_b='"&da_b&"',da_c='"&da_c&"',da_d='"&da_d&"',da_e='"&da_e&"',da_f='"&da_f&"',da='"&daok&"',select_only=1 where id="&test_no&""
			   else
			      str="update "&session("select_tk")&" set tm_text='"&test_text&"',da_a='"&da_a&"',da_b='"&da_b&"',da_c='"&da_c&"',da_d='"&da_d&"',da_e='"&da_e&"',da_f='"&da_f&"',da='"&daok&"',select_only=1 where id="&test_no&""
			   end if
			   conn.execute(str)
		   end if		   
	 end if
end if
%>
<%'删除图片
if doing="dele_image" then
   test_no=request.querystring("test_no")
   str="select img_name from "&session("select_tk")&" where id="&test_no&""
   set rs=conn.execute(str)

         dim fs1,del_file
		   del_file="testimages/"&rs("img_name")
		   del_file=Server.MapPath(del_file)
		   set fs1=CreateObject("Scripting.FileSystemObject")
           if fs1.FileExists(del_file) then	
              Set fs1=Server.CreateObject("Scripting.FileSystemObject")
              fs1.DeleteFile del_file,True
		   end if
		   
   str="update "&session("select_tk")&" set img_name=' ' where id="&test_no&""
   conn.execute(str)
end if
%>
<%'删除试题
if doing="dele" then
    dele_id=request.querystring("dele_id")
	str="select img_name from "&session("select_tk")&" where id="&dele_id&""
	set rs=conn.execute(str)
	if rs("img_name")<>"" and rs("img_name")<>" " then
	     dim fs2,del_file2
		      del_file2="testimages/"&rs("img_name")
		      del_file2=Server.MapPath(del_file2)
		      set fs2=CreateObject("Scripting.FileSystemObject")
              if fs2.FileExists(del_file2) then	
                   Set fs2=Server.CreateObject("Scripting.FileSystemObject")
                   fs2.DeleteFile del_file2,True
		      end if
	end if
	str="delete from "&session("select_tk")&" where id="&dele_id&""
	conn.execute(str)%>
<%conn.close%>
<!--#include file="open.asp" -->
<!--#include file="sort.asp" -->

<%end if%>

<%'确定显示第几题
   if doing="sele" then
      test_no=request.form("test_no")
   else
       test_no=request.querystring("test_no")
   end if
   if test_no="" or test_no=0 then test_no=1 end if

%>

<table width="770" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td class="unnamed4"> </td>
  </tr>
</table>

<table width="770" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#ff99cc" bgcolor="#edebdb">
  <tr> 
    <td width="200" valign="top"> 

⌨️ 快捷键说明

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