基于Springboot+vue前后端分离防作弊考试系统

本文主要是介绍基于Springboot+vue前后端分离防作弊考试系统,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

作者主页:编程指南针

作者简介:Java领域优质创作者、CSDN博客专家 、CSDN内容合伙人、掘金特邀作者、阿里云博客专家、51CTO特邀作者、多年架构师设计经验、腾讯课堂常驻讲师

主要内容:Java项目、Python项目、前端项目、人工智能与大数据、简历模板、学习资料、面试题库、技术互助

收藏点赞不迷路  关注作者有好处

文末获取源码 

项目编号:BS-XX-104

指南针考试系统是一个多角色在线培训考试系统,系统集成了用户管理、角色管理、题库管理、试题管理、考试管理、在线考试等功能,考试流程完善。实现一整套完整体系的考试系统,方便用户在此系统中进行练习并不断提升自己,在考试中不断进步。本系统采用前后端分离方式进行开发实现,使用springboot+vue来进行开发.考试时自动调用摄相头进行考试监控,以防止作弊。

技术栈

  1. SpringBoot
  2. Mybatis-plus
  3. MySQL 5.7
  4. Vue全家桶
  5. ElementUI
  6. Redis
  7. Swagger
  8. 阿里云OSS
  9. Log4j

主要功能

1. 权限控制

本系统存在三个不同的角色,教师,管理员,学生三种用户,此系统是基于vue+springboot实现的前后端分离,用户权限校验通过JWT生成token令牌发放到用户,并根据令牌对用户的身份合法性进行校验。

2. 在线考试

学生用户在注册登录之后,可以在本系统进行在线的考试,考试可由教师和管理员进行布置并设置考试权限(公开,密码),考试题型分为 单选、多选、判断、简答题,并支持题目附带配图。考试过程中需开启摄像头进行考试,系统会自动抓拍考生实时考试状态。

3. 成绩模块

参加考试后的学生用户,在提交试卷后进入考试结果页面,页面会自动核对学生用户的逻辑题的对错,对于简答题需要老师或者超级管理员进行批阅。对于学生用户参与的考试,学生用户可以查看到考试的详情并可以查看到自己所错的逻辑题。

4. 题库模块

学生用户在题库模块中可以进行题目的功能训练,训练模式分为,顺序练习,随机练习,也可以根据题型练习(单选,多选,判断)。用户答题时会实时判断正确与否,并有错题解析功能。

5. 题库管理

超级管理员和教师可以对本考试系统已有的题库进行管理,实现对题库信息的CRUD操作

6. 试题管理

教师和系统管理员用户有权限对本系统的所有试题进行操作,本系统试题支持复杂类型的题目,考试题目支持多插图,选项答案支持单插图功能。

7. 考试管理

教师和系统管理员用户有权限对系统存在的考试进行操作,本系统考试支持公开考试和密码口令考试,并可以对考试进行禁用也可以在设置考试时间段,对于考试可以进行很便利的进行组卷,系统内置两种组卷模式,题库组卷和自由选题组卷。

8. 考卷批阅

对于本系统中存在的复杂考试的题目,可以又对应的老师进行批阅,此系统的逻辑题无需老师用户进行批阅,老师的工作仅仅是批阅简答题这种无准确答案类型的题目,极大地减轻了老师用户的工作量

9. 考试统计

本系统针对每一次考试进行数据统计和报表,让使用本系统的老师用户能够直观的了解到每一次考试人员的进步。

10. 用户管理

超级管理员可以对注册本系统用户的进行授权,并拥有操作一切用户的权限。

下面展示一下系统的主要功能:

登陆:

后台管理首页

题库管理

试题管理

考试管理

阅卷管理

考试统计

公告管理

用户管理

教师登陆

学生登陆

在线考试:考试时要调出摄相头进行监控

查看个人成绩和错题:并为通过考试的生成证书

日常题库训练

部门核心代码:

package com.wzz.controller;import com.wzz.dto.AddUserDto;
import com.wzz.entity.Notice;
import com.wzz.entity.UserRole;
import com.wzz.service.NoticeService;
import com.wzz.service.UserRoleService;
import com.wzz.service.UserService;
import com.wzz.vo.CommonResult;
import com.wzz.vo.PageResponse;
import com.wzz.vo.UserInfoVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;import javax.validation.Valid;
import java.util.List;/*** @author by znz* @implNote 2021/10/20 19:07*/
@Validated
@RestController
@RequiredArgsConstructor
@Api(tags = "超级管理员权限相关的接口")
@RequestMapping(value = "/admin")
public class AdminController {private final UserService userService;private final UserRoleService userRoleService;private final NoticeService noticeService;@GetMapping("/getUser")@ApiOperation("获取用户信息,可分页 ----> 查询条件(可无)(username,trueName),必须有的(pageNo,pageSize)")public CommonResult<PageResponse<UserInfoVo>> getUser(@RequestParam(required = false) String loginName,@RequestParam(required = false) String trueName,Integer pageNo, Integer pageSize) {return CommonResult.<PageResponse<UserInfoVo>>builder().data(userService.getUser(loginName, trueName, pageNo, pageSize)).build();}@GetMapping("/handleUser/{type}")@ApiOperation("管理员操作用户: type=1(启用) 2(禁用) 3(删除) userIds(需要操作的用户id)")public CommonResult<Void> handleUser(@PathVariable("type") Integer type, String userIds) {userService.handlerUser(type, userIds);return CommonResult.<Void>builder().build();}@PostMapping("/addUser")@ApiOperation("管理员用户新增用户")@ApiImplicitParams({@ApiImplicitParam(name = "user", value = "系统用户实体", required = true, dataType = "user", paramType = "body")})public CommonResult<Void> addUser(@RequestBody @Valid AddUserDto userDto) {userService.addUser(userDto);return CommonResult.<Void>builder().build();}@GetMapping("/getRole")@ApiOperation("查询系统存在的所有角色信息")public CommonResult<List<UserRole>> getRole() {return CommonResult.<List<UserRole>>builder().data(userRoleService.getUserRole()).build();}@GetMapping("/getAllNotice")@ApiOperation("获取系统发布的所有公告(分页 条件查询  二合一接口)")@ApiImplicitParams({@ApiImplicitParam(name = "noticeContent", value = "搜索公告内容", dataType = "string", paramType = "query"),@ApiImplicitParam(name = "pageNo", value = "查询结果分页当前页面", required = true, dataType = "int", paramType = "query"),@ApiImplicitParam(name = "pageSize", value = "查询结果的页面条数大小", required = true, dataType = "int", paramType = "query")})public CommonResult<PageResponse<Notice>> getAllNotice(@RequestParam(required = false, name = "noticeContent") String content,Integer pageNo, Integer pageSize) {return CommonResult.<PageResponse<Notice>>builder().data(noticeService.getAllNotices(content, pageNo, pageSize)).build();}@PostMapping("/publishNotice")@ApiOperation("发布新公告")@ApiImplicitParams({@ApiImplicitParam(name = "notice", value = "通知实体对象", required = true, dataType = "notice", paramType = "body")})public CommonResult<Void> publishNotice(@RequestBody Notice notice) {noticeService.publishNotice(notice);return CommonResult.<Void>builder().build();}@GetMapping("/deleteNotice")@ApiOperation("批量删除公告")@ApiImplicitParams({@ApiImplicitParam(name = "noticeIds", value = "系统公告id", required = true, dataType = "string", paramType = "query")})public CommonResult<Void> deleteNotice(@RequestParam(name = "ids") String noticeIds) {noticeService.deleteNoticeByIds(noticeIds);return CommonResult.<Void>builder().build();}@PostMapping("/updateNotice")@ApiOperation("更新公告")@ApiImplicitParams({@ApiImplicitParam(name = "notice", value = "通知实体对象", required = true, dataType = "notice", paramType = "body")})public CommonResult<Void> updateNotice(@RequestBody Notice notice) {noticeService.updateNotice(notice);return CommonResult.<Void>builder().build();}
}

package com.wzz.controller;import com.wzz.entity.ExamQuestion;
import com.wzz.entity.ExamRecord;
import com.wzz.service.ExamQuestionService;
import com.wzz.service.QuestionService;
import com.wzz.service.impl.ExamRecordServiceImpl;
import com.wzz.vo.CommonResult;
import com.wzz.vo.PageResponse;
import com.wzz.vo.QuestionVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;/*** @author by znz* @implNote 2021/11/7 19:44*/
@Slf4j
@RestController
@RequiredArgsConstructor
@Api(tags = "学生权限相关的接口")
@RequestMapping(value = "/student")
public class StudentController {private final ExamRecordServiceImpl examRecordService;private final QuestionService questionService;private final ExamQuestionService examQuestionService;@GetMapping("/getMyGrade")@ApiOperation("获取个人成绩(分页 根据考试名查询)")@ApiImplicitParams({@ApiImplicitParam(name = "username", value = "系统唯一用户名", required = true, dataType = "string", paramType = "query"), @ApiImplicitParam(name = "pageNo", value = "当前页面数", required = true, dataType = "int", paramType = "query"), @ApiImplicitParam(name = "pageSize", value = "当前页面大小", required = true, dataType = "int", paramType = "query"), @ApiImplicitParam(name = "examId", value = "考试唯一id", dataType = "int", paramType = "query")})public CommonResult<PageResponse<ExamRecord>> getMyGrade(String username, Integer pageNo, Integer pageSize, @RequestParam(required = false) Integer examId) {return CommonResult.<PageResponse<ExamRecord>>builder().data(examRecordService.getUserGrade(username, examId, pageNo, pageSize)).build();}@GetMapping("/getCertificate")@ApiOperation("生成证书接口")@ApiImplicitParams({@ApiImplicitParam(name = "examName", value = "考试名称", required = true, dataType = "string", paramType = "query"), @ApiImplicitParam(name = "examRecordId", value = "考试记录id", required = true, dataType = "int", paramType = "query")})public void getCertificate(HttpServletResponse response, @RequestParam(name = "examName") String examName, @RequestParam(name = "examRecordId") Integer examRecordId) {examRecordService.createExamCertificate(response, examName, examRecordId);}@PostMapping("/addExamRecord")@ApiOperation("保存考试记录信息,返回保存记录的id")@ApiImplicitParams({@ApiImplicitParam(name = "examRecord", value = "考试记录实体对象", required = true, dataType = "examRecord", paramType = "body")})public CommonResult<Integer> addExamRecord(@RequestBody ExamRecord examRecord, HttpServletRequest request) {return CommonResult.<Integer>builder().data(examRecordService.addExamRecord(examRecord, request)).build();}// TODO 优化成多id一次查询@GetMapping("/getQuestionById/{id}")@ApiOperation("根据id获取题目信息")@ApiImplicitParams({@ApiImplicitParam(name = "id", value = "问题id", required = true, dataType = "int", paramType = "path")})public CommonResult<QuestionVo> getQuestionById(@PathVariable("id") Integer id) {return CommonResult.<QuestionVo>builder().data(questionService.getQuestionVoById(id)).build();}@GetMapping("/getExamRecordById/{recordId}")@ApiOperation("根据考试的记录id查询用户考试的信息")@ApiImplicitParams({@ApiImplicitParam(name = "recordId", value = "考试记录id", required = true, dataType = "int", paramType = "query")})public CommonResult<ExamRecord> getExamRecordById(@PathVariable Integer recordId) {return CommonResult.<ExamRecord>builder().data(examRecordService.getExamRecordById(recordId)).build();}@GetMapping("/getExamQuestionByExamId/{examId}")@ApiOperation("根据考试id查询考试中的每一道题目id和分值")@ApiImplicitParams({@ApiImplicitParam(name = "examId", value = "考试id", required = true, dataType = "int", paramType = "query")})public CommonResult<ExamQuestion> getExamQuestionByExamId(@PathVariable Integer examId) {return CommonResult.<ExamQuestion>builder().data(examQuestionService.getExamQuestionByExamId(examId)).build();}
}

package com.wzz.controller;import com.wzz.entity.ExamRecord;
import com.wzz.entity.Question;
import com.wzz.entity.QuestionBank;
import com.wzz.service.*;
import com.wzz.utils.OSSUtil;
import com.wzz.vo.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;import javax.validation.Valid;
import java.util.List;/*** @author wzz* @implNote 2021/10/24 15:42*/
@Slf4j
@Validated
@RestController
@RequiredArgsConstructor
@Api(tags = "老师权限相关的接口")
@RequestMapping(value = "/teacher")
public class TeacherController {private final ExamService examService;private final UserService userService;private final QuestionService questionService;private final ExamRecordService examRecordService;private final QuestionBankService questionBankService;@GetMapping("/getQuestionBank")@ApiOperation("获取所有题库信息")public CommonResult<List<QuestionBank>> getQuestionBank() {return CommonResult.<List<QuestionBank>>builder().data(questionBankService.getAllQuestionBanks()).build();}@GetMapping("/getQuestion")@ApiImplicitParams({@ApiImplicitParam(name = "questionType", value = "问题类型", dataType = "string", paramType = "query"),@ApiImplicitParam(name = "questionBank", value = "问题所属题库", dataType = "string", paramType = "query"),@ApiImplicitParam(name = "questionContent", value = "问题内容", dataType = "string", paramType = "query"),@ApiImplicitParam(name = "pageNo", value = "页面数", required = true, dataType = "int", paramType = "query"),@ApiImplicitParam(name = "pageSize", value = "页面大小", required = true, dataType = "int", paramType = "query")})@ApiOperation("获取题目信息,可分页 ----> 查询条件(可无)(questionType,questionBank,questionContent),必须有的(pageNo,pageSize)")public CommonResult<PageResponse<Question>> getQuestion(@RequestParam(required = false) String questionType,@RequestParam(required = false) String questionBank,@RequestParam(required = false) String questionContent,Integer pageNo, Integer pageSize) {return CommonResult.<PageResponse<Question>>builder().data(questionService.getQuestion(questionType, questionBank, questionContent, pageNo, pageSize)).build();}@GetMapping("/deleteQuestion")@ApiOperation("根据id批量删除")@ApiImplicitParams({@ApiImplicitParam(name = "questionIds", value = "问题id的字符串以逗号分隔", required = true, dataType = "string", paramType = "query")})public CommonResult<Void> deleteQuestion(String questionIds) {questionService.deleteQuestionByIds(questionIds);return CommonResult.<Void>builder().build();}@GetMapping("/addBankQuestion")@ApiOperation("将问题加入题库")@ApiImplicitParams({@ApiImplicitParam(name = "questionIds", value = "问题id的字符串以逗号分隔", required = true, dataType = "string", paramType = "query"),@ApiImplicitParam(name = "banks", value = "题库id的字符串以逗号分隔", required = true, dataType = "string", paramType = "query")})public CommonResult<String> addBankQuestion(String questionIds, String banks) {questionBankService.addQuestionToBank(questionIds, banks);return CommonResult.<String>builder().build();}@GetMapping("/removeBankQuestion")@ApiOperation("将问题从题库移除")@ApiImplicitParams({@ApiImplicitParam(name = "questionIds", value = "问题id的字符串以逗号分隔", required = true, dataType = "string", paramType = "query"),@ApiImplicitParam(name = "banks", value = "题库id的字符串以逗号分隔", required = true, dataType = "string", paramType = "query")})public CommonResult<Void> removeBankQuestion(String questionIds, String banks) {questionBankService.removeBankQuestion(questionIds, banks);return CommonResult.<Void>builder().build();}@PostMapping("/uploadQuestionImage")@ApiOperation("接受前端上传的图片,返回上传图片地址")@ApiImplicitParams({@ApiImplicitParam(name = "file", value = "图片文件", required = true, dataType = "file", paramType = "body")})public CommonResult<String> uploadQuestionImage(MultipartFile file) throws Exception {log.info("开始上传文件: {}", file.getOriginalFilename());return CommonResult.<String>builder().data(OSSUtil.picOSS(file)).message("上传成功").build();}@PostMapping("/addQuestion")@ApiOperation("添加试题")@ApiImplicitParams({@ApiImplicitParam(name = "questionVo", value = "问题的vo视图对象", required = true, dataType = "questionVo", paramType = "body")})public CommonResult<Void> addQuestion(@RequestBody @Valid QuestionVo questionVo) {questionService.addQuestion(questionVo);return CommonResult.<Void>builder().build();}@PostMapping("/updateQuestion")@ApiOperation("更新试题")@ApiImplicitParams({@ApiImplicitParam(name = "questionVo", value = "问题的vo视图对象", required = true, dataType = "questionVo", paramType = "body")})public CommonResult<Void> updateQuestion(@RequestBody @Valid QuestionVo questionVo) {questionService.updateQuestion(questionVo);return CommonResult.<Void>builder().build();}@GetMapping("/deleteQuestionBank")@ApiOperation("删除题库并去除所有题目中的包含此题库的信息")@ApiImplicitParams({@ApiImplicitParam(name = "ids", value = "删除题库的id字符串逗号分隔", required = true, dataType = "string", paramType = "query")})public CommonResult<Void> deleteQuestionBank(String ids) {questionBankService.deleteQuestionBank(ids);return CommonResult.<Void>builder().build();}@PostMapping("/addQuestionBank")@ApiOperation("添加题库信息")@ApiImplicitParams({@ApiImplicitParam(name = "questionBank", value = "题库的实体对象", required = true, dataType = "questionBank", paramType = "body")})public CommonResult<Void> addQuestionBank(@RequestBody QuestionBank questionBank) {questionBankService.addQuestionBank(questionBank);return CommonResult.<Void>builder().build();}@GetMapping("/operationExam/{type}")@ApiOperation("操作考试的信息表(type 1启用 2禁用 3删除)")@ApiImplicitParams({@ApiImplicitParam(name = "type", value = "操作类型", required = true, dataType = "int", paramType = "query"),@ApiImplicitParam(name = "ids", value = "操作的考试id集合", required = true, dataType = "string", paramType = "query")})public CommonResult<Void> operationExam(@PathVariable("type") Integer type, String ids) {examService.operationExam(type, ids);return CommonResult.<Void>builder().build();}@PostMapping("/addExamByBank")@ApiOperation("根据题库添加考试")@ApiImplicitParams({@ApiImplicitParam(name = "addExamByBankVo", value = "根据题库添加考试vo对象", required = true, dataType = "addExamByBankVo", paramType = "body")})public CommonResult<Void> addExamByBank(@RequestBody @Valid AddExamByBankVo addExamByBankVo) {examService.addExamByBank(addExamByBankVo);return CommonResult.<Void>builder().build();}@PostMapping("/addExamByQuestionList")@ApiOperation("根据题目列表添加考试")@ApiImplicitParams({@ApiImplicitParam(name = "addExamByQuestionVo", value = "通过题目列表添加考试的vo对象", required = true, dataType = "addExamByQuestionVo", paramType = "body")})public CommonResult<Void> addExamByQuestionList(@RequestBody @Valid AddExamByQuestionVo addExamByQuestionVo) {examService.addExamByQuestionList(addExamByQuestionVo);return CommonResult.<Void>builder().build();}@PostMapping("/updateExamInfo")@ApiOperation("更新考试的信息")@ApiImplicitParams({@ApiImplicitParam(name = "addExamByQuestionVo", value = "通过题目列表添加考试的vo对象", required = true, dataType = "addExamByQuestionVo", paramType = "body")})public CommonResult<Void> updateExamInfo(@RequestBody AddExamByQuestionVo addExamByQuestionVo) {examService.updateExamInfo(addExamByQuestionVo);return CommonResult.<Void>builder().build();}@GetMapping("/getExamRecord")@ApiOperation("获取考试记录信息,(pageNo,pageSize)")@ApiImplicitParams({@ApiImplicitParam(name = "examId", value = "考试id", required = true, dataType = "int", paramType = "query"),@ApiImplicitParam(name = "pageNo", value = "页面数", required = true, dataType = "int", paramType = "query"),@ApiImplicitParam(name = "pageSize", value = "页面大小", required = true, dataType = "int", paramType = "query")})public CommonResult<PageResponse<ExamRecord>> getExamRecord(@RequestParam(required = false) Integer examId, Integer pageNo, Integer pageSize) {return CommonResult.<PageResponse<ExamRecord>>builder().data(examRecordService.getExamRecord(examId, pageNo, pageSize)).build();}// TODO 改成ids查询@GetMapping("/getUserById/{userId}")@ApiOperation("根据用户id查询用户信息")@ApiImplicitParams({@ApiImplicitParam(name = "userId", value = "用户id", required = true, dataType = "int", paramType = "query")})public CommonResult<UserInfoVo> getUserById(@PathVariable Integer userId) {return CommonResult.<UserInfoVo>builder().data(userService.getUserInfoById(userId)).build();}@GetMapping("/setObjectQuestionScore")@ApiOperation("设置考试记录的客观题得分,设置总分为逻辑得分+客观题")@ApiImplicitParams({@ApiImplicitParam(name = "totalScore", value = "总成绩", required = true, dataType = "int", paramType = "query"),@ApiImplicitParam(name = "examRecordId", value = "考试记录id", required = true, dataType = "int", paramType = "query")})public CommonResult<Void> setObjectQuestionScore(Integer totalScore, Integer examRecordId) {examRecordService.setObjectQuestionScore(totalScore, examRecordId);return CommonResult.<Void>builder().build();}@GetMapping("/getExamPassRate")@ApiOperation("提供每一门考试的通过率数据(echarts绘图)")public CommonResult<List<String>> getExamPassRate() {return CommonResult.<List<String>>builder().data(examService.getExamPassRateEchartData()).build();}@GetMapping("/getExamNumbers")@ApiOperation("提供每一门考试的考试次数(echarts绘图)")public CommonResult<List<String>> getExamNumbers() {return CommonResult.<List<String>>builder().data(examService.getExamNumbersEchartData()).build();}
}

package com.wzz.controller;import com.wzz.entity.Exam;
import com.wzz.service.ExamService;
import com.wzz.service.NoticeService;
import com.wzz.service.QuestionBankService;
import com.wzz.vo.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;import java.util.List;@RestController
@RequiredArgsConstructor
@Api(tags = "三个角色公共的相关接口")
@RequestMapping(value = "/public")
public class PublicController {private final NoticeService noticeService;private final ExamService examService;private final QuestionBankService questionBankService;@PostMapping("/getExamInfo")@ApiOperation("根据信息查询考试的信息")@ApiImplicitParams({@ApiImplicitParam(name = "examQueryVo", value = "考试信息查询vo对象", required = true, dataType = "examQueryVo", paramType = "body")})public CommonResult<PageResponse<Exam>> getExamInfo(@RequestBody ExamQueryVo examQueryVo) {return CommonResult.<PageResponse<Exam>>builder().data(examService.getExamPage(examQueryVo)).build();}@GetMapping("/getExamInfoById")@ApiOperation("根据考试id查询考试的信息和题目列表")@ApiImplicitParams({@ApiImplicitParam(name = "examId", value = "考试id", required = true, dataType = "int", paramType = "query")})public CommonResult<AddExamByQuestionVo> getExamInfoById(@RequestParam Integer examId) {return CommonResult.<AddExamByQuestionVo>builder().data(examService.getExamInfoById(examId)).build();}@GetMapping("/allExamInfo")@ApiOperation("查询考试所有信息")public CommonResult<List<Exam>> allExamInfo() {return CommonResult.<List<Exam>>builder().data(examService.list(null)).build();}@GetMapping("/getBankHaveQuestionSumByType")@ApiOperation("获取题库中所有题目类型的数量")@ApiImplicitParams({@ApiImplicitParam(name = "bankName", value = "题库名称", dataType = "string", paramType = "query"),@ApiImplicitParam(name = "pageNo", value = "页面数", required = true, dataType = "int", paramType = "query"),@ApiImplicitParam(name = "pageSize", value = "页面大小", required = true, dataType = "int", paramType = "query"),})public CommonResult<PageResponse<BankHaveQuestionSum>> getBankHaveQuestionSumByType(@RequestParam(required = false) String bankName,Integer pageNo, Integer pageSize) {return CommonResult.<PageResponse<BankHaveQuestionSum>>builder().data(questionBankService.getBankHaveQuestionSumByType(bankName, pageNo, pageSize)).build();}@GetMapping("/getQuestionByBankIdAndType")@ApiOperation("根据题库id和题目类型获取题目信息 type(1单选 2多选 3判断)")@ApiImplicitParams({@ApiImplicitParam(name = "bankId", value = "题库id", required = true, dataType = "int", paramType = "query"),@ApiImplicitParam(name = "type", value = "题目类型", required = true, dataType = "int", paramType = "query"),})public CommonResult<List<QuestionVo>> getQuestionByBankIdAndType(Integer bankId, Integer type) {return CommonResult.<List<QuestionVo>>builder().data(questionBankService.getQuestionByBankIdAndType(bankId, type)).build();}@GetMapping("/getQuestionByBank")@ApiOperation("根据题库获取所有的题目信息(单选,多选,判断题)")@ApiImplicitParams({@ApiImplicitParam(name = "bankId", value = "题库id", required = true, dataType = "int", paramType = "query")})public CommonResult<List<QuestionVo>> getQuestionByBank(Integer bankId) {return CommonResult.<List<QuestionVo>>builder().data(questionBankService.getQuestionsByBankId(bankId)).build();}@GetMapping("/getCurrentNewNotice")@ApiOperation("获取当前系统最新的公告")public CommonResult<String> getCurrentNewNotice() {return CommonResult.<String>builder().data(noticeService.getCurrentNotice()).build();}
}

这篇关于基于Springboot+vue前后端分离防作弊考试系统的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/774443

相关文章

Vue3 的 shallowRef 和 shallowReactive:优化性能

大家对 Vue3 的 ref 和 reactive 都很熟悉,那么对 shallowRef 和 shallowReactive 是否了解呢? 在编程和数据结构中,“shallow”(浅层)通常指对数据结构的最外层进行操作,而不递归地处理其内部或嵌套的数据。这种处理方式关注的是数据结构的第一层属性或元素,而忽略更深层次的嵌套内容。 1. 浅层与深层的对比 1.1 浅层(Shallow) 定义

JVM 的类初始化机制

前言 当你在 Java 程序中new对象时,有没有考虑过 JVM 是如何把静态的字节码(byte code)转化为运行时对象的呢,这个问题看似简单,但清楚的同学相信也不会太多,这篇文章首先介绍 JVM 类初始化的机制,然后给出几个易出错的实例来分析,帮助大家更好理解这个知识点。 JVM 将字节码转化为运行时对象分为三个阶段,分别是:loading 、Linking、initialization

Spring Security 基于表达式的权限控制

前言 spring security 3.0已经可以使用spring el表达式来控制授权,允许在表达式中使用复杂的布尔逻辑来控制访问的权限。 常见的表达式 Spring Security可用表达式对象的基类是SecurityExpressionRoot。 表达式描述hasRole([role])用户拥有制定的角色时返回true (Spring security默认会带有ROLE_前缀),去

浅析Spring Security认证过程

类图 为了方便理解Spring Security认证流程,特意画了如下的类图,包含相关的核心认证类 概述 核心验证器 AuthenticationManager 该对象提供了认证方法的入口,接收一个Authentiaton对象作为参数; public interface AuthenticationManager {Authentication authenticate(Authenti

Spring Security--Architecture Overview

1 核心组件 这一节主要介绍一些在Spring Security中常见且核心的Java类,它们之间的依赖,构建起了整个框架。想要理解整个架构,最起码得对这些类眼熟。 1.1 SecurityContextHolder SecurityContextHolder用于存储安全上下文(security context)的信息。当前操作的用户是谁,该用户是否已经被认证,他拥有哪些角色权限…这些都被保

Spring Security基于数据库验证流程详解

Spring Security 校验流程图 相关解释说明(认真看哦) AbstractAuthenticationProcessingFilter 抽象类 /*** 调用 #requiresAuthentication(HttpServletRequest, HttpServletResponse) 决定是否需要进行验证操作。* 如果需要验证,则会调用 #attemptAuthentica

Spring Security 从入门到进阶系列教程

Spring Security 入门系列 《保护 Web 应用的安全》 《Spring-Security-入门(一):登录与退出》 《Spring-Security-入门(二):基于数据库验证》 《Spring-Security-入门(三):密码加密》 《Spring-Security-入门(四):自定义-Filter》 《Spring-Security-入门(五):在 Sprin

Java架构师知识体认识

源码分析 常用设计模式 Proxy代理模式Factory工厂模式Singleton单例模式Delegate委派模式Strategy策略模式Prototype原型模式Template模板模式 Spring5 beans 接口实例化代理Bean操作 Context Ioc容器设计原理及高级特性Aop设计原理Factorybean与Beanfactory Transaction 声明式事物

不懂推荐算法也能设计推荐系统

本文以商业化应用推荐为例,告诉我们不懂推荐算法的产品,也能从产品侧出发, 设计出一款不错的推荐系统。 相信很多新手产品,看到算法二字,多是懵圈的。 什么排序算法、最短路径等都是相对传统的算法(注:传统是指科班出身的产品都会接触过)。但对于推荐算法,多数产品对着网上搜到的资源,都会无从下手。特别当某些推荐算法 和 “AI”扯上关系后,更是加大了理解的难度。 但,不了解推荐算法,就无法做推荐系

这15个Vue指令,让你的项目开发爽到爆

1. V-Hotkey 仓库地址: github.com/Dafrok/v-ho… Demo: 戳这里 https://dafrok.github.io/v-hotkey 安装: npm install --save v-hotkey 这个指令可以给组件绑定一个或多个快捷键。你想要通过按下 Escape 键后隐藏某个组件,按住 Control 和回车键再显示它吗?小菜一碟: <template