(免费分享)基于springboot,vue在线考试系统
该项目是一个前后端分离,后端使用 SpringBoot,前端使用 VUE 和 Element-UI 组件库配合完成开发。
开发工具:IDEA,数据库:mysql5.7
源码获取:下方gongzhonghao,输入007
package com.exam.controller;import com.exam.entity.Admin;
import com.exam.entity.ApiResult;
import com.exam.serviceimpl.AdminServiceImpl;
import com.exam.util.ApiResultHandler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;@RestController
public class AdminController {private AdminServiceImpl adminService;@Autowiredpublic AdminController(AdminServiceImpl adminService){this.adminService = adminService;}@GetMapping("/admins")public ApiResult findAll(){System.out.println("查询全部");return ApiResultHandler.success(adminService.findAll());}@GetMapping("/admin/{adminId}")public ApiResult findById(@PathVariable("adminId") Integer adminId){System.out.println("根据ID查找");return ApiResultHandler.success(adminService.findById(adminId));}@DeleteMapping("/admin/{adminId}")public ApiResult deleteById(@PathVariable("adminId") Integer adminId){adminService.deleteById(adminId);return ApiResultHandler.success();}@PutMapping("/admin/{adminId}")public ApiResult update(@PathVariable("adminId") Integer adminId, Admin admin){return ApiResultHandler.success(adminService.update(admin));}@PostMapping("/admin")public ApiResult add(Admin admin){return ApiResultHandler.success(adminService.add(admin));}
}
package com.exam.controller;
import com.exam.entity.ApiResult;
import com.exam.entity.PaperManage;
import com.exam.service.PaperService;
import com.exam.serviceimpl.FillQuestionServiceImpl;
import com.exam.serviceimpl.JudgeQuestionServiceImpl;
import com.exam.serviceimpl.MultiQuestionServiceImpl;
import com.exam.util.ApiResultHandler;
import com.exam.vo.Item;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;import java.util.List;
@RestController
public class ItemController {@Autowired
MultiQuestionServiceImpl multiQuestionService;@Autowired
FillQuestionServiceImpl fillQuestionService;@Autowired
JudgeQuestionServiceImpl judgeQuestionService;@Autowired
PaperService paperService;@PostMapping("/item")
public ApiResult ItemController(@RequestBody Item item) {
// 选择题
Integer changeNumber = item.getChangeNumber();
// 填空题
Integer fillNumber = item.getFillNumber();
// 判断题
Integer judgeNumber = item.getJudgeNumber();
//出卷id
Integer paperId = item.getPaperId();// 选择题数据库获取
List<Integer> changeNumbers = multiQuestionService.findBySubject(item.getSubject(), changeNumber);
if(changeNumbers==null){
return ApiResultHandler.buildApiResult(400,"选择题数据库获取失败",null);
}
for (Integer number : changeNumbers) {
PaperManage paperManage = new PaperManage(paperId,1,number);
int index = paperService.add(paperManage);
if(index==0)
return ApiResultHandler.buildApiResult(400,"选择题组卷保存失败",null);
}// 填空题
List<Integer> fills = fillQuestionService.findBySubject(item.getSubject(), fillNumber);
if(fills==null)
return ApiResultHandler.buildApiResult(400,"填空题数据库获取失败",null);
for (Integer fillNum : fills) {
PaperManage paperManage = new PaperManage(paperId,2,fillNum);
int index = paperService.add(paperManage);
if(index==0)
return ApiResultHandler.buildApiResult(400,"填空题题组卷保存失败",null);
}
// 判断题
List<Integer> judges = judgeQuestionService.findBySubject(item.getSubject(), judgeNumber);
if(fills==null)
return ApiResultHandler.buildApiResult(400,"判断题数据库获取失败",null);
for (Integer judge : judges) {
PaperManage paperManage = new PaperManage(paperId,3,judge);
int index = paperService.add(paperManage);
if(index==0)
return ApiResultHandler.buildApiResult(400,"判断题题组卷保存失败",null);
}return ApiResultHandler.buildApiResult(200,"试卷组卷成功",null);
}
}
(免费分享)基于springboot,vue在线考试系统相关推荐
- java项目:基于springboot+vue在线考试系统1013
项目描述 springboot+vue在线考试系统: 使用目前较为流行的框架spring boot,前端部分采用了vue,项目的业务流程相对简单,该项目主要功能包括学生管理,教师管理,题库管理,成绩查 ...
- 基于SpringBoot+Vue在线考试系统【web端+小程序端】【附带源码】
最近和不少大佬聊天,有的技术很牛,有的赚很多,有的已经是高管,有的有自己的公司. 通过聊天,我发现成功人的优点基本相同: 能吃苦,执行力强,自律性强. 喝了不少酒后,酒后吐真言,成功的人都不容易,说这 ...
- Springboot+vue在线考试系统源码,前后端分离
Springboot+vue在线考试系统源码 开发语言:Java 数据库:Mysql 开发工具:Eclipse 使用技术: 后端:SpringBoot 前端:VUE 和 Element-UI 源码免费 ...
- 【毕业设计】基于SpingBoot+vue 在线考试系统(论文+源码+ppt+视频)
作品描述 系统系基于 B/S 框架架构,采用SpringBoot和Vue.js实现系统.在此架构下进行系统开发,功能测试和调试Bug都十分方便.客户端只需安装Google Chrome等浏览器,服务端 ...
- Java项目:Springboot+vue在线考试系统
作者主页:夜未央5788 简介:Java领域优质创作者.Java项目.学习资料.技术互助 文末获取源码 在线考试系统 项目介绍 该项目是一个前后端分离项目,后端使用 SpringBoot,前端使用 V ...
- 免费分享一个springboot+vue的办公系统
springboot+vue的OA系统 项目介绍 项目部署 项目特点 项目展示 项目介绍 这是一个采用前后端分离开发的项目,前端采用 Vue 开发.后端采用 SpringBoot + Mybatis ...
- (免费分享)基于springboot,vue公司财务系统
该系统是一个简单的公司财务管理系统,包含用户基本信息管理(员工管理,管理员管理),工资管理(员工工资管理,管理员工资管理),业务管理(员工业务管理,管理员业务管理),系统管理(系统留言公告,用户管理, ...
- 基于springboot的在线考试系统的设计与实现 毕业设计毕设参考
后台功能 (1)网站初始化:设置网站名称.关键字.描述等 (2)系统设置:设置关于我们.联系我们.加入我们.法律声明 (3)资讯录入:选择资讯分类.录入资讯标题.简介.内容等 (4)资讯管理:查看所有 ...
- 基于javaweb的在线考试系统(单选,多选,判断,填空,简答题)(java+springboot+ssm+mysql+html)
基于javaweb的在线考试系统(单选,多选,判断,填空,简答题)(java+springboot+ssm+mysql+html) 运行环境 Java≥8.MySQL≥5.7 开发工具 eclipse ...
最新文章
- 分数统计C语言,分数统计编程 求助!!!!!!!!!!!!!!!!!!!!!!...
- 如何让 Mybatis 自动生成代码
- Linux 学习_ssh(secure shell)
- Visual Studio 2022发布了,我最爱的5大特性
- (转载)【TP5.0】设置session有效时长+修改默认存储路径
- 无心剑中译切尼《当代的悖论》
- (最小生成树) Borg Maze -- POJ -- 3026
- 关于跨域的处理的几种方法的整理
- 怀才当遇网—毕业季 | 你总说毕业遥遥无期,转眼就各奔东西
- as ssd测试软件得分少,【科普贴】如何读懂AS SSD的测试数据
- 深圳免费旅游景点大全|深圳旅游攻略(下)
- python mac 启动台 图标 跳跃_详解macOS的Mac电脑上使用“启动台”(Launchpad)
- 手机中的照片不见了如何恢复
- Between Us 2 进化的史诗
- win7通过win10的ISO镜像免费升级正版win10(组图)
- 【功能实现】qrcode生成二维码Demo
- 获投5亿元E轮融资,百分点能否成为数据+AI领域的独角兽?
- 【饭谈】软素质怎么提高?(适合软件测试人的专用办法)
- gitbook搭建在线书籍
- [VIM] 配置选项说明