JavaWeb项目开发案例精粹-第3章在线考试系统-007View层
0.login.jsp
1 <%@ page language="java" import="java.util.*" pageEncoding="gbk"%> 2 <%@ taglib prefix="s" uri="/struts-tags"%> 3 <html> 4 <head> 5 <title>教师(学生)登录页面</title> 6 <style type="text/css"> 7 <!-- 8 body { 9 margin-left: 0px; 10 margin-top: 0px; 11 margin-right: 0px; 12 margin-bottom: 0px; 13 background-color: #1D3647; 14 } 15 .STYLE1 {color: #E6EBF1} 16 --> 17 </style> 18 <link href="teacher/images/skin.css" rel="stylesheet" type="text/css"> 19 </head> 20 21 <body> 22 <table width="100%" height="166" border="0" cellpadding="0" cellspacing="0"> 23 <tr> 24 <td height="42" valign="top"><table width="100%" height="42" border="0" cellpadding="0" cellspacing="0" class="login_top_bg"> 25 <tr> 26 <td width="1%" height="21"> </td> 27 <td height="42"> </td> 28 <td width="17%"> </td> 29 </tr> 30 </table></td> 31 </tr> 32 <tr> 33 <td valign="top"><table width="100%" height="532" border="0" cellpadding="0" cellspacing="0" class="login_bg"> 34 <tr> 35 <td width="49%" align="right"><table width="91%" height="532" border="0" cellpadding="0" cellspacing="0" class="login_bg2"> 36 <tr> 37 <td height="138" valign="top"><table width="89%" height="427" border="0" cellpadding="0" cellspacing="0"> 38 <tr> 39 <td height="149"> </td> 40 </tr> 41 <tr> 42 <td height="80" align="right" valign="top"> </td> 43 </tr> 44 <tr> 45 <td height="198" align="right" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0"> 46 <tr> 47 <td width="35%"> </td> 48 <td width="65%" height="25" class="left_txt"><p>1- 教师录入考试题目以及答案信息</p></td> 49 </tr> 50 <tr> 51 <td> </td> 52 <td height="25" class="left_txt"><p>2- 学生参加考试并自动评分和查看正确答案</p></td> 53 </tr> 54 <tr> 55 <td> </td> 56 <td height="25" class="left_txt"><p>3- 教师查看学生考试成绩</p></td> 57 </tr> 58 </table></td> 59 </tr> 60 </table></td> 61 </tr> 62 63 </table></td> 64 <td width="1%" > </td> 65 <td width="50%" valign="bottom"><table width="100%" height="59" border="0" align="center" cellpadding="0" cellspacing="0"> 66 <tr> 67 <td width="4%"> </td> 68 <td width="96%" height="38"><span class="login_txt_bt">教师(学生)登录</span></td> 69 </tr> 70 <tr> 71 <td> </td> 72 <td height="21"><table cellSpacing="0" cellPadding="0" width="100%" border="0" id="table211" height="328"> 73 <tr> 74 <td height="164" colspan="2" align="middle"> 75 <form name="myform" action="login.action" method="post"> 76 <table cellSpacing="0" cellPadding="0" width="100%" border="0" height="143" id="table212"> 77 <tr> 78 <td colspan="2"><FONT color="red"><s:actionerror/></FONT></td><!--显示错误信息 --> 79 </tr> 80 <tr> 81 <td width="14%" height="38" class="top_hui_text"><span class="login_txt">编号: </span></td> 82 <td height="38" colspan="2" class="top_hui_text"><input name="id" class="editbox4" value="" size="20"> </td> 83 </tr> 84 <tr> 85 <td width="14%" height="35" class="top_hui_text"><span class="login_txt"> 密 码: </span></td> 86 <td height="35" colspan="2" class="top_hui_text"><input class="editbox4" type="password" size="20" name="password"> 87 <img src="teacher/images/luck.gif" width="19" height="18"> </td> 88 </tr> 89 <tr> 90 <td width="14%" height="35" ><span class="login_txt">登录角色:</span></td> 91 <td height="35" colspan="2" class="login_txt"><input type="radio" name="role" value="teacher" checked="checked">教师 92 <input type="radio" name="role" value="student">学生</td> 93 </tr> 94 <tr> 95 <td height="35" > </td> 96 <td width="19%" height="35" ><input name="Submit" type="submit" class="button" id="Submit" value="登 录"> </td> 97 <td width="67%" class="top_hui_text"><input name="cs" type="button" class="button" id="cs" value="取 消" onClick="showConfirmMsg1()"></td> 98 </tr> 99 </table> 100 <br> 101 </form></td> 102 </tr> 103 <tr> 104 <td width="433" height="164" align="right" valign="bottom"><img src="teacher/images/login-wel.gif" width="242" height="138"></td> 105 <td width="57" align="right" valign="bottom"> </td> 106 </tr> 107 </table></td> 108 </tr> 109 </table> 110 </td> 111 </tr> 112 </table></td> 113 </tr> 114 <tr> 115 <td height="20"><table width="100%" border="0" cellspacing="0" cellpadding="0" class="login-buttom-bg"> 116 <tr> 117 <td align="center"><span class="login-buttom-txt STYLE1">在线考试系统Copyright © 2009-2010 </span></td> 118 </tr> 119 </table></td> 120 </tr> 121 </table> 122 </body> 123 </html>
1.student/index.jsp
1 <%@ page language="java" import="java.util.*" pageEncoding="gbk"%> 2 <%@ taglib prefix="s" uri="/struts-tags"%> 3 <html> 4 <head> 5 <title>开始考试</title> 6 <link href="student/images/css2.css" rel="stylesheet" type="text/css"/> 7 <style type="text/css"> 8 <!-- 9 .STYLE3 {font-size: 18px; } 10 .STYLE4 {font-size: 18px; font-weight: bold; } 11 .STYLE5 {color: #FF0000} 12 --> 13 </style> 14 <script type="text/javascript"> 15 var ksTime; //定义考试时间以分钟计算 16 ksTime = 120;//设置时间 这里设置为0.1代表是6秒,测试用 17 if(readCookie("ss")==""){ 18 setCookie("ss",new Date(),ksTime/60); 19 } 20 function sT(){ 21 var tti = new Date(); 22 var lt = parseInt((tti-new Date(readCookie("ss")))/1000) 23 if((ksTime*60-lt)<0){ 24 setCookie("ss",new Date(),0); 25 alert("考试时间到!\n即将提交试卷!"); 26 document.forms[0].submit(); 27 }else{ 28 lm = Math.floor(lt / 60); 29 ls = lt % 60; 30 allY = ksTime*60-lt; 31 ym = Math.floor(allY / 60); 32 ys = allY % 60; 33 document.getElementById("tTime").innerHTML = "考试已经开始了" + lm + "分" + ls + "秒" + ",剩余" + ym + "分" + ys + "秒"; 34 var ttt = setTimeout("sT()",1000); 35 } 36 } 37 function readCookie(name) { 38 var cookieValue = ""; 39 var search = name + "="; 40 if(document.cookie.length > 0) { 41 offset = document.cookie.indexOf(search); 42 if (offset != -1) { 43 offset += search.length; 44 end = document.cookie.indexOf(";", offset); 45 if (end == -1) 46 end = document.cookie.length; 47 cookieValue = document.cookie.substring(offset, end) 48 } 49 } 50 return cookieValue; 51 } 52 function setCookie(name, value, hours) { 53 var expire = ""; 54 if(hours != null) { 55 expire = new Date((new Date()).getTime() + hours * 3600000); 56 expire = "; expires=" + expire.toGMTString(); 57 } 58 document.cookie = name + "=" + value + expire; 59 } 60 </script> 61 </head> 62 63 <body onload="sT()"> 64 <table width="1003" height="485" border="0" cellpadding="0" cellspacing="0" class="centerbg"> 65 <tr> 66 <td width="149" height="485"> </td> 67 <td width="741" valign="top" class="rightbian"> 68 <form action="submitExam.action" method="post"> 69 <table width="98%" border="0" align="center" cellpadding="0" cellspacing="10"> 70 <tr> 71 <td><div align="center" class="STYLE3">考试时间:120 分钟</div></td> 72 <td><div align="center" class="STYLE3">考生:${sessionScope.studentInfo.studentName}</div></td> 73 <td><div align="center" class="STYLE3">总分 :100 分</div></td> 74 </tr> 75 <tr> 76 <td> </td> 77 <td><div id="tTime"></div></td> 78 <td> </td> 79 </tr> 80 <tr> 81 <td colspan="3" bgcolor="#999999" class="STYLE4">选择题(每小题5分,共20个)</td> 82 </tr> 83 <!--题目开始--> 84 85 <s:iterator value="#request.subjects" var="subject" status="sta"> 86 <tr> 87 <input type="hidden" name="subjectID" value="${subject.subjectID}"/> 88 <td colspan="3"><strong>第<span class="STYLE5">${sta.index + 1}</span>题 ${subject.subjectTitle}</strong> </td> 89 </tr> 90 <tr> 91 <td colspan="3"><strong>A.</strong>${subject.subjectOptionA}</td> 92 </tr> 93 <tr> 94 <td colspan="3"><strong>B.</strong>${subject.subjectOptionB}</td> 95 </tr> 96 <tr> 97 <td colspan="3"><strong>C.</strong>${subject.subjectOptionC}</td> 98 </tr> 99 <tr> 100 <td colspan="3"><strong>D.</strong>${subject.subjectOptionD}</td> 101 </tr> 102 <tr> 103 <td height="32" colspan="3" bgcolor="#CCCCCC">选择答案: 104 <input type="radio" name="subjectAnswer${sta.index}" value="A" checked="checked"/> 105 A 106 <input type="radio" name="subjectAnswer${sta.index}" value="B" /> 107 B 108 <input type="radio" name="subjectAnswer${sta.index}" value="C" /> 109 C 110 <input type="radio" name="subjectAnswer${sta.index}" value="D" /> 111 D</td> 112 </tr> 113 </s:iterator> 114 <!--题目结束--> 115 <tr> 116 <td colspan="3"><div align="center"> 117 <input type="submit" value=" 提交答卷 " name="Submit" /> 118 </div></td> 119 </tr> 120 </table> 121 </form> 122 </td> 123 <td width="113"> </td> 124 </tr> 125 </table> 126 </body> 127 </html>
2.student/exampleResult.jsp
1 <%@ page language="java" import="java.util.*" pageEncoding="gbk"%> 2 <%@ taglib prefix="s" uri="/struts-tags"%> 3 <html xmlns="http://www.w3.org/1999/xhtml"> 4 <head> 5 <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> 6 <title>考试结果</title> 7 <link href="images/css2.css" rel="stylesheet" type="text/css"/> 8 <style type="text/css"> 9 <!-- 10 .STYLE3 {font-size: 18px; } 11 .STYLE4 {font-size: 18px; font-weight: bold; } 12 .STYLE5 {color: #FF0000} 13 --> 14 </style> 15 16 <body> 17 <table width="1003" height="485" border="0" cellpadding="0" cellspacing="0" class="centerbg"> 18 <tr> 19 <td width="149" height="485"> </td> 20 <td width="741" valign="top" class="rightbian"> 21 <table width="60%" align="center" cellpadding="10" cellspacing="0" border="1"> 22 <tr> 23 <td height="35" colspan="2"></td> 24 </tr> 25 <tr> 26 <td height="49" colspan="2"><div align="center"><span class="STYLE4"><strong>eggpeijun</strong>考试情况表</span></div></td> 27 </tr> 28 <tr> 29 <td colspan="2"> </td> 30 </tr> 31 <tr> 32 <td><div align="center">考试姓名:${request.studentName}</div></td> 33 <td><div align="center">考生得分:${request.GeneralPoint}分</div></td> 34 </tr> 35 <tr> 36 <td colspan="2"><div align="center"><a href="showSubjectAnswer.action">查看答案</a></div></td> 37 </tr> 38 </table></td> 39 <td width="113"> </td> 40 </tr> 41 </table> 42 </body> 43 </html>
3.student/showAnswer.jsp
1 <%@ page language="java" import="java.util.*" pageEncoding="gbk"%> 2 <%@ taglib prefix="s" uri="/struts-tags"%> 3 <html> 4 <head> 5 <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> 6 <title>显示试题答案</title> 7 <link href="student/images/css2.css" rel="stylesheet" type="text/css"/> 8 <style type="text/css"> 9 <!-- 10 .STYLE3 {font-size: 18px; } 11 .STYLE4 {font-size: 18px; font-weight: bold; } 12 .STYLE5 {color: #FF0000} 13 --> 14 </style> 15 </head> 16 17 <body> 18 <table width="1003" height="485" border="0" cellpadding="0" cellspacing="0" class="centerbg"> 19 <tr> 20 <td width="149" height="485"> </td> 21 <td width="741" valign="top" class="rightbian"> 22 <table width="98%" border="0" align="center" cellpadding="0" cellspacing="10"> 23 <tr> 24 <td><div align="center" class="STYLE3">考试时间:120 分钟</div></td> 25 <td><div align="center" class="STYLE3">考生:${sessionScope.studentInfo.studentName}</div></td> 26 <td><div align="center" class="STYLE3">总分 :100 分</div></td> 27 </tr> 28 <tr> 29 <td> </td> 30 <td></td> 31 <td> </td> 32 </tr> 33 <tr> 34 <td colspan="3" bgcolor="#999999" class="STYLE4">选择题(每小题5分,共20个)</td> 35 </tr> 36 <!--题目开始--> 37 <s:iterator value="#request.subjects" var="subject" status="sta"> 38 <tr> 39 <td colspan="3"><strong>第<span class="STYLE5">${sta.index + 1}</span>题 ${subject.subjectTitle}</strong> </td> 40 </tr> 41 <tr> 42 <td colspan="3"><strong>A.</strong>${subject.subjectOptionA}</td> 43 </tr> 44 <tr> 45 <td colspan="3"><strong>B.</strong>${subject.subjectOptionB}</td> 46 </tr> 47 <tr> 48 <td colspan="3"><strong>C.</strong>${subject.subjectOptionC}</td> 49 </tr> 50 <tr> 51 <td colspan="3"><strong>D.</strong>${subject.subjectOptionD}</td> 52 </tr> 53 <tr> 54 <td height="32" colspan="3" bgcolor="#CCCCCC"> 55 <strong>【正确答案】:${subject.subjectAnswer}</strong><br/> 56 <strong>【参考解析】:${subject.subjectParse}</strong></tr> 57 </s:iterator> 58 <!--题目结束--> 59 </table></td> 60 <td width="113"> </td> 61 </tr> 62 </table> 63 </body> 64 </html>
4.teacher/index.html
1 <html> 2 <head> 3 <title>考试系统管理中心</title> 4 <meta http-equiv=Content-Type content=text/html;charset=gb2312> 5 </head> 6 <frameset rows="64,*" frameborder="NO" border="0" framespacing="0"> 7 <frame src="admin_top.html" noresize="noresize" frameborder="NO" name="topFrame" scrolling="no" marginwidth="0" marginheight="0" target="main" /> 8 <frameset cols="200,*" rows="560,*" id="frame"> 9 <frame src="left.html" name="leftFrame" noresize="noresize" marginwidth="0" marginheight="0" frameborder="0" scrolling="no" target="main" /> 10 <frame src="right.html" name="main" marginwidth="0" marginheight="0" frameborder="0" scrolling="auto" target="_self" /> 11 </frameset> 12 <noframes> 13 <body></body> 14 </noframes> 15 </html>
5.teacher/left.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2 <html xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> 5 <title>管理页面</title> 6 7 <script src="js/prototype.lite.js" type="text/javascript"></script> 8 <script src="js/moo.fx.js" type="text/javascript"></script> 9 <script src="js/moo.fx.pack.js" type="text/javascript"></script> 10 <style> 11 body { 12 font:12px Arial, Helvetica, sans-serif; 13 color: #000; 14 background-color: #EEF2FB; 15 margin: 0px; 16 } 17 #container { 18 width: 182px; 19 } 20 H1 { 21 font-size: 12px; 22 margin: 0px; 23 width: 182px; 24 cursor: pointer; 25 height: 30px; 26 line-height: 20px; 27 } 28 H1 a { 29 display: block; 30 width: 182px; 31 color: #000; 32 height: 30px; 33 text-decoration: none; 34 moz-outline-style: none; 35 background-image: url(images/menu_bgs.gif); 36 background-repeat: no-repeat; 37 line-height: 30px; 38 text-align: center; 39 margin: 0px; 40 padding: 0px; 41 } 42 .content{ 43 width: 182px; 44 height: 26px; 45 46 } 47 .MM ul { 48 list-style-type: none; 49 margin: 0px; 50 padding: 0px; 51 display: block; 52 } 53 .MM li { 54 font-family: Arial, Helvetica, sans-serif; 55 font-size: 12px; 56 line-height: 26px; 57 color: #333333; 58 list-style-type: none; 59 display: block; 60 text-decoration: none; 61 height: 26px; 62 width: 182px; 63 padding-left: 0px; 64 } 65 .MM { 66 width: 182px; 67 margin: 0px; 68 padding: 0px; 69 left: 0px; 70 top: 0px; 71 right: 0px; 72 bottom: 0px; 73 clip: rect(0px,0px,0px,0px); 74 } 75 .MM a:link { 76 font-family: Arial, Helvetica, sans-serif; 77 font-size: 12px; 78 line-height: 26px; 79 color: #333333; 80 background-image: url(images/menu_bg1.gif); 81 background-repeat: no-repeat; 82 height: 26px; 83 width: 182px; 84 display: block; 85 text-align: center; 86 margin: 0px; 87 padding: 0px; 88 overflow: hidden; 89 text-decoration: none; 90 } 91 .MM a:visited { 92 font-family: Arial, Helvetica, sans-serif; 93 font-size: 12px; 94 line-height: 26px; 95 color: #333333; 96 background-image: url(images/menu_bg1.gif); 97 background-repeat: no-repeat; 98 display: block; 99 text-align: center; 100 margin: 0px; 101 padding: 0px; 102 height: 26px; 103 width: 182px; 104 text-decoration: none; 105 } 106 .MM a:active { 107 font-family: Arial, Helvetica, sans-serif; 108 font-size: 12px; 109 line-height: 26px; 110 color: #333333; 111 background-image: url(images/menu_bg1.gif); 112 background-repeat: no-repeat; 113 height: 26px; 114 width: 182px; 115 display: block; 116 text-align: center; 117 margin: 0px; 118 padding: 0px; 119 overflow: hidden; 120 text-decoration: none; 121 } 122 .MM a:hover { 123 font-family: Arial, Helvetica, sans-serif; 124 font-size: 12px; 125 line-height: 26px; 126 font-weight: bold; 127 color: #006600; 128 background-image: url(images/menu_bg2.gif); 129 background-repeat: no-repeat; 130 text-align: center; 131 display: block; 132 margin: 0px; 133 padding: 0px; 134 height: 26px; 135 width: 182px; 136 text-decoration: none; 137 } 138 </style> 139 </head> 140 141 <body> 142 <table width="100%" height="280" border="0" cellpadding="0" cellspacing="0" bgcolor="#EEF2FB"> 143 <tr> 144 <td width="182" valign="top"><div id="container"> 145 <h1 class="type"><a href="javascript:void(0)">试题管理</a></h1> 146 <div class="content"> 147 <table width="100%" border="0" cellspacing="0" cellpadding="0"> 148 <tr> 149 <td><img src="images/menu_topline.gif" width="182" height="5" /></td> 150 </tr> 151 </table> 152 <ul class="MM"> 153 <li><a href="subjectAdd.jsp" target="main">录入试题</a></li> 154 <li><a href="subjectQuery.action" target="main">管理试题</a></li> 155 <li><a href="subjectQuery.jsp" target="main">查询试题</a></li> 156 </ul> 157 </div> 158 <h1 class="type"><a href="javascript:void(0)">学生管理</a></h1> 159 <div class="content"> 160 <table width="100%" border="0" cellspacing="0" cellpadding="0"> 161 <tr> 162 <td><img src="images/menu_topline.gif" width="182" height="5" /></td> 163 </tr> 164 </table> 165 <ul class="MM"> 166 <li><a href="studentQueryByName.jsp" target="main">通过姓名查找学生成绩</a></li> 167 <li><a href="studentQueryByClass.jsp" target="main">查找某班级全部学生成绩</a></li> 168 </ul> 169 </div> 170 </div> 171 <script type="text/javascript"> 172 var contents = document.getElementsByClassName('content'); 173 var toggles = document.getElementsByClassName('type'); 174 175 var myAccordion = new fx.Accordion( 176 toggles, contents, {opacity: true, duration: 400} 177 ); 178 myAccordion.showThisHideOpen(contents[0]); 179 </script> 180 </td> 181 </tr> 182 </table> 183 </body> 184 </html>
6.teacher/right.html
1 <link href="images/skin.css" rel="stylesheet" type="text/css" /> 2 <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><style type="text/css"> 3 <!-- 4 body { 5 margin-left: 0px; 6 margin-top: 0px; 7 margin-right: 0px; 8 margin-bottom: 0px; 9 background-color: #EEF2FB; 10 } 11 --> 12 </style> 13 <body> 14 <table width="100%" border="0" cellpadding="0" cellspacing="0"> 15 <tr> 16 <td width="17" valign="top" background="images/mail_leftbg.gif"><img src="images/left-top-right.gif" width="17" height="29" /></td> 17 <td valign="top" background="images/content-bg.gif"><table width="100%" height="31" border="0" cellpadding="0" cellspacing="0" class="left_topbg" id="table2"> 18 <tr> 19 <td height="31"><div class="titlebt">欢迎界面</div></td> 20 </tr> 21 </table></td> 22 <td width="16" valign="top" background="images/mail_rightbg.gif"><img src="images/nav-right-bg.gif" width="16" height="29" /></td> 23 </tr> 24 <tr> 25 <td valign="middle" background="images/mail_leftbg.gif"> </td> 26 <td valign="top" bgcolor="#F7F8F9"><table width="98%" border="0" align="center" cellpadding="0" cellspacing="0"> 27 <tr> 28 <td width="53%" valign="top"> </td> 29 </tr> 30 <tr> 31 <td valign="top"><span class="left_bt">欢迎使用在线考试管理系统</span><br> 32 <br> 33 <span class="left_txt"> <img src="images/ts.gif" width="16" height="16">各位老师您好:<br> 34 您现在使用的是</span><span class="left_txt">XXX公司开发的在线考试系统,通过该系统,您可以在线录入考试题目,更新考试系统以及查询考试题目;同时还可以对学生信息还有学生成绩信息进行维护。<br> 35 </span></td> 36 </tr> 37 38 </table></td> 39 <td background="images/mail_rightbg.gif"> </td> 40 </tr> 41 <tr> 42 <td valign="bottom" background="images/mail_leftbg.gif"><img src="images/buttom_left2.gif" width="17" height="17" /></td> 43 <td background="images/buttom_bgs.gif"><img src="images/buttom_bgs.gif" width="17" height="17"></td> 44 <td valign="bottom" background="images/mail_rightbg.gif"><img src="images/buttom_right2.gif" width="16" height="17" /></td> 45 </tr> 46 </table> 47 </body>
7.teacher/studentManager.jsp
1 <%@ page language="java" import="java.util.*" pageEncoding="gbk"%> 2 <%@ taglib prefix="s" uri="/struts-tags"%> 3 <link href="images/skin.css" rel="stylesheet" type="text/css" /> 4 <style type="text/css"> 5 <!-- 6 body { 7 margin-left: 0px; 8 margin-top: 0px; 9 margin-right: 0px; 10 margin-bottom: 0px; 11 background-color: #EEF2FB; 12 } 13 #manageSubject table td{ 14 font-size:12px; 15 } 16 --> 17 </style> 18 <body> 19 <table width="100%" border="0" cellpadding="0" cellspacing="0"> 20 <tr> 21 <td width="17" valign="top" background="images/mail_leftbg.gif"><img src="images/left-top-right.gif" width="17" height="29" /></td> 22 <td valign="top" background="images/content-bg.gif"><table width="100%" height="31" border="0" cellpadding="0" cellspacing="0" class="left_topbg" id="table2"> 23 <tr> 24 <td height="31"><div class="titlebt">管理学生</div></td> 25 </tr> 26 </table></td> 27 <td width="16" valign="top" background="images/mail_rightbg.gif"><img src="images/nav-right-bg.gif" width="16" height="29" /></td> 28 </tr> 29 <tr> 30 <td valign="middle" background="images/mail_leftbg.gif"> </td> 31 <td valign="top" bgcolor="#F7F8F9"><table width="98%" border="0" align="center" cellpadding="0" cellspacing="0"> 32 <tr> 33 <td width="53%" valign="top"> </td> 34 </tr> 35 <tr> 36 <td valign="middle"><span class="left_txt"> 37 <div id="manageSubject" align="center"><!--管理试题--> 38 <table width="95%" cellspacing="10"> 39 <tr align="center"> 40 <td>学生编号</td> 41 <td>所属班级</td> 42 <td>学生姓名</td> 43 <td>成绩</td> 44 </tr> 45 <s:iterator value="#request.students" var="student"> 46 <tr align="center"> 47 <td>${student.studentID}</td> 48 <td>${student.sclass}</td> 49 <td>${student.studentName}</td> 50 <td>${student.result}</td> 51 </tr> 52 </s:iterator> 53 </table> 54 </div> 55 </td> 56 </tr> 57 58 </table></td> 59 <td background="images/mail_rightbg.gif"> </td> 60 </tr> 61 <tr> 62 <td valign="bottom" background="images/mail_leftbg.gif"><img src="images/buttom_left2.gif" width="17" height="17" /></td> 63 <td background="images/buttom_bgs.gif"><img src="images/buttom_bgs.gif" width="17" height="17"></td> 64 <td valign="bottom" background="images/mail_rightbg.gif"><img src="images/buttom_right2.gif" width="16" height="17" /></td> 65 </tr> 66 </table> 67 </body>
8.teacher/subjectAdd.jsp
1 <%@ page language="java" import="java.util.*" pageEncoding="gbk"%> 2 <%@ taglib prefix="s" uri="/struts-tags"%> 3 <html> 4 <head> 5 <title>试题添加页面</title> 6 <style type="text/css"> 7 <!-- 8 body { 9 margin-left: 0px; 10 margin-top: 0px; 11 margin-right: 0px; 12 margin-bottom: 0px; 13 background-color: #EEF2FB; 14 } 15 #addSubjectForm table td{ 16 font-size:12px; 17 } 18 --> 19 </style> 20 <link href="images/skin.css" rel="stylesheet" type="text/css"> 21 </head> 22 <body> 23 <table width="100%" border="0" cellpadding="0" cellspacing="0"> 24 <tr> 25 <td width="17" valign="top" background="images/mail_leftbg.gif"><img src="images/left-top-right.gif" width="17" height="29" /></td> 26 <td valign="top" background="images/content-bg.gif"><table width="100%" height="31" border="0" cellpadding="0" cellspacing="0" class="left_topbg" id="table2"> 27 <tr> 28 <td height="31"><div class="titlebt">录入试题</div></td> 29 </tr> 30 </table></td> 31 <td width="16" valign="top" background="images/mail_rightbg.gif"><img src="images/nav-right-bg.gif" width="16" height="29" /></td> 32 </tr> 33 <tr> 34 <td valign="middle" background="images/mail_leftbg.gif"> </td> 35 <td valign="top" bgcolor="#F7F8F9"><table width="98%" border="0" align="center" cellpadding="0" cellspacing="0"> 36 <tr> 37 <td width="53%" valign="top"> </td> 38 </tr> 39 <tr> 40 <td valign="middle"><span class="left_txt"> 41 <div id="addSubjectForm" align="center"><!--录入试题表单--> 42 <form action="subjectAdd.action" method="post"> 43 <table border="0" cellspacing="10" cellpadding="0"> 44 <tr> 45 <td colspan="2"><FONT color="red"><s:actionerror/></FONT></td> 46 </tr> 47 <tr> 48 <td>试题题目:</td> 49 <td><input type="text" name="subjectTitle" size="80" ></td> 50 </tr> 51 <tr> 52 <td>选项A:</td> 53 <td><input type="text" name="subjectOptionA" size="20" ></td> 54 </tr> 55 <tr> 56 <td>选项B:</td> 57 <td><input type="text" name="subjectOptionB" size="20" ></td> 58 </tr> 59 <tr> 60 <td>选项C:</td> 61 <td><input type="text" name="subjectOptionC" size="20" ></td> 62 </tr> 63 <tr> 64 <td>选项D:</td> 65 <td><input type="text" name="subjectOptionD" size="20" ></td> 66 </tr> 67 <tr> 68 <td>答案:</td> 69 <td> 70 <input name="subjectAnswer" type="radio" value="A" checked>A 71 <input name="subjectAnswer" type="radio" value="B">B 72 <input name="subjectAnswer" type="radio" value="C">C 73 <input name="subjectAnswer" type="radio" value="D">D 74 </td> 75 </tr> 76 <tr> 77 <td valign="top">试题解析:</td> 78 <td> 79 <textarea name="subjectParse" cols="76" rows="10"></textarea> 80 </td> 81 </tr> 82 <tr> 83 <td colspan="2"><div align="center"> 84 <input type="submit" value="录入"> 85 <input type="reset" value="重置"> 86 </div> 87 </td> 88 </tr> 89 </table> 90 </form> 91 </div> 92 </td> 93 </tr> 94 95 </table></td> 96 <td background="images/mail_rightbg.gif"> </td> 97 </tr> 98 <tr> 99 <td valign="bottom" background="images/mail_leftbg.gif"><img src="images/buttom_left2.gif" width="17" height="17" /></td> 100 <td background="images/buttom_bgs.gif"><img src="images/buttom_bgs.gif" width="17" height="17"></td> 101 <td valign="bottom" background="images/mail_rightbg.gif"><img src="images/buttom_right2.gif" width="16" height="17" /></td> 102 </tr> 103 </table> 104 </body> 105 </html>
9.
You can do anything you set your mind to, man!