收藏 分销(赏)

试题库数据库设计.doc

上传人:a199****6536 文档编号:3068611 上传时间:2024-06-14 格式:DOC 页数:13 大小:225.54KB
下载 相关 举报
试题库数据库设计.doc_第1页
第1页 / 共13页
试题库数据库设计.doc_第2页
第2页 / 共13页
试题库数据库设计.doc_第3页
第3页 / 共13页
试题库数据库设计.doc_第4页
第4页 / 共13页
试题库数据库设计.doc_第5页
第5页 / 共13页
点击查看更多>>
资源描述

1、数据库设计说明书 -试题库系统 年级 学号 姓名 班级 一、 数据库设计原则1.系统架构:本子系统的模块结构如下:1、在线考试模块。2、在线练习模块。a) 传统的试卷读取。b) 自动组卷。除了以上主要模块外,还有一些不是重点但是同样重要的模块,包括学生登陆,密码修改,学生信息维护等等。2系统流程分析在需求分析,总体设计之后,该系统的初步轮廓已经确定,为了实现既定需求,同时综合对系统的安全性,实用性及合理性各方面的考虑,根据软件工程的思想,本系统的流程图如图1-1所示。2.用例图(在线考试子系统中主要用到了学生用例图):(1)(2)3.试卷内容分类:1.填空题2.判断题3.单选题4.多选题5.问

2、答题4. 设计工具:SQLServer企业管理器,PowerDesigner ,powerbuilder , Visual Basic二数据元素定义1. 教师基本信息表教师基本信息表存放教师类用户的基本信息。与学生基本信息表不同的是,它不包括成绩字段。具体设计如表2-1所示。表2-1 Teacher表字段名称字段说明字段类型字段大小备注TeacherID教师编号数字长整型主关键字TeacherName教师姓名文本10B不能为空TeacherPassword教师登录口令文本20B不能为空2.管理员账号表管理人员账号表主要是为对访问系统的教师及学生类人员的信息进行管理,以维护本系统的正常运行,确保

3、系统的安全性和可靠性而创建的。其字段结构如表2-2所示。表2-2 Admin表字段名称字段说明字段类型字段大小备注AdministratorID管理人员编号数字长整型主关键字AdministratorName管理人员姓名文本10B不能为空AdministratorPassword管理人员口令文本20B不能为空3. 试卷信息表每次考试之前,由教师类用户创建本次考试的试卷。相应的试卷信息被保存在试卷信息表中。当学生类用户参加考试时,完成的试卷答案也被保存到试卷信息表中,以备评阅。在试卷信息表中还保存了试卷评阅结果,其表结构如表2-3所示。表2-3 QuestionPaper表字段名称字段说明字段类

4、型字段大小备注PaperSerial试卷中的题目编号数字长整型主关键字QuestionID试题原编号数字长整型不能为空QuestionType试题类型数字字节型主关键字UserAnswer学生答案备注Score该题分值数字单精度小数位数一位Commence教师实际判分数字单精度允许空填空题库信息表: 填空题库信息表用于存储填空题的基本信息,表中各字段功能定义如表2-4所示。表2-4 Filling表字段名称字段说明字段类型字段大小备注QuestionID题目编号数字长整型主关键字Question题目内容文本250B不能为空Answer参考答案文本50B不能为空Score题目分值数字单精度小数位

5、数一位,不能为空TeacherID出题教师编号数字长整型不能为空QuesDifficult难度系数数字字节1:易,2:中,3:难判断题库信息表: 判断题库信息表用于存储判断题的基本信息,其中为迎合人们的通常习惯,将判断题描述为“对”或“错”两种结果。表中各字段功能定义如表2-5所示。表2-5 RightOrWrong表字段名称字段说明字段类型字段大小备注QuestionID题目编号数字长整型主关键字Question题目内容文本250B不能为空Answer参考答案文本对/错Score题目分值数字单精度小数位数一位,不能为空TeacherID出题教师编号数字长整型不能为空QuesDifficult

6、难度系数数字字节1:易,2:中,3:难单选题库信息表: 单选题类型的题目与填空题不同的是:除问题本身外,应该具有4个可选项,其表定义如表2-6所示。表2-6 SingleSel表字段名称字段说明字段类型字段大小备注QuestionID题目编号数字长整型主关键字Question题目内容文本250B不能为空ChoiceA选项A文本50BChoiceB选项B文本50BChoiceC选项C文本50BChoiceD选项D文本50BAnswer参考答案文本10BA、B、C、DScore题目分值数字单精度小数位数一位,不能为空TeacherID出题教师编号数字长整型不能为空QuesDifficult难度系数

7、数字字节1:易,2:中,3:难多选题库信息表: 多选题同单选题类似,也包括四个可选项,与其稍微不同的是:多选题的答案包括不只一个选项。表结构如表2-7所示。表2-7 MultiSel表字段名称字段说明字段类型字段大小备注QuestionID题目编号数字长整型主关键字Question题目内容文本250B不能为空续表6-4 ChoiceA选项A文本50BChoiceB选项B文本50BChoiceC选项C文本50BChoiceD选项D文本50BAnswer参考答案文本10BABCD的组合Score题目分值数字单精度小数位数一位,不能为空TeacherID出题教师编号数字长整型不能为空QuesDiff

8、icult难度系数数字字节1:易,2:中,3:难问答题库信息表: 问答题库信息表存放问答题的基本信息。与填空题不同的是,问答题的答案往往字数较多,故将其定义为支持较长文本的类型。表结构如表2-8所示。表2-8 EssayQuestion表字段名称字段说明字段类型字段大小备注QuestionID题目编号数字长整型主关键字Question题目内容文本250B不能为空Answer参考答案备注Score题目分值数字单精度小数位数一位,不能为空TeacherID出题教师编号数字长整型不能为空QuesDifficult难度系数数字字节1:易,2:中,3:难 三命名规范 1.卷类窗体的设计:本系统将试卷信息

9、定义为一个名为QuestionPaper的类,QuestionPaper类的对象实例Qpaper将提供对试卷创建、试卷修改、答题、评阅等主要功能的支持。QuestionPaper类方法及说明如表3-1所示。表3-1 QuestionPaper类方法及说明方法名称功能说明方法名称功能说明AddQuestion向试卷添加题目GetQID获取随即问题号,私有方法Check评阅试卷GetQuestion获取题目内容Create创建试卷GetQuestionID获取问题编号DelQuestion删除试卷中的一个题目GetType获取试题类型GetChoice获取选择题的各选项GetUserAnswer获

10、取用户答案GetDBRS获取题库数据集,私有方法ReportToFile输出试卷到文件GetQAnswer获取问题参考答案SetAnswer回答试卷GetQSerial获取第n条试题的编号四数据库表结构的SQL建表语句-用户表id 密码 权限 科室create table users (id varchar(20) not null,upwd varchar(20) not null,uright int,uroom varchar(20) not null,uname varchar(8) not null,constraint PK_user primary key (id);-用户组表组

11、ID 组名create table ugroup (ugid int not null,15name varchar(20) not null,constraint PK_ugroup primary key (ugid);-组权限表组ID 菜单tag 权限create table gright (ugid int not null,menu_tag varchar(20) not null,mright int,constraint PK_gright primary key (ugid);-学生表id 密码姓名性别年级专业班级create table students (stu_id va

12、rchar(20) not null,pwd varchar(20) not null,name varchar(8) not null,sex varchar(2),grade varchar(4) not null,major varchar(30) not null,classvarchar(4) not null,constraint PK_students primary key (stu_id);-课程表id 课程名create table course (cid varchar(20) not null,cname varchar(30) not null,constraint

13、PK_course primary key (cid);-题型表题型编号,题型,在试卷中的顺序位置create table styles (sid int not null,sname varchar(20) not null,sorder int not null,constraint PK_styles primary key(sid);-课程题型关联表课程ID 题型IDcreate table course_styles(cid varchar(20) not null,16sid int not null,constraint PK_course_styles primary key

14、(cid,sid);-学生课程关联表create table students_course (stu_id varchar(20) not null,cid varchar(20) not null,constraint PK_students_course primary key(stu_id,cid);-题目表id 题目内容课程id 题型id 章节关键词难度添加时间添加人审核审核人create table questions(qid int not null,content text not null,cid varchar(20) not null,sid varchar(2) not

15、 null,chapter int not null,point varchar(50),qlevel int not null,add_time datetime not null,add_user varchar(20) not null,auditint not null,auditteacher varchar(20)constraint PK_questions primary key (qid);-题目附加信息表附加id 附加题标题附加内容create table extra_questions (eid int not null,etitlevarchar(100),conten

16、t text not nullconstraint PK_extra_questions primary key (eid);-题目-附加信息关联表create table q_e (eid int not null,qid int not null,constraint PK_e_q primary key (eid,qid);-题目-图片关联表17create table p_q (qid int not null,pid int not null,constraint PK_p_q primary key (qid,pid);-答案表create table answers (aid i

17、nt not null,qid int not null,optionsname varchar(1) not null,options varchar(300) not null,answer int,constraint PK_answers primary key (aid);-图片列表create table pics (pid int not null,pname varchar(30),pBlob image,constraint PK_pics primary key (pid);-试卷列表id,name 考试时间,课程代号,考试与否0 练习,1 考试,试卷类型,考试方式0 传统

18、,1在线,审核,审核人ID,考试与否0 未考,1 已考create table testpaper_list(paper_id int not null,paper_name varchar(50) not null,paper_time datetime not null,cid varchar(20) not null,test int not null,paper_styles varchar(1),testway int,audit int not null,auditteacher varchar(20) not null,sysstate nt,constraint PK_test

19、paper_list primary key (paper_id);-试卷详细信息create table testpaper(paper_id int not null,18qid int not null,q_num int,qscore int,constraint PK_testpaper primary key (paper_id,qid);-参加考试学生表试卷Id 学号0 未考,1 已考,2 作弊create table paper_students(paper_id int not null,stu_id varchar(20) not null,stu_state int,co

20、nstraint PK_paper_students primary key (paper_id,stu_id);-已考的试卷create table paper_done (paper_id int not null,stu_id varchar(20) not null,qid int not null,q_num int,answer varchar(200) not null,stu_score int,grade_teacher varchar(20),grade_time datetime,audit_teacher varchar(20),audit_time datetime,constraint PK_paper_done primary key (paper_id,stu_id,qid);

展开阅读全文
相似文档                                   自信AI助手自信AI助手
猜你喜欢                                   自信AI导航自信AI导航
搜索标签

当前位置:首页 > 包罗万象 > 大杂烩

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        获赠5币

©2010-2024 宁波自信网络信息技术有限公司  版权所有

客服电话:4008-655-100  投诉/维权电话:4009-655-100

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :gzh.png    weibo.png    LOFTER.png 

客服