最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

Springboot+vue前后端分離考試系統(tǒng)

2022-04-19 12:20 作者:指南針畢業(yè)設計  | 我要投稿

?作者主頁:編程指南針


?簡介:Java領(lǐng)域優(yōu)質(zhì)創(chuàng)作者、CSDN博客專家? Java項目、簡歷模板、學習資料、面試題庫、技術(shù)互助

文末獲取源碼



項目編號:BS-XX-104

指南針考試系統(tǒng)是一個多角色在線培訓考試系統(tǒng),系統(tǒng)集成了用戶管理、角色管理、題庫管理、試題管理、考試管理、在線考試等功能,考試流程完善。實現(xiàn)一整套完整體系的考試系統(tǒng),方便用戶在此系統(tǒng)中進行練習并不斷提升自己,在考試中不斷進步。本系統(tǒng)采用前后端分離方式進行開發(fā)實現(xiàn),使用springboot+vue來進行開發(fā).

技術(shù)棧


  1. SpringBoot


  2. Mybatis-plus


  3. MySQL 5.7


  4. Vue全家桶


  5. ElementUI


  6. Redis


  7. Swagger


  8. 阿里云OSS


  9. Log4j

主要功能

1. 權(quán)限控制

本系統(tǒng)存在三個不同的角色,教師,管理員,學生三種用戶,此系統(tǒng)是基于vue+springboot實現(xiàn)的前后端分離,用戶權(quán)限校驗通過JWT生成token令牌發(fā)放到用戶,并根據(jù)令牌對用戶的身份合法性進行校驗。

2. 在線考試

學生用戶在注冊登錄之后,可以在本系統(tǒng)進行在線的考試,考試可由教師和管理員進行布置并設置考試權(quán)限(公開,密碼),考試題型分為 單選、多選、判斷、簡答題,并支持題目附帶配圖。考試過程中需開啟攝像頭進行考試,系統(tǒng)會自動抓拍考生實時考試狀態(tài)。

3. 成績模塊

參加考試后的學生用戶,在提交試卷后進入考試結(jié)果頁面,頁面會自動核對學生用戶的邏輯題的對錯,對于簡答題需要老師或者超級管理員進行批閱。對于學生用戶參與的考試,學生用戶可以查看到考試的詳情并可以查看到自己所錯的邏輯題。

4. 題庫模塊

學生用戶在題庫模塊中可以進行題目的功能訓練,訓練模式分為,順序練習,隨機練習,也可以根據(jù)題型練習(單選,多選,判斷)。用戶答題時會實時判斷正確與否,并有錯題解析功能。

5. 題庫管理

超級管理員和教師可以對本考試系統(tǒng)已有的題庫進行管理,實現(xiàn)對題庫信息的CRUD操作

6. 試題管理

教師和系統(tǒng)管理員用戶有權(quán)限對本系統(tǒng)的所有試題進行操作,本系統(tǒng)試題支持復雜類型的題目,考試題目支持多插圖,選項答案支持單插圖功能。

7. 考試管理

教師和系統(tǒng)管理員用戶有權(quán)限對系統(tǒng)存在的考試進行操作,本系統(tǒng)考試支持公開考試和密碼口令考試,并可以對考試進行禁用也可以在設置考試時間段,對于考試可以進行很便利的進行組卷,系統(tǒng)內(nèi)置兩種組卷模式,題庫組卷和自由選題組卷。

8. 考卷批閱

對于本系統(tǒng)中存在的復雜考試的題目,可以又對應的老師進行批閱,此系統(tǒng)的邏輯題無需老師用戶進行批閱,老師的工作僅僅是批閱簡答題這種無準確答案類型的題目,極大地減輕了老師用戶的工作量

9. 考試統(tǒng)計

本系統(tǒng)針對每一次考試進行數(shù)據(jù)統(tǒng)計和報表,讓使用本系統(tǒng)的老師用戶能夠直觀的了解到每一次考試人員的進步。

10. 用戶管理

超級管理員可以對注冊本系統(tǒng)用戶的進行授權(quán),并擁有操作一切用戶的權(quán)限。

下面展示一下系統(tǒng)的主要功能:


登陸:


后臺管理首頁


題庫管理


試題管理

考試管理


閱卷管理


考試統(tǒng)計


公告管理


用戶管理

教師登陸



學生登陸


在線考試:考試時要調(diào)出攝相頭進行監(jiān)控


查看個人成績和錯題:并為通過考試的生成證書



日常題庫訓練



部門核心代碼:

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 = "超級管理員權(quán)限相關(guān)的接口")@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 = "系統(tǒng)用戶實體", 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("查詢系統(tǒng)存在的所有角色信息") ? ?public CommonResult<List<UserRole>> getRole() { ? ? ? ?return CommonResult.<List<UserRole>>builder() ? ? ? ? ? ? ? ?.data(userRoleService.getUserRole()) ? ? ? ? ? ? ? ?.build(); ? ?} ? ?@GetMapping("/getAllNotice") ? ?@ApiOperation("獲取系統(tǒng)發(fā)布的所有公告(分頁 條件查詢 ?二合一接口)") ? ?@ApiImplicitParams({ ? ? ? ? ? ?@ApiImplicitParam(name = "noticeContent", value = "搜索公告內(nèi)容", dataType = "string", paramType = "query"), ? ? ? ? ? ?@ApiImplicitParam(name = "pageNo", value = "查詢結(jié)果分頁當前頁面", required = true, dataType = "int", paramType = "query"), ? ? ? ? ? ?@ApiImplicitParam(name = "pageSize", value = "查詢結(jié)果的頁面條數(shù)大小", 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("發(fā)布新公告") ? ?@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 = "系統(tǒng)公告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 = "學生權(quán)限相關(guān)的接口")@RequestMapping(value = "/student")public class StudentController { ? ?private final ExamRecordServiceImpl examRecordService; ? ?private final QuestionService questionService; ? ?private final ExamQuestionService examQuestionService; ? ?@GetMapping("/getMyGrade") ? ?@ApiOperation("獲取個人成績(分頁 根據(jù)考試名查詢)") ? ?@ApiImplicitParams({@ApiImplicitParam(name = "username", value = "系統(tǒng)唯一用戶名", required = true, dataType = "string", paramType = "query"), @ApiImplicitParam(name = "pageNo", value = "當前頁面數(shù)", 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 優(yōu)化成多id一次查詢 ? ?@GetMapping("/getQuestionById/{id}") ? ?@ApiOperation("根據(jù)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("根據(jù)考試的記錄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("根據(jù)考試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 = "老師權(quán)限相關(guān)的接口")@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 = "問題內(nèi)容", dataType = "string", paramType = "query"), ? ? ? ? ? ?@ApiImplicitParam(name = "pageNo", value = "頁面數(shù)", 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("根據(jù)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("根據(jù)題庫添加考試") ? ?@ApiImplicitParams({ ? ? ? ? ? ?@ApiImplicitParam(name = "addExamByBankVo", value = "根據(jù)題庫添加考試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("根據(jù)題目列表添加考試") ? ?@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 = "頁面數(shù)", 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("根據(jù)用戶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("提供每一門考試的通過率數(shù)據(jù)(echarts繪圖)") ? ?public CommonResult<List<String>> getExamPassRate() { ? ? ? ?return CommonResult.<List<String>>builder() ? ? ? ? ? ? ? ?.data(examService.getExamPassRateEchartData()) ? ? ? ? ? ? ? ?.build(); ? ?} ? ?@GetMapping("/getExamNumbers") ? ?@ApiOperation("提供每一門考試的考試次數(shù)(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 = "三個角色公共的相關(guān)接口")@RequestMapping(value = "/public")public class PublicController { ? ?private final NoticeService noticeService; ? ?private final ExamService examService; ? ?private final QuestionBankService questionBankService; ? ?@PostMapping("/getExamInfo") ? ?@ApiOperation("根據(jù)信息查詢考試的信息") ? ?@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("根據(jù)考試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("獲取題庫中所有題目類型的數(shù)量") ? ?@ApiImplicitParams({ ? ? ? ? ? ?@ApiImplicitParam(name = "bankName", value = "題庫名稱", dataType = "string", paramType = "query"), ? ? ? ? ? ?@ApiImplicitParam(name = "pageNo", value = "頁面數(shù)", 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("根據(jù)題庫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("根據(jù)題庫獲取所有的題目信息(單選,多選,判斷題)") ? ?@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("獲取當前系統(tǒng)最新的公告") ? ?public CommonResult<String> getCurrentNewNotice() { ? ? ? ?return CommonResult.<String>builder() ? ? ? ? ? ? ? ?.data(noticeService.getCurrentNotice()) ? ? ? ? ? ? ? ?.build(); ? ?} }



Springboot+vue前后端分離考試系統(tǒng)的評論 (共 條)

分享到微博請遵守國家法律
鲜城| 六枝特区| 开原市| 永德县| 牙克石市| 包头市| 周口市| 宁武县| 沁源县| 金乡县| 紫金县| 莱州市| 安图县| 晋城| 肃宁县| 沙坪坝区| 临猗县| 普兰县| 和政县| 福建省| 龙山县| 科技| 安吉县| 东乡族自治县| 木里| 扶沟县| 乌拉特中旗| 南充市| 壤塘县| 白朗县| 英超| 五华县| 宜兴市| 神木县| 岳西县| 康乐县| 合阳县| 阳曲县| 安福县| 普定县| 花莲县|