201819102024 包丽荣
题目的代码:
<form action="defen.jsp" method="post">
<h2>一、判断</h2><br>
<table>
<tr>
<td></td><td>正确</td><td>错误</td>
</tr>
<tr>
<td>1.《白夜行》的作者是东野圭吾。</td><td> <input type="radio" name="pd1" id="pd1" value="1"></td><td><input type="radio" name="pd1" id="pd2"value="2"></td>
</tr>
<tr>
<td>2.《地狱变》的作者是东野圭吾。</td><td> <input type="radio" name="pd2"value="1"></td><td><input type="radio" name="pd2"value="2"></td>
</tr>
<tr>
<td>3.《骆驼祥子》中祥子的老婆是虎妞。</td><td> <input type="radio" name="pd3"value="1"></td><td><input type="radio" name="pd3"value="2"></td>
</tr>
<tr>
<td>4.“big brother is watching you”是小说《美丽新世界》中的线索内容。</td><td> <input type="radio" name="pd4"value="1"></td><td><input type="radio" name="pd4"value="2"></td>
</tr>
<tr>
<td>5.叶绿素的作用是吸收阳光进行光合作用。</td><td> <input type="radio" name="pd5"value="1"></td><td><input type="radio" name="pd5"value="2"></td>
</tr>
</table>
<h2>二、选择</h2><br>
<table>
<tr><td colspan="4"> 6.王小波的爱人是( )</td></tr>
<tr><td><input type="radio" name="xz1"value="1">A、银河</td><td><input type="radio" name="xz1"value="2">B、李银河</td>
<td><input type="radio" name="xz1"value="3">C、小红</td><td><input type="radio" name="xz1"value="4">D、小刘</td></tr>
<tr><td colspan="4"> 7.余华的作品有( )</td></tr>
<tr><td><input type="radio" name="xz2"value="1">A、《活着》</td><td><input type="radio" name="xz2"value="2">B、《绿毛水怪》</td>
<td><input type="radio" name="xz2"value="3"> C、《红拂夜奔》</td><td><input type="radio" name="xz2"value="4">D、《一只特立独行的猪》</td></tr>
<tr><td colspan="4"> 8.老舍的作品包括( )</td></tr>
<tr><td> <input type="radio" name="xz3"value="1">A、《阿Q正传》</td><td><input type="radio" name="xz3"value="2">B、《狂人日记》</td>
<td><input type="radio" name="xz3"value="3"> C、《红楼梦》</td><td><input type="radio" name="xz3"value="4">D、《城南旧事》</td></tr>
<tr><td colspan="4"> 9.东野圭吾的作品大多是( )</td></tr>
<tr><td> <input type="radio" name="xz4"value="1">A、文言文小说</td><td><input type="radio" name="xz4"value="2">B、自传体小说</td>
<td><input type="radio" name="xz4"value="3"> C、言情小说</td><td><input type="radio" name="xz4"value="4">D、悬疑小说</td></tr>
<tr><td colspan="4"> 10.东野圭吾的作品有( )</td></tr>
<tr><td> <input type="radio" name="xz5"value="1">A、《沉睡的人鱼之家》</td><td><input type="radio" name="xz5"value="2">B、《夏日烟火和我的尸体》</td>
<td><input type="radio" name="xz5"value="3"> C、《巧克力的秘密》</td><td><input type="radio" name="xz5"value="4">D、《茶花女》</td></tr>
</table>
三、多选</h2><br>
11.岁寒三友( )<br>
<input type="checkbox" name="dx1" value="1">A、梅<br>
<input type="checkbox" name="dx1"value="2">B、兰<br>
<input type="checkbox" name="dx1"value="3">C、竹<br>
<input type="checkbox" name="dx1"value="4">D、菊<br>
<input type="checkbox" name="dx1"value="5">E、牡丹<br>
12.植物中的斐波那契( )<br>
<input type="checkbox" name="dx2"value="1">A、叶脉<br>
<input type="checkbox" name="dx2"value="2">B、根<br>
<input type="checkbox" name="dx2"value="3">C、叶片<br>
<input type="checkbox" name="dx2"value="4">D、按照叶脉的顺序<br>
<input type="checkbox" name="dx2"value="5">E、按照根的顺序<br>
13.猫的品种都有( )<br>
<input type="checkbox" name="dx4"value="1">A.无毛猫<br>
<input type="checkbox" name="dx4"value="2">B.加菲猫<br>
<input type="checkbox" name="dx4"value="3">C.蓝猫<br>
<input type="checkbox" name="dx4"value="4">D.缅因猫<br>
14.狗的品种都有( )<br>
<input type="checkbox" name="dx5"value="1">A.哈士奇<br>
<input type="checkbox" name="dx5"value="2">B.金毛<br>
<input type="checkbox" name="dx5"value="3">C.拉布拉多<br>
<input type="checkbox" name="dx5"value="4">D.以上都是<br>
<input type="submit" value="提交">
提交答案后的代码:
<% int score=0;
String t1=request.getParameter("pd1");
String t2=request.getParameter("pd2");
String t3=request.getParameter("pd3");
String t4=request.getParameter("pd4");
String t5=request.getParameter("pd5");
String t6=request.getParameter("xz1");
String t7=request.getParameter("xz2");
String t8=request.getParameter("xz3");
String t9=request.getParameter("xz4");
String t10=request.getParameter("xz5");
String t11[]=request.getParameterValues("dx1");
String t12[]=request.getParameterValues("dx2");
String t13[]=request.getParameterValues("dx3");
String t14[]=request.getParameterValues("dx4");
String t15[]=request.getParameterValues("dx5");
if (t1==null)
{
out.print("<p style='color:yellow'>1.漏选</p>");
}
else if(t1.equals("1"))
{
out.print("<p style='color:green'>1.正确</p>");
score+=5;
}
else
out.print("<p style='color:red'>1.错误</p>");
if (t2==null)
{
out.print("<p style='color:blue'>2.选项未全</p>");
}
else if(t2.equals("2"))
{
out.print("<p style='color:green'>2.错误</p>");
score+=5;
}
else
out.print("<p style='color:red'>2.正确</p>");
if (t3==null)
{
out.print("<p style='color:blue'>3.选项未全</p>");
}
else if(t3.equals("1"))
{
out.print("<p style='color:green'>3.正确</p>");
score+=5;
}
else
out.print("<p style='color:red'>3.错误</p>");
if (t4==null)
{
out.print("<p style='color:blue'>4.选项未全</p>");
}
else if(t4.equals("2"))
{
out.print("<p style='color:green'>4.正确</p>");
score+=5;
}
else
out.print("<p style='color:red'>4.错误</p>");
if (t5==null)
{
out.print("<p style='color:blue'>5.选项未全</p>");
}
else if(t5.equals("1"))
{
out.print("<p style='color:green'>5.正确</p>");
score+=5;
}
else
out.print("<p style='color:red'>5.错误</p>");
if (t6==null)
{
out.print("<p style='color:blue'>6.选项未全</p>");
}
else if(t6.equals("2"))
{
out.print("<p style='color:green'>6.正确</p>");
score+=5;
}
else
out.print("<p style='color:red'>6.错误</p>");
if (t7==null)
{
out.print("<p style='color:blue'>7.选项未全</p>");
}
else
if(t7.equals("1"))
{
out.print("<p style='color:green'>7.正确</p>");
score+=5;
}
else
out.print("<p style='color:red'>7.错误</p>");
if (t8==null)
{
out.print("<p style='color:blue'>8.选项未全</p>");
}
else
if(t8.equals("2"))
{
out.print("<p style='color:green'>8.正确</p>");
score+=5;
}
else
out.print("<p style='color:red'>8.错误</p>");
if (t9==null)
{
out.print("<p style='color:blue'>9.选项未全</p>");
}
else
if(t9.equals("4"))
{
out.print("<p style='color:green'>9.正确</p>");
score+=5;
}
else
out.print("<p style='color:red'>9.错误</p>");
if (t10==null)
{
out.print("<p style='color:blue'>10.选项未全</p>");
}
else
if(t10.equals("1"))
{
out.print("<p style='color:green'>10.正确</p>");
score+=5;
}
else
out.print("<p style='color:red'>3.错误</p>");
if (t11==null||t11.length<2)
{
out.print("<p style='color:blue'>11.选项未全</p>");
}
else
if(t11[0].equals("1")&t11[1].equals("2")&t11[2].equals("3"))
{
out.print("<p style='color:green'>11.正确</p>");
score+=5;
}
else
out.print("<p style='color:red'>11.错误</p>");
if (t12==null||t12.length<3)
{
out.print("<p style='color:blue'>12.选项未全</p>");
}
else
if(t12[0].equals("1")&t12[1].equals("2")&t12[2].equals("3"))
{
out.print("<p style='color:green'>12.正确</p>");
score+=5;
}
else
out.print("<p style='color:red'>12.错误</p>");
if (t13==null||t13.length<4)
{
out.print("<p style='color:blue'>13.选项未全</p>");
}
else
if(t13[0].equals("1")&t13[1].equals("2")&t13[2].equals("3")&t13[3].equals("4"))
{
out.print("<p style='color:green'>13.正确</p>");
score+=5;
}
else
out.print("<p style='color:red'>13.错误</p>");
if (t14==null||t14.length<3)
{
out.print("<p style='color:blue'>14.选项未全</p>");
}
else
if(t14[0].equals("4"))
{
out.print("<p style='color:green'>14.正确</p>");
score+=5;
}
else
out.print("<p style='color:red'>14.错误</p>");
out.print("<p style='color:red;'><font size='120px;'>成绩"+score+"</font><p>");
%>