在线考试系统论文.docx

上传人:b****5 文档编号:8845224 上传时间:2023-05-15 格式:DOCX 页数:28 大小:902.53KB
下载 相关 举报
在线考试系统论文.docx_第1页
第1页 / 共28页
在线考试系统论文.docx_第2页
第2页 / 共28页
在线考试系统论文.docx_第3页
第3页 / 共28页
在线考试系统论文.docx_第4页
第4页 / 共28页
在线考试系统论文.docx_第5页
第5页 / 共28页
在线考试系统论文.docx_第6页
第6页 / 共28页
在线考试系统论文.docx_第7页
第7页 / 共28页
在线考试系统论文.docx_第8页
第8页 / 共28页
在线考试系统论文.docx_第9页
第9页 / 共28页
在线考试系统论文.docx_第10页
第10页 / 共28页
在线考试系统论文.docx_第11页
第11页 / 共28页
在线考试系统论文.docx_第12页
第12页 / 共28页
在线考试系统论文.docx_第13页
第13页 / 共28页
在线考试系统论文.docx_第14页
第14页 / 共28页
在线考试系统论文.docx_第15页
第15页 / 共28页
在线考试系统论文.docx_第16页
第16页 / 共28页
在线考试系统论文.docx_第17页
第17页 / 共28页
在线考试系统论文.docx_第18页
第18页 / 共28页
在线考试系统论文.docx_第19页
第19页 / 共28页
在线考试系统论文.docx_第20页
第20页 / 共28页
亲,该文档总共28页,到这儿已超出免费预览范围,如果喜欢就下载吧!
下载资源
资源描述

在线考试系统论文.docx

《在线考试系统论文.docx》由会员分享,可在线阅读,更多相关《在线考试系统论文.docx(28页珍藏版)》请在冰点文库上搜索。

在线考试系统论文.docx

在线考试系统论文

一、需求分析2

1、实现功能:

2

二、总体设计2

1、设计目标2

2、设计原则2

3、项目规划2

三、模板设计及功能3

1、考生在线考试模块说明3

2、管理员管理模板说明3

3、总体架构设计4

4、开发和运行环境4

四、数据库设计4

五、详细设计与实现5

六、使用说明17

七、总结18

一、需求分析

1、实现功能:

●用户类别:

登录系统的身份定为两种,一是管理员,二是学生。

●考生登录功能:

考生输入身份和密码登陆系统后可以登录,同时查看考生的信息,选择对应的试卷可进行考试。

考试结束时提交系统将自动对题进行评分。

●管理员管理:

考生输入身份和密码登陆系统后可以登录。

管理员可添加考生成绩、查询考生成绩、修改考生成绩、删除考生成绩信息。

二、总体设计

1、设计目标

●实现在线考试系统的功能。

●实现考生的登录和答题。

●实现管理员对考试成绩的添加、查看、更改、删除。

2、设计原则

●页面模板化:

将页面中的一些常用的部分模板化,如页面的头部、尾部等,这样在设计页面时,如果有重复的部分,只需要用现成的模板来拼装即可。

这样可以实现代码重用和全局的控制。

●后台和前台的独立:

将后管理模板和前台考试模板独立起来,便于管理员管理和维护数据。

同时,对用户的权限进行控制,可以增加系统的安全性。

3、项目规划

在线考试系统由两大部分组成:

●在线考试模板:

该部分主要包括考生身份验证、在线答题、查看考生信息。

●管理员管理模板:

该部分主要包括成绩管理、成绩添加、成绩查询、成绩更改、成绩删除。

三、模板设计及功能

1、考生在线考试模块说明

●首页模板:

该模板提供在线考试系统的考生身份验证及登陆等功能。

●考生答题模板:

该模板提供了选择考试科目功能,使考生能够方便地选择答题及考生的信息显示。

2、管理员管理模板说明

●管理员管理模板:

该模板提供了考生成绩的添加、修改、更改和删除功能。

3、总体架构设计

我们的在线考试系统采用jsp+mysql+javascript进行功能实现

在线考试系统说明

文件/文件夹名称

说明

On-line-exam

主文件夹

table

用于存放表文件夹

css

用于保存css外部样式表文件

Student.mdb、score.mdb

数据库文件

images

用于保存网站中的应用的图片文件

4、开发和运行环境

在线考试系统的开发和运行需要以下软件平台的支持:

●操作系统:

windowsXP.

●数据库:

mysql-5.0.51a-win32

●开发工具:

jdk-6u10-windows-i586-p.exe、

●Web服务器:

Tomcat6.0.

●浏览器:

360浏览器

四、数据库设计

在线考试系统所采用的数据库为Mysql,数据库名称为exam,包含2张数表。

a)数据表概要说明

数据库名:

exam.

数据表:

student、score

b)主要数据表的结构

(1)student(学生信息表)

学生信息表用来保存考生的相关信息。

Student表结构如下:

字段名

数据类型

空否

主键否

备注

number

varchar(10)

no

PRI

准考证号

name

varchar(10)

Yes

(null)

考生姓名

sex

varchar(6)

Yes

(null)

考生性别

class

varchar(20)

Yes

(null)

考生班级

degree

varchar(10)

yes

(null)

考生学历

telephone

int

Yes

(null)

考生电话

(2)score(成绩表)

成绩表用来保存考生的考试成绩信息,便于管理员的管理。

score表的结构如下:

字段名

数据类型

空否

主键否

备注

number

Varchar(10)

no

PRI

准考证号

name

varchar(8)

no

(null)

考生姓名

english

int

yes

(null)

英语成绩

maths

int

yes

(null)

数学成绩

chinese

int

yes

(null)

语文成绩

zonghe

int

yes

(null)

综合成绩

五、详细设计与实现

下面详细介绍在线考试系统的设计与实现过程。

a)学生登录页面设计(1-student.jsp)

代码1

--

body{

margin-left:

0px;

margin-top:

0px;

margin-right:

0px;

margin-bottom:

0px;

background-color:

#609FC3;

}

-->

<%

request.setCharacterEncoding("gb2312");

Stringzkzh=request.getParameter("zkzh");

Stringname=request.getParameter("name");

Stringbj=request.getParameter("bj");

if(zkzh==null||zkzh.length()==0)

out.print("");

else

out.print("准考证号"+zkzh+" "+" "+" "+" "+" "+" ");

if(name==null||name.length()==0)

out.print("");

else

out.print("姓名"+name+" "+" "+" "+" "+" "+" ");

if(bj==null||bj.length()==0)

out.print("");

else

out.print("班级:

"+bj);

%>

代码2

<%

intsum=0;

Strings1=request.getParameter("radio1");

Strings2=request.getParameter("radio2");

Strings3=request.getParameter("radio3");

Strings4=request.getParameter("radio4");

Strings5=request.getParameter("radio5");

Strings6=request.getParameter("radio6");

Strings7=request.getParameter("radio7");

Strings8=request.getParameter("radio8");

Strings9=request.getParameter("radio9");

Strings10=request.getParameter("radio10");

if(s1.equals("A"))

sum++;

if(s2.equals("B"))

sum++;

if(s3.equals("C"))

sum++;

if(s4.equals("D"))

sum++;

if(s5.equals("A"))

sum++;

if(s6.equals("B"))

sum++;

if(s7.equals("C"))

sum++;

if(s8.equals("D"))

sum++;

if(s9.equals("A"))

sum++;

if(s10.equals("B"))

sum++;

%>

你的得分是:

<%=sum%>

下一套题(语文)

代码3

<%

Connectioncon;

Statementsql;

ResultSetrs;

try{Class.forName("com.mysql.jdbc.Driver");

}

catch(Exceptione)

{out.print(e);

}

try{

Stringurl="jdbc:

mysql:

//localhost:

3306/exam";

con=DriverManager.getConnection(url,"root","123");

sql=con.createStatement();

rs=sql.executeQuery("SELECT*FROMstudent");

out.print("");

out.print("");

out.print(""+"学号");

out.print(""+"姓名");

out.print(""+"性别");

out.print(""+"班级");

out.print(""+"学历");

out.print(""+"电话");

out.print("");

while(rs.next())

{out.print("");

out.print(""+rs.getString

(1)+"");

out.print(""+rs.getString

(2)+"");

out.print(""+rs.getString(3)+"");

out.print(""+rs.getString(4)+"");

out.print(""+rs.getString(5)+"");

out.print(""+rs.getInt(6)+"");

out.print("");

}

out.print("");

con.close();

}

catch(Exceptionex)

{

out.print(ex);

}

%>

b)管理员显示页面(news.jsp)

 

代码1

<%

Connectioncon=null;

Statementstmt=null;

ResultSetrs=null;

Stringresult=null;

intintPageSize;//一页显示的记录数

intintRowCount;//记录总数

intintPageCount;//总页数

intintPage;//待显示页码

inti;

intPageSize=10;//设置一页显示的记录数

StringstrPage=request.getParameter("page");

//取得待显示页码

if(strPage==null)

{//表明在QueryString中没有page这一个参数,

此时显示第一页数据

intPage=1;

}

else{//将字符串转换成整型

intPage=Integer.parseInt(strPage);

//if(intPage<1)intPage=1;

}

try{

Class.forName("com.mysql.jdbc.Driver");//Class.forName("org.gjt.mm.mysql.Driver");

Stringurl="jdbc:

mysql:

//localhost:

3306/exam";

con=DriverManager.getConnection(url,"root","123");

stmt=con.createStatement(ResultSet.TYPE_SCROLL_

SENSITIVE,ResultSet.CONCUR_UPDATABLE);

StringstrSQL="SELECT*FROMscore";

rs=stmt.executeQuery(strSQL);

rs.last();//光标指向查询结果集中最后一条记录

intRowCount=rs.getRow();//获取记录总数

//intPageCount=(intRowCount+intPageSize-1)

/intPageSize;

intPageCount=(intRowCount%intPageSize==0)?

(intRowCount/intPageSize):

(intRowCount/intPageSize+1);

//记算总页数

/*if(intPage>intPageCount)

intPage=intPageCount;*///调整待显示的页码

if(intPageCount>0)

{

rs.absolute((intPage-1)*intPageSize+1);

//将记录指针定位到待显示页的第一条记录上

//显示数据

i=0;

while(i

rs.isAfterLast()){%>

<%=rs.getString

(1)%>

<%=rs.getString

(2)%>

<%=rs.getString(3)%>

<%=rs.getString(4)%>

<%=rs.getString(5)%>

<%=rs.getString(6)%>

number

=<%=rs.getString

(1)%>">修改

number

=<%=rs.getString

(1)%>">删除

<%rs.next();

i++;

}

}

%>

<%=intPageCount%>页第<%=intPage%>页

<%if(intPage

page=

<%=intPage+1%>">下一页

<%}%>

<%if(intPage>1){%>

page=

<%=intPage-1%>">上一页

<%}

}

catch(Exceptionex)

{

out.print(ex);

}

finally

{

con.close();

stmt.close();}

%>

代码2

<%

try{//获取提交学生的学号和姓名

Stringn=request.getParameter("number").trim();

Stringname=request.getParameter("name");

bytec[]=name.getBytes("ISO-8859-1");

name=newString(c);

Stringenglish=request.getParameter("english").trim();

Stringmaths=request.getParameter("maths").trim();

Stringchinese=request.getParameter("chinese").trim();

Stringzonghe=request.getParameter("zonghe").trim();

//获取提交的新的成绩

Connectioncon=null;

Statementsql=null;

ResultSetrs=null;

Stringurl;

Class.forName("com.mysql.jdbc.Driver");//Class.forName("org.gjt.mm.mysql.Driver");

url="jdbc:

mysql:

//localhost:

3306/exam";

//Class.forName("com.microsoft.jdbc.

sqlserver.SQLServerDriver");

//url="jdbc:

microsoft:

sqlserver:

//localhost:

1433;

DatabaseName=university2";

con=DriverManager.getConnection(url,"root","123");

//建立与数据库的连接

sql=con.createStatement();

Stringcondition=

"INSERT

INTO

scoreVALUES"+"("+"'"+n+"','"+name+"','"+english+"','"+

maths+"','"+chinese+"','"+zonghe+"')";

sql.executeUpdate(condition);//执行添加操作

%>

返回继续

添加记录后的表

<%

rs=sql.executeQuery("SELECT*FROM

scoreORDERBYnumber");

out.print("

cellpadding=5cellspacing=0bordercolor=blue>");

out.print("");

out.print(""+"学号"+"");

out.print(""+"姓名"+"");

out.print(""+"英语"+"");

out.print(""+"数学"+"");

out.print(""+"语文"+"");

out.print(""+"综合"+"");

out.print("");

while(rs.next())

{

out.print("");

Stringxuehao=rs.getString

(1);

out.print(""+xuehao+"");

Stringxingming=rs.getString

(2);

out.print(""+xingming+"");

Stringyingyu=rs.getString(3);

out.print(""+yingyu+"");

Stringshuxue=rs.getString(4);

out.print(""+shuxue+"");

Stringyuwen=rs.getString(5);

out.print(""+yuwen+"");

Stringzh=rs.getString(6);

out.print(""+zh+"");

out.print("");

}

out.print("");

con.close();

}

catch(SQLExceptionevent)

{out.print("数据操作异常,请重新输入!

");

out.print("返回");}

catch(NumberFormatExceptione)

{

out.print("
"+"请输入有效数据");

}

%>

代码3

<%

try{

Stringurl,sql;

Connectioncon;

ResultSetrs;

PreparedStatementpstmt=null;

StringnewNumber=(String)session.getAttribute("number");

StringnewName=request.getParameter("name");

if(newName==null)newName="";

byteb[]=newName.getBytes("ISO-8859-1");

newName=newString(b,"UTf-8");

StringEnglish=request.getParameter("english");

if(English==null||English.length()==0)

{

English="0";

}

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > PPT模板 > 动物植物

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2