基于javaweb的SpringBoot在线考试系统(java+springboot+vue+mysql+maven)

运行环境

Java≥8、MySQL≥5.7、Node.js≥14

开发工具

后端:eclipse/idea/myeclipse/sts等均可配置运行
前端:WebStorm/VSCode/HBuilderX等均可

❗没学过node.js的不要搞前后端分离项目

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

功能说明

340123072402

350123072402

360123072402

370123072402

390123072402

400123072402

400123072403

基于javaweb的SpringBoot在线考试系统(java+springboot+vue+mysql+maven)

管理员和教师登陆此账号就进入后台,学生登陆此账号就进入前端做题。

老师发布了考试,学生才可以在主页面看到相应的考试信息。 有考试安排表以后,才能给该次考试添加题目,对应数据表是exammanage。 该表保存该次考试,课程名称,考试时间,所属专业,学院等等信息。

题库表设计和普通数据表设计有所区别。分别是选择题题库表,填空题题库表,判断题题库表, 每个表保存相应类型的题库,通过一张中间表,将题库和试题关联起来。 这样就组成了一张完整的试卷。

管理员的功能:

考试管理、题库管理、成绩查询、学生管理、教师管理

首先需要增加考试,才能在这个考试下,添加题目。题目可以在题库中自由组题。

学生功能:

查看可以做的试卷、已经做的试卷练习、自己每次考试的分数、给管理员留言等。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
    public ApiResult update(@RequestBody Teacher teacher){
return ApiResultHandler.success(teacherService.update(teacher));
}

@PostMapping("/teacher")
public ApiResult add(@RequestBody Teacher teacher){
return ApiResultHandler.success(teacherService.add(teacher));
}
}
package com.exam.controller;


@RestController
public class MessageController {

@Autowired
private MessageServiceImpl messageService;

@GetMapping("/messages/{page}/{size}")
public ApiResult<Message> findAll(@PathVariable("page") Integer page, @PathVariable("size") Integer size) {
Page<Message> messagePage = new Page<>(page,size);
IPage<Message> all = messageService.findAll(messagePage);
return ApiResultHandler.buildApiResult(200,"查询所有留言",all);
}

@GetMapping("/message/{id}")
public ApiResult findById(@PathVariable("id") Integer id) {
Message res = messageService.findById(id);
return ApiResultHandler.buildApiResult(200,"根据Id查询",res);
}

@DeleteMapping("/message/{id}")
public int delete(@PathVariable("id") Integer id) {
int res = messageService.delete(id);
return res;
}

@PostMapping("/message")
public ApiResult add(@RequestBody Message message) {
int res = messageService.add(message);
if (res == 0) {
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
    @PostMapping("/exam")
public ApiResult add(@RequestBody ExamManage exammanage){
int res = examManageService.add(exammanage);
if (res ==1) {
return ApiResultHandler.buildApiResult(200, "添加成功", res);
} else {
return ApiResultHandler.buildApiResult(400,"添加失败",res);
}
}

@GetMapping("/examManagePaperId")
public ApiResult findOnlyPaperId() {
ExamManage res = examManageService.findOnlyPaperId();
if (res != null) {
return ApiResultHandler.buildApiResult(200,"请求成功",res);
}
return ApiResultHandler.buildApiResult(400,"请求失败",res);
}
}
package com.exam.controller;



@RestController
public class ItemController {

@Autowired
MultiQuestionServiceImpl multiQuestionService;

@Autowired
FillQuestionServiceImpl fillQuestionService;

@Autowired
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
    @GetMapping("/messages/{page}/{size}")
public ApiResult<Message> findAll(@PathVariable("page") Integer page, @PathVariable("size") Integer size) {
Page<Message> messagePage = new Page<>(page,size);
IPage<Message> all = messageService.findAll(messagePage);
return ApiResultHandler.buildApiResult(200,"查询所有留言",all);
}

@GetMapping("/message/{id}")
public ApiResult findById(@PathVariable("id") Integer id) {
Message res = messageService.findById(id);
return ApiResultHandler.buildApiResult(200,"根据Id查询",res);
}

@DeleteMapping("/message/{id}")
public int delete(@PathVariable("id") Integer id) {
int res = messageService.delete(id);
return res;
}

@PostMapping("/message")
public ApiResult add(@RequestBody Message message) {
int res = messageService.add(message);
if (res == 0) {
return ApiResultHandler.buildApiResult(400,"添加失败",res);
} else {
return ApiResultHandler.buildApiResult(200,"添加成功",res);
}
}
}
package com.exam.controller;


@RestController
public class AdminController {

private AdminServiceImpl adminService;
@Autowired
public AdminController(AdminServiceImpl adminService){
this.adminService = adminService;
}

@GetMapping("/admins")
public ApiResult findAll(){
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36

Student studentRes = loginService.studentLogin(username,password);
if (studentRes != null) {
return ApiResultHandler.buildApiResult(200, "请求成功", studentRes);
}

return ApiResultHandler.buildApiResult(400, "请求失败", null);
}
}
package com.exam.controller;


@RestController
public class JudgeQuestionController {

@Autowired
private JudgeQuestionServiceImpl judgeQuestionService;

@PostMapping("/judgeQuestion")
public ApiResult add(@RequestBody JudgeQuestion judgeQuestion) {
int res = judgeQuestionService.add(judgeQuestion);
if (res != 0) {
return ApiResultHandler.buildApiResult(200,"添加成功",res);
}
return ApiResultHandler.buildApiResult(400,"添加失败",res);
}

@GetMapping("/judgeQuestionId")
public ApiResult findOnlyQuestionId() {
JudgeQuestion res = judgeQuestionService.findOnlyQuestionId();
return ApiResultHandler.buildApiResult(200,"查询成功",res);
}
}
package com.exam.controller;


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38

@RestController
public class MultiQuestionController {

@Autowired
private MultiQuestionServiceImpl multiQuestionService;

@GetMapping("/multiQuestionId")
public ApiResult findOnlyQuestion() {
MultiQuestion res = multiQuestionService.findOnlyQuestionId();
return ApiResultHandler.buildApiResult(200,"查询成功",res);
}

@PostMapping("/MultiQuestion")
public ApiResult add(@RequestBody MultiQuestion multiQuestion) {
int res = multiQuestionService.add(multiQuestion);
if (res != 0) {

return ApiResultHandler.buildApiResult(200,"添加成功",res);
}
return ApiResultHandler.buildApiResult(400,"添加失败",res);
}
}
package com.exam.controller;


@RestController
public class FillQuestionController {

@Autowired
private FillQuestionServiceImpl fillQuestionService;

@PostMapping("/fillQuestion")
public ApiResult add(@RequestBody FillQuestion fillQuestion) {
int res = fillQuestionService.add(fillQuestion);
if (res != 0) {
return ApiResultHandler.buildApiResult(200,"添加成功",res);
}


项目链接:
https://javayms.github.io?id=021222062008200wc
https://javayms.pages.dev?id=021222062008200wc