该项目是一个前后端分离,后端使用 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在线考试系统相关推荐

  1. java项目:基于springboot+vue在线考试系统1013

    项目描述 springboot+vue在线考试系统: 使用目前较为流行的框架spring boot,前端部分采用了vue,项目的业务流程相对简单,该项目主要功能包括学生管理,教师管理,题库管理,成绩查 ...

  2. 基于SpringBoot+Vue在线考试系统【web端+小程序端】【附带源码】

    最近和不少大佬聊天,有的技术很牛,有的赚很多,有的已经是高管,有的有自己的公司. 通过聊天,我发现成功人的优点基本相同: 能吃苦,执行力强,自律性强. 喝了不少酒后,酒后吐真言,成功的人都不容易,说这 ...

  3. Springboot+vue在线考试系统源码,前后端分离

    Springboot+vue在线考试系统源码 开发语言:Java 数据库:Mysql 开发工具:Eclipse 使用技术: 后端:SpringBoot 前端:VUE 和 Element-UI 源码免费 ...

  4. 【毕业设计】基于SpingBoot+vue 在线考试系统(论文+源码+ppt+视频)

    作品描述 系统系基于 B/S 框架架构,采用SpringBoot和Vue.js实现系统.在此架构下进行系统开发,功能测试和调试Bug都十分方便.客户端只需安装Google Chrome等浏览器,服务端 ...

  5. Java项目:Springboot+vue在线考试系统

    作者主页:夜未央5788 简介:Java领域优质创作者.Java项目.学习资料.技术互助 文末获取源码 在线考试系统 项目介绍 该项目是一个前后端分离项目,后端使用 SpringBoot,前端使用 V ...

  6. 免费分享一个springboot+vue的办公系统

    springboot+vue的OA系统 项目介绍 项目部署 项目特点 项目展示 项目介绍 这是一个采用前后端分离开发的项目,前端采用 Vue 开发.后端采用 SpringBoot + Mybatis ...

  7. (免费分享)基于springboot,vue公司财务系统

    该系统是一个简单的公司财务管理系统,包含用户基本信息管理(员工管理,管理员管理),工资管理(员工工资管理,管理员工资管理),业务管理(员工业务管理,管理员业务管理),系统管理(系统留言公告,用户管理, ...

  8. 基于springboot的在线考试系统的设计与实现 毕业设计毕设参考

    后台功能 (1)网站初始化:设置网站名称.关键字.描述等 (2)系统设置:设置关于我们.联系我们.加入我们.法律声明 (3)资讯录入:选择资讯分类.录入资讯标题.简介.内容等 (4)资讯管理:查看所有 ...

  9. 基于javaweb的在线考试系统(单选,多选,判断,填空,简答题)(java+springboot+ssm+mysql+html)

    基于javaweb的在线考试系统(单选,多选,判断,填空,简答题)(java+springboot+ssm+mysql+html) 运行环境 Java≥8.MySQL≥5.7 开发工具 eclipse ...

最新文章

  1. 分数统计C语言,分数统计编程 求助!!!!!!!!!!!!!!!!!!!!!!...
  2. 如何让 Mybatis 自动生成代码
  3. Linux 学习_ssh(secure shell)
  4. Visual Studio 2022发布了,我最爱的5大特性
  5. (转载)【TP5.0】设置session有效时长+修改默认存储路径
  6. 无心剑中译切尼《当代的悖论》
  7. (最小生成树) Borg Maze -- POJ -- 3026
  8. 关于跨域的处理的几种方法的整理
  9. 怀才当遇网—毕业季 | 你总说毕业遥遥无期,转眼就各奔东西
  10. as ssd测试软件得分少,【科普贴】如何读懂AS SSD的测试数据
  11. 深圳免费旅游景点大全|深圳旅游攻略(下)
  12. python mac 启动台 图标 跳跃_详解macOS的Mac电脑上使用“启动台”(Launchpad)
  13. 手机中的照片不见了如何恢复
  14. Between Us 2 进化的史诗
  15. win7通过win10的ISO镜像免费升级正版win10(组图)
  16. 【功能实现】qrcode生成二维码Demo
  17. 获投5亿元E轮融资,百分点能否成为数据+AI领域的独角兽?
  18. 【饭谈】软素质怎么提高?(适合软件测试人的专用办法)
  19. gitbook搭建在线书籍
  20. [VIM] 配置选项说明

热门文章

  1. 能编程的游戏,你还等什么?
  2. 北上广深杭30K试题:JVM内存模型如何分配的?
  3. Android 指引蒙版的实现
  4. python利用opencv进行车牌号识别定位
  5. IDEA插件离线下载安装
  6. 极光IM + 极光推送,集成中遇到的问题
  7. visio 2007:方向键无法移动图像解决方法
  8. 三路DI和十路DO继电器输出,RS-485/232远程I/O模块 WJ71
  9. PHP multicraft_Multicraft中文网 - 动态新闻
  10. 现在QQ上的那些“黑客”们