JAVA编写的代码获取的值不能显示

liuliuying123 2017-03-04 05:12:33

代码:
<div style=" margin:0px auto; line-height:50px;text-align:center;">在线考试系统</div>
<form name="" action="./result.jsp?action=save" method="post">
<table width="80%" border="0" align="center" cellpadding="0" cellspacing="0">
<%
Question question = new Question();
List<QuestionInfo> list = question.getList("");
int i = 1;
String choice = "";
for (QuestionInfo info : list) {
int hidQuestionCount = DataConverter.toInt(request.getParameter("hidQuestionCount"));//共有多少个题目
for (int j = 1; j <= hidQuestionCount; j++) {

if (i == j) {
choice = request.getParameter("choice" + j);//获取每一题的选项
}

}
%>
<tr>
<td height="30" bgcolor="#94A6DA" style="color:#ffffff;"><%=i%>、 <%=info.getTitle()%></td>
</tr>
<tr>
<td height="30">
<p>
你选择的答案是:<font color="#FF0000"><%=choice%> </font>, 正确答案是:<font color="blue"><%=info.getAnswer()%></font>
</p>
<p>
回答:<font color="#FF0000"> <%
if (choice.equals(info.getAnswer()))
out.print("正确");
else
out.print("错误");
%>
</font>
</p>
</td>
</tr>
<%
i++;
}
%>
</table>
<div style=" margin:0px auto; line-height:50px;text-align:center;">
<input type="submit" name="button" id="button" value="提交" onclick="return confirm('确定要提交吗?一经提交将无法修改!');" />
</div>
</form>
...全文
131 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
syhleo 2017-03-05
  • 打赏
  • 举报
回复
查看一下代码有没有错误!

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧