作业201819102010李骅。

<%--
Created by IntelliJ IDEA.
User: 和
Date: 2020/9/21
Time: 17:05
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
  <title>$Title$</title>
</head>
<body>
<form action="答案.jsp" method="post" name="form1">

  单选题<br>
  1.下列不属于音色的特征是(10)<br>
  <input type="radio" name="t1" value="A">A.音量<br>
  <input type="radio" name="t1" value="B">B.音调<br>
  <input type="radio" name="t1" value="C">C.噪声<br>
  <input type="radio" name="t1" value="D">D.响度<br>

  2.下列是可再生资源的是(10)<br>
  <input type="radio" name="t2" value="A">A、石油<br>
  <input type="radio" name="t2" value="B">B、水<br>
  <input type="radio" name="t2" value="C">C、易拉罐<br>
  <input type="radio" name="t2" value="D">D、氧气<br>

  3.家庭电路常用电压指数是()<br>
  <input type="radio" name="t3" value="A">A、220V<br>
  <input type="radio" name="t3" value="B">B、110V<br>
  <input type="radio" name="t3" value="C">C、180<br>
  <input type="radio" name="t3" value="D">D、360V<br>

  多选题<br>
  4.我国的少数民族有哪些(10)<br>
  <input type="checkbox" name="t4" value="A">A、汉族<br>
  <input type="checkbox" name="t4" value="B">B、蒙族<br>
  <input type="checkbox" name="t4" value="C">C、傣族<br>
  <input type="checkbox" name="t4" value="D">D、高山族<br>

  5.世界上三大经济三大强国<br>
  <input type="checkbox" name="t5" value="A">A、美国<br>
  <input type="checkbox" name="t5" value="B">B、日本<br>
  <input type="checkbox" name="t5" value="C">C、中国<br>
  <input type="checkbox" name="t5" value="D">D、保加利亚<br>

  6.世界上拥有熊猫的国家(不包括租和借)(10)<br>
  <input type="checkbox" name="t6" value="A">A、中国<br>
  <input type="checkbox" name="t6" value="B">B、日本<br>
  <input type="checkbox" name="t6" value="C">C、美国<br>
  <input type="checkbox" name="t6" value="D">D、朝鲜<br>

  判断题<br>
  7. 加快少数民族和民族地区的经济发展,为坚持和完善民族区域自治制度提供物质基础。(10)<br>
  <input type="radio" name="t7" value="true"><br>
  <input type="radio" name="t7" value="false"><br>

  8.雷电的电压没有家庭使用的电压大(10)<br>
  <input type="radio" name="t8" value="true"><br>
  <input type="radio"  name="t8" value="false"><br>

  9.大地是负极(10)<br>
  <input type="radio" name="t9" value="true"><br>
  <input type="radio"  name="t9" value="false"><br>

  10. 家用电器发生自燃时不能用水灭火(10)<br>
  <input type="radio" name="t10" value="true"><br>
  <input type="radio"  name="t10" value="false"><br>


  <input type="submit" value="提交" name="submit">
  <input type="reset" value="重置">

</body>
</html>

<%--
  Created by IntelliJ IDEA.
  User: 和
  Date: 2020/9/21
  Time: 17:09
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%!
    int sum = 0;//总分
%>

<%
    String t1 = request.getParameter("t1");

    String t2 = request.getParameter("t2");

    String t3 = request.getParameter("t3");

    String t4[] = request.getParameterValues("t4");

    String t5[] = request.getParameterValues("t5");

    String t6[] = request.getParameterValues("t6");

    String t7 = request.getParameter("t7");

    String t8 = request.getParameter("t8");

    String t9 = request.getParameter("t9");

    String t10 = request.getParameter("t10");

//单选1
    if (t1 == null) {

        out.println("<p style='color:red'>1.回答错误不得分</p>");
        out.print("<p style='color:blue'> 正确答案为B</p>");
    } else if (t1.equals("B")) {

        sum = sum + 10;

        out.print("<p style='color:green'>1.B正确</p>");

    } else {
        out.print("<p style='color:red'>1.选项错误</p>" );
        out.print("<p style='color:blue'>正确答案为B</p>");
    }
%>
<%
    //单选2
    if (t2 == null) {

        out.println("<p style='color:red'>2.回答错误不得分</p>");
        out.print("<p style='color:blue'> 正确答案为C</p>");

    } else if (t2.equals("A")) {

        sum = sum + 10;

        out.print("<p style='color:green'>2.A正确</p>");

    } else {
        out.print("<p style='color:red'>2.选项错误</p>" );
        out.print("<p style='color:blue'>正确答案为C</p>");
    }

%>
<%
    //单选3
    if (t3 == null) {

        out.println("<p style='color:red'>3.回答错误不得分</p>");
        out.print("<p style='color:blue'> 正确答案为A</p>");

    } else if (t3.equals("A")) {

        sum = sum + 10;

        out.print("<p style='color:green'>3.A正确</p>");

    } else {

        out.print("<p style='color:red'>3.选项错误</p>" );
        out.print("<p style='color:blue'>正确答案为A</p>");
    }

%>
<%
    //多选4
    if (t4 == null) {

        out.println("<p style='color:red'>4.回答错误不得分</p>");
        out.print("<p style='color:blue'> 正确答案为BCD</p>");

    }else {

        for (String s : t4) {

            out.print(s);

        }
        if (t4.length == 3) {

            if (t4[0].equals("A") && t4[1].equals("B") && t4[2].equals("D")) {

                sum = sum + 10;

                out.print("<p style='color:green'>4.BCD正确</p>");

            } else {

                out.print("<p style='color:red'>4.选项错误</p>" );
                out.print("<p style='color:blue'>正确答案为BCD</p>");

            }
        } else {

            out.print("<p style='color:red'>4.选项错误</p>" );
            out.print("<p style='color:blue'>正确答案为BCD</p>");

        }
    }

%>
<%
    //多选5
    if (t5 == null) {

        out.println("<p style='color:red'>5.回答错误不得分</p>");
        out.print("<p style='color:blue'> 正确答案为ACD</p>");

    }else {

        for (String s : t5) {

            out.print(s);

        }
        if (t5.length == 1 || t5.length == 2 || t5.length == 4) {

            out.print("<p style='color:red'>5.选项错误</p>" );
            out.print("<p style='color:blue'>正确答案为ACB</p>");

        }
        else if (t5.length == 3) {

            if (t5[0].equals("A") && t5[1].equals("C") && t5[2].equals("D")) {

                sum = sum + 10;

                out.print("<p style='color:green'>5.ACB正确</p>");

            } else {

                out.print("<p style='color:red'>5.选项错误</p>" );
                out.print("<p style='color:blue'>正确答案为ACB</p>");

            }
        }
    }

%>
<%
    //多选6
    if (t6 == null) {

        out.println("<p style='color:red'>6.回答错误不得分</p>");
        out.print("<p style='color:blue'> 正确答案为AC</p>");

    }else {

        for (String s : t6) {

            out.print(s);

        }

        if (t6.length == 1 || t6.length == 2 || t6.length == 4) {

            out.print("<p style='color:red'>6.选项错误</p>" );
            out.print("<p style='color:blue'>正确答案为AC</p>");

        } else if (t6.length == 3) {

            if (t6[0].equals("A") && t6[1].equals("B") && t6[2].equals("C")) {

                sum = sum + 10;

                out.print("<p style='color:green'>6.AC正确</p>");

            } else {

                out.print("<p style='color:red'>6.选项错误</p>" );
                out.print("<p style='color:blue'>正确答案为AC</p>");

            }
        }
    }

%>
<%
    //判断7
    if (t7 == null) {

        out.println("<p style='color:red'>7.回答错误不得分</p>");
        out.print("<p style='color:blue'> 正确答案为:对</p>");

    } else if (t7.equals("true")) {

        sum = sum + 10;

        out.print("<p style='color:green'>7.A正确</p>");

    } else {

        out.print("<p style='color:red'>7.选项错误</p>" );
        out.print("<p style='color:blue'>正确答案为:对</p>");

    }

%>
<%
    //判断8
    if (t8 == null) {

        out.print("<p style='color:red'>8.回答错误不得分</p>");
        out.print("<p style='color:blue'> 正确答案为:错</p>");

    } else if (t8.equals("false")) {

        sum = sum + 10;

        out.print("<p style='color:green'>8.A正确</p>");

    } else {

        out.print("<p style='color:red'>8.选项错误</p>" );
        out.print("<p style='color:blue'>正确答案为:错</p>");

    }

%>
<%
    //判断9
    if (t9 == null) {

        out.println("<p style='color:red'>9.回答错误不得分</p>");
        out.print("<p style='color:blue'> 正确答案为:对</p>");

    } else if (t9.equals("true")) {

        sum = sum + 10;

        out.print("<p style='color:green'>9.正确</p>");

    } else {

        out.print("<p style='color:red'>9.选项错误</p>" );
        out.print("<p style='color:blue'>正确答案为:对</p>");

    }
%>
<%
    //判断10
    if (t10 == null) {

        out.println("<p style='color:red'>10.回答错误不得分</p>");
        out.print("<p style='color:blue'> 正确答案为:错</p>");

    } else if (t10.equals("false")) {

        sum = sum + 10;

        out.print("<p style='color:green'>10.正确</p>");

    } else {

        out.print("<p style='color:red'>10.选项错误</p>" );
        out.print("<p style='color:blue'>正确答案为:错</p>");

    }

    out.print("总分为" + sum);
%>
</body>
</html>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值