试题库数据库设计

上传人:无*** 文档编号:71324736 上传时间:2022-04-07 格式:DOC 页数:12 大小:263.50KB
返回 下载 相关 举报
试题库数据库设计_第1页
第1页 / 共12页
试题库数据库设计_第2页
第2页 / 共12页
试题库数据库设计_第3页
第3页 / 共12页
点击查看更多>>
资源描述
数据库设计说明书-试题库系统年级学号姓名班级一、数据库设计原则1. 系统架构:本子系统的模块结构如下:1、在线考试模块。2、在线练习模块。a)传统的试卷读取。b)自动组卷。除了以上主要模块外,还有一些不是重点但是同样重要的模块,包括学生登陆,密码修改, 学生信息维护等等。2. 系统流程分析在需求分析,总体设计之后,该系统的初步轮廓已经确定,为了实现既定需求,同时综合对系统的安全性, 实用性及合理性各方面的考虑,根据软件工程的思想, 本系统的流程图如图1-1所示。2.用例图(在线考试子系统中主要用到了学生用例图):(1)(2)3. 试卷内容分类:1. 填空题2. 判断题3. 单选题4. 多选题5. 问答题4. 设计工具:SQLServer企业管理器, PowerDesigner ,powerbuilder ,Visual Basic二数据元素定义1. 教师基本信息表教师基本信息表存放教师类用户的基本信息。与学生基本信息表不同的是,它不包括 成绩字段。具体设计如表 2-1所示。表 2-1 Teacher 表字段名称字段说明字段类型字段大小备注TeacherlD教师编号数字长整型主关键字TeacherName教师姓名文本10B不能为空TeacherPasswor d教师登录口令文本20B不能为空2. 管理员账号表管理人员账号表主要是为对访问系统的教师及学生类人员的信息进行管理,以维护本 系统的正常运行,确保系统的安全性和可靠性而创建的。其字段结构如表2-2所示。表 2-2 Admin 表字段名称字段说明字段类型字段大小备注Admi nistratorlD管理人员编号数字长整型主关键字Admi nistratorName管理人员姓名文本10B不能为空Admi nistratorPassword管理人员口令文本20B不能为空3试卷信息表每次考试之前,由教师类用户创建本次考试的试卷。相应的试卷信息被保存在试卷信 息表中。当学生类用户参加考试时,完成的试卷答案也被保存到试卷信息表中,以备评阅。在试卷信息表中还保存了试卷评阅结果,其表结构如表2-3所示。表 2-3 QuestionPaper表字段名称字段说明字段类型字段大小备注PaperSerial试卷中的题目编号数字:长整型主关键字Questio nID试题原编号数字长整型不能为空Questi on Type试题类型数字字节型主关键字UserA nswer学生答案备注Score该题分值数字:单精度小数位数一位Comme nee教师实际判分数字单精度允许空填空题库信息表:填空题库信息表用于存储填空题的基本信息,表中各字段功能定义如表2-4所示。表 2-4 Filling 表字段名称字段说明字段类型字段大小备注Questio nID:题目编号 数字长整型主关键字Questi on题目内容文本250B不能为空An swer参考答案文本50B不能为空Score:题目分值数字单精度小数位数一位,不能为空TeaeherlD出题教师编号数字长整型不能为空QuesDiffic难度系数数字字节1:易,2 :中,3 :难ult判断题库信息表:判断题库信息表用于存储判断题的基本信息, 其中为迎合人们的通常习惯,将判 断题描述为“对”或“错”两种结果。表中各字段功能定义如表2-5所示。表 2-5 RightOrWrong表字段名称字段说明字段类型字段大小备注Questio nID:题目编号数字长整型主关键字Questi on题目内容文本250B不能为空An swer参考答案文本对/错Score:题目分值数字:单精度小数位数一位,不能为空TeacherID出题教师编号数字长整型不能为空QuesDiffic ult难度系数数字字节1:易,2 :中,3 :难单选题库信息表:单选题类型的题目与填空题不同的是: 除问题本身外,应该具有4个可选项,其 表定义如表2-6所示。表 2-6 SingleSel表字段名称字段说明字段类型字段大小备注Questio nID:题目编号数字长整型主关键字Questi on题目内容文本250B不能为空ChoiceA选项A文本50BChoiceB选项B文本50BChoiceC:选项C文本50BChoiceD选项D文本50BAn swer:参考答案文本10BA、B C DScore题目分值数字单精度小数位数一位,不能为空TeacherID出题教师编号数字长整型不能为空QuesDiffic ult难度系数数字字节1:易,2 :中,3 :难多选题库信息表:多选题同单选题类似,也包括四个可选项,与其稍微不同的是:多选题的答案包 括不只一个选项。表结构如表2-7所示。表 2-7 MultiSel 表字段名称字段说明字段类型字段大小备注Questio nID:题目编号数字长整型主关键字Questi on题目内容文本250B不能为空续表6-4ChoiceA选项A文本50BChoiceB选项B文本50BChoiceC选项C文本50BChoiceD选项D文本50BAn swer:参考答案文本10BABCD的组合Score题目分值数字单精度小数位数一位,不能为空TeacherID出题教师编号数字长整型不能为空QuesDiffic ult难度系数数字字节1:易,2 :中,3 :难问答题库信息表:问答题库信息表存放问答题的基本信息。 与填空题不同的是,问答题的答案往往 字数较多,故将其定义为支持较长文本的类型。表结构如表2-8所示。表 2-8 EssayQuestion 表字段名称字段说明字段类型字段大小备注Questio nID:题目编号数字长整型主关键字Questi on题目内容文本250B不能为空An swer参考答案备注Score:题目分值数字单精度小数位数一位,不能为空TeacherID出题教师编号数字长整型不能为空QuesDiffic ult难度系数数字字节1:易,2 :中,3 :难三命名规范1.卷类窗体的设计:本系统将试卷信息定义为一个名为QuestionPaper的类,QuestionPaper类的对象实例Qpaper将提供对试卷创建、试卷修改、答题、评阅等主要功能的支持。QuestionPaper类方法及说明如表 3-1所示。表3-1 QuestionPaper类方法及说明方法名称功能说明方法名称功能说明AddQuestion向试卷添加题目GetQID获取随即问题号,私有方法Check评阅试卷GetQuesti on获取题目内容Create创建试卷GetQuestionl D获取冋题编号DelQuesti on删除试卷中的一个题目GetType获取试题类型GetChoice获取选择题的各选项GetUserA nswer获取用户答案GetDBRS获取题库数据集,私有方法ReportToFile输出试卷到文件GetQA nswer获取冋题参考答案SetAn swer回答试卷GetQSerial获取第n条试题的编号四数据库表结构的SQL建表语句-用户表id密码权限科室create table users (id varchar(20) not null,upwd varchar(20) not nu II, uright int,uroom varchar(20) not n ull,un ame varchar(8) not nu II,con stra int PK_user primary key (id);-用户组表组ID组名create table ugroup (ugid int not n ull,15n ame varchar(20) not nu II,con stra int PK_ugroup primary key (ugid);-组权限表组ID菜单tag权限create table gright (ugid int not n ull,menu _tag varchar(20) not n ull,mright int,con stra int PK_gright primary key (ugid);- 学生表 id 密码姓名性别年级专业班级create table students ( stu_id varchar(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 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, 16 sid int not null, constraint PK_course_styles primary key (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 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), content text not null constraint 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) );- 题目- 图片关联表17 create table p_q ( qid int not null, pid int not null, constraint PK_p_q primary key (qid,pid) );- 答案表create table answers ( aid int 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 传统,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_testpaper_list primary key (paper_id) );- 试卷详细信息create table testpaper( paper_id int not null, 18 qid 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,constraint 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) );
展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 压缩资料 > 基础医学


copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!