【JSP开源代码栏目提醒】:网学会员在JSP开源代码频道为大家收集整理了exam.jsp提供大家参考,希望对大家有所帮助!
<%@page contentType="text/html;charset=GBK"%>
<%@page import="java.util.*,com.myExam.bean.*"%>
<html>
<head><title>参加考试</title>
<style type="text/css">
<!--定义消息的样式
.style1 {
color: #FF0000;
font-weight: bold;
}
-->
</style>
</head>
<!--获取要参加的试卷和试题-->
<%
Exam exam = (Exam)request.getAttribute("exam");
List shitis = (List)request.getAttribute("shitis");
Map mapShitiOptions = (Map)request.getAttribute("mapShitiOptions");
%>
<body>
<!--该表单的提交都要通过setExam.do-->
<form name="user" action="/myExam/setExam.do" method="post">
<table width="767" border="1">
<tr>
<td height="27" colspan="2"><div align="center"><%=exam.getName()%></div></td>
<input type="hidden" name="examId" width="320" value="<%=exam.getId()%>">
<input type="hidden" name="examName" width="320" value="<%=exam.getName()%>">
</tr>
<!--列出所有试题-->
<%
for (int i = 0; shitis != null && i < shitis.size(); i++) {
Shiti shiti = (Shiti)shitis.get(i);
%>
<tr>
<td height="27" colspan="2"><%=i+1%>、<%=shiti.getName()%>(该试题<%=exam.getFenshu()%>分)</td>
</tr>
<tr>
<!--列出所有试题项目-->
<%
if (mapShitiOptions != null) {
List list = (List)mapShitiOptions.get(shiti.getId());
for (int j = 0; list != null && j < list.size(); j++) {
ShitiOption shitiOption = (ShitiOption)list.get(j);
%>
<td width="826"><%=shitiOption.getName()%>
<%
if (shiti.getShitiOption() == 0 || shiti.getShitiOption() == 2){
%>
<input type="radio" name="<%=shiti.getId()%>" value="<%=shitiOption.getId()%>">
<%
}
if (shiti.getShitiOption() == 1){
%>
<input type="checkbox" name="<%=shiti.getId()%>" value="<%=shitiOption.getId()%>">
<%}%>
</td>
<%
}}
%>
</tr>
<%
}
%>
<tr>
<td colspan="4"><div align="center">
<input type="submit" name="method" value="countExam">
</div>
</td>
</tr>
</table>
</form>
</body>
</html>
上一篇:
ex9_21.jsp
下一篇:
临床前药物安全性评价中毒性病理学新技术的应用