作业提交系统界面设计1管理员添加用户的界面与编码代码:<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%><%const need_purview=3%><!--#include file="../localhost.asp"--><!--#include file="show_error.asp"--><!--#include file="../purview.asp"--><%response.expires=0%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""/TR/html4/loose.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>添加管理组成员</title><link href="../eric.css" rel="stylesheet" type="text/css"></head><body><form name="add_manager" method="post"action="admin_check.asp?action=add_manager"><table width="600" border="0" align="center" cellpadding="4" cellspacing="1" id="table_01"><tr><td width="120" class="white_bold_blue">添加管理组成员</td><td width="240" class="white_bold_blue"> </td><td width="212" class="white_bold_blue">说明:</td></tr><td>用户名:</td><td><input name="username" type="text" class="input_text_01" id="username" size="20" maxlength="20"></td><td>请使用英文1-20</td></tr><tr><td>密码:</td><td><input name="password" type="password" class="input_text_01"id="password" size="20" maxlength="20"></td><td>8-20位的密码</td></tr><tr><td>确认密码:</td><td><input name="passwordq" type="password" class="input_text_01"id="passwordq" size="20" maxlength="20"></td><td>再输入一遍密码,以确认</td></tr><tr><td>教师名:</td><td><input name="teacher_name" type="text" class="input_text_01"id="teacher_name" size="20" maxlength="20"></td><td> </td></tr><tr><td>权限:</td><td><select name="purview" id="purview"><option value="2">普通教师</option><option value="3">系统管理员</option></select></td><td class="red_12pt_font">当前系统设定权限后不可更改,请慎重</td></tr><tr><td>备注:</td><td> <textarea name="remark" cols="30" rows="3"class="input_textarea_01" id="remark"></textarea></td><td>可以不填</td></tr><tr><td colspan="3" class="center"><input type="submit" name="Submit" value="提交"> <input type="reset" name="Submit2" value="重置"></td></tr></table></body></html>2 用户管理界面代码:<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%><%const need_purview=3%><!--#include file="../localhost.asp"--><!--#include file="conn.asp"--><!--#include file="../lockip.asp"--><!--#include file="show_error.asp"--><!--#include file="../purview.asp"--><%response.expires=0%><SCRIPT language=javascript>//确认窗口function ConfirmDel(id){url="show_detail_info.asp?action=del_manager&id="+idif(confirm("确定要删除该账号吗?删除将不能恢复!所有该教师布置的作业和学生上传的作业将删除!以及相关学生的注册信息。
请慎重!?"))location=url}</SCRIPT><html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>用户管理</title><link href="../eric.css" rel="stylesheet" type="text/css"><style type="text/css"><!--.style1 {color: #FF0000}--></style></head><body><table width="600" border="0" align="center" cellpadding="4" cellspacing="1"id="table_01"><tr><td width="50" class="white_bold_blue">用户名</td><td width="50" class="white_bold_blue">姓名:</td><td width="90" class="white_bold_blue">班级:</td><td width="70" class="white_bold_blue">备注:</td><td width="90" class="white_bold_blue">权限:</td><td width="90" class="white_bold_blue">操作:</td></tr><%dim sql_50sql_50="select * from eric_manager"call opendb()set rs=conn.execute (sql_50)do while not rs.eof%><tr><td width="50"><%=trim(rs("eric_manager"))%></td><td width="50"><%=trim(rs("teacher"))%></td><td width="90"><%=trim(rs("class_e"))%></td><td width="70"><%=trim(rs("remark"))%></td><td width="90"><%if rs("purview")=2 thenresponse.write "普通教师"elseif rs("purview")=3 thenresponse.write "系统管理员<span class='style1'>* </span> "end if%></td><td width="200" class="center"><input name="modify" type="button"id="modify"onclick="window.location.href='show_detail_info.asp?action=update_ma nager&id=<%=rs("id")%>'" value="修改"><input type="button" name="is_lock" value="<%dim actif rs("is_lock")=false thenact="锁定"elseact="解锁"end ifresponse.write act%>"onclick="window.location.href='show_detail_info.asp?action=lock_manager&id=<%=r s("id")%>&is_lock=<%=act%>'"> <input name="del" type="submit" id="del" value="删除" onclick="return ConfirmDel(<%=rs("id")%>)"></td></tr><%rs.movenextloopcall closers()call closedb()%></table></body></html>3 教师添加班级的界面与编码代码:<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%><%const need_purview=2%><!--#include file="../localhost.asp"--><!--#include file="show_error.asp"--><!--#include file="../purview.asp"--><%response.expires=0if session("purview")>2 thencall error("对不起,该系统目前该功能只对教师开放,如有需要,请自建一个教师帐号!--><a href='control/admin_main.asp' target='_parent'>返回管理首页</a>") call Iserror()response.endend if%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""/TR/html4/loose.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>网上作业提交系统</title><link href="../eric.css" rel="stylesheet" type="text/css"><style type="text/css"><!--.style3 {color: #FFFFFF; font-weight: bold; font-size: 14px; }--></style></head><body><form name="form1" method="post" action="admin_check.asp?action=add_class"><table width="600" border="0" align="center" cellpadding="4" cellspacing="1" id="table_01"><tr><td width="181" class="white_bold_blue">添加班级:</td><td width="226" class="white_bold_blue"> </td><td width="165" class="white_bold_blue">说明:</td></tr><tr><td>添加你教的班级:</td><td><input name="class_er" type="text" class="input_text_01"id="class_er" size="20" maxlength="20"></td><td>如:计科0701班</td></tr><tr><td colspan="3"><span class="red_bold_14pt_font">注意:</span><table width="500" border="0" align="center" cellpadding="4" cellspacing="1" id="table_02"><tr><td width="16" height="16" align="center" valign="middle" bgcolor="#0099CC" class="style3">1</td><td width="464" class="red_12pt_font"> 在添加完成该操作后,系统会创建以此命名的文件夹,请不要随意改动(如更名,会大来大量的数据操作!),或者删除,学生的作业都将提交到该文件夹下面,一旦删除,则所有该班级的作业都将删除,无法恢复,请慎重! </td></tr><tr><td width="16" height="16" align="center" valign="middle" bgcolor="#0099CC" class="style3">2</td><td>如果你教授多个班级,请一个添加完成后,继续添加</td></tr><tr><td height="16" align="center" valign="middle" bgcolor="#0099CC" class="style3">3</td><td>只用添加了班级才能布置作业给相应的班级</td></tr><tr><td height="16" align="center" valign="middle" bgcolor="#0099CC" class="style3">4</td><td>还有什么疑问,可以问系统管理员.</td></tr><tr><td height="16" align="center" valign="middle" bgcolor="#0099CC" class="style3">5</td><td class="red_12pt_font">当前系统班级文件夹建立后,不允许改名,下一版支持</td></tr></table><br></td></tr><tr><td colspan="3" class="center"><input type="submit" name="Submit" value="提交"> <input type="reset" name="Submit2" value="重置"></td></tr></table></form></body></html>4 教师布置作业的界面与编码代码:<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%><%const need_purview=2%><!--#include file="../localhost.asp"--><!--#include file="conn.asp"--><!--#include file="show_error.asp"--><!--#include file="../purview.asp"--><%response.buffer=true%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""/TR/html4/loose.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>布置作业</title><link href="../eric.css" rel="stylesheet" type="text/css"><style type="text/css"><!--.style3 {color: #FFFFFF; font-weight: bold; font-size: 14px; }--></style></head><body><form name="form1" method="post" action="admin_check.asp?action=add_homework"> <table width="600" border="0" align="center" cellpadding="4" cellspacing="1" id="table_01"><tr><td width="163"class="white_bold_blue">布置作业:</td><td width="237" class="white_bold_blue"> </td><td width="172" class="white_bold_blue">说明</td></tr><tr><td>作业名称:</td><td><input name="homework_name" type="text" class="input_text_01"id="homework_name" size="20" maxlength="20"></td><td>如:圆弧连接</td></tr><tr><td>当前是否允许上传作业:</td><td><input name="is_upload" type="radio" value="1" checked>允许上传<input type="radio" name="is_upload" value="-1">不允许上传</td><td>该功能可以用在限制时段交作业</td></tr><tr><td>面向的对象:</td><td><select name="object_e" size="3" multiple class="select_01"id="object_e"><%if session("purview")>2 thenresponse.clearcall error("对不起该功能目前只对普通开放,系统管理员如有需要,请另建一教师账号,使用该功能!")call Iserror()response.endend ifdim sql_61sql_61="select eric_manager,class_e from eric_manager whereeric_manager='" & session("teacher") & "' and class_e<>''"call opendb()set rs=conn.execute(sql_61)if rs.eof thencall closers()call closedb()response.clearcall error("当前该教师没有班级,不能布置作业!请先添加授课班级或请与系统管理员联系!")call Iserror()response.endelsedim class_eclass_e=rs("class_e")call closers()call closedb()if Instr(class_e,"|")>0 thenarray_class_e=split(class_e,"|")for i=0 to ubound(array_class_e)response.write "<option value='" & array_class_e(i) & "'>" &array_class_e(i) & "</option>"nextelseresponse.write "<option value='" & class_e & "'>" & class_e & "</option>"end ifend if%></select></td><td>按住ctrl选择多个班级</td></tr><tr><td>内容:</td><td><textarea name="content" cols="30" rows="8" class="input_textarea_01" id="content"></textarea></td><td> </td></tr><tr><td>上传相关文件:</td><td> </td><td> </td></tr><tr><td colspan="3"><span class="red_bold_14pt_font">注意:</span><table width="500" border="0" align="center" cellpadding="4"cellspacing="1"id="table_02"><tr><td width="16" height="16" align="center" valign="middle"bgcolor="#0099CC" class="style3">1</td><td width="464" class="red_12pt_font"> 在添加完成该操作后,系统会创建以此命名的文件夹,请不要随意改动(如更名,会带来大量的数据操作!),或者删除,学生的作业都将提交到该文件夹下面,一旦删除,则所有该次作业都将删除,无法恢复,请慎重! </td></tr><tr><td width="16" height="16" align="center" valign="middle"bgcolor="#0099CC" class="style3">2</td><td>如果你要布置多个作业,请一个添加完成后,再继续添加</td></tr><tr><td height="16" align="center" valign="middle" bgcolor="#0099CC" class="style3">3</td><td>只用添加了班级才能布置作业给相应的班级</td></tr><tr><td height="16" align="center" valign="middle"bgcolor="#0099CC"class="style3">4</td><td>还有什么疑问,可以问系统管理员.</td></tr><tr><td height="16" align="center" valign="middle" bgcolor="#0099CC" class="style3">5</td><td class="red_12pt_font">当前版本系统不允许更改作业名称!</td></tr></table></td></tr><tr><td colspan="3" class="center"><input type="submit" name="Submit" value="提交"> <input type="reset" name="Submit2" value="重置"></td></tr></table></form></body></html>5 教师下载及批改作业的界面与编码代码:grade=trim(request.form("grade"))If grade>=0 and grade <=100 Then'成绩为有效数字id=trim(request.querystring("id"))'过滤字符if id<>"" Thencall opendb()set rs=conn.execute("select * from upload_info where id=" & id)if rs.eof Thencall error("非法参数!")call Iserror()response.Endelsehomework_name=rs("upload_homework_name")class_object=rs("class_e")end Ifcall closers()call closedb()end Ifcall opendb()conn.execute("update upload_info set grade='"& grade&"',edit_time='"&now()&"' where id="&id)call closedb()Elsecall error("输入的成绩无效!")call Iserror()End Ifresponse.redirect"manage_homework.asp?action=homework_detail&homework_name="&homework_name&"&cla ss_object="&class_object6 学生用户注册的界面与编码7 学生上传作业的界面与编码8 学生查看自己作业提交情况及得分的界面与编码代码:<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%><%const need_purview=1%><!--#include file="localhost.asp"--><!--#include file="conn.asp"--><!--#include file="lockip.asp"--><!--#include file="show_error.asp"--><!--#include file="purview.asp"--><html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title></title><link href="eric.css" rel="stylesheet" type="text/css"><SCRIPT language=javascript>function openScript(url, width, height) {var Win = window.open(url,"openScript",'width=' + width + ',height=' + height + ',resizable=0,scrollbars=yes,menubar=no,status=n0' );}</SCRIPT></head><body><%dim sql_80sql_80="select * from homework where object_class='" &session("student_class") & "' and homework_name<>'' order by id desc"'使最近的一次作业排在最前,sql_81= "select * from upload_info where class_e='" & session("student_class") & "' and upload_username='" & session("student") & "' order by id desc"'使最后上传的文件排在最前面call opendb()set rs=conn.execute(sql_80)if not rs.eof thenarray_01=rs.getrows()'取得SElECTa Recordset的二维数组rows_01=ubound(array_01,2)'取得array_01第二维的下界'set rs=rs.NextRecordset '使用Nextrecordset激活下一个recordsetcall closers()set rs=conn.execute(sql_81)if not rs.eof thenis_upfile=truearray_02=rs.GetRows '再次取得第二个SElECTb Recordset的二维数组rows_02=ubound(array_02,2)'取得array_02第二维的下界elseis_upfile=falseend ifcall closers()elsecall closers()call closedb()response.write "<spanclass='red_bold_14pt_font'>当前未有布置的作业!</span>"response.endend if'call closedb()%><table width="600" border="0" align="center" cellpadding="4" cellspacing="1" id="table_01"><tr><td width="39" class="white_bold_blue">序号</td><td width="157" class="white_bold_blue">作业名称:</td><td width="60" class="white_bold_blue">授课教师</td><td width="158" class="white_bold_blue">操作:</td><td width="105" class="white_bold_blue">布置及上传时间</td><td width="95" class="white_bold_blue">得分:</td><td width="95" class="white_bold_blue">备注:</td></tr><%for i=0 to rows_01%><tr><td align="center" class="white_bold_blue"><%=i+1%></td><td><a title="点击查看该次作业内容!"href=javascript:openScript('detail.asp?id=<%=array_01(0,i)%>',418,300)><%=array _01(2,i)%></a><% '第2列第i行,数据库表中homework中的字段不能随意添加或删除%></td><td align="center"><%=array_01(6,i)%></td><td><%if array_01(4,i)=true then'是否允许上传response.write "<a href='upload.asp?id=" & array_01(0,i) &"&work_name=" & array_01(2,i) & "'>[上传]</a>"elseif array_01(4,i)=false thenresponse.write "<FONT SIZE='2' COLOR='red'>[当前不允许上传该作业]</FONT>"end if%></td><td><%=array_01(3,i)%><%'布置作业的时间%></td><td> </td><td> </td></tr><%if is_upfile=true thenk=0for j=0 to rows_02if array_01(2,i)=array_02(5,j) And array_01(6,i)=array_02(7,j) then k=k+1%><tr><td colspan="2"><%=right(array_02(2,j),len(array_02(2,j))-instrRev(array_02(2,j),"/"))%><%'输出上传的文件名%></td><td> </td><td><ahref="download.asp?work_name=<%=array_01(2,i)%>&id=<%=array_02(0,j)%>&FileName= <%=right(array_02(2,j),len(array_02(2,j))-instrRev(array_02(2,j),"/"))%>">[下载]</a> <%if array_01(4,i)=true thenresponse.write "<a href='check.asp?action=delete_upfile&id=" & array_02(0,j) & "'>[删除]</a>"end if%> </td><td><%=array_02(4,j)%></td><td align="center"><% if array_02(9,j)>=0 Thenresponse.write array_02(9,j)&"分"elseresponse.write "未批阅"end if%></td><td> </td></tr><%end ifnextif k=0 then%><tr><td colspan="2"><FONT SIZE="2" COLOR="red">当前你未提交本次作业!</FONT></td><td> </td><td> </td>。