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

📄 datebase.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%>
<%  '选择题库
  select_tk=request.querystring("select_tk")
if session("select_tk")="" and select_tk="" then
      str="select * from tk_name"
	  set rs=conn.execute(str)
	  if rs.eof then
	      response.redirect("date_none.asp")
	  else
	      session("select_tk")=rs("题库表名")
	  end if
end if

if select_tk<>"" then
   str="select * from tk_name where 科目名称='"&select_tk&"'"
   set rs=conn.execute(str)
   session("select_tk")=rs("题库表名")
end if
%>
<%in_test=request.querystring("in_test")
  if in_test="" then in_test="onlyong" 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"> 
      <div align="center" class="unnamed14h20"> 
        <table width="163" border="0" cellspacing="0" cellpadding="0">
          <tr> 
            <td class="unnamed6"> </td>
          </tr>
          <tr> 
            <td background="images/top01.gif" class="unnamed10"> </td>
          </tr>
          <tr> 
            <td height="30" background="images/mid01.gif" class="unnamed14">
<div align="center"><a href="datebase.asp?in_test=onlyong" class="unnamed14wu">增加单选题</a></div></td>
          </tr>
          <tr> 
            <td height="30" background="images/mid01.gif" class="unnamed14">
<div align="center"><a href="datebase.asp?in_test=many" class="unnamed14wu">增加多选题</a></div></td>
          </tr>
          <tr> 
            <td height="30" background="images/mid01.gif" class="unnamed14">
<div align="center"><a href="date_brow.asp" class="unnamed14wu">浏览编辑</a></div></td>
          </tr>
          <tr> 
            <td background="images/bottom01.gif" class="unnamed10"> </td>
          </tr>
          <tr> 
            <td class="unnamed6"> </td>
          </tr>
        </table>
        <table width="163" border="0" cellspacing="0" cellpadding="0">
          <tr> 
            <td class="unnamed6"> </td>
          </tr>
          <tr> 
            <td background="images/top01.gif" class="unnamed10"> </td>
          </tr>
          <tr> 
            <td height="30" background="images/mid01.gif" class="unnamed14"> <div align="center">题库选择</div></td>
          </tr>
     <% str="select * from tk_name"
        set rs=conn.execute(str)
		do while not rs.eof%>
          <tr> 
            <td height="20" background="images/mid01.gif" class="unnamed14"> 
              <div align="center" class="unnamed12"><a href=datebase.asp?select_tk=<%=rs("题库表名")%>><%=rs("科目名称")%></a></div></td>
          </tr>
	 <%rs.movenext
	    loop%>
          <tr> 
            <td background="images/bottom01.gif" class="unnamed10"> </td>
          </tr>
          <tr> 
            <td class="unnamed6"> </td>
          </tr>
        </table>
        <font color="#FF0000"> </font> </div></td>
    <td width="570" valign="top">
<table width="400" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td class="unnamed6"> </td>
        </tr>
      </table>
      <%if in_test="onlyong" then%> <%'写入题库操作 
  if doing="insert" 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
		 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
		 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
		 str="insert into "&session("select_tk")&"(tm_text,img_name,da_a,da_b,da_c,da_d,da_e,da_f,da,select_only) values('"&test_text&"','"&image&"','"&da_a&"','"&da_b&"','"&da_c&"','"&da_d&"','"&da_e&"','"&da_f&"','"&daok&"',1)"
		 conn.execute(str)
	 end if
  end if
%>
      <table width="550" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr> 
          <td><form name="form2" method="post" action="datebase.asp?in_test=onlyong&doing=insert">
              <table width="500" border="1" align="center" cellpadding="0" cellspacing="0">
                <tr> 
                  <td height="30" colspan="2" bgcolor="#CCCCCC" class="unnamed16"> 
                    <div align="center"><strong>增 加 <font color="#0000FF">单 顶</font> 
                      选 择 题  </strong><font color="#FF0000"><span class="unnamed14">当前题库:<%=session("select_tk")%></span></font></div></td>
                </tr>
                <tr> 
                  <td width="80" valign="top" class="unnamed14"> <div align="right">题目内容:</div></td>
                  <td width="420" class="unnamed12">  
                    <textarea style="font-family:宋体;font-size:14px" name="test_text" cols="52" rows="10" id="test_text"></textarea></td>
                </tr>
                <tr> 
                  <%
   file_name=year(now)
   if month(now)<10 then file_name=file_name&"0"&month(now) else file_name=file_name&month(now) end if
   if day(now)<10 then file_name=file_name&"0"&day(now) else file_name=file_name&day(now) end if
   if hour(now)<10 then file_name=file_name&"0"&hour(now) else file_name=file_name&hour(now) end if
   if minute(now)<10 then file_name=file_name&"0"&minute(now) else file_name=file_name&minute(now) end if
   if second(now)<10 then file_name=file_name&"0"&second(now) else file_name=file_name&second(now) end if

⌨️ 快捷键说明

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