项目介绍
学生在线考试管理系统,分为管理员与老师、学生三种角色;
教师/管理员主要功能:
-
学生管理:查看所有学生的基本信息,管理员则还可以对学生的基本信息(除了账号和密码外)进行修改和对学生的删除操作。
-
教师管理:查看所有教师的基本信息(除密码外),并修改自己的基本信息,而管理员除了以上功能还可以对所有教师的所有信息进行修改删除操作,也能添加教师。
-
班级管理:要能对班级的信息进行管理。
-
试题管理:首先要能对试题进行增删改查,并且应该对试题进行不同科目的分类以方便试卷的生成。
-
试卷管理:试卷的主体是试题,然后用户能对试卷进行增删改查操作。
-
考试管理:可以选择相应的试卷设置时间进行考试。考试一旦生成后无法修改。
-
记录管理:查看试卷的考试情况;以班级为单位根据班级考试情况生成每个考试的不同班级的及格率以方便排名。
学生主要功能:
-
学生注册:学生可以通过注册一个账号,然后可以用于登陆系统。
-
参与考试:学生要可以参与考试
-
查询历史考试情况:学生在考完试后系统便会记录它的考试得分,进行准确率的分析,并提供试卷详情查看,且这此的考试信息会存入数据库中以便于下次查看。
环境需要
1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。
2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA;
3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可
4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS;
5.是否Maven项目: 是;查看源码目录中是否包含pom.xml;若包含,则为maven项目,否则为非maven项目
6.数据库:MySql 5.7版本;
技术栈
-
后端:SpringBoot+Mybatis
-
前端:Thymleaf+BootStrap+Html
使用说明
- 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件;
2.使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven;
若为maven项目,导入成功后请执行maven clean;maven install命令,配置tomcat,然后运行;
-
将项目中application.yml配置文件中的数据库配置改为自己的配置;
-
访问地址:http://localhost:8080
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
}
//试题去修改页面
@RequestMapping("/toEditQuestion/{id}")
public String toEditQuestion(@PathVariable("id") Integer id,Model model){
List<Question> questionCourses=questionService.queryAllCourse();
List<Question> questionTypes=questionService.queryAllType();
Question question=questionService.getQuestionById(id);
model.addAttribute("questionTypes",questionTypes);
model.addAttribute("questionCourses",questionCourses);
model.addAttribute("question",question);
return "question/questionEdit";
}
//修改具体操作
@RequestMapping("/EditQuestion")
public String EditQuestion(Question question){
questionService.editQuestion(question);
return "redirect:/question/getAllQuestion";
}
}
学生管理控制层:
@Controller
@RequestMapping("/student")
public class StudentController {
@Autowired
private ClasseMapper classeMapper;
@Autowired
private StudentService studentService;
//查看所有学生
@RequestMapping("/getAllStudent")
public String getAllStudent(Model model){
List<Student> students = studentService.getAll();
model.addAttribute("students",students);
return "student/studentList";
}
//修改编辑功能,先获取该id得学生信息
@RequestMapping("/{id}")
public String updateStudent(@PathVariable("id") Integer id,Model model){
//试题去修改页面
@RequestMapping("/toEditQuestion/{id}")
public String toEditQuestion(@PathVariable("id") Integer id,Model model){
List<Question> questionCourses=questionService.queryAllCourse();
List<Question> questionTypes=questionService.queryAllType();
Question question=questionService.getQuestionById(id);
model.addAttribute("questionTypes",questionTypes);
model.addAttribute("questionCourses",questionCourses);
model.addAttribute("question",question);
return "question/questionEdit";
}
//修改具体操作
@RequestMapping("/EditQuestion")
public String EditQuestion(Question question){
questionService.editQuestion(question);
return "redirect:/question/getAllQuestion";
}
//试题删除
@RequestMapping("/deleteQuestion/{id}")
return "redirect:/student/getAllStudent";
}
//删除学生
@RequestMapping("/deleteStudent/{id}")
public String deleteStudent(@PathVariable("id") Integer id){
studentService.deleteById(id);
return "redirect:/student/getAllStudent";
}
}
教师管理控制层:
@Controller
@RequestMapping("/teacher")
public class TeacherController {
@Autowired
private TeacherService teacherService;
@Autowired
private ClasseService classeService;
//查看所有教师
@RequestMapping("/getAllTeacher")
public String getAllTeacher(Model model){
List<Teacher> teachers = teacherService.getAll();
//查找classe表中已存在的教师,将用于表单教师是否可以删除
List<Classe> classes=classeService.queryAllTeacherId();
List<Integer> teaId=new ArrayList<>();
for(Classe cla:classes){
teaId.add(cla.getTeacherId());
//默认查询所有
questionCourseresRes="all";
}else {
questionCourseresRes=questionCourseBef;
}
//若是第一次查询则用上次提交的表单中的类型、课程,若是第二次查询则延用上次类型
String questionTypeBef=question.getQuestionType();
String questionTypesRes="";
if(questionTypeBef==null){
//默认查询所有
questionTypesRes="k";
}else {
questionTypesRes=questionTypeBef;
}
List<Question> questionids=paperService.queryALlQuestionId();
List<Integer> quesIds=new ArrayList<>();
for(Question qid:questionids){
quesIds.add(qid.getQuestionId());
}
model.addAttribute("quesIds",quesIds);
PageHelper.startPage(pageNum,pageSize);//这行是重点,表示从pageNum页开始,每页pageSize条数据
List<Question> questions = questionService.getAll(question);
PageInfo<Question> pageInfo = new PageInfo<Question>(questions);
model.addAttribute("questionCourseresRes",questionCourseresRes);
questionTypes.add(new Question("k","bug"));
String questionCourseBef = question.getQuestionCourse();
String questionCourseresRes="";
if(questionCourseBef==null){
//默认查询所有
questionCourseresRes="all";
}else {
questionCourseresRes=questionCourseBef;
}
//若是第一次查询则用上次提交的表单中的类型、课程,若是第二次查询则延用上次类型
String questionTypeBef=question.getQuestionType();
String questionTypesRes="";
if(questionTypeBef==null){
//默认查询所有
questionTypesRes="k";
}else {
questionTypesRes=questionTypeBef;
if(teacherId==0){
/*若id为0即是刚添加未分配,要进行增加操作*/
teacherService.addTeacher(teacher);
}else {
/*若id已存在,是要进行修改操作*/
teacherService.editTeacher(teacher);
}
return "redirect:/teacher/getAllTeacher";
}
//教师去修改页面
@RequestMapping("/{id}")
public String toEditTeacher(@PathVariable("id") Integer id,Model model){
Teacher teacher=teacherService.getTeacherById(id);
model.addAttribute("teacher",teacher);
return "teacher/teacherAdd";
}
//教师删除
@RequestMapping("/deleteTeacher/{id}")
public String deleteTeacherById(@PathVariable("id") Integer id,Model model){
teacherService.deleteTeacherById(id);
return "redirect:/teacher/getAllTeacher";
}
}
questionService.deleteQuestionById(id);
return "redirect:/question/getAllQuestion";
}
}
学生管理控制层:
@Controller
@RequestMapping("/student")
public class StudentController {
@Autowired
private ClasseMapper classeMapper;
@Autowired
private StudentService studentService;
//查看所有学生
}
}
学生管理控制层:
@Controller
@RequestMapping("/student")
public class StudentController {
@Autowired
private ClasseMapper classeMapper;
@Autowired
private StudentService studentService;
//查看所有学生
@RequestMapping("/getAllStudent")
public String getAllStudent(Model model){
List<Student> students = studentService.getAll();
model.addAttribute("students",students);
return "student/studentList";
}
//修改编辑功能,先获取该id得学生信息
@RequestMapping("/{id}")
public String updateStudent(@PathVariable("id") Integer id,Model model){
Student student=studentService.getStudentById(id);
String questionCourseresRes="";
if(questionCourseBef==null){
//默认查询所有
questionCourseresRes="all";
}else {
questionCourseresRes=questionCourseBef;
}
//若是第一次查询则用上次提交的表单中的类型、课程,若是第二次查询则延用上次类型
String questionTypeBef=question.getQuestionType();
String questionTypesRes="";
if(questionTypeBef==null){
//默认查询所有
questionTypesRes="k";
}else {
questionTypesRes=questionTypeBef;
}
List<Question> questionids=paperService.queryALlQuestionId();
List<Integer> quesIds=new ArrayList<>();
for(Question qid:questionids){
quesIds.add(qid.getQuestionId());
}
model.addAttribute("quesIds",quesIds);
PageHelper.startPage(pageNum,pageSize);//这行是重点,表示从pageNum页开始,每页pageSize条数据
List<Question> questions = questionService.getAll(question);
PageInfo<Question> pageInfo = new PageInfo<Question>(questions);
model.addAttribute("questionCourseresRes",questionCourseresRes);
model.addAttribute("questionTypesRes",questionTypesRes);