201819102006郭展昊考试试卷 ( 2020-09-21)

201819102006郭展昊考试试卷

考试系统:编写一个简单的考试系统。要求由两个页面组成,第一个页面显示试题,第二个页面获取考生提交的选择,并显示提交的结果,正确的使用绿色显示,错误的使用红色显示(若未选对,正确的选项使用蓝色显示),最后统计考生得分并显示。题型要求具有判断题、单选题、多选题,每种类型的题目至少5个以上。
代码如下:

第一页代码

<%--
  Created by IntelliJ IDEA.
  User: j
  Date: 2020/9/21
  Time: 16:07
  To change this template use File | Settings | File Templates.
--%>
<%@page  contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
  <title>答题卡</title>
</head>
<body>
<%
%>
<form action="check.jsp" mathod="get">
  <h1> 一:判断题</h1>
  <br>
  1、计算机辅助设计简称CAD。<br>
  <input type="radio" name="r1" value="1">Ture
  <input type="radio" name="r1" value="2">False<br>

  2、多媒体技术有交互性,集成性等特征。<br>
  <input type="radio" name="r2" value="1">Ture
  <input type="radio" name="r2" value="2">False<br>

  3、进程是程序的一次执行过程,是系统进行调度和资源分配的一个独立单位。<br>
  <input type="radio" name="r3" value="1">Ture
  <input type="radio" name="r3" value="2">False<br>

  4、DVD光盘单面最大容量为4.7GB,双面为8.5GB。<br>
  <input type="radio" name="r4" value="1">Ture
  <input type="radio" name="r4" value="2">False<br>

  5、计算机软件分为系统软件和应用软件两大类。<br>
  <input type="radio" name="r5" value="1">Ture
  <input type="radio" name="r5" value="2">False<br>


  <h2>二:选择题</h2>
  <br>
  1,第二代电子计算机使用的电子器件是( )<br>
  <input type="radio" name="c1" value="1">A.电子管<br>
  <input type="radio" name="c1" value="2">B.晶体管<br>
  <input type="radio" name="c1" value="3">C.集成电路<br>
  <input type="radio" name="c1" value="4">D.超大规模集成电路<br>

  2.目前,制造计算机所用的电子器件是 ( )<br>
  <input type="radio" name="c2" value="1">A.电子管<br>
  <input type="radio" name="c2" value="2">B.晶体管<br>
  <input type="radio" name="c2" value="3">C.集成电路<br>
  <input type="radio" name="c2" value="4">D.超大规模集成电路<br>

  3.计算机病毒是( )<br>
  <input type="radio" name="c3" value="1">A.带细菌的磁盘<br>
  <input type="radio" name="c3" value="2">B.已损坏的磁盘<br>
  <input type="radio" name="c3" value="3">C.具有破坏性的特制程序<br>
  <input type="radio" name="c3" value="4">D.被破坏的程序<br>

  4.将十进制数97转换成无符号二进制整数等于( )<br>
  <input type="radio" name="c4" value="1">A.1011111<br>
  <input type="radio" name="c4" value="2">B.1100001<br>
  <input type="radio" name="c4" value="3">C.1101111<br>
  <input type="radio" name="c4" value="4">D.1100011<br>

  5.大写字母B的ASCII码值是( )<br>
  <input type="radio" name="c5" value="1">A.65<br>
  <input type="radio" name="c5" value="2">B.66<br>
  <input type="radio" name="c5" value="3">C.41H<br>
  <input type="radio" name="c5" value="4">D.97<br>

  <h3>三:多选题</h3>
  <br>
  1,在windows”我的电脑“可用来()<br>
  <input type="checkbox" name="d1" value="1">A.管理计算机资源<br>
  <input type="checkbox" name="d1" value="2">B.对文件进行移动<br>
  <input type="checkbox" name="d1" value="3">C.对文件进行删除<br>
  <input type="checkbox" name="d1" value="4">D.对文件进行复制<br>
  <br>

  2,鼠标是一种新型的什么设备()<br>
  <input type="checkbox" name="d2" value="1">A.输出设备<br>
  <input type="checkbox" name="d2" value="2">B.通讯设备<br>
  <input type="checkbox" name="d2" value="3">C.控制设备<br>
  <input type="checkbox" name="d2" value="4">D.输出设备<br>
  <br>

  3,windows内置有()<br>
  <input type="checkbox" name="d3" value="1">A.IE<br>
  <input type="checkbox" name="d3" value="2">B.系统工具<br>
  <input type="checkbox" name="d3" value="3">C.画笔<br>
  <input type="checkbox" name="d3" value="4">D.五笔输入法<br>
  <br>

  4,人机进行信息交互可以借助windows对话框,其内容如下()<br>
  <input type="checkbox" name="d4" value="1">A.单选框<br>
  <input type="checkbox" name="d4" value="2">B.复选框<br>
  <input type="checkbox" name="d4" value="3">C.列表框<br>
  <input type="checkbox" name="d4" value="4">D.选项卡<br>
  <br>

  5,在控制面板的显示属性里,背景选项卡的墙纸可以选择什么文件( )<br>
  <input type="checkbox" name="d5" value="1">A.JPG<br>
  <input type="checkbox" name="d5" value="2">B.HTML<br>
  <input type="checkbox" name="d5" value="3">C.BMP<br>
  <input type="checkbox" name="d5" value="4">D.WAV<br>
  <br>

  <input type="submit" name="sub" value="提交">
  <input type="reset" name="res" value="重置">
</form>
</body>
</html>

在这里插入图片描述

第二页代码


<%--
  Created by IntelliJ IDEA.
  User: j
  Date: 2020/9/20
  Time: 17:16
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>成绩及纠错</title>
</head>
<body>
<%  int score=0;

    String t1=request.getParameter("r1");
    String t2=request.getParameter("r2");
    String t3=request.getParameter("r3");
    String t4=request.getParameter("r4");
    String t5=request.getParameter("r5");

    String t6=request.getParameter("c1");
    String t7=request.getParameter("c2");
    String t8=request.getParameter("c3");
    String t9=request.getParameter("c4");
    String t10=request.getParameter("c5");

    String t11[]=request.getParameterValues("d1");
    String t12[]=request.getParameterValues("d2");
    String t13[]=request.getParameterValues("d3");
    String t14[]=request.getParameterValues("d4");
    String t15[]=request.getParameterValues("d5");

    if (t1==null)
    {
        out.print("<p style='color:blue'>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("1"))
    {
        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("1"))
    {
        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("2"))
    {
        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("4"))
    {
        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("3"))
    {
        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("2"))
    {
        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("4"))
    {
        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("2")&t12[1].equals("3")&t12[2].equals("5"))
    {
        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("1")&t14[1].equals("2")&t14[2].equals("4"))
    {
        out.print("<p style='color:green'>14.正确</p>");
        score+=5;
    }
    else
        out.print("<p style='color:red'>14.错误</p>");
    if (t15==null||t15.length<3)
    {
        out.print("<p style='color:blue'>15.漏选</p>");
    }
    else
    if(t15[0].equals("1")&t15[1].equals("2")&t15[2].equals("4"))
    {
        out.print("<p style='color:green'>15.正确</p>");
        score+=5;
    }
    else
        out.print("<p style='color:red'>15.错误</p>");
    out.print("<p style='color:red;'><font size='120px;'>成绩"+score+"</font><p>");
%>
</body>
</html>

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值