网站导航网学 原创论文 原创专题 网站设计 最新系统 原创论文 论文降重 发表论文 论文发表 UI设计定制 论文答辩PPT格式排版 期刊发表 论文专题
返回网学首页
网学原创论文
最新论文 推荐专题 热门论文 论文专题
当前位置: 网学 > 交易代码 > 课程设计 > 正文

VB+SQL Server智能排课系统

论文降重修改服务、格式排版等 获取论文 论文降重及排版 论文发表 相关服务
VB+SQL Server智能排课系统
摘   要
排课问题是所有教育行业都要面对的问题,尤其针对高校纷繁复杂的课程和专业,一直没有很好解决方法。但这又是每个学校在每个学期都会碰到的必修课。本文在相关理论的指导下,在分析以往一些排课软件的基础上,提出一种排课系统的设计方法,对一些具体的问题给出相应解决方案。希望对于相关部门有所帮助。此系统主要被分为三个部分:界面的设计、排课算法的设计、以及报表的自动生成。纵观全局,我们确定用Visual Basic 语言作为程序设计语言以及运用SQL Server 2000 数据库作为后台的数据库支持。
 关键词:排课、排课系统、设计、高校
Abstract
Course arranging Problem is a problem which working in the development of education is facing. Especially, there is no a good solution for this matter of the college. However, it is also a necessary administration task for every school in every semester. This essay, with the correlative theory’s guidance, on the basis of analyzing some courses-arraying software, proposes a design method of commonly used courses arraying information system in college, and solves some of the certain problems. Hoping it is useful for the relative department. The system consist of three parts: the interface design, the algorithm of Course Timetable system, and printing the tables. On the whole, we decided to use VB computer language to design and SQL Server 2000 Data Base to support.
Key Words: courses arranging; courses arrangement management system; design;  college29
 

VB+SQL Server智能排课系统
目   录
摘     要. I
Abstract II
第一章 引言. 1
第二章 可行性研究. 3
2.1 系统目标及任务. 3
2.2 开发工具的选择和介绍. 3
2.3 对现有的排课系统的分析. 5
2.4系统的逻辑模型. 6
2.4.1 系统结构图. 6
2.4.2 系统流程图. 6
2.4.3数据字典. 7
2.5 系统的可行性. 8
2.5.1经济可行性分析. 8
2.5.2操作可行性分析. 9
2.5.3 技术可行性分析. 9
2.6成本效益分析. 9
第三章 需求分析. 10
3.1 系统的运行环境要求. 10
3.1.1硬件要求. 10
3.1.2软件要求. 10
3.2 系统的功能要求. 10
3.3系统的性能要求. 11
3.3.1 E-R图. 11
第四章 总体设计. 13
4.1 模块设计. 13
4.2 功能分解. 14
4.3 数据库设计. 14
4.3.1 定义属性表. 14
4.4 排课系统总构架. 16
第五章 详细设计. 17
5.1用户界面设计. 17
5.1.1简单易用和个性化需求. 17
5.1.2对数据的查询. 17
5.1.3系统菜单功能. 17
5.2 课程表的生成. 19
5.2.1 班级课程表查询打印设计. 19
5.2.2 教师课程表查询打印设计. 25
5.2.3 教室课程表查询打印设计. 31
第六章 测试. 37
6.1 排课系统功能测试. 37
6.2 排课系统课表合理性测试. 37
6.3 该系统的不足和改进方案. 37
第七章 总结. 39
7.1软件设计小结. 39
参考文献. 40
附 录. 41
Survey Report 45
 

VB+SQL Server智能排课系统
第一章 引言
随着信息技术的飞速发展,各个行业的信息化势在必行。正所谓“科学技术是第一生产力”,科技的进步大大地提高了生产率。然而,在高校这个知识密集的地方,如何才能提高办学效率,更好地完成教学任务,跟上社会发展步伐,这是一个摆在教学工作者面前的一个迫切的问题。应用信息化来改造传统的教学管理模式是一个重要途径。
近几年来,随着各高校办公自动化工作的推进,教务管理自动化也被摆上了日程。在教务工作中占有很大比重的一项就是每学期的课程排定工作。由于教工、教室和设备的相对紧张,如何进行合理地安排和分配,从而充分利用教学资源是我们不得不面对的问题。而人工进行排课不仅任务重,效率低,而且易出错,难于维护,想要排出一张各方面都满意的课表非常困难。并且随着高校规模的扩大手工排课的难度和工作量呈几何级数增长。
排课系统正是为了减轻教务人员的工作量,实现教务工作自动化,解决排课这一老大难问题的教务办公软件。尤其针对高校的排课一直都没有很好的解决方法,但是此问题又是每个学校在每个学期都会碰到的必要行政作业。本文在相关理论的指导下,在分析以往一些排课软件的基础上,提出一个高校通用排课系统的设计方法,并对一些具体的问题给出相应解决方案。但是,由于技术、经验的有限和数据量过大,目前我们很难做出一个满足所有需要的排课系统。因为它不仅要考虑到教室冲突问题和教师冲突问题,还要考虑到分段课、单双周课时的资源利用问题;另外由于高校的教学特点,还要处理合班课、分班课、体育课与选修课等特殊课程。针对这些问题,在此专门对数据库设计作了一些探索,并于架构的选择和模块的划分上经过精心调整,在菜单的设计上也体现了人性化的操作。该设计贴近用户需求,功能完整,架构合理,并用大量的框图模型体现了系统的规划。
本软件使用Microsoft Basic 6.0进行编写和SQL Server 2000数据库相连接。数据库的特点:1.实现数据共享 2.实现数据独立3.减少了数据冗余度 4.避免了数据不一致性5.加强了对数据的保护。一个数据库应用系统通常是由数据库和应用程序两部分组成,它们是在数据库管理系统支持下设计和开发出来的
第二章 可行性研究
2.1 系统目标及任务
本软件主要是适用于高等学校教务部门的办公软件,运用此软件,可以免去工作人员繁忙而枯燥的手工排课过程,直接通过计算机进行排课。我的任务是完成排课系统的界面设计以及排课后报表的生成。
2.2 开发工具的选择和介绍
针对目前世界上流行的大量软件和开发工具,经过认真分析其优缺点,结合排课系统的需要和目前的硬件环境,我们选用微软WINDOWS平台下的Visual Basic 6.0(简写为VB6.0)作为软件开发工具和SQL Server 2000数据库进行连接。
作为数据库系统的开发,Visual Basic是一个非常理想选择。Visual Basic是一种可视化的、面对对象和条用事件驱动方式的结构化高级程序设计,可用于开发Windows环境下的应用程序。它简单易学、效率高,且功能强大,可以与Windows的专业开发工具SDK相媲美,而且程序开发人员不必具有C/C++编程基础。在Visual Basic环境下,利用事件驱动的编程机制、新颖易用的可视化设计工具,使用Windows内部的应用程序接口(API)函数,以及动态链接库(DLL)、动态数据交换(DDE)、对象的链接与嵌入(OLE)、开放式数据访问(ODBC)等技术,可以高效、快速地开发出Windows环境下功能强大、图形界面丰富的应用软件系统。总的来说,Visual Basic具有以下特点:
1、可视化编程
用传统程序设计语言设计程序时,都是通过编写程序代码来设计用户界面,在设计过程中看不到界面的实际显示效果,必须编译后运行程序才能观察。如果对界面的效果不满意,还要回到程序中修改。有时候,这种编程-编译-修改的操作可能要反复多次,大大影响了软件开发效率。Visual Basic提供了可视化设计工具,把Windows界面设计的复杂性“封装”起来,开发人员不必为界面设计而编写大量程序代码。只需要按设计要求的屏幕布局,用系统提供的工具,在屏幕上画出各种“部件”,即图形对象,并设置这些图形对象的属性。Visual Basic自动产生界面设计代码,程序设计人员只需要编写实现程序功能的那部分代码,从而可以大大提高程序设计的效率。
2、面向对象的程序设计
4.0版 以后的Visual Basic支持面向对象的程序设计,但它与一般的面向对象的程序设计语言(C++)不完全相同。在一般的面向对象程序设计语言中,对象由程序代码和数据组成,是抽象的概念;而Visual Basic则是应用面向对象的程序设计方法(OOP),把程序和数据封装起来作为一个对象,并为每个对象赋予应有的属性,使对象成为实在的东西。在设计对象时,不必编写建立和描述每个对象的程序代码,而是用工具画在界面上,Visual Basic自动生成对象的程序代码并封装起来。每个对象以图形方式显示在界面上,都是可视的。
3、结构化程序设计语言
Visual Basic是在BASIC语言的基础上发展起来的,具有高级程序设计语言的语句结构,接近于自然语言和人类的逻辑思维方式。Visual Basic语句简单易懂,其编辑器支持彩色代码,可自动进行语法错误检查,同时具有功能强大且使用灵活的调试器和编译器。Visual Basic是解释型语言,在输入代码的同时,解释系统将高级语言分解翻译成计算机可以识别的机器指令,并判断每个语句的语法错误。在设计Visual Basic程序的过程中,随时可以运行程序,而在整个程序设计好之后,可以编译生成可执行文件(.EXE),脱离Visual Basic环境,直接在Windows环境下运行。
4、事件驱动编程机制
Visual Basic通过事件来执行对象的操作。一个对象可能会产生多个事件,每个事件都可以通过一段程序来响应。例如,命令按钮是一个对象,当用户单击该按钮时,将产生一个“单击”(CLICK)事件,而在产生该事件时将执行一段程序,用来实现指定的操作。
在用Visual Basic设计大型应用软件时,不必建立具有明显开始和结束的程序,而是编写若干个微小的子程序,即过程。这些过程分别面向不同的对象,由用户操作引发某个事件来驱动完成某种特定的功能,或者由事件驱动程序调用通用过程来执行指定的操作,这样可以方便编程人员,提高效率。
5、访问数据库
Visual Basic具有强大的数据库管理功能,利用数据控件和数据库管理窗口,可以直接建立或处理SQL Server 2000数据库,并提供了强大的数据存储功能。Visual Basic提供开放式数据连接,即ODBC功能,可通过直接访问或建立连接的方式使用并操作后台大型网络数据库,如SQL Server,Oracle等。在应用程序中,可以使用结构化查询语言SQL数据标准,直接访问服务器上的数据库。
6、对象的链接与嵌入(OLE)
对象的链接与嵌入(OLE)将每个应用程序都看作是一个对象(object),将不同的对象链接(link)起来,再嵌入(embed)某个应用程序中,从而可以得到具有声音、影像、图像、动画、文字等各种信息的集合式的文件。OLE技术是Microsoft公司对象技术的战略,它把多个应用程序合为一体,将每个应用程序看作是一个对象进行链接和嵌入,是一种应用程序一体化的技术。利用OLE技术,可以方便地建立复合式文档(compound document),这种文档由来自多个不同应用程序的对象组成,文档中的每个对象都与原来的应用程序相联系,并可执行与原来应用程序完全相同的操作。
7、动态链接库(DLL)
Visual Basic是一种高级程序设计语言,不具备低级语言的功能,对访问机器硬件的操作不太容易实现。但它可以通过动态链接库技术将C/C++或汇编语言编写的程序加入到Visual Basic应用程序中,可以像调用内部函数一样调用其他语言编写的函数。此外,通过动态链接库,还可以调用Windows应用程序接口(API)函数,实现SDK所具有的功能。
2.3 对现有的排课系统的分析
随着我国市场经济的快速发展和信息化水平的不断提高,如何利用先进的管理手段,提高教育单位教学排课管理的水平,是当今社会所面临的一个课题。提高教育管理水平,必须全方位地提高教育管理意识。只有高标准、高质量的管理才能满足教育事业的发展需求。面对信息时代的挑战,利用高科技手段来提高教学排课管理无疑是一条行之有效的途径。在某种意义上,信息与科技在教学管理与现代化建设中显现出越来越重要的地位。教学排课管理方面的信息化与科学化,已成为现代化生活水平步入高台阶的重要标志。
有关排课管理系统的软件市面上有不少,教学管理人员也试用过一些,但总觉得不是很好用,不能完全满足我们的要求,所以都放弃用这些软件了,改为每
 

VB+SQL Server智能排课系统
次输入数据后,用手工更改数据库存量和安排课程,另外课表也无法用限制条件自动生成.以及直接导出到EXCLE表中,所以,迫切希望有一套完全适合排课管理应用的软件,以减轻管理人员的工作负担。
另一方面由于这类软件大多数是单机版的,现在也有不少是网络板的,但大部份都是在本地网络上运行的。因此系统的开发方向应当是面向网络版的排课管理系统开发。这点在今后的学习中将不断完善。
2.4系统的逻辑模型
2.4.1 系统结构图
 若图片无法显示请联系QQ3710167,本论文免费,转发请注明源于www.lwfree.cn                
图2-1 系统结构图
Chart 2-1 Structure system
2.4.2 系统流程图
为了实现管理信息系统的计算机化,仅仅用文字来描述信息的流动和存储还远远不够,还要进一步调查分析舍去物质流,抽象出信息流,绘制出数据流程图,并对各种数据的属性和各项处理功能进行详细分析。系统分析的主要成果是系统的逻辑模型。本系统主要是以数据流图、数据字典和E-R图为主要描述工具来勾画系统的概貌。
数据流图(DFD,data flow diagram)是描述数据处理过程的有力工具。数据流图从数据传递和加工的角度,以图形的方式刻画数据流从输入到输出的移动变换过程。
          若图片无法显示请联系QQ3710167,本论文免费,转发请注明源于www.lwfree.cn 
图2-2 系统流程图
Chart 2-2 System diagram
2.4.3 数据字典

名字:班级编号
描述:唯一地标识班级库表中一个特定班级的关键域
定义:班级编号=10{char}
位置:编辑班级信息,课程信息,教学计划,班级课程表
 

名字:教室编号
描述:唯一地标识教室库表中一个特定教室的关键域
定义:教室编号=10{char}
位置:编辑教室信息,教室课程表
 

名字:教师编号
描述:唯一地标识教师库表中一个特定教师的关键域
定义:教师编号=10{char}
位置:编辑教师信息,教学计划,教师课程表
 

名字:学院编号
描述:唯一地标识学院库表中一个特定学院的关键域
定义:学院编号=10{char}
位置:编辑教师信息
 

名字:班级课程表
描述:每学期一个确定班级的上课情况信息表
定义:班级课程表=班级名称+课程名称+上课地点
位置:输出到打印机
 

名字:课程编号
描述:唯一地标识课程库表中一门特定课程的关键域
定义:课程编号=10{char}
位置:编辑课程信息,教学计划
 

名字:教室课程表
描述:每学期一个确定教室的上课时间安排情况信息表
定义:教室课程表=教室名称+班级名称
位置:输出到打印机
 

  名称:教师课程表
  描述:每学期每个教师的上课情况信息表
定义:教师课程表=教师姓名+课程名称+班级名称+教室名称
  位置:输出到打印机
2.5 系统的可行性
2.5.1经济可行性分析
本系统开发简单但要耗去一定的时间,所用的开发工具和软件都差不多是免费的。本系统在以后的使用中对于教育办公自动化管理,节省教育人力、物力资源等都有很大的帮助。由此可见,开发此系统在经济上是完全可行的。
2.5.2操作可行性分析
如今的计算机已经走进千家万户,硬件成本的下降,导致计算机购买成本的降低.我的这套系统是利用自己的计算机加微软的集成开发环境Microsoft Visual Basic6.0作为软件的开发平台和SQL Server 2000数据库连接。使开发出来的系统有直观的用户界面、有良好的安全性设置、有详细的操作说明书,这样更使各类用户很快地掌握系统的使用方法和操作,因此在操作上是可行的。
2.5.3 技术可行性分析
从目前IT业界比较流行的数据库开发、管理软件来看,对于比较简单的中小型数据库,VB 和SQL Server 2000的结合无疑是在实际应用中较为成功的一种解决方案。为用户提供了业界软件开发一直坚持的操作简单的用户界面、完善强大的数据库操作功能和简洁明了的数据库接口。所以技术实行起来相对会容易。
2.6成本效益分析
本系统的开发平台和开发工具都是免费提供的,所以不存在经济成本问题。由于本软件还处于开发初期,所开发出的软件需要不断的修改和维护,就效益而言,它取代了传统的手工排课方式,节省了人力和时间。如果要创造更高的效益需要对系统进行更多的优化。
 

VB+SQL Server智能排课系统

第三章 需求分析
3.1 系统的运行环境要求
3.1.1硬件要求
1  486/DX66Mhz以上CPU
2  内存16M以上(使用Windows NT需要32M以上内存)
3  硬盘容量1GB以上(典型安装需要128MB硬盘空间,完全安装须要147MB硬盘空间,外加Microsoft开发者文档67MB硬盘空间)
4  VGA以上分辨率的显示器.
5  一个CD-ROM驱动器
6  鼠标、打印机
3.1.2软件要求
1  操作系统应使用Microsoft Windows95及以上版本或者更高版本。
2  安装有Visual Basic语言及SQL Server2000数据库。
3.2 系统的功能要求
利用计算机实现计算机自动排课管理势在必行。对于教育单位来说,利用计算机支持其高效率完成排课管理的日常事务,是适应现代教学制度要求、推动教学管理走向科学化、规范化的必要条件;而排课管理是一项琐碎、复杂而又十分细致的工作,课表信息录入,教师授课安排,限制条件输入,课表的自动生成等管理,一般不允许出错,如果实行手工操作,须手工填制大量的表格,这就会耗费教育工作人员大量的时间和精力,计算机进行排课工作的管理,不仅能够保证各项信息准确无误、快速输出,同时计算机具有手工管理所无法比拟的优点.例如:检索迅速、查找方便、可靠性高、存储量大、保密性好、寿命长、成本低等。这些优点能够极大地提高排课管理的效率,也是教育的科学化、正规化管理,与世界接轨的重要条件。
3.3系统的性能要求
本系统在性能上应达到如下要求:
l   系统软件运行应该速度快、稳定、可靠,具有很高的健壮性和容错、纠错能力;
l   系统软件操作上应简单、方便,界面简洁明了、美观;
l   系统软件应能具有较高的安全性,对内对外都有严格的身份认证和数据保密的措施;
l   系统软件在结构上应具有很好的可扩展性,便于将来的功能扩展和维护;
数据计算准确无误,精确度符合业务的需要。
3.3.1 E-R图
1.教师E-R图
                图3-1 教师E-R
            Chart 3-1 the diagram of teacher’s E-R
 若图片无法显示请联系QQ3710167,本论文免费,转发请注明源于www.lwfree.cn
2.班级E-R图
                          图3-2 班级E-R
                     Chart 3-2 the diagram of class’ E-R
   3.课程E-R图                      图3-3 课程E-R
               Chart 3-3 the diagram of course’s E-R
4.教室E-R图 
图3-4 教室E-R
                 Chart 3-4 the diagram of classroom’s E-R
第四章 总体设计
4.1 模块设计
模块是软件结构的基础,软件结构的好坏完全由模块的属性体现出来,把软件模块化的目的是为了降低软件复杂性,使软件设计,测试,调试,维护等工作变得简易,但随着模块数目的增加,通过接口连接这些模块的工作量也随之增加。从这些特性可得出如图的一条总的成本(或工作量)曲线,在考虑模块化时,应尽量使模块数接近于图中的M,它使得研制成本最小,而且应尽量避免不足的模块化或超量。
若图片无法显示请联系QQ3710167,本论文免费,转发请注明源于www.lwfree.cn
图4-1 模块与成本关系图
Chart 4-1 Relation between module and cost
基于上述原因,在进行总体规划的初步设想中,以高校各种资源和资源的分配为依据,综合多种相关因素,将该系统划分成以下六个子功能模块:基本信息管理子系统、用户管理子系统、数据管理子系统、教学计划管理子系统、排课管理子系统、课表查询子系统。在数据库设计上,遵循“功能分离,数据共享”的原则,将数据库分成基础数据库及目标数据库两大部分,其中,基础数据库又可分为初始设置信息库、基本信息库、用户信息库三个功能子库。目标库主要存放系统运行过程中的动态数据,目标方案等。
 

VB+SQL Server智能排课系统
4.2 功能分解
基本信息管理子系统功能:班级信息,教室信息和教室信息的添加、保存、编辑和删除:
1、用户管理子系统功能:用户密码的设置和修改,用户权限的设置,用户重新登陆;
2、数据管理子系统功能:包括对教室、教师、班级、教学计划和课表数据的保存、查询、更新、删除;
3、教学计划管理子系统功能:某一确定的学期的教学工作计划,对于班级而言,每门课程的学时、开始周、结束周以及每门课程的任课教师,该子系统对教学计划进行管理和完善;
4、排课管理子系统功能:包括自动排课,手动排课两个部分;
5、课表查询子系统功能:对于具体的班级、教师、教室进行课表查询,打印;
4.3 数据库设计
排课管理系统是一项复杂的系统工程,其间需要大量的数据来支撑,从某种程度上来讲,排课管理系统的设计过程,其实也就是一个规范和完整的数据库设计过程。经过多年的发展,关系型数据库系统(RDBMS)是最成熟的一种数据库管理模式,也是当前最流行的数据库管理系统。故在此也采用该模式(在加一些关系数据库的介绍)。
4.3.1 定义属性表
1.bClass表





字段名称

类 型

字段大小

说  明


ClassID

字 符

 

班级编号


ClassName

文 本

16

班级名称


DepID

文 本

16

学院编号


SpecID

文 本

16

专业编号、


ClassStuNum

整 型

4

班级人数
图4-2 班级表
Chart 4-2 Class table
2.bClassRoom表





字段名称

类 型

说  明


ClassRoomID

字 符

教室编号,字段大小10


ClassRoomName

文 本

教室名称,字段大小16


ClassTypeID

字 符

教室类型,字段大小16


ClassRoomStuNum

整 型

容纳人数,字段大小4


BuildingID

字 符

教学楼编号,字段大小10


ClassRoomFlag

整 型

教室标识符,字段大小4
 
图4-3 教室表
Chart 4-3 Classroom table
3.bCourse表





字段名称

类 型

说  明


CourseID

字 符

课程编号,字段大小10


CourseName

字 符

课程名称,字段大小20


CourseYXJ

字 符

课程优先级,字段大小10


ClassID

字 符

班级编号,字段大小10


CourseFlag

整 型

课程标识符,字段大小4
 
图4-4 课程表
Chart 4-4 Course table
4.bTeacher表





字段名称

类 型

说  明


TeacherID

字 符

教师编号,字段大小10


TeacherName

文 本

教师名称,字段大小16


DepID

文 本

学院编号,字段大小16


CourseID

字 符

课程编号,字段大小10
 
图4-5 教师表
Chart 4-5 Teacher table
5.bTeachPlan表





字段名称

类 型

说  明


CourseID

字 符

课程编号,字段大小10


CourseName

文 本

课程名称,字段大小16


TeacherID

字 符

教师编号,字段大小10


TeacherName

文 本

教师名称,字段大小16


WeekNum

字 符

周学时,字段大小10


CourseNum

字 符

总学时,字段大小10
 
图4-6 教师计划表
Chart 4-6 Reach plan table
 
 
6.bTempTable表





字段名称

类 型

说  明


ClassID

字 符

班级编号,字段大小10


CourseID

字 符

课程编号,字段大小10


TeacherID

字 符

教师编号,字段大小10


ClassRoomID

字 符

教室编号,字段大小10


TTime

整 型

时间标识,字段大小4


Week

整 型

周数,字段大小4
 
图4-7 临时表
Chart 4-7 Temporary table
4.4 排课系统总构架若图片无法显示请联系QQ3710167,本论文免费,转发请注明源于www.lwfree.cn
 
图4-8 系统总架构
Chart 4-8 System frame
 

VB+SQL Server智能排课系统
第五章 详细设计及代码设计
5.1用户界面设计
随着视窗操作系统的全面推广和流行,如今GUI已经成为业界用户接口的一个标准。在本系统的设计过程中,也按照GUI的设计原则来设计用户接口,给用户提供一个友好的人机交互界面。具体来说,将按照以下几点原则来设计。
5.1.1简单易用和个性化需求
无论什么系统,面向什么使用者,都应该以简单易用而不显枯燥为标准。本系统使用图形化的用户界面,整个界面功能键的设定和窗体布局,完全具有独特统一的风格。
5.1.2对数据的查询
查询是信息系统中不可缺少的功能。本系统设计的是一种可对任意指定的表、按所有字段进行的查询。查询的结果,在本系统中用数据窗口对象显示输出。对于查询的结果,用户也可以根据自己的需求,选择显示的字段和设计自己的视图。当然,系统下一步应该提供的功能就是根据查询结果,生成各式各类的报表。
5.1.3系统菜单功能
在实际的系统设计中,菜单可分为两种类型,即下拉式菜单和弹出式菜单,下拉式菜单系统中,一般有一个主菜单,其中包括若干个选择项.主菜单单的每一项又可下拉出下一级子菜单.这样用一个个的窗口的形式弹出在屏幕上,它是通过菜单编辑器建立,其步骤如下:
1)        选取要建立菜单的窗体
2)        从“工具”菜单中,选取“菜单编辑器”建立如下图所示的系统主菜单:
若图片无法显示请联系QQ3710167,本论文免费,转发请注明源于www.lwfree.cn
图5-1 菜单编辑
Chart 5-1 Menu edit
基本信息输入
基本信息输入菜单是让录入员输入和修改课程信息、班级信息、教师信息、教室信息基本数据,数据管理包括课程、班级、教师、教室、课表数据的查询,打印。
班级信息中包括班级编号、班级名称、班级人数以及添加、保存、查询、编辑、删除等功能。如下为班级信息的界面:

图5-2 班级信息界面
Chart 5-2 Interface of class information
    教师信息中包括教师编号、教师姓名、职称以及添加、保存、查询。
5.2 课程表的生成
5.2.1 班级课程表查询打印设计
经过信息录入和复杂的排课过程,终于到了生成课程表的输出后期阶段,显示出完整的课程表是我们的最终目的。本系统是直接将课程表到入EXCEL表格中,使表格的形式更加美观,所用工具用户非常熟悉。如下是班级课表查询界面:

图5-3 班级课表查询界面
Chart 5-3 Interface of inquire class table
通过输入确定的班级编号,来搜索某一具体班级的课程表。若你忘记班级的编号,可以通过界面上的班级编号与班级名称对照表查询班级编号。当确定好你所要查询的班级后,点击“查询课程表”按钮,就可以查询该班的课程表了。

图5-4 班级课程表界面
Chart 5-4 Interface of class table
上图就是最终生成的班级课程表。其主要代码如下:
 

VB+SQL Server智能排课系统
Private Sub Command1_Click()
    Dim strCourseID As String
    Dim strClassRoomID As String
    Dim i As Integer, j As Integer
    If Combo1.Text = "" Then
        MsgBox "请输入要查询的班级编号!"
        Exit Sub
    End If
    strSQL = "SELECT * FROM bTempTableA where classid= " & Combo1.Text & " order by ttime"
    strtempsql = "SELECT courseID,courseName FROM bCourse"
    strclassroomsql = "SELECT ClassRoomID,ClassRoomName FROM bclassroom"
    ConenctToDatabase
    rst.Open strSQL, db, adOpenKeyset, adLockOptimistic
    temp.Open strtempsql, db, adOpenKeyset, adLockReadOnly
    classtemp.Open strclassroomsql, db, adOpenKeyset, adLockReadOnly
    If rst.RecordCount() <> 0 Then
        i = rst.RecordCount()
    Else
        MsgBox "无此信息,请重新输入!"
        rst.Close
        temp.Close
        classtemp.Close
        Exit Sub
    End If
    Set xlapp = New Excel.Application
Set xlbook = xlapp.Workbooks.Open(App.Path & "\课程表模板.xlt")
    xlapp.Visible = True
    Set xlsheet = xlbook.Worksheets("班级课程表")
    xlsheet.Activate
    xlsheet.Cells(5, 1) = Combo1.Text & "级"
    xlsheet.Cells(5, 6) = Date
    While i <> 0
                strCourseID = rst.Fields("courseID")
                temp.Filter = "courseID = '" & strCourseID & "'"
                strClassRoomID = rst.Fields("classroomID")
                classtemp.Filter = "classroomID = '" & strClassRoomID & "'"
            Select Case rst.Fields("Ttime")
            Case Is = 1
                xlsheet.Cells(9, 3) = temp.Fields("coursename")
                xlsheet.Cells(11, 3) = classtemp.Fields("classroomName")
            Case Is = 2
                xlsheet.Cells(13, 3) = temp.Fields("coursename")
                xlsheet.Cells(15, 3) = classtemp.Fields("classroomName")
            Case Is = 3
                xlsheet.Cells(17, 3) = temp.Fields("coursename")
                xlsheet.Cells(19, 3) = classtemp.Fields("classroomName")
            Case Is = 4
                xlsheet.Cells(21, 3) = temp.Fields("coursename")
                xlsheet.Cells(23, 3) = classtemp.Fields("classroomName")
            Case Is = 5
                xlsheet.Cells(9, 4) = temp.Fields("coursename")
                xlsheet.Cells(11, 4) = classtemp.Fields("classroomName")
            Case Is = 6
                xlsheet.Cells(13, 4) = temp.Fields("coursename")
                xlsheet.Cells(15, 4) = classtemp.Fields("classroomName")
            Case Is = 7
                xlsheet.Cells(17, 4) = temp.Fields("coursename")
                xlsheet.Cells(19, 4) = classtemp.Fields("classroomName")
            Case Is = 8
                xlsheet.Cells(21, 4) = temp.Fields("coursename")
                xlsheet.Cells(23, 4) = classtemp.Fields("classroomName")
            Case Is = 9
                xlsheet.Cells(9, 5) = temp.Fields("coursename")
                xlsheet.Cells(11, 5) = classtemp.Fields("classroomName")
            Case Is = 10
                xlsheet.Cells(13, 5) = temp.Fields("coursename")
                xlsheet.Cells(15, 5) = classtemp.Fields("classroomName")
            Case Is = 11
                xlsheet.Cells(17, 5) = temp.Fields("coursename")
                xlsheet.Cells(19, 5) = classtemp.Fields("classroomName")
            Case Is = 12
                xlsheet.Cells(21, 5) = temp.Fields("coursename")
                xlsheet.Cells(23, 5) = classtemp.Fields("classroomName")
            Case Is = 13
                xlsheet.Cells(9, 6) = temp.Fields("coursename")
                xlsheet.Cells(11, 6) = classtemp.Fields("classroomName")
            Case Is = 14
                xlsheet.Cells(13, 6) = temp.Fields("coursename")
                xlsheet.Cells(15, 6) = classtemp.Fields("classroomName")
            Case Is = 15
                xlsheet.Cells(17, 6) = temp.Fields("coursename")
                xlsheet.Cells(19, 6) = classtemp.Fields("classroomName")
            Case Is = 16
                xlsheet.Cells(21, 6) = temp.Fields("coursename")
                xlsheet.Cells(23, 6) = classtemp.Fields("classroomName")
            Case Is = 17
                xlsheet.Cells(9, 7) = temp.Fields("coursename")
                xlsheet.Cells(11, 7) = classtemp.Fields("classroomName")
            Case Is = 18
                xlsheet.Cells(13, 7) = temp.Fields("coursename")
                xlsheet.Cells(15, 7) = classtemp.Fields("classroomName")
            Case Is = 19
                xlsheet.Cells(17, 7) = temp.Fields("coursename")
                xlsheet.Cells(19, 7) = classtemp.Fields("classroomName")
            Case Is = 20
                xlsheet.Cells(21, 7) = temp.Fields("coursename")
                xlsheet.Cells(23, 7) = classtemp.Fields("classroomName")
            Case Is = 21
                xlsheet.Cells(9, 8) = temp.Fields("coursename")
                xlsheet.Cells(11, 8) = classtemp.Fields("classroomName")
            Case Is = 22
                xlsheet.Cells(13, 8) = temp.Fields("coursename")
                xlsheet.Cells(15, 8) = classtemp.Fields("classroomName")
            Case Is = 23
                xlsheet.Cells(17, 8) = temp.Fields("coursename")
                xlsheet.Cells(19, 8) = classtemp.Fields("classroomName")
            Case Is = 24
                xlsheet.Cells(21, 8) = temp.Fields("coursename")
                xlsheet.Cells(23, 8) = classtemp.Fields("classroomName")
            Case Is = 25
                xlsheet.Cells(9, 9) = temp.Fields("coursename")
                xlsheet.Cells(11, 9) = classtemp.Fields("classroomName")
            Case Is = 26
                xlsheet.Cells(13, 9) = temp.Fields("coursename")
                xlsheet.Cells(15, 9) = classtemp.Fields("classroomName")
            Case Is = 27
                xlsheet.Cells(17, 9) = temp.Fields("coursename")
                xlsheet.Cells(19, 9) = classtemp.Fields("classroomName")
            Case Is = 28
                xlsheet.Cells(21, 9) = temp.Fields("coursename")
                xlsheet.Cells(23, 9) = classtemp.Fields("classroomName")
           Case Else
                MsgBox "数据溢出,请检查系统!"
            End Select
        i = i - 1
        rst.MoveNext
        Wend
 
VB+SQL Server智能排课系统
5.2.2 教师课程表查询打印设计
有了班级课程表的设计成功,教师课程表就显得容易多了。我们依然把课程表导入到EXCEL中,基于界面风格的统一,与班级课表查询相似。下面是教师课表查询界面:
若图片无法显示请联系QQ3710167,本论文免费,转发请注明源于www.lwfree.cn
图5-5 教师课表查询界面
Chart 5-5 Interface of inquire teacher table
通过以上界面可以查询具体教师一学期的课程安排情况,其中生成的课表信息包括所教课程和班级,上课具体时间,教室。使教师一目了然,方便地查询到自己所教班级、课程。准确无误地反映在课表上。
若图片无法显示请联系QQ3710167,本论文免费,转发请注明源于www.lwfree.cn
图5-6 教师课程表界面
Chart 5-6 Interface of teacher table
以下是主要代码:
 Private Sub Command1_Click()
    Dim a As String
    Dim i As Integer, j As Integer
    Dim strCourseID As String
    Dim strClassRoomID As String
    Dim strclasssql As String
    Dim strClassID As String       
    strsql = "SELECT * FROM bTempTableA where teacherid= " & Text1.Text & " order by ttime"
    strtempsql = "SELECT courseID,courseName FROM bCourse"
    strclassroomsql = "SELECT ClassRoomID,ClassRoomName FROM bclassroom"
    strclasssql = "select classID,classname from bclass"
    ConenctToDatabase
    rst.Open strsql, db, adOpenKeyset, adLockOptimistic
    coursetemprst.Open strtempsql, db, adOpenKeyset, adLockReadOnly
    classtemprst.Open strclasssql, db, adOpenKeyset, adLockReadOnly
    classroomrst.Open strclassroomsql, db, adOpenDynamic, adLockReadOnly
    If rst.RecordCount() <> 0 Then
        i = rst.RecordCount()
    Else
        MsgBox "无此信息,请重新输入!"
        rst.Close
        coursetemprst.Close
        classtemprst.Close
        classroomrst.Close
        Exit Sub
    End If
Set xlapp = New Excel.Application
Set xlbook = xlapp.Workbooks.Open(App.Path & "\课程表模板.xlt")
xlapp.Visible = True
Set xlsheet = xlbook.Worksheets("教师课程表")
xlsheet.Activate
xlsheet.Cells(5, 1) = DataGrid1.Columns(1).Text
xlsheet.Cells(5, 6) = Date
While i <> 0
                strCourseID = rst.Fields("courseID")
                coursetemprst.Filter = "courseID = '" & strCourseID & "'"
                strClassRoomID = rst.Fields("classroomID")
                classroomrst.Filter = "classroomID = '" & strClassRoomID & "'"
                strClassID = rst.Fields("classID")
                classtemprst.Filter = "classID = '" & strClassID & "'"
  Select Case rst.Fields("Ttime")
            Case Is = 1
                xlsheet.Cells(9, 3) = coursetemprst.Fields("coursename")
                xlsheet.Cells(10, 3) = classroomrst.Fields("classroomName")
                xlsheet.Cells(12, 3) = classtemprst.Fields("classname")
            Case Is = 2
                xlsheet.Cells(13, 3) = coursetemprst.Fields("coursename")
                xlsheet.Cells(14, 3) = classroomrst.Fields("classroomName")
                xlsheet.Cells(16, 3) = classtemprst.Fields("classname")
            Case Is = 3
                xlsheet.Cells(17, 3) = coursetemprst.Fields("coursename")
                xlsheet.Cells(18, 3) = classroomrst.Fields("classroomName")
                xlsheet.Cells(20, 3) = classtemprst.Fields("classname")
            Case Is = 4
                xlsheet.Cells(21, 3) = coursetemprst.Fields("coursename")
                xlsheet.Cells(22, 3) = classroomrst.Fields("classroomName")
                xlsheet.Cells(24, 3) = classtemprst.Fields("classname")
            Case Is = 5
                xlsheet.Cells(9, 4) = coursetemprst.Fields("coursename")
                xlsheet.Cells(10, 4) = classroomrst.Fields("classroomName")
                xlsheet.Cells(12, 4) = classtemprst.Fields("classname")
            Case Is = 6
                xlsheet.Cells(13, 4) = coursetemprst.Fields("coursename")
                xlsheet.Cells(14, 4) = classroomrst.Fields("classroomName")
                xlsheet.Cells(16, 4) = classtemprst.Fields("classname")
            Case Is = 7
                xlsheet.Cells(17, 4) = coursetemprst.Fields("coursename")
                xlsheet.Cells(18, 4) = classroomrst.Fields("classroomName")
                xlsheet.Cells(20, 4) = classtemprst.Fields("classname")
            Case Is = 8
                xlsheet.Cells(21, 4) = coursetemprst.Fields("coursename")
                xlsheet.Cells(22, 4) = classroomrst.Fields("classroomName")
                xlsheet.Cells(24, 4) = classtemprst.Fields("classname")
            Case Is = 9
                xlsheet.Cells(9, 5) = coursetemprst.Fields("coursename")
                xlsheet.Cells(10, 5) = classroomrst.Fields("classroomName")
                xlsheet.Cells(12, 5) = classtemprst.Fields("classname")
            Case Is = 10
                xlsheet.Cells(13, 5) = coursetemprst.Fields("coursename")
                xlsheet.Cells(14, 5) = classroomrst.Fields("classroomName")
                xlsheet.Cells(16, 5) = classtemprst.Fields("classname")
            Case Is = 11
                xlsheet.Cells(17, 5) = coursetemprst.Fields("coursename")
                xlsheet.Cells(18, 5) = classroomrst.Fields("classroomName")
                xlsheet.Cells(20, 5) = classtemprst.Fields("classname")
            Case Is = 12
                xlsheet.Cells(21, 5) = coursetemprst.Fields("coursename")
                xlsheet.Cells(22, 5) = classroomrst.Fields("classroomName")
                xlsheet.Cells(24, 5) = classtemprst.Fields("classname")
            Case Is = 13
                xlsheet.Cells(9, 6) = coursetemprst.Fields("coursename")
                xlsheet.Cells(10, 6) = classroomrst.Fields("classroomName")
                xlsheet.Cells(12, 6) = classtemprst.Fields("classname")
            Case Is = 14
                xlsheet.Cells(13, 6) = coursetemprst.Fields("coursename")
                xlsheet.Cells(14, 6) = classroomrst.Fields("classroomName")
                xlsheet.Cells(16, 6) = classtemprst.Fields("classname")
            Case Is = 15
                xlsheet.Cells(17, 6) = coursetemprst.Fields("coursename")
                xlsheet.Cells(18, 6) = classroomrst.Fields("classroomName")
                xlsheet.Cells(20, 6) = classtemprst.Fields("classname")
            Case Is = 16
                xlsheet.Cells(21, 6) = coursetemprst.Fields("coursename")
                xlsheet.Cells(22, 6) = classroomrst.Fields("classroomName")
                xlsheet.Cells(24, 6) = classtemprst.Fields("classname")
            Case Is = 17
                xlsheet.Cells(9, 7) = coursetemprst.Fields("coursename")
                xlsheet.Cells(10, 7) = classroomrst.Fields("classroomName")
                xlsheet.Cells(12, 7) = classtemprst.Fields("classname")
            Case Is = 18
                xlsheet.Cells(13, 7) = coursetemprst.Fields("coursename")
                xlsheet.Cells(14, 7) = classroomrst.Fields("classroomName")
                xlsheet.Cells(16, 7) = classtemprst.Fields("classname")
            Case Is = 19
                xlsheet.Cells(17, 7) = coursetemprst.Fields("coursename")
                xlsheet.Cells(18, 7) = classroomrst.Fields("classroomName")
                xlsheet.Cells(20, 7) = classtemprst.Fields("classname")
            Case Is = 20
                xlsheet.Cells(21, 7) = coursetemprst.Fields("coursename")
                xlsheet.Cells(22, 7) = classroomrst.Fields("classroomName")
                xlsheet.Cells(24, 7) = classtemprst.Fields("classname")
            Case Is = 21
 

 
VB+SQL Server智能排课系统
xlsheet.Cells(9, 8) = coursetemprst.Fields("coursename")
                xlsheet.Cells(10, 8) = classroomrst.Fields("classroomName")
                xlsheet.Cells(12, 8) = classtemprst.Fields("classname")
            Case Is = 22
                xlsheet.Cells(13, 8) = coursetemprst.Fields("coursename")
                xlsheet.Cells(14, 8) = classroomrst.Fields("classroomName")
                xlsheet.Cells(16, 8) = classtemprst.Fields("classname")
            Case Is = 23
                xlsheet.Cells(17, 8) = coursetemprst.Fields("coursename")
                xlsheet.Cells(18, 8) = classroomrst.Fields("classroomName")
                xlsheet.Cells(20, 8) = classtemprst.Fields("classname")
            Case Is = 24
                xlsheet.Cells(21, 8) = coursetemprst.Fields("coursename")
                xlsheet.Cells(22, 8) = classroomrst.Fields("classroomName")
                xlsheet.Cells(24, 8) = classtemprst.Fields("classname")
            Case Is = 25
                xlsheet.Cells(9, 9) = coursetemprst.Fields("coursename")
                xlsheet.Cells(10, 9) = classroomrst.Fields("classroomName")
                xlsheet.Cells(12, 9) = classtemprst.Fields("classname")
            Case Is = 26
                xlsheet.Cells(13, 9) = coursetemprst.Fields("coursename")
                xlsheet.Cells(14, 9) = classroomrst.Fields("classroomName")
                xlsheet.Cells(16, 9) = classtemprst.Fields("classname")
            Case Is = 27
                xlsheet.Cells(17, 9) = coursetemprst.Fields("coursename")
                xlsheet.Cells(18, 9) = classroomrst.Fields("classroomName")
                xlsheet.Cells(20, 9) = classtemprst.Fields("classname")
            Case Is = 28
                xlsheet.Cells(21, 9) = coursetemprst.Fields("coursename")
                xlsheet.Cells(22, 9) = classroomrst.Fields("classroomName")
                xlsheet.Cells(24, 9) = classtemprst.Fields("classname")
            Case Else
                MsgBox "数据溢出,请检查系统!"
            End Select
        i = i - 1
        rst.MoveNext
        Wend    
5.2.3 教室课程表查询打印设计
教室课程表是为了方便查询某一确定教室是否有课,确定是哪个班上课,而且方便无课的学生选择自修的教室。查询教室课程表的界面如下:
若图片无法显示请联系QQ3710167,本论文免费,转发请注明源于www.lwfree.cn
图5-7 教室课程表查询界面
Chart 5-7 Interface of inquire classroom table
点击“查询课程表”就会立即生成教室课程表。其主要的代码如下:
Private Sub Command1_Click()
Dim strClassID As String
Dim i As Integer
strsql = "SELECT * FROM bTempTableA where classroomid= " & Text1.Text & " order by ttime"
strclasssql = "select classID,classname from bclass"
ConenctToDatabase
    rst.Open strsql, db, adOpenKeyset, adLockOptimistic
temp.Open strclasssql, db, adOpenKeyset, adLockReadOnly
    If rst.RecordCount() <> 0 Then
        i = rst.RecordCount()
    Else
        MsgBox "无此信息,请重新输入!"
        rst.Close
        temp.Close
        Exit Sub
    End If
Set xlapp = New Excel.Application
Set xlbook = xlapp.Workbooks.Open(App.Path & "\课程表模板.xlt")
xlapp.Visible = True
Set xlsheet = xlbook.Worksheets("教室课程表")
xlsheet.Activate
xlsheet.Cells(5, 1) = DataGrid1.Columns(1).Text
xlsheet.Cells(5, 6) = Date
    While i <> 0
                strClassID = rst.Fields("classID")
                temp.Filter = "classID = '" & strClassID & "'"
       Select Case rst.Fields("Ttime")
            Case Is = 1
                xlsheet.Cells(9, 3) = temp.Fields("classname")
            Case Is = 2
                xlsheet.Cells(13, 3) = temp.Fields("classname")
            Case Is = 3
                xlsheet.Cells(17, 3) = temp.Fields("classname")
            Case Is = 4
                xlsheet.Cells(21, 3) = temp.Fields("classname")
            Case Is = 5
                xlsheet.Cells(9, 4) = temp.Fields("classname")
            Case Is = 6
                xlsheet.Cells(13, 4) = temp.Fields("classname")
            Case Is = 7
                xlsheet.Cells(17, 4) = temp.Fields("classname")
            Case Is = 8
                xlsheet.Cells(21, 4) = temp.Fields("classname")
            Case Is = 9
                xlsheet.Cells(9, 5) = temp.Fields("classname")
            Case Is = 10
                xlsheet.Cells(13, 5) = temp.Fields("classname")
            Case Is = 11
                xlsheet.Cells(17, 5) = temp.Fields("classname")
            Case Is = 12
                xlsheet.Cells(21, 5) = temp.Fields("classname")
            Case Is = 13
                xlsheet.Cells(9, 6) = temp.Fields("classname")
            Case Is = 14
                xlsheet.Cells(13, 6) = temp.Fields("classname")
            Case Is = 15
                xlsheet.Cells(17, 6) = temp.Fields("classname")
            Case Is = 16
                xlsheet.Cells(21, 6) = temp.Fields("classname")
            Case Is = 17
                xlsheet.Cells(9, 7) = temp.Fields("classname")
 

 VB+SQL Server智能排课系统

Case Is = 18
                xlsheet.Cells(13, 7) = temp.Fields("classname")
           Case Is = 19
                xlsheet.Cells(17, 7) = temp.Fields("classname")
           Case Is = 20
                xlsheet.Cells(21, 7) = temp.Fields("classname")
           Case Is = 21
                xlsheet.Cells(9, 8) = temp.Fields("classname")
           Case Is = 22
                xlsheet.Cells(13, 8) = temp.Fields("classname")
           Case Is = 23
                xlsheet.Cells(17, 8) = temp.Fields("classname")
           Case Is = 24
                xlsheet.Cells(21, 8) = temp.Fields("classname")
           Case Is = 25
                xlsheet.Cells(9, 9) = temp.Fields("classname")
           Case Is = 26
                xlsheet.Cells(13, 9) = temp.Fields("classname")
           Case Is = 27
                xlsheet.Cells(17, 9) = temp.Fields("classname")
            Case Is = 28
                xlsheet.Cells(21, 9) = temp.Fields("classname")
                Case Else
                MsgBox "数据溢出,请检查系统!"
            End Select
        i = i - 1
        rst.MoveNext
        Wend
 
第六章 测试
6.1 排课系统功能测试
本软件的主要功能是能够查询到教师、教室、班级的相关信息,从而了解到各个部分不用的资源以及现状。利用自动排课来完成本系统的核心内容,进行计算机的自动排课,接下来发生冲突的部分,运用手工排课来调整局部的资源冲突问题。最后,是按照各部分的不同需求,分别按班级、教师、教师来打印出他们满意的课程表,以方便不同群体的工作和学习。
通过对该系统的运行,均能完成预期的功能,对于功能的测试基本成功。
6.2 排课系统课表合理性测试
对于课程表的设计,本软件是将课程导入到Microsoft Office 提供的EXCEL中。因为EXECL 已经为我们提供了标准的Windows 特有的界面和相关功能,所以应该充分利用现有的、最有效的资源。导入到EXCEL中是生成报表的一种方法。可根据用户的不同需求来打印出不同的班级,不同的教室和具体的某一位教师的上课时间安排,地点安排,以及具体上课的课程名称。
通过对该软件的运行,可以方便轻松地打印出具体班级、教师、教室的一学期的课程安排情况。
6.3 该系统的不足和改进方案
该系统的不足之处在于,由于数据信息的缺乏,不能对输入的任意一学期的课程进行现场排课,只能进行的是指定某一确定学期,通过该学期的教学计划来进行排课。对于一些高校有多个校区,本系统还不能对所有的校区进行资源和数据上的分离来进行完美的毫无冲突的排课,这是需要改进的地方之一。还有,本系统个别地方缺乏人性化的设计,例如,对于高年龄的老教师来说,尽量不要安排他们去高层进行授课,授课的地点不能有太大的跨越。
改进的方案其实是多种多样的,对于一些人性化的设计,我们可以通过手工排课来调整。对于跨校区的排课,是我们以后修改和维护本系统的一个方向,通过尝试别的排课算法来实现,或者通过后续的维护来实现。
 

VB+SQL Server智能排课系统
第七章 总结
为了设计出高校排课系统,本文参阅了大量的资料,更总结了很多前人的经验。排课管理功能是排课系统设计的重点和难点,它不仅要考虑到教室冲突问题和教师冲突问题,还要考虑到分段课、单双周课时的资源利用问题;另外由于高校的教学特点,还要处理合班课、分班课、体育课与选修课等特殊课程。针对这些问题,在此专门对数据库设计作了一些探索,并于架构的选择和模块的划分上经过精心调整,在菜单的设计上也体现了人性化的操作。该设计贴近用户需求,功能完整,架构合理,并用大量的框图模型体现了系统的规划。界面的设计也更是煞废苦心,努力实现风格统一,方便用户的做法。由于该文档开发周期短,还有许多悬而未决的问题诸如接口设计、出错处理、类的确定等等。软件工程的文档开发是一个不断改进和修正的阶段,我们也只能精益求精,并在今后提出问题和解决问题的过程中,期待能得到令高校用户满意的蓝本
致谢
在短短的毕业设计期间,我非常感谢徐远纯老师和李娟老师对我的指导,尤其是徐远纯老师对我的无微不至关怀与帮助,对我的毕业设计起到了推波助澜的作用。我从对于课题的一无所知到能完成所有的设计,老师的作用是不言而喻的,他指导我们怎样对课题进行需求分析,怎样做设计前的准备,与我经常的沟通。对我的毕业设计高度重视,从他那里我学到了许多书本上学不到的东西,只有通过经验总结才能领悟的东西,通过老师的指导,节约了很多自己摸索的时间,用更多的来完善系统的设计。深深地感觉到自己的实际操作能力和思维有了明显的提高。
在整体的设计过程中,也感谢校方和信息工程学院给我的大力支持,为我提供的良好的毕业设计环境,使我能够准确、认真、顺利地完成本次毕业设计。也感谢同学给我的帮助,本次毕业设计是我终身难忘的一次经历,使我收益匪浅。
由于本次毕业设计的时间有限,对于系统的设计还有很多不完善的地方,我会在以后的学习中加以修改,希望广大的老师和同学多提宝贵意见。
参考文献
[1]张海藩 《软件工程导论》 清华大学出版社 2001.05
[2]郭  琦 《[a1] Visual Basic 数据库系统开发技术》第一版.人民邮电出版社2002.05
[3]刘  韬 《Visual Basic6.0 数据库系统开发实例导航》第一版.人民邮电出版社 2002.06
[4]马  力 《Visual Basic 6.0 简明教程》第一版.机械工业出版社2003.09
[5] [美] Steven Jordan 牛 力等编著 《Visual Basic 6 编程宝典》 电子工业出版社 2005.01





 [a1]格式不对
 

VB+SQL Server智能排课系统
附 录
大学的排课系统是一个组合的问题,这个问题是由在规定的房间和时间段的数量内安排一套课程组成。解决为问题订时间表的一个现实世界手工经常需要相当多数量的时间,有时几天或者甚至周。因此,许多研究已被投资为了提供对于人类课程表的自动化的支持。贡献来自运筹学和人工智能的领域。 本文参照学期和方法来满足限制条件。方法提出使用约束逻辑编写程序被发展。约束逻辑编写程序把逻辑编写程序的语句与从运筹学和人工智能的方法的效率相结合。 它最近成为解决时间表问题的一种有前途的方法。
从满足限制运用古典的方法要求作一个满足限制问题的模拟问题,一套变量,每一个带有它能承担的价值的一个领域,和在变量中间的一套约束。约束是通过禁用的结合价值规定解决方案的空间的关系。
方法包括搜索,启发式,和约束传播。 典型地,系统的搜索把价值分配到依次地跟随一些搜索秩序的变量。如果过程没能扩展一种部分的解决,被取消与选择探索的决定。 系统的搜索经常依赖于启发式,这定义在其中变量和价值被选择的秩序。约束传播是补充的; 它通过识别不能参加一种解决的价值简化一个问题。 这方法搜索空间剪除与搜索变得容易。
在实践中,大多数以约束为基础的时间表系统不支持或者是轻微的约束或者是使用一个分支和境界代替搜索时序回溯。 分支和境界从一种解决开始并且要求下一种解决是更好的。质量依赖于轻微的约束的装置的一个适合的费用功能测量。 有了这方法,然而,在选择变量和价值中较弱的约束将不起起作用。
在收集教师的要求之后和关于新的过程的信息,第一项建议作为一个起始的点以前一年的课程表被发展。这被再一次为了被同样的人们提供的新的过程不发生的过程被在课程表中使用自由的狭缝完成左边左,而教师的要求优先于前一年的课程表。 在把建议分发到所有教师的估计和新的要求之后将加以收集。
从当前的建议一个起始开始,一项新的建议被发展在当前的建议上结合修改,再一次可能少量的改动等等。建立一张新的课程表,这样是一个多级而逐渐增长的过程。 依赖于上学期的课程表,改变尽可能少量的信息,减少为建立一张新的课程表所需要的工作的量,并且通过保持人们每星期保证接受新的课程表的习惯。
同时应该注意到,其它地方的教室资源分配。然而,对空间或者一定的设备的冲突的要求可能是改变课程表的一种原因。
一般的约束因为教师的身体状况、学院的原因,和个人的优先选择;
一个教师不能同时在两个地方授课,如此避免一个教师的冲突过程;
至少应该有一个教师在两个过程之间的一个小时中断;
一些教师为了教学规定了确定的时间和天数;
星期一下午为了教授会议而不排课,来方便教授们讨论重要的决定。
此系统包括五个单元,每个模块的设计都有一个特定的区域。大多数模块当不同的单元的成员被坚持时,被坚持一个单一的单元的成员仅仅一些过程。 过程坚持一个一定的单元的成员不可与过程冲突坚持其它同样的单元的成员。
提供每星期典型地包括两次讲课和一种个别辅导。所有的讲课之间必须给予适当的中断。 个别专业课程不应该安排在同一天里。 所有课程都应该被安排在上午9点和下午6点之间。
仅仅极少的课程是强制性的被安排给一个一定的期间的学生,而大多数过程对所有学生是可选和开放的。 对于每一大学生研究的期间有一套强制性的过程,高度将予以推荐的出席。毕业生研究的课程仅仅依赖于大学生研究提供的知识。没有先后秩序。 一个期间的大学生课程不可冲突,而不同的期间的大学生过程允许冲突。 毕业生的课程不应该冲突。
第一次观察弄清楚现有的课程表不会遇到毕业生课程冲突或者一次公共课程和一种个别专业课程被安排在同样的天。 进而,就多年考虑到毕业生过程的数字提供,它变得清楚有小空间没有冲突而为所有毕业生课程确定具体的时间。这因为下列的原因。 如前所述,大学生过程强制性和有可选择性的两种形式。 这方法区别从第三个期间的学生以及从第四个期间的学生的第二个期间的学生是可能,这使之有可能允许冲突不同的期间的大学生过程。毕业生课程仅仅依赖于被大学生过程提供的知识。没有出席的推荐的秩序,这样制定不可能区别从第七个学期的学生和第五个学期的学生,这使不接受冲突是必要的毕业生课程按照某种方法来解决所面临的问题
关于逐渐增长的要求,基于新的课程和改变尽可能少量的已经确定前一年的课程表。
根据一个学者的观点,毕业生就自由的学习缺乏结构和导致被课程表约束的说明。
通过移去解决第二个问题选择没有冲突约束被成为艰辛和时间消耗;同时,因此,不实际。把毕业生课程分类和允许当然冲突内容和期待学生的数字不同的范畴赢得往回某种自由,但是识别足够范畴是不可能按照过程平均地传播过范畴的这样一种方法,,这防止冲突是必要的。它变得清楚我们是需要某种重量约束能够表达软弱和强健的约束不是强制性的。
一有限的套变量的约束满意,每一个带有一个有限的领域和一有限的套约束。 一种解决向其这样的领域的一种价值绘制地图每一变量所有约束被满足。部分的满足限制是每一约束与一个重量有关。 一个约束的一个重量表达其满足重要性,允许把艰难的约束与较弱的约束相区别。 苛刻的限制规则于赋予无穷的重量。较低的约束,有限的重量在约束中间考虑进去优先选择的说明。 一种解决向其这样的领域的一种价值绘制每一变量所有的限制约束被满足,并且违反的较低约束的整个的重量是最小限度的。
显然,我们为了每一握住时这一过程仅仅需要一个变量,起始的时间点,它曾经预定于。 每一变量的领域包括整个的星期,对所编号时期,因为例如:指示星期一的上午9点钟等等。 要求、希望、推荐能以一套专门的约束来表达。
过程不可与另一个冲突的没有冲突约束要求。预先安排的约束和利用性约束被用来表达教师的优先选择,以及过程必须在一段一定的时间内发生。
分配约束确保有一过程之间的至少一天和另一个,或者两过程预定于不同的天。
契约约束确保那一个过程将在另一个之后直接被预定。关于较弱的约束,优先选择的三个等级被选择:较弱的限制条件,一般限制条件和较苛刻的限制条件,这被翻译成为整数1,3,9。
搜索过程使用相结合在上面为了变量和价值选择被给的解答者与时序回溯和启发式。 对于可变的选择,首先失败原则被选择,这通过增加领域的主要动态地命令变量,原则提出关于计算的水流状态而选择变量之一最小的领域。对于价值选择,一种最好的适合策略被使用选择最好的额定时期之一。 根据一个乐观的观点,这将是违反一套柔软的约束的时期之一最小限度的整个的重量,但是评估应该像二重唱,无冲突的传播性能。进而,最好的评估不一定违反约束的最小的数
 

VB+SQL Server智能排课系统
字: 一种强壮的个人优先选择可能平衡10个软弱没有冲突约束。 这方法生产关于问题的一种好的第一种解决。搜索一种较好的解决是必要的。
产生一张排课表运行如下。 每一过程与把整个的星期考虑进去的一个领域约束有关,从0到167所编号的时期。 注意到那一切是重要,对于每一过程,所有时期的初始的评估是0表明没有时期最初不被给优先选择。当时,预先安排的约束和利用性约束将在约束中被翻译出来。加进去而非在约束中可能使用规则缩小过程的领域在上面提出。传播直到而继续固定点被到达,,当时更进一步重写那就是说不改变商店。通常,我们的以一致为基础的有限的领域解答者不是足够强大可确定约束是可以满足的。为了保证一种有效的解决被找到搜索过程被呼叫。 在约束中的增加可能开始传播,如此等等。
现在我们已讨论建立一张排课时间表的细节,如何用这系统建立基于前一年的一张排课时间表的一张新的排课时间表?对我们的解决中心是固定一张排课时间表的观念。固定一张排课时间表在于为了保证所有过程将再一次将预定于同样的时间已被预定的每一课程增加一个低要求的预先安排的约束提供。
必要计算的时间依赖于是否一张以前的时间表被再利用。 在42段时期之内为89过程从抓确定时间花费大约五分钟。
处理限制规则是一种宣言的高级语言扩展,为了编写应用起源的约束的设计者们。 在本文中,它已被争辩的约束处理规则是执行艰难和较弱的约束规则总的一个有限的领域的调整。设计者足够强大可作为一个大学排课系统的核心。因特网依赖于,和更加专门世界宽阔的Web(WWW )以便使教师把新的希望靠自己进入到说明中成为可能和提供。 网络前端基于HTML; 发展约束设计者和把它附加到排课表问题的一个数据库花费大约三个星期。时代显示的好的执行实现和十分合理的时间表产生那约束处理规则能够调解有效的执行和算法的执行。这十分高的水平方法也意味着计划能容易地被保持和修改。
 

VB+SQL Server智能排课系统
Survey Report
University course timetabling problems are combinatorial problems, which consist of scheduling a set of courses within a given number of rooms and time periods. Solving a real world timetabling problem manually often requires a significant amount of time, sometimes several days or even weeks. Therefore, a lot of research has been invested in order to provide automated support for human timetablers. Contributions come from the fields of operations research and artificial Intelligence. This paper refers to terms and methods from constraint satisfaction. The methods presented were developed using constraint logic programming. Constraint logic programming combines the declarativity of logic programming with the efficiency of methods from operations research and artificial intelligence. It has recently become a promising approach for solving timetabling problems.
Applying classical methods from constraint satisfaction requires to model the problem as a constraint satisfaction problem, a set of variables, each associated with a domain of values it can take on, and a set of constraints among the variables. Constraints are relations that specify the space of solutions by forbidding combinations of values.
Methods include search, heuristics, and constraint propagation. Typically, systematic search assigns values to variables sequentially following some search order. If the procedure fails to extend a partial solution, decisions are undone and alternatives explored. Systematic search often relies on heuristics, which define the order in which variables and values are chosen. Constraint propagation is complementary; it simplifies a problem by identifying values that cannot participate in a solution. This way the search space gets pruned and search becomes easier.
In practice, most constraint-based timetabling systems either do not support soft constraints or use a branch and bound search instead of chronological backtracking. Branch and bound starts out from a solution and requires the next solution to be better. Quality is measured by a suitable cost function that depends on the set of violated soft constraints. With this approach, however, soft constraints play no role in selecting variables and values.
After collecting wishes of teacher and information on the new courses, a first proposal is developed with the timetable of the previous year as a starting point. This is done by using free slots in the timetable left by courses not taking place again for new courses offered by the same people, whereas wishes of teachers take precedence over the timetable of the previous year. After handing out the proposal to all teachers, evaluations and new wishes are collected.
With the current proposal as a starting point, a new proposal is developed incorporating the responses on the current proposal, again changing as little as possible, and so on. Creating a new timetable is thus a multistage, incremental process. Relying on the timetable of the previous year and changing as little as possible by incremental scheduling drastically reduces the amount of work necessary for creating a new timetable and ensures acceptance of the new timetable by keeping the weekly course of events people are accustomed to.
Note that the assignment of rooms is done elsewhere. Nevertheless, conflicting requirements for space or certain equipment may be a cause for changing the timetable.
The general constraints are due to physical laws, academic reasons, and personal preferences of teachers:
A teacher cannot be in two places at the same time, so avoid clashing the courses of a teacher. There should be at least a one hour break between two courses of a teacher.
Some teachers prefer certain times or days for teaching.
Monday afternoon is reserved for professors’ meetings: Do not schedule professors’ courses for Monday afternoon.
The department consists of five units, each dedicated to a certain area of research.  Most courses are held by members of a single unit while only a few courses are held by members of different units. Courses held by members of a certain unit must not clash with courses held by other members of the same unit.
An offering typically consists of two lectures and a tutorial per week. There should be a day break between the lectures of an offering. The tutorial should not take place on a day, on which a lecture of the same offering takes place. All courses should be scheduled between9 a.m.and6 p.m. No lectures should be scheduled for Friday afternoon. No tutorials should be scheduled for late Friday afternoon.
Only few of the courses are mandatory for and dedicated to students of a certain term, while most courses are optional and open to all students. For each term of the undergraduate studies there is a set of mandatory courses, the attendance of which is highly recommended. Courses of the graduate studies only rely on the knowledge provided by courses of the undergraduate studies. There is no recommended order of attendance. Undergraduate courses of a term must not clash, while undergraduate courses of different terms are allowed to clash. Graduate courses should not clash.
First observations made clear that existing timetables do not meet the requirements stated, e.g., courses of a unit or graduate courses clash or a lecture of an offering and a tutorial of the same offering are scheduled for the same day. Furthermore, considering the number of graduate courses offered over the years, it became clear that there is too little space to schedule all graduate courses without clashes. This is due to the following reason. As mentioned before, undergraduate courses are mandatory and there is a recommended order of attendance. This way it is possible to distinguish students of the first term from students of the third term and students of the second term from students of the fourth term, which makes it possible to allow clashing of undergraduate courses of different terms. The graduate courses only rely on the knowledge provided by the undergraduate courses. There is no recommended order of attendance, thus making it impossible to distinguish students of the fifth term from students of the seventh term, which makes it necessary to disallow clashing of graduate courses in some way. So we faced two problems:
The demand for incremental scheduling by basing the new timetable on the timetable of the previous year and changing as little as possible made it necessary to handle old timetables, which do not meet the requirements stated.
From a scheduler’s point of view, the graduate studies lack structure taking
 

VB+SQL Server智能排课系统
freedom and leading to over constrained timetable specifications.
Tackling the second problem by removing selected no-clash constraints turned out to be laborious and time-consuming and, therefore, impractical. Classifying graduate courses by contents and expected number of students and allowing clashing of courses of different categories won back some freedom, but it was not possible to identify enough categories in such a way that courses spread evenly over categories, which would have been necessary to prevent conflicts. It became clear that we were in need of some kind of weighted constraints able to express weak and strong constraints that are not mandatory.
A Constraint Satisfaction Problem(CSP)consists of a finite set of variables, each associated with a finite domain and a finite set of constraints. A solution of a CSP maps each variable to a value of its domain such that all the constraints are satisfied. A partial constraint satisfaction problem(PCSP) is a CSP where each constraint is associated with a weight. A weight of a constraint expresses the importance of its fulfillment, allowing one to distinguish hard constraints from soft constraints. Hard constraints stand out due to infinite weights. The finite weights of soft constraints allow for the specification of preferences among constraints. A solution of a PCSP maps each variable to a value of its domain such that all hard constraints are satisfied and the total weight of the violated soft constraints is minimal.
Clearly, we only need one variable for each course holding the period, the starting time point, it has been scheduled for. Each variable’s domain consists of the whole week, the periods being numbered from0 to 167, for example,9 denotes 9 a.m. on Monday, and so on. Requirements, wishes, and recommendations can be expressed with a small set of specialized constraints.
No-clash constraints demand that a course must not clash with another one.
Preassignment constraints and availability constraints are used to express teachers’ preferences and that a course must take place at a certain time.
Distribution constraints make sure that there is at least one day between a course and another, or that two courses are scheduled for different days.
Compactness constraints make sure that one course will be scheduled directly after another.
With respect to soft constraints, three grades of preferences were chosen: weakly preferred, preferred, and strongly preferred, which get translated to the integer weights1,3, and9.
The search procedure employed integrates the solver given above with chronological backtracking and heuristics for variable and value selection. For variable selection, the first fail principle was chosen, which dynamically orders variables by increasing cardinality of domains, the principle proposes to select one of the variables with the smallest domains with respect to the current state of computation. For value selection, a best-fit strategy was used choosing one of the best rated periods. From an optimistic point of view, this will be one of the periods violating a set of soft constraints with minimal total weight, but the estimate may be too good duet o the low propagation performance of the no–clash solver. Furthermore, the best assessment does not necessarily violate a minimum number of constraints: a strong personal preference may balance out 10 weak no –clash constraints. This approach yielded a good first solution to the problem. It was not necessary to search for a better solution.
The generation of a timetable runs as follows. Each course is associated with a domain constraint allowing for the whole week, the periods being numbered from 0 to 167. It is important to note that, for each course, the initial assessment for all periods is 0 indicating that no period is given preference initially. Then preassignment constraints and availability constraints will be translated into in and not in constraints. Adding in and not in constraints may narrow the domains of the courses using the rules presented above. Propagation continues until a fix point is reached, that is to say, when further rewriting does not change the store. Usually, our consistency-based finite domain solver is not powerful enough to determine that the constraints are satisfiable. In order to guarantee that a valid solution is found the search procedure is called. Addition of an in constraint may initiate propagation, and so on.
Now that we have discussed the details of creating a timetable, how does one create a new timetable based on a timetable of the previous year with this system? Central to our solution is the notion of fixing a timetable. Fixing a timetable consists in adding a soft preassignment constraint for each course that has been scheduled ensuring that all courses offered again will be scheduled for the same time.
The time necessary to compute a timetable depends on whether a previous timetable is reused or not. Scheduling 89 courses within 42 time periods from scratch took about five minutes. Considering an ‘‘almost good’’ previous timetable saved about two and a half minutes.
Constraint handling rules is a declarative high level language extension, especially designed for writing application-oriented constraint solvers. In this paper, it has been argued that CHR is a good vehicle for implementing a finite domain solver that performs hard and soft constraint propagation. The solver is powerful enough to serve as the core of a university timetabling system. The internet is relied on, and more specifically the World Wide Web(WWW) to enable teachers to enter new wishes and offerings into the specification by themselves. The Web front end is based on HTML; pages are also generated by a Prolog program. Developing the constraint solver and attaching it to a database of timetabling problems took about three weeks; developing the front end took an other two weeks. The solver takes only a few lines of code. The good execution times achieved and the very reasonable timetables generated demonstrate that CHR is able to reconcile efficient execution and declarative implementation. This very high level approach also means that the program can be easily maintained and modified.
  • 上一篇资讯: 机票预定系统
  • 设为首页 | 加入收藏 | 网学首页 | 原创论文 | 计算机原创
    版权所有 网学网 [Myeducs.cn] 您电脑的分辨率是 像素
    Copyright 2008-2020 myeducs.Cn www.myeducs.Cn All Rights Reserved 湘ICP备09003080号 常年法律顾问:王律师