201819101040杨榆作业三

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>wenti</title>
</head>
<body>

<form action="tijiao.jsp" name="example" method="post">
    <p>考试开始,总分为15分</p>
    <p>一、单选题(5分)</p>
    <p>第一题:</p>
    <p>“但愿人长久,千里共婵娟”,其中婵娟指的是什么? <br>
        <input type="checkbox" name="chanjuan" value="A">月亮
        <input type="checkbox" name="chanjuan" value="B">姻缘

    </p><br>
    <p>第二题:</p>
    <p>王先生的QQ签名档最近改成了“庆祝弄璋之喜”,王先生近来的喜事是:<br>
        <input type="checkbox" name="xishi" value="A">妻子生了个男孩
        <input type="checkbox" name="xishi" value="B">新婚
        <input type="checkbox" name="xishi" value="C">搬家
        <input type="checkbox" name="xishi" value="D">考试通过
    </p>

    <p>第三题:</p>
    <p>“爆竹声中一岁除,春风送暖入屠苏”,这里的“屠苏”指的是:<br>
        <input type="checkbox" name="tusu" value="A">苏州
        <input type="checkbox" name="tusu" value="B">房屋
        <input type="checkbox" name="tusu" value="C">酒
        <input type="checkbox" name="tusu" value="D">庄稼
    </p>
    <p>第四题:</p>
    <p>“床前明月光”是李白的千古名句,其中 “床”指的是什么?<br>
        <input type="checkbox" name="chuang" value="A">窗户
        <input type="checkbox" name="chuang" value="B">卧具
        <input type="checkbox" name="chuang" value="C">井上的围栏

    </p>
       <p>第五题:</p>
    <p>1932年,清华大学招生试题中有一道对对子题,上联“孙行者”,下面下联中最合适的是:<br>
        <input type="checkbox" name="heshi" value="A">胡适之
        <input type="checkbox" name="heshi" value="B">周树人
        <input type="checkbox" name="heshi" value="C">郁达夫
        <input type="checkbox" name="heshi" value="D">唐三藏
    </p>
    <p>二、判断题(5分)</p>
    <p>第一题:</p>
    <p>1. 昆虫是世界上种类和数量最多、分布最广的动物。 <br>
        <input type="checkbox" name="dongwu" value="对">√
        <input type="checkbox" name="dongwu" value="错">X

    </p><br>
    <p>第二题:</p>
    <p>2. 井水清澈透明,是一种纯净的水。 <br>
        <input type="checkbox" name="jingshui" value="对">√
        <input type="checkbox" name="jingshui" value="错">X

    </p><br>
    <p>第三题:</p>
    <p>3. 地球上每一个地方都有明显的四季变化。 <br>
        <input type="checkbox" name="diqiu" value="对">√
        <input type="checkbox" name="diqiu" value="错">X

    </p><br>
    <p>第四题:</p>
    <p>4. 浮在水面上的物体受到水的浮力,沉在水中的物体没有受到水的浮力。 <br>
        <input type="checkbox" name="fuli" value="对">√
        <input type="checkbox" name="fuli" value="错">X
    </p><br>
    <p>第五题:</p>
    <p>5. 空气是一种看不见、摸不着的物体,所以它不占据一定得空间。 <br>
        <input type="checkbox" name="kongqi" value="对">√
        <input type="checkbox" name="kongqi" value="错">X
    </p><br>

    <p>
        <input type="submit" value="提交答案"/>
        <input type="reset" value="清除答案"/>
    </p>
</form>

</body>
</html>

 

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>tijiao</title>
</head>
<body>

<h3>考生选择的答案为:</h3>
<%! int score=0; %>
<%
    String[] chanjuan = request.getParameterValues("chanjuan");
    if(chanjuan != null){
        for(int i=0;i<chanjuan.length;i++){
            if(chanjuan[i].equals("A")){
                out.println("<p style='color:red'>姻缘        答案错误!<br>");
            }
            if(chanjuan[i].equals("B")){
                out.println("<p style='color:green'>月亮        答案正确<br>");
                score +=1;

            }
        }
    }
    String[] xishi = request.getParameterValues("xishi");
    if(xishi != null){
        for(int i=0;i<xishi.length;i++){
            if(xishi[i].equals("A")){
                out.println("<p style='color:green'>妻子生了个男孩        答案正确<br>");
                score +=1;
            }
            if(xishi[i].equals("B")){
                out.println("<p style='color:red'>新婚        答案错误!<br>");

            }
            if(xishi[i].equals("C")){
                out.println("<p style='color:red'>搬家        答案错误!<br>");
            }
            if(xishi[i].equals("D")){
                out.println("<p style='color:red'>考试通过        答案错误!<br>");
            }
        }

    }
    String[] tusu = request.getParameterValues("tusu");
    if(tusu != null){
        for(int i=0;i<tusu.length;i++){
            if(tusu[i].equals("A")){
                out.println("<p style='color:red'>苏州       答案错误<br>");

            }
            if(tusu[i].equals("B")){
                out.println("<p style='color:red'>房屋        答案错误!<br>");

            }
            if(tusu[i].equals("C")){
                out.println("<p style='color:green'>酒        答案正确!<br>");
                score +=1;
            }
            if(tusu[i].equals("D")){
                out.println("<p style='color:red'>庄稼        答案错误!<br>");
            }
        }

    }
    String[] chuang = request.getParameterValues("chuang");
    if(chuang != null){
        for(int i=0;i<chuang.length;i++){
            if(chuang[i].equals("A")){
                out.println("<p style='color:red'>窗户        答案错误<br>");
            }
            if(chuang[i].equals("B")){
                out.println("<p style='color:red'>卧具        答案错误!<br>");

            }
            if(chuang[i].equals("C")){
                out.println("<p style='color:green'>井上的围栏        答案正确!<br>");
                score +=1;
            }

            }
        }


    String[] heshi = request.getParameterValues("heshi");
    if(heshi != null){
        for(int i=0;i<heshi.length;i++){
            if(heshi[i].equals("A")){
                out.println("<p style='color:green'>胡适之        答案正确<br>");
                score +=1;
            }
            if(heshi[i].equals("B")){
                out.println("<p style='color:red'>周树人        答案错误!<br>");

            }
            if(heshi[i].equals("C")){
                out.println("<p style='color:red'>郁达夫        答案错误!<br>");
            }
            if(heshi[i].equals("D")){
                out.println("<p style='color:red'>唐三藏        答案错误!<br>");
            }
        }

    }
    String[] jingshui = request.getParameterValues("jingshui");
    if(jingshui != null){
        for(int i=0;i<jingshui.length;i++){
            if(jingshui[i].equals("对")){
                out.println("<p style='color:red'>√        答案错误!<br>");

            }
            if(jingshui[i].equals("错")){
                out.println("<p style='color:green'>X        答案正确!<br>");
                score +=1;
            }
            }
    }
    String[] diqiu = request.getParameterValues("diqiu");
    if(diqiu != null){
        for(int i=0;i<diqiu.length;i++){
            if(diqiu[i].equals("对")){
                out.println("<p style='color:red'>√        答案错误!<br>");

            }
            if(diqiu[i].equals("错")){
                out.println("<p style='color:green'>X        答案正确!<br>");
                score +=1;
            }
        }
    }
    String[] fuli = request.getParameterValues("fuli");
    if(fuli != null){
        for(int i=0;i<fuli.length;i++){
            if(fuli[i].equals("对")){
                out.println("<p style='color:red'>√        答案错误!<br>");

            }
            if(fuli[i].equals("错")){
                out.println("<p style='color:green'>X        答案正确!<br>");
                score +=1;
            }
        }
    }
    String[] kongqi = request.getParameterValues("kongqi");
    if(kongqi != null){
        for(int i=0;i<kongqi.length;i++){
            if(kongqi[i].equals("对")){
                out.println("<p style='color:red'>√        答案错误!<br>");

            }
            if(kongqi[i].equals("错")){
                out.println("<p style='color:green'>X        答案正确!<br>");
                score +=1;
            }
        }
    }
    out.print("<br>得分为:"+score);
    score = 0;

%>

</body>
</html>

 

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值