├── exam ├── static │ ├── .gitkeep │ └── img │ │ ├── icon.png │ │ └── userimg.png ├── config │ ├── prod.env.js │ ├── dev.env.js │ └── index.js ├── build │ ├── logo.png │ ├── vue-loader.conf.js │ ├── build.js │ ├── check-versions.js │ ├── utils.js │ ├── webpack.base.conf.js │ ├── webpack.dev.conf.js │ └── webpack.prod.conf.js ├── src │ ├── assets │ │ ├── logo.png │ │ └── img │ │ │ ├── cry1.gif │ │ │ ├── cry2.jpg │ │ │ ├── good1.jpg │ │ │ ├── good2.gif │ │ │ ├── icon.png │ │ │ ├── evening.png │ │ │ ├── loginbg.png │ │ │ └── userimg.png │ ├── components │ │ ├── common │ │ │ ├── mainTop.vue │ │ │ ├── navigator.vue │ │ │ ├── hello.vue │ │ │ ├── mainLeft.vue │ │ │ └── header.vue │ │ ├── teacher │ │ │ ├── answerDescription.vue │ │ │ ├── examDescription.vue │ │ │ ├── addStudent.vue │ │ │ ├── selectAnswer.vue │ │ │ ├── allStudentsGrade.vue │ │ │ ├── addAnswer.vue │ │ │ ├── selectExamToPart.vue │ │ │ ├── addExam.vue │ │ │ ├── studentManage.vue │ │ │ └── selectExam.vue │ │ ├── student │ │ │ ├── myFooter.vue │ │ │ ├── manager.vue │ │ │ ├── index.vue │ │ │ ├── scoreTable.vue │ │ │ ├── answerScore.vue │ │ │ └── myExam.vue │ │ ├── admin │ │ │ ├── index.vue │ │ │ ├── addTeacher.vue │ │ │ └── tacherManage.vue │ │ └── charts │ │ │ ├── grade.vue │ │ │ └── scorePart.vue │ ├── App.vue │ ├── vuex │ │ ├── Demo.vue │ │ └── store.js │ ├── main.js │ └── router │ │ └── index.js ├── .editorconfig ├── .gitignore ├── .babelrc ├── .postcssrc.js ├── README.md ├── index.html └── package.json ├── img ├── 删除试卷.png ├── 后台管理.png ├── 学生管理.png ├── 提前交卷.png ├── 添加考试.png ├── 添加试题.png ├── 留言模块.png ├── 登录.png ├── 答题模块.png ├── 练习模式.png ├── 考试查询.png ├── 试卷列表.png ├── 回复留言模块.png ├── 学生分数查询.png ├── 编辑试卷信息.png ├── 学生成绩折线图.png └── 提交试卷显示分数.png ├── springboot ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── src │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── exam │ │ │ │ ├── vo │ │ │ │ ├── AnswerVO.java │ │ │ │ └── Item.java │ │ │ │ ├── service │ │ │ │ ├── AnswerService.java │ │ │ │ ├── AdminService.java │ │ │ │ ├── LoginService.java │ │ │ │ ├── ReplayService.java │ │ │ │ ├── PaperService.java │ │ │ │ ├── MessageService.java │ │ │ │ ├── ScoreService.java │ │ │ │ ├── StudentService.java │ │ │ │ ├── TeacherService.java │ │ │ │ ├── FillQuestionService.java │ │ │ │ ├── JudgeQuestionService.java │ │ │ │ ├── MultiQuestionService.java │ │ │ │ └── ExamManageService.java │ │ │ │ ├── entity │ │ │ │ ├── PaperManage.java │ │ │ │ ├── Replay.java │ │ │ │ ├── JudgeQuestion.java │ │ │ │ ├── FillQuestion.java │ │ │ │ ├── Score.java │ │ │ │ ├── Teacher.java │ │ │ │ ├── Login.java │ │ │ │ ├── Message.java │ │ │ │ ├── MultiQuestion.java │ │ │ │ ├── ExamManage.java │ │ │ │ ├── ApiResult.java │ │ │ │ ├── Admin.java │ │ │ │ └── Student.java │ │ │ │ ├── ExamsystemApplication.java │ │ │ │ ├── MybatisPlusConfig.java │ │ │ │ ├── serviceimpl │ │ │ │ ├── AnswerServiceImpl.java │ │ │ │ ├── PaperServiceImpl.java │ │ │ │ ├── LoginServiceImpl.java │ │ │ │ ├── AdminServiceImpl.java │ │ │ │ ├── MessageServiceImpl.java │ │ │ │ ├── ReplayServiceImpl.java │ │ │ │ ├── ScoreServiceImpl.java │ │ │ │ ├── TeacherServiceImpl.java │ │ │ │ ├── StudentServiceImpl.java │ │ │ │ ├── FillQuestionServiceImpl.java │ │ │ │ ├── MultiQuestionServiceImpl.java │ │ │ │ ├── JudgeQuestionServiceImpl.java │ │ │ │ └── ExamManageServiceImpl.java │ │ │ │ ├── mapper │ │ │ │ ├── AnswerMapper.java │ │ │ │ ├── PaperMapper.java │ │ │ │ ├── LoginMapper.java │ │ │ │ ├── AdminMapper.java │ │ │ │ ├── ReplayMapper.java │ │ │ │ ├── MessageMapper.java │ │ │ │ ├── FillQuestionMapper.java │ │ │ │ ├── TeacherMapper.java │ │ │ │ ├── JudgeQuestionMapper.java │ │ │ │ ├── ScoreMapper.java │ │ │ │ ├── StudentMapper.java │ │ │ │ ├── ExamManageMapper.java │ │ │ │ └── MultiQuestionMapper.java │ │ │ │ ├── util │ │ │ │ └── ApiResultHandler.java │ │ │ │ └── controller │ │ │ │ ├── AnswerController.java │ │ │ │ ├── ReplayController.java │ │ │ │ ├── FillQuestionController.java │ │ │ │ ├── JudgeQuestionController.java │ │ │ │ ├── MultiQuestionController.java │ │ │ │ ├── LoginController.java │ │ │ │ ├── AdminController.java │ │ │ │ ├── MessageController.java │ │ │ │ ├── TeacherController.java │ │ │ │ ├── PaperController.java │ │ │ │ ├── ScoreController.java │ │ │ │ ├── StudentController.java │ │ │ │ ├── ItemController.java │ │ │ │ └── ExamManageController.java │ │ └── resources │ │ │ └── application.properties │ └── test │ │ └── java │ │ └── com │ │ └── exam │ │ └── ExamsystemApplicationTests.java ├── .gitignore └── pom.xml └── README.md /exam/static/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /img/删除试卷.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YXJ2018/SpringBoot-Vue-OnlineExam/HEAD/img/删除试卷.png -------------------------------------------------------------------------------- /img/后台管理.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YXJ2018/SpringBoot-Vue-OnlineExam/HEAD/img/后台管理.png -------------------------------------------------------------------------------- /img/学生管理.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YXJ2018/SpringBoot-Vue-OnlineExam/HEAD/img/学生管理.png -------------------------------------------------------------------------------- /img/提前交卷.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YXJ2018/SpringBoot-Vue-OnlineExam/HEAD/img/提前交卷.png -------------------------------------------------------------------------------- /img/添加考试.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YXJ2018/SpringBoot-Vue-OnlineExam/HEAD/img/添加考试.png -------------------------------------------------------------------------------- /img/添加试题.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YXJ2018/SpringBoot-Vue-OnlineExam/HEAD/img/添加试题.png -------------------------------------------------------------------------------- /img/留言模块.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YXJ2018/SpringBoot-Vue-OnlineExam/HEAD/img/留言模块.png -------------------------------------------------------------------------------- /img/登录.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YXJ2018/SpringBoot-Vue-OnlineExam/HEAD/img/登录.png -------------------------------------------------------------------------------- /img/答题模块.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YXJ2018/SpringBoot-Vue-OnlineExam/HEAD/img/答题模块.png -------------------------------------------------------------------------------- /img/练习模式.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YXJ2018/SpringBoot-Vue-OnlineExam/HEAD/img/练习模式.png -------------------------------------------------------------------------------- /img/考试查询.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YXJ2018/SpringBoot-Vue-OnlineExam/HEAD/img/考试查询.png -------------------------------------------------------------------------------- /img/试卷列表.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YXJ2018/SpringBoot-Vue-OnlineExam/HEAD/img/试卷列表.png -------------------------------------------------------------------------------- /img/回复留言模块.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YXJ2018/SpringBoot-Vue-OnlineExam/HEAD/img/回复留言模块.png -------------------------------------------------------------------------------- /img/学生分数查询.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YXJ2018/SpringBoot-Vue-OnlineExam/HEAD/img/学生分数查询.png -------------------------------------------------------------------------------- /img/编辑试卷信息.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YXJ2018/SpringBoot-Vue-OnlineExam/HEAD/img/编辑试卷信息.png -------------------------------------------------------------------------------- /exam/config/prod.env.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | module.exports = { 3 | NODE_ENV: '"production"' 4 | } 5 | -------------------------------------------------------------------------------- /img/学生成绩折线图.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YXJ2018/SpringBoot-Vue-OnlineExam/HEAD/img/学生成绩折线图.png -------------------------------------------------------------------------------- /img/提交试卷显示分数.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YXJ2018/SpringBoot-Vue-OnlineExam/HEAD/img/提交试卷显示分数.png -------------------------------------------------------------------------------- /exam/build/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YXJ2018/SpringBoot-Vue-OnlineExam/HEAD/exam/build/logo.png -------------------------------------------------------------------------------- /exam/src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YXJ2018/SpringBoot-Vue-OnlineExam/HEAD/exam/src/assets/logo.png -------------------------------------------------------------------------------- /exam/static/img/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YXJ2018/SpringBoot-Vue-OnlineExam/HEAD/exam/static/img/icon.png -------------------------------------------------------------------------------- /exam/static/img/userimg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YXJ2018/SpringBoot-Vue-OnlineExam/HEAD/exam/static/img/userimg.png -------------------------------------------------------------------------------- /exam/src/assets/img/cry1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YXJ2018/SpringBoot-Vue-OnlineExam/HEAD/exam/src/assets/img/cry1.gif -------------------------------------------------------------------------------- /exam/src/assets/img/cry2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YXJ2018/SpringBoot-Vue-OnlineExam/HEAD/exam/src/assets/img/cry2.jpg -------------------------------------------------------------------------------- /exam/src/assets/img/good1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YXJ2018/SpringBoot-Vue-OnlineExam/HEAD/exam/src/assets/img/good1.jpg -------------------------------------------------------------------------------- /exam/src/assets/img/good2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YXJ2018/SpringBoot-Vue-OnlineExam/HEAD/exam/src/assets/img/good2.gif -------------------------------------------------------------------------------- /exam/src/assets/img/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YXJ2018/SpringBoot-Vue-OnlineExam/HEAD/exam/src/assets/img/icon.png -------------------------------------------------------------------------------- /exam/src/assets/img/evening.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YXJ2018/SpringBoot-Vue-OnlineExam/HEAD/exam/src/assets/img/evening.png -------------------------------------------------------------------------------- /exam/src/assets/img/loginbg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YXJ2018/SpringBoot-Vue-OnlineExam/HEAD/exam/src/assets/img/loginbg.png -------------------------------------------------------------------------------- /exam/src/assets/img/userimg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YXJ2018/SpringBoot-Vue-OnlineExam/HEAD/exam/src/assets/img/userimg.png -------------------------------------------------------------------------------- /exam/src/components/common/mainTop.vue: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /springboot/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YXJ2018/SpringBoot-Vue-OnlineExam/HEAD/springboot/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /springboot/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip 2 | -------------------------------------------------------------------------------- /exam/config/dev.env.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const merge = require('webpack-merge') 3 | const prodEnv = require('./prod.env') 4 | 5 | module.exports = merge(prodEnv, { 6 | NODE_ENV: '"development"' 7 | }) 8 | -------------------------------------------------------------------------------- /exam/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /exam/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | /dist/ 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | 8 | # Editor directories and files 9 | yarn.lock 10 | .idea 11 | .vscode 12 | *.suo 13 | *.ntvs* 14 | *.njsproj 15 | *.sln 16 | -------------------------------------------------------------------------------- /exam/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | ["env", { 4 | "modules": false, 5 | "targets": { 6 | "browsers": ["> 1%", "last 2 versions", "not ie <= 8"] 7 | } 8 | }], 9 | "stage-2" 10 | ], 11 | "plugins": ["transform-vue-jsx", "transform-runtime"] 12 | } 13 | -------------------------------------------------------------------------------- /exam/.postcssrc.js: -------------------------------------------------------------------------------- 1 | // https://github.com/michael-ciniawsky/postcss-load-config 2 | 3 | module.exports = { 4 | "plugins": { 5 | "postcss-import": {}, 6 | "postcss-url": {}, 7 | // to edit target browsers: use "browserslist" field in package.json 8 | "autoprefixer": {} 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/vo/AnswerVO.java: -------------------------------------------------------------------------------- 1 | package com.exam.vo; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class AnswerVO { 7 | private String question; 8 | private String subject; 9 | private String score; 10 | private String section; 11 | private String level; 12 | private String type; 13 | } 14 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/service/AnswerService.java: -------------------------------------------------------------------------------- 1 | package com.exam.service; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.exam.vo.AnswerVO; 6 | 7 | public interface AnswerService { 8 | 9 | IPage findAll(Page page); 10 | } 11 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/vo/Item.java: -------------------------------------------------------------------------------- 1 | package com.exam.vo; 2 | 3 | import lombok.Data; 4 | 5 | //题目模型 6 | @Data 7 | public class Item { 8 | 9 | private String subject; 10 | 11 | private Integer paperId; 12 | 13 | private Integer changeNumber; 14 | 15 | private Integer fillNumber; 16 | 17 | private Integer judgeNumber; 18 | } 19 | -------------------------------------------------------------------------------- /springboot/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/entity/PaperManage.java: -------------------------------------------------------------------------------- 1 | package com.exam.entity; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | 7 | @Data 8 | @NoArgsConstructor 9 | @AllArgsConstructor 10 | public class PaperManage { 11 | private Integer paperId; 12 | 13 | private Integer questionType; 14 | 15 | private Integer questionId; 16 | 17 | 18 | } -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/service/AdminService.java: -------------------------------------------------------------------------------- 1 | package com.exam.service; 2 | 3 | import com.exam.entity.Admin; 4 | 5 | import java.util.List; 6 | 7 | public interface AdminService{ 8 | 9 | public List findAll(); 10 | 11 | public Admin findById(Integer adminId); 12 | 13 | public int deleteById(int adminId); 14 | 15 | public int update(Admin admin); 16 | 17 | public int add(Admin admin); 18 | } 19 | -------------------------------------------------------------------------------- /exam/README.md: -------------------------------------------------------------------------------- 1 | # 项目介绍及启动说明 2 | 3 | > 在线考试系统-前端项目文件。 4 | 5 | ### 安装建议 6 | 7 | > 建议使用`yarn`来安装项目依赖,首先安装yarn,然后设置yarn源为淘宝镜像 8 | 9 | ``` bash 10 | # 安装yarn 11 | npm install yarn -g 12 | 13 | # 查看是否安装成功 14 | yarn -v 15 | 16 | # 设置yarn源为淘宝镜像源 17 | yarn config set registry https://registry.npm.taobao.org 18 | 19 | # 安装依赖 20 | yarn install or npm install 21 | 22 | # 启动项目 23 | yarn dev or npm run dev 24 | 25 | # 打包构建 26 | yarn build or npm run build 27 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/entity/Replay.java: -------------------------------------------------------------------------------- 1 | package com.exam.entity; 2 | 3 | 4 | import com.fasterxml.jackson.annotation.JsonFormat; 5 | import lombok.Data; 6 | 7 | import java.util.Date; 8 | 9 | @Data 10 | public class Replay { 11 | private Integer messageId; 12 | 13 | private Integer replayId; 14 | 15 | private String replay; 16 | 17 | @JsonFormat(pattern = "yyyy-MM-dd", timezone="GMT+8") 18 | private Date replayTime; 19 | } -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/service/LoginService.java: -------------------------------------------------------------------------------- 1 | package com.exam.service; 2 | 3 | import com.exam.entity.Admin; 4 | import com.exam.entity.Student; 5 | import com.exam.entity.Teacher; 6 | 7 | public interface LoginService { 8 | 9 | public Admin adminLogin(Integer username, String password); 10 | 11 | public Teacher teacherLogin(Integer username, String password); 12 | 13 | public Student studentLogin(Integer username, String password); 14 | } 15 | -------------------------------------------------------------------------------- /springboot/src/test/java/com/exam/ExamsystemApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.exam; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class ExamsystemApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | 18 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/service/ReplayService.java: -------------------------------------------------------------------------------- 1 | package com.exam.service; 2 | 3 | import com.exam.entity.Replay; 4 | 5 | import java.util.List; 6 | 7 | public interface ReplayService { 8 | 9 | List findAll(); 10 | 11 | List findAllById(Integer messageId); 12 | 13 | Replay findById(Integer replayId); 14 | 15 | int delete(Integer replayId); 16 | 17 | int update(Replay replay); 18 | 19 | int add(Replay replay); 20 | } 21 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/entity/JudgeQuestion.java: -------------------------------------------------------------------------------- 1 | package com.exam.entity; 2 | 3 | import lombok.Data; 4 | 5 | //判断题实体类 6 | @Data 7 | public class JudgeQuestion { 8 | private Integer questionId; 9 | 10 | private String subject; 11 | 12 | private String question; 13 | 14 | private String answer; 15 | 16 | private String level; 17 | 18 | private String section; 19 | 20 | private Integer score; 21 | 22 | private String analysis; //题目解析 23 | } -------------------------------------------------------------------------------- /springboot/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=8080 2 | spring.datasource.username=root 3 | spring.datasource.password=123456 4 | spring.datasource.url=jdbc:mysql://localhost:3306/exam?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=UTC 5 | spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver 6 | spring.datasource.type=com.alibaba.druid.pool.DruidDataSource 7 | mybatis.configuration.mapUnderscoreToCamelCase=true 8 | logging.level.com.exam.mapper=debug -------------------------------------------------------------------------------- /exam/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 去吧皮卡丘 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/entity/FillQuestion.java: -------------------------------------------------------------------------------- 1 | package com.exam.entity; 2 | 3 | import lombok.Data; 4 | 5 | //填空题实体类 6 | @Data 7 | public class FillQuestion { 8 | private Integer questionId; 9 | 10 | private String subject; 11 | 12 | private String question; 13 | 14 | private String answer; 15 | 16 | private Integer score; 17 | 18 | private String level; 19 | 20 | private String section; 21 | 22 | private String analysis; //题目解析 23 | } 24 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/entity/Score.java: -------------------------------------------------------------------------------- 1 | package com.exam.entity; 2 | 3 | import lombok.Data; 4 | 5 | import java.util.Date; 6 | 7 | @Data 8 | public class Score { 9 | private Integer examCode; 10 | 11 | private Integer studentId; 12 | 13 | private String subject; 14 | 15 | private Integer ptScore; 16 | 17 | private Integer etScore; 18 | 19 | private Integer score; 20 | 21 | private Integer scoreId; 22 | 23 | private String answerDate; 24 | } -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/service/PaperService.java: -------------------------------------------------------------------------------- 1 | package com.exam.service; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.exam.entity.PaperManage; 6 | 7 | import java.util.List; 8 | 9 | public interface PaperService { 10 | 11 | List findAll(); 12 | 13 | List findById(Integer paperId); 14 | 15 | int add(PaperManage paperManage); 16 | } 17 | -------------------------------------------------------------------------------- /exam/src/App.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 12 | 13 | 29 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/entity/Teacher.java: -------------------------------------------------------------------------------- 1 | package com.exam.entity; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class Teacher { 7 | private Integer teacherId; 8 | 9 | private String teacherName; 10 | 11 | private String institute; 12 | 13 | private String sex; 14 | 15 | private String tel; 16 | 17 | private String email; 18 | 19 | private String pwd; 20 | 21 | private String cardId; 22 | 23 | private String type; 24 | 25 | private String role; 26 | } -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/service/MessageService.java: -------------------------------------------------------------------------------- 1 | package com.exam.service; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.exam.entity.Message; 6 | 7 | public interface MessageService { 8 | IPage findAll(Page page); 9 | 10 | Message findById(Integer id); 11 | 12 | int delete(Integer id); 13 | 14 | int update(Message message); 15 | 16 | int add(Message message); 17 | } 18 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/ExamsystemApplication.java: -------------------------------------------------------------------------------- 1 | package com.exam; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; 6 | 7 | @SpringBootApplication() 8 | public class ExamsystemApplication { 9 | 10 | public static void main(String[] args) { 11 | SpringApplication.run(ExamsystemApplication.class, args); 12 | } 13 | 14 | } 15 | 16 | -------------------------------------------------------------------------------- /exam/src/vuex/Demo.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 25 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/entity/Login.java: -------------------------------------------------------------------------------- 1 | package com.exam.entity; 2 | 3 | public class Login { 4 | private Integer username; 5 | private String password; 6 | 7 | public Integer getUsername() { 8 | return username; 9 | } 10 | 11 | public void setUsername(Integer username) { 12 | this.username = username; 13 | } 14 | 15 | public String getPassword() { 16 | return password; 17 | } 18 | 19 | public void setPassword(String password) { 20 | this.password = password; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/entity/Message.java: -------------------------------------------------------------------------------- 1 | package com.exam.entity; 2 | 3 | import com.fasterxml.jackson.annotation.JsonFormat; 4 | import lombok.Data; 5 | 6 | import java.util.Date; 7 | import java.util.List; 8 | 9 | @Data 10 | public class Message { 11 | private Integer id; 12 | private Integer temp_id;//解决id为null创建的一个临时id 13 | 14 | private String title; 15 | 16 | private String content; 17 | 18 | @JsonFormat(pattern = "yyyy-MM-dd", timezone="GMT+8") 19 | private Date time; 20 | 21 | List replays; //一对多关系,评论信息 22 | } -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/service/ScoreService.java: -------------------------------------------------------------------------------- 1 | package com.exam.service; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.exam.entity.Score; 6 | 7 | import java.util.List; 8 | 9 | public interface ScoreService { 10 | int add(Score score); 11 | 12 | List findAll(); 13 | 14 | IPage findById(Page page, Integer studentId); 15 | 16 | List findById(Integer studentId); 17 | 18 | List findByExamCode(Integer examCode); 19 | } 20 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/service/StudentService.java: -------------------------------------------------------------------------------- 1 | package com.exam.service; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.exam.entity.Student; 6 | 7 | import java.util.List; 8 | 9 | public interface StudentService { 10 | 11 | IPage findAll(Page page); 12 | 13 | Student findById(Integer studentId); 14 | 15 | int deleteById(Integer studentId); 16 | 17 | int update(Student student); 18 | 19 | int updatePwd(Student student); 20 | int add(Student student); 21 | } 22 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/entity/MultiQuestion.java: -------------------------------------------------------------------------------- 1 | package com.exam.entity; 2 | 3 | import lombok.Data; 4 | 5 | // 选择题实体 6 | @Data 7 | public class MultiQuestion { 8 | private Integer questionId; 9 | 10 | private String subject; 11 | 12 | private String section; 13 | 14 | private String answerA; 15 | 16 | private String answerB; 17 | 18 | private String answerC; 19 | 20 | private String answerD; 21 | 22 | private String question; 23 | 24 | private String level; 25 | 26 | private String rightAnswer; 27 | 28 | private String analysis; //题目解析 29 | 30 | private Integer score; 31 | 32 | } -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/service/TeacherService.java: -------------------------------------------------------------------------------- 1 | package com.exam.service; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.exam.entity.Teacher; 6 | 7 | import java.util.List; 8 | 9 | public interface TeacherService { 10 | 11 | IPage findAll(Page page); 12 | 13 | public List findAll(); 14 | 15 | public Teacher findById(Integer teacherId); 16 | 17 | public int deleteById(Integer teacherId); 18 | 19 | public int update(Teacher teacher); 20 | 21 | public int add(Teacher teacher); 22 | } 23 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/service/FillQuestionService.java: -------------------------------------------------------------------------------- 1 | package com.exam.service; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.exam.entity.FillQuestion; 6 | 7 | import java.util.List; 8 | 9 | public interface FillQuestionService { 10 | 11 | List findByIdAndType(Integer paperId); 12 | 13 | IPage findAll(Page page); 14 | 15 | FillQuestion findOnlyQuestionId(); 16 | 17 | int add(FillQuestion fillQuestion); 18 | 19 | List findBySubject(String subject,Integer pageNo); 20 | } 21 | -------------------------------------------------------------------------------- /exam/build/vue-loader.conf.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const utils = require('./utils') 3 | const config = require('../config') 4 | const isProduction = process.env.NODE_ENV === 'production' 5 | const sourceMapEnabled = isProduction 6 | ? config.build.productionSourceMap 7 | : config.dev.cssSourceMap 8 | 9 | module.exports = { 10 | loaders: utils.cssLoaders({ 11 | sourceMap: sourceMapEnabled, 12 | extract: isProduction 13 | }), 14 | cssSourceMap: sourceMapEnabled, 15 | cacheBusting: config.dev.cacheBusting, 16 | transformToRequire: { 17 | video: ['src', 'poster'], 18 | source: 'src', 19 | img: 'src', 20 | image: 'xlink:href' 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/service/JudgeQuestionService.java: -------------------------------------------------------------------------------- 1 | package com.exam.service; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.exam.entity.JudgeQuestion; 6 | 7 | import java.util.List; 8 | 9 | public interface JudgeQuestionService { 10 | 11 | List findByIdAndType(Integer paperId); 12 | 13 | IPage findAll(Page page); 14 | 15 | JudgeQuestion findOnlyQuestionId(); 16 | 17 | int add(JudgeQuestion judgeQuestion); 18 | 19 | List findBySubject(String subject,Integer pageNo); 20 | } 21 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/service/MultiQuestionService.java: -------------------------------------------------------------------------------- 1 | package com.exam.service; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.exam.entity.MultiQuestion; 6 | 7 | import java.util.List; 8 | 9 | public interface MultiQuestionService { 10 | 11 | List findByIdAndType(Integer PaperId); 12 | 13 | IPage findAll(Page page); 14 | 15 | MultiQuestion findOnlyQuestionId(); 16 | 17 | int add(MultiQuestion multiQuestion); 18 | 19 | List findBySubject(String subject,Integer pageNo); 20 | } 21 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/entity/ExamManage.java: -------------------------------------------------------------------------------- 1 | package com.exam.entity; 2 | 3 | import lombok.Data; 4 | 5 | import java.util.Date; 6 | 7 | @Data 8 | public class ExamManage { 9 | private Integer examCode; 10 | 11 | private String description; 12 | 13 | private String source; 14 | 15 | private Integer paperId; 16 | 17 | private String examDate; 18 | 19 | private Integer totalTime; 20 | 21 | private String grade; 22 | 23 | private String term; 24 | 25 | private String major; 26 | 27 | private String institute; 28 | 29 | private Integer totalScore; 30 | 31 | private String type; 32 | 33 | private String tips; 34 | } -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/service/ExamManageService.java: -------------------------------------------------------------------------------- 1 | package com.exam.service; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.exam.entity.ExamManage; 6 | 7 | import java.util.List; 8 | 9 | public interface ExamManageService { 10 | 11 | /** 12 | * 不分页查询所有考试信息 13 | */ 14 | List findAll(); 15 | IPage findAll(Page page); 16 | 17 | ExamManage findById(Integer examCode); 18 | 19 | int delete(Integer examCode); 20 | 21 | int update(ExamManage exammanage); 22 | 23 | int add(ExamManage exammanage); 24 | 25 | ExamManage findOnlyPaperId(); 26 | } 27 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/MybatisPlusConfig.java: -------------------------------------------------------------------------------- 1 | package com.exam; 2 | 3 | import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor; 4 | import org.mybatis.spring.annotation.MapperScan; 5 | import org.springframework.context.annotation.Bean; 6 | import org.springframework.context.annotation.Configuration; 7 | import org.springframework.transaction.annotation.EnableTransactionManagement; 8 | 9 | @EnableTransactionManagement 10 | @Configuration 11 | @MapperScan("com.exam.service.*.mapper*") 12 | public class MybatisPlusConfig { 13 | /** 14 | * 分页插件 15 | * @return 16 | */ 17 | @Bean 18 | public PaginationInterceptor paginationInterceptor() { 19 | return new PaginationInterceptor(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/serviceimpl/AnswerServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.exam.serviceimpl; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.exam.mapper.AnswerMapper; 6 | import com.exam.service.AnswerService; 7 | import com.exam.vo.AnswerVO; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Service; 10 | 11 | @Service 12 | public class AnswerServiceImpl implements AnswerService { 13 | 14 | @Autowired 15 | private AnswerMapper answerMapper; 16 | 17 | @Override 18 | public IPage findAll(Page page) { 19 | return answerMapper.findAll(page); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /exam/src/components/teacher/answerDescription.vue: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 31 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/mapper/AnswerMapper.java: -------------------------------------------------------------------------------- 1 | package com.exam.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.exam.vo.AnswerVO; 6 | import org.apache.ibatis.annotations.Mapper; 7 | import org.apache.ibatis.annotations.Select; 8 | 9 | 10 | @Mapper 11 | public interface AnswerMapper { 12 | @Select("select question, subject, score, section,level, \"选择题\" as type from multi_question " + 13 | "union select question, subject, score, section,level, \"判断题\" as type from judge_question " + 14 | "union select question, subject, score, section,level, \"填空题\" as type from fill_question") 15 | IPage findAll(Page page); 16 | } 17 | -------------------------------------------------------------------------------- /exam/src/components/teacher/examDescription.vue: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 30 | -------------------------------------------------------------------------------- /exam/src/main.js: -------------------------------------------------------------------------------- 1 | // The Vue build version to load with the `import` command 2 | // (runtime-only or standalone) has been set in webpack.base.conf with an alias. 3 | import Vue from 'vue' 4 | import App from './App' 5 | import router from './router' 6 | import echarts from 'echarts' 7 | import axios from 'axios' 8 | import ElementUI from 'element-ui' 9 | import 'element-ui/lib/theme-chalk/index.css' 10 | import VueCookies from 'vue-cookies' 11 | import store from '@/vuex/store' 12 | 13 | Vue.use(ElementUI) 14 | Vue.use(VueCookies) 15 | 16 | Vue.config.productionTip = false 17 | Vue.prototype.bus = new Vue() 18 | Vue.prototype.$echarts = echarts 19 | Vue.prototype.$axios = axios 20 | 21 | new Vue({ 22 | el: '#app', 23 | router, 24 | store, 25 | render: h => h(App), 26 | components: { App }, 27 | template: '' 28 | }) 29 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/mapper/PaperMapper.java: -------------------------------------------------------------------------------- 1 | package com.exam.mapper; 2 | 3 | import com.exam.entity.PaperManage; 4 | import org.apache.ibatis.annotations.Insert; 5 | import org.apache.ibatis.annotations.Mapper; 6 | import org.apache.ibatis.annotations.Select; 7 | 8 | import java.util.List; 9 | 10 | @Mapper 11 | public interface PaperMapper { 12 | @Select("select paperId, questionType,questionId from paper_manage") 13 | List findAll(); 14 | 15 | @Select("select paperId, questionType,questionId from paper_manage where paperId = #{paperId}") 16 | List findById(Integer paperId); 17 | 18 | @Insert("insert into paper_manage(paperId,questionType,questionId) values " + 19 | "(#{paperId},#{questionType},#{questionId})") 20 | int add(PaperManage paperManage); 21 | } 22 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/util/ApiResultHandler.java: -------------------------------------------------------------------------------- 1 | package com.exam.util; 2 | 3 | import com.exam.entity.ApiResult; 4 | 5 | public class ApiResultHandler { 6 | 7 | public static ApiResult success(Object object) { 8 | ApiResult apiResult = new ApiResult(); 9 | apiResult.setData(object); 10 | apiResult.setCode(200); 11 | apiResult.setMessage("请求成功"); 12 | return apiResult; 13 | } 14 | 15 | public static ApiResult success() { 16 | return success(null); 17 | } 18 | 19 | public static ApiResult buildApiResult(Integer code, String message, T data) { 20 | ApiResult apiResult = new ApiResult(); 21 | 22 | 23 | apiResult.setCode(code); 24 | apiResult.setMessage(message); 25 | apiResult.setData(data); 26 | return apiResult; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /exam/src/components/student/myFooter.vue: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 19 | 20 | 42 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/serviceimpl/PaperServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.exam.serviceimpl; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.exam.entity.PaperManage; 6 | import com.exam.mapper.PaperMapper; 7 | import com.exam.service.PaperService; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Service; 10 | 11 | import java.util.List; 12 | 13 | @Service 14 | public class PaperServiceImpl implements PaperService { 15 | 16 | @Autowired 17 | private PaperMapper paperMapper; 18 | @Override 19 | public List findAll() { 20 | return paperMapper.findAll(); 21 | } 22 | 23 | @Override 24 | public List findById(Integer paperId) { 25 | return paperMapper.findById(paperId); 26 | } 27 | 28 | @Override 29 | public int add(PaperManage paperManage) { 30 | return paperMapper.add(paperManage); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/serviceimpl/LoginServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.exam.serviceimpl; 2 | 3 | import com.exam.entity.Admin; 4 | import com.exam.entity.Student; 5 | import com.exam.entity.Teacher; 6 | import com.exam.mapper.LoginMapper; 7 | import com.exam.service.LoginService; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Service; 10 | 11 | import java.util.List; 12 | 13 | @Service 14 | public class LoginServiceImpl implements LoginService { 15 | 16 | @Autowired 17 | private LoginMapper loginMapper; 18 | 19 | @Override 20 | public Admin adminLogin(Integer username, String password) { 21 | return loginMapper.adminLogin(username,password); 22 | } 23 | 24 | @Override 25 | public Teacher teacherLogin(Integer username, String password) { 26 | return loginMapper.teacherLogin(username,password); 27 | } 28 | 29 | @Override 30 | public Student studentLogin(Integer username, String password) { 31 | return loginMapper.studentLogin(username,password); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/mapper/LoginMapper.java: -------------------------------------------------------------------------------- 1 | package com.exam.mapper; 2 | 3 | import com.exam.entity.Admin; 4 | import com.exam.entity.Student; 5 | import com.exam.entity.Teacher; 6 | import org.apache.ibatis.annotations.Mapper; 7 | import org.apache.ibatis.annotations.Select; 8 | 9 | import java.util.List; 10 | 11 | @Mapper 12 | public interface LoginMapper { 13 | 14 | @Select("select adminId,adminName,sex,tel,email,cardId,role from adminuser where adminId = #{username} and pwd = #{password}") 15 | public Admin adminLogin(Integer username, String password); 16 | 17 | @Select("select teacherId,teacherName,institute,sex,tel,email,cardId," + 18 | "type,role from teacher where teacherId = #{username} and pwd = #{password}") 19 | public Teacher teacherLogin(Integer username, String password); 20 | 21 | @Select("select studentId,studentName,grade,major,clazz,institute,tel," + 22 | "email,cardId,sex,role from student where studentId = #{username} and pwd = #{password}") 23 | public Student studentLogin(Integer username,String password); 24 | } 25 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/serviceimpl/AdminServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.exam.serviceimpl; 2 | 3 | import com.exam.entity.Admin; 4 | import com.exam.mapper.AdminMapper; 5 | import com.exam.service.AdminService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | 9 | import java.util.List; 10 | 11 | @Service 12 | public class AdminServiceImpl implements AdminService { 13 | 14 | @Autowired 15 | private AdminMapper adminMapper; 16 | 17 | @Override 18 | public List findAll() { 19 | return adminMapper.findAll(); 20 | } 21 | 22 | @Override 23 | public Admin findById(Integer adminId) { 24 | return adminMapper.findById(adminId); 25 | } 26 | 27 | @Override 28 | public int deleteById(int adminId) { 29 | return adminMapper.deleteById(adminId); 30 | } 31 | 32 | @Override 33 | public int update(Admin admin) { 34 | return adminMapper.update(admin); 35 | } 36 | 37 | @Override 38 | public int add(Admin admin) { 39 | return 0; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/entity/ApiResult.java: -------------------------------------------------------------------------------- 1 | package com.exam.entity; 2 | 3 | 4 | public class ApiResult { 5 | /** 6 | * 错误码,表示一种错误类型 7 | * 请求成功,状态码为200 8 | */ 9 | private int code; 10 | 11 | /** 12 | * 对错误代码的详细解释 13 | */ 14 | private String message; 15 | 16 | /** 17 | * 返回的结果包装在value中,value可以是单个对象 18 | */ 19 | private T data; 20 | 21 | public ApiResult() { 22 | } 23 | 24 | public ApiResult(int code, String message, T data) { 25 | this.code = code; 26 | this.message = message; 27 | this.data = data; 28 | } 29 | 30 | public int getCode() { 31 | return code; 32 | } 33 | 34 | public void setCode(int code) { 35 | this.code = code; 36 | } 37 | 38 | public String getMessage() { 39 | return message; 40 | } 41 | 42 | public void setMessage(String message) { 43 | this.message = message; 44 | } 45 | 46 | public T getData() { 47 | return data; 48 | } 49 | 50 | public void setData(T data) { 51 | this.data = data; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/mapper/AdminMapper.java: -------------------------------------------------------------------------------- 1 | package com.exam.mapper; 2 | 3 | import com.exam.entity.Admin; 4 | import org.apache.ibatis.annotations.*; 5 | 6 | import java.util.List; 7 | 8 | @Mapper 9 | public interface AdminMapper { 10 | 11 | @Select("select adminName,sex,tel,email,cardId,role from adminuser") 12 | public List findAll(); 13 | 14 | @Select("select adminName,sex,tel,email,cardId,role from adminuser where adminId = #{adminId}") 15 | public Admin findById(Integer adminId); 16 | 17 | @Delete("delete from adminuser where adminId = #{adminId}") 18 | public int deleteById(int adminId); 19 | 20 | @Update("update admin set adminName = #{adminName},sex = #{sex}," + 21 | "tel = #{tel}, email = #{email},pwd = #{pwd},cardId = #{cardId},role = #{role} where adminId = #{adminId}") 22 | public int update(Admin admin); 23 | 24 | @Options(useGeneratedKeys = true,keyProperty = "adminId") 25 | @Insert("insert into admin(adminName,sex,tel,email,pwd,cardId,role) " + 26 | "values(#{adminName},#{sex},#{tel},#{email},#{pwd},#{cardId},#{role})") 27 | public int add(Admin admin); 28 | } 29 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/mapper/ReplayMapper.java: -------------------------------------------------------------------------------- 1 | package com.exam.mapper; 2 | 3 | import com.exam.entity.Replay; 4 | import org.apache.ibatis.annotations.*; 5 | 6 | import java.util.List; 7 | 8 | @Mapper 9 | public interface ReplayMapper { 10 | 11 | @Select("select messageId,replayId,replay,replayTime from replay") 12 | List findAll(); 13 | 14 | @Select("select messageId,replayId,replay,replayTime from replay where messageId = #{messageId}") 15 | List findAllById(Integer messageId); 16 | 17 | @Select("select messageId,replayId,replay,replayTime from replay where messageId = #{messageId}") 18 | Replay findById(Integer messageId); 19 | 20 | @Delete("delete from replay where replayId = #{replayId}") 21 | int delete(Integer replayId); 22 | 23 | @Update("update replay set title = #{title}, replay = #{replay}, replayTime = #{replayTime} where replayId = #{replayId}") 24 | int update(Replay replay); 25 | 26 | @Options(useGeneratedKeys = true,keyProperty = "replayId") 27 | @Insert("insert into replay(messageId,replay,replayTime) values(#{messageId}, #{replay},#{replayTime})") 28 | int add(Replay replay); 29 | } 30 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/controller/AnswerController.java: -------------------------------------------------------------------------------- 1 | package com.exam.controller; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.exam.entity.ApiResult; 6 | import com.exam.serviceimpl.AnswerServiceImpl; 7 | import com.exam.util.ApiResultHandler; 8 | import com.exam.vo.AnswerVO; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.web.bind.annotation.GetMapping; 11 | import org.springframework.web.bind.annotation.PathVariable; 12 | import org.springframework.web.bind.annotation.RestController; 13 | 14 | 15 | @RestController 16 | public class AnswerController { 17 | 18 | @Autowired 19 | private AnswerServiceImpl answerService; 20 | 21 | @GetMapping("/answers/{page}/{size}") 22 | public ApiResult findAllQuestion(@PathVariable("page") Integer page, @PathVariable("size") Integer size){ 23 | Page answerVOPage = new Page<>(page,size); 24 | IPage answerVOIPage = answerService.findAll(answerVOPage); 25 | return ApiResultHandler.buildApiResult(200,"查询所有题库",answerVOIPage); 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/controller/ReplayController.java: -------------------------------------------------------------------------------- 1 | package com.exam.controller; 2 | 3 | import com.exam.entity.ApiResult; 4 | import com.exam.entity.Replay; 5 | import com.exam.serviceimpl.ReplayServiceImpl; 6 | import com.exam.util.ApiResultHandler; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.web.bind.annotation.*; 9 | 10 | import java.util.List; 11 | 12 | @RestController 13 | public class ReplayController { 14 | 15 | @Autowired 16 | private ReplayServiceImpl replayService; 17 | 18 | @PostMapping("/replay") 19 | public ApiResult add(@RequestBody Replay replay) { 20 | int data = replayService.add(replay); 21 | if (data != 0) { 22 | return ApiResultHandler.buildApiResult(200,"添加成功!",data); 23 | } else { 24 | return ApiResultHandler.buildApiResult(400,"添加失败!",null); 25 | } 26 | } 27 | 28 | @GetMapping("/replay/{messageId}") 29 | public ApiResult findAllById(@PathVariable("messageId") Integer messageId) { 30 | List res = replayService.findAllById(messageId); 31 | return ApiResultHandler.buildApiResult(200,"根据messageId查询",res); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /exam/src/components/admin/index.vue: -------------------------------------------------------------------------------- 1 | // 展示组件页面 2 | 16 | 17 | 37 | 38 | 53 | 54 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/serviceimpl/MessageServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.exam.serviceimpl; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.exam.entity.Message; 6 | import com.exam.mapper.MessageMapper; 7 | import com.exam.service.MessageService; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Service; 10 | 11 | import java.util.List; 12 | 13 | @Service 14 | public class MessageServiceImpl implements MessageService { 15 | 16 | @Autowired 17 | private MessageMapper messageMapper; 18 | 19 | @Override 20 | public IPage findAll(Page page) { 21 | return messageMapper.findAll(page); 22 | } 23 | 24 | @Override 25 | public Message findById(Integer id) { 26 | return messageMapper.findById(id); 27 | } 28 | 29 | @Override 30 | public int delete(Integer id) { 31 | return messageMapper.delete(id); 32 | } 33 | 34 | @Override 35 | public int update(Message message) { 36 | return messageMapper.update(message); 37 | } 38 | 39 | @Override 40 | public int add(Message message) { 41 | return messageMapper.add(message); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/serviceimpl/ReplayServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.exam.serviceimpl; 2 | 3 | import com.exam.entity.Replay; 4 | import com.exam.mapper.ReplayMapper; 5 | import com.exam.service.ReplayService; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | 9 | import java.util.List; 10 | 11 | @Service 12 | public class ReplayServiceImpl implements ReplayService { 13 | 14 | @Autowired 15 | private ReplayMapper replayMapper; 16 | 17 | @Override 18 | public List findAll() { 19 | return replayMapper.findAll(); 20 | } 21 | 22 | @Override 23 | public List findAllById(Integer messageId) { 24 | return replayMapper.findAllById(messageId); 25 | } 26 | 27 | @Override 28 | public Replay findById(Integer replayId) { 29 | return replayMapper.findById(replayId); 30 | } 31 | 32 | @Override 33 | public int delete(Integer replayId) { 34 | return replayMapper.delete(replayId); 35 | } 36 | 37 | @Override 38 | public int update(Replay replay) { 39 | return replayMapper.update(replay); 40 | } 41 | 42 | @Override 43 | public int add(Replay replay) { 44 | return replayMapper.add(replay); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/serviceimpl/ScoreServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.exam.serviceimpl; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.exam.entity.Score; 6 | import com.exam.mapper.ScoreMapper; 7 | import com.exam.service.ScoreService; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Service; 10 | 11 | import java.util.List; 12 | 13 | @Service 14 | public class ScoreServiceImpl implements ScoreService { 15 | 16 | @Autowired 17 | private ScoreMapper scoreMapper; 18 | @Override 19 | public int add(Score score) { 20 | return scoreMapper.add(score); 21 | } 22 | 23 | @Override 24 | public List findAll() { 25 | return scoreMapper.findAll(); 26 | } 27 | 28 | @Override 29 | public IPage findById(Page page, Integer studentId) { 30 | return scoreMapper.findById(page, studentId); 31 | } 32 | 33 | @Override 34 | public List findById(Integer studentId) { 35 | return scoreMapper.findById(studentId); 36 | } 37 | 38 | @Override 39 | public List findByExamCode(Integer examCode) { 40 | return scoreMapper.findByExamCode(examCode); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/controller/FillQuestionController.java: -------------------------------------------------------------------------------- 1 | package com.exam.controller; 2 | 3 | import com.exam.entity.ApiResult; 4 | import com.exam.entity.FillQuestion; 5 | import com.exam.serviceimpl.FillQuestionServiceImpl; 6 | import com.exam.util.ApiResultHandler; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.web.bind.annotation.GetMapping; 9 | import org.springframework.web.bind.annotation.PostMapping; 10 | import org.springframework.web.bind.annotation.RequestBody; 11 | import org.springframework.web.bind.annotation.RestController; 12 | 13 | @RestController 14 | public class FillQuestionController { 15 | 16 | @Autowired 17 | private FillQuestionServiceImpl fillQuestionService; 18 | 19 | @PostMapping("/fillQuestion") 20 | public ApiResult add(@RequestBody FillQuestion fillQuestion) { 21 | int res = fillQuestionService.add(fillQuestion); 22 | if (res != 0) { 23 | return ApiResultHandler.buildApiResult(200,"添加成功",res); 24 | } 25 | return ApiResultHandler.buildApiResult(400,"添加失败",res); 26 | } 27 | 28 | @GetMapping("/fillQuestionId") 29 | public ApiResult findOnlyQuestionId() { 30 | FillQuestion res = fillQuestionService.findOnlyQuestionId(); 31 | return ApiResultHandler.buildApiResult(200,"查询成功",res); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /exam/build/build.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | require('./check-versions')() 3 | 4 | process.env.NODE_ENV = 'production' 5 | 6 | const ora = require('ora') 7 | const rm = require('rimraf') 8 | const path = require('path') 9 | const chalk = require('chalk') 10 | const webpack = require('webpack') 11 | const config = require('../config') 12 | const webpackConfig = require('./webpack.prod.conf') 13 | 14 | const spinner = ora('building for production...') 15 | spinner.start() 16 | 17 | rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { 18 | if (err) throw err 19 | webpack(webpackConfig, (err, stats) => { 20 | spinner.stop() 21 | if (err) throw err 22 | process.stdout.write(stats.toString({ 23 | colors: true, 24 | modules: false, 25 | children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. 26 | chunks: false, 27 | chunkModules: false 28 | }) + '\n\n') 29 | 30 | if (stats.hasErrors()) { 31 | console.log(chalk.red(' Build failed with errors.\n')) 32 | process.exit(1) 33 | } 34 | 35 | console.log(chalk.cyan(' Build complete.\n')) 36 | console.log(chalk.yellow( 37 | ' Tip: built files are meant to be served over an HTTP server.\n' + 38 | ' Opening index.html over file:// won\'t work.\n' 39 | )) 40 | }) 41 | }) 42 | -------------------------------------------------------------------------------- /exam/src/components/common/navigator.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 39 | 40 | 50 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/controller/JudgeQuestionController.java: -------------------------------------------------------------------------------- 1 | package com.exam.controller; 2 | 3 | import com.exam.entity.ApiResult; 4 | import com.exam.entity.JudgeQuestion; 5 | import com.exam.serviceimpl.JudgeQuestionServiceImpl; 6 | import com.exam.util.ApiResultHandler; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.web.bind.annotation.GetMapping; 9 | import org.springframework.web.bind.annotation.PostMapping; 10 | import org.springframework.web.bind.annotation.RequestBody; 11 | import org.springframework.web.bind.annotation.RestController; 12 | 13 | @RestController 14 | public class JudgeQuestionController { 15 | 16 | @Autowired 17 | private JudgeQuestionServiceImpl judgeQuestionService; 18 | 19 | @PostMapping("/judgeQuestion") 20 | public ApiResult add(@RequestBody JudgeQuestion judgeQuestion) { 21 | int res = judgeQuestionService.add(judgeQuestion); 22 | if (res != 0) { 23 | return ApiResultHandler.buildApiResult(200,"添加成功",res); 24 | } 25 | return ApiResultHandler.buildApiResult(400,"添加失败",res); 26 | } 27 | 28 | @GetMapping("/judgeQuestionId") 29 | public ApiResult findOnlyQuestionId() { 30 | JudgeQuestion res = judgeQuestionService.findOnlyQuestionId(); 31 | return ApiResultHandler.buildApiResult(200,"查询成功",res); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/controller/MultiQuestionController.java: -------------------------------------------------------------------------------- 1 | package com.exam.controller; 2 | 3 | import com.exam.entity.ApiResult; 4 | import com.exam.entity.MultiQuestion; 5 | import com.exam.serviceimpl.MultiQuestionServiceImpl; 6 | import com.exam.util.ApiResultHandler; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.web.bind.annotation.GetMapping; 9 | import org.springframework.web.bind.annotation.PostMapping; 10 | import org.springframework.web.bind.annotation.RequestBody; 11 | import org.springframework.web.bind.annotation.RestController; 12 | 13 | @RestController 14 | public class MultiQuestionController { 15 | 16 | @Autowired 17 | private MultiQuestionServiceImpl multiQuestionService; 18 | 19 | @GetMapping("/multiQuestionId") 20 | public ApiResult findOnlyQuestion() { 21 | MultiQuestion res = multiQuestionService.findOnlyQuestionId(); 22 | return ApiResultHandler.buildApiResult(200,"查询成功",res); 23 | } 24 | 25 | @PostMapping("/MultiQuestion") 26 | public ApiResult add(@RequestBody MultiQuestion multiQuestion) { 27 | int res = multiQuestionService.add(multiQuestion); 28 | if (res != 0) { 29 | 30 | return ApiResultHandler.buildApiResult(200,"添加成功",res); 31 | } 32 | return ApiResultHandler.buildApiResult(400,"添加失败",res); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/mapper/MessageMapper.java: -------------------------------------------------------------------------------- 1 | package com.exam.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.exam.entity.Message; 6 | import org.apache.ibatis.annotations.*; 7 | 8 | import java.util.List; 9 | 10 | @Mapper 11 | public interface MessageMapper { 12 | @Select("select id,id as temp_id,title,content,time from message order by id desc") 13 | @Results({ 14 | @Result(property = "replays", column = "temp_id",many = @Many(select = "com.exam.mapper.ReplayMapper.findAllById")) 15 | }) 16 | IPage findAll(Page page); 17 | 18 | @Select("select id,title,content,time from message where id = #{id}") 19 | @Results({ 20 | @Result(property = "replays", column = "id",many = @Many(select = "com.exam.mapper.ReplayMapper.findAllById")) 21 | }) 22 | Message findById(Integer id); 23 | 24 | @Delete("delete from message where id = #{id}") 25 | int delete(Integer id); 26 | 27 | @Update("update message set title = #{title}, content = #{content}, time = #{time} where " + 28 | "id = #{id}") 29 | int update(Message message); 30 | 31 | @Options(useGeneratedKeys = true,keyProperty = "id") 32 | @Insert("insert into message(title, content, time) values(#{title},#{content},#{time})") 33 | int add(Message message); 34 | } 35 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/mapper/FillQuestionMapper.java: -------------------------------------------------------------------------------- 1 | package com.exam.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.exam.entity.FillQuestion; 6 | import org.apache.ibatis.annotations.*; 7 | 8 | import java.util.List; 9 | 10 | //填空题 11 | @Mapper 12 | public interface FillQuestionMapper { 13 | 14 | @Select("select * from fill_question where questionId in (select questionId from paper_manage where questionType = 2 and paperId = #{paperId})") 15 | List findByIdAndType(Integer paperId); 16 | 17 | @Select("select * from fill_question") 18 | IPage findAll(Page page); 19 | 20 | /** 21 | * 查询最后一条questionId 22 | * @return FillQuestion 23 | */ 24 | @Select("select questionId from fill_question order by questionId desc limit 1") 25 | FillQuestion findOnlyQuestionId(); 26 | 27 | @Options(useGeneratedKeys = true,keyProperty ="questionId" ) 28 | @Insert("insert into fill_question(subject,question,answer,analysis,level,section) values " + 29 | "(#{subject,},#{question},#{answer},#{analysis},#{level},#{section})") 30 | int add(FillQuestion fillQuestion); 31 | 32 | @Select("select questionId from fill_question where subject = #{subject} order by rand() desc limit #{pageNo}") 33 | List findBySubject(String subject,Integer pageNo); 34 | } 35 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/serviceimpl/TeacherServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.exam.serviceimpl; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.exam.entity.Teacher; 6 | import com.exam.mapper.TeacherMapper; 7 | import com.exam.service.TeacherService; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Service; 10 | 11 | import java.util.List; 12 | 13 | @Service 14 | public class TeacherServiceImpl implements TeacherService { 15 | @Autowired 16 | private TeacherMapper teacherMapper; 17 | 18 | @Override 19 | public IPage findAll(Page page) { 20 | return teacherMapper.findAll(page); 21 | } 22 | 23 | @Override 24 | public List findAll() { 25 | return teacherMapper.findAll(); 26 | } 27 | 28 | @Override 29 | public Teacher findById(Integer teacherId) { 30 | return teacherMapper.findById(teacherId); 31 | } 32 | 33 | @Override 34 | public int deleteById(Integer teacherId) { 35 | return teacherMapper.deleteById(teacherId); 36 | } 37 | 38 | @Override 39 | public int update(Teacher teacher) { 40 | return teacherMapper.update(teacher); 41 | } 42 | 43 | @Override 44 | public int add(Teacher teacher) { 45 | return teacherMapper.add(teacher); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/mapper/TeacherMapper.java: -------------------------------------------------------------------------------- 1 | package com.exam.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.exam.entity.Teacher; 6 | import org.apache.ibatis.annotations.*; 7 | 8 | import java.util.List; 9 | 10 | @Mapper 11 | public interface TeacherMapper { 12 | 13 | @Select("select * from teacher") 14 | IPage findAll(Page page); 15 | 16 | @Select("select * from teacher") 17 | public List findAll(); 18 | 19 | @Select("select * from teacher where teacherId = #{teacherId}") 20 | public Teacher findById(Integer teacherId); 21 | 22 | @Delete("delete from teacher where teacherId = #{teacherId}") 23 | public int deleteById(Integer teacherId); 24 | 25 | @Update("update teacher set teacherName = #{teacherName},sex = #{sex}," + 26 | "tel = #{tel}, email = #{email},pwd = #{pwd},cardId = #{cardId}," + 27 | "role = #{role},institute = #{institute},type = #{type} where teacherId = #{teacherId}") 28 | public int update(Teacher teacher); 29 | 30 | @Options(useGeneratedKeys = true,keyProperty = "teacherId") 31 | @Insert("insert into teacher(teacherName,sex,tel,email,pwd,cardId,role,type,institute) " + 32 | "values(#{teacherName},#{sex},#{tel},#{email},#{pwd},#{cardId},#{role},#{type},#{institute})") 33 | public int add(Teacher teacher); 34 | } 35 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/serviceimpl/StudentServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.exam.serviceimpl; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.exam.entity.Student; 6 | import com.exam.mapper.StudentMapper; 7 | import com.exam.service.StudentService; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Service; 10 | 11 | import java.util.List; 12 | 13 | @Service 14 | public class StudentServiceImpl implements StudentService { 15 | @Autowired 16 | private StudentMapper studentMapper; 17 | 18 | 19 | @Override 20 | public IPage findAll(Page page) { 21 | return studentMapper.findAll(page); 22 | } 23 | 24 | @Override 25 | public Student findById(Integer studentId) { 26 | return studentMapper.findById(studentId); 27 | } 28 | 29 | @Override 30 | public int deleteById(Integer studentId) { 31 | return studentMapper.deleteById(studentId); 32 | } 33 | 34 | @Override 35 | public int update(Student student) { 36 | return studentMapper.update(student); 37 | } 38 | 39 | @Override 40 | public int updatePwd(Student student) { 41 | return studentMapper.updatePwd(student); 42 | } 43 | 44 | @Override 45 | public int add(Student student) { 46 | return studentMapper.add(student); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/serviceimpl/FillQuestionServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.exam.serviceimpl; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.exam.entity.FillQuestion; 6 | import com.exam.mapper.FillQuestionMapper; 7 | import com.exam.service.FillQuestionService; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Service; 10 | 11 | import java.util.List; 12 | 13 | @Service 14 | public class FillQuestionServiceImpl implements FillQuestionService { 15 | 16 | @Autowired 17 | private FillQuestionMapper fillQuestionMapper; 18 | 19 | @Override 20 | public List findByIdAndType(Integer paperId) { 21 | return fillQuestionMapper.findByIdAndType(paperId); 22 | } 23 | 24 | @Override 25 | public IPage findAll(Page page) { 26 | return fillQuestionMapper.findAll(page); 27 | } 28 | 29 | @Override 30 | public FillQuestion findOnlyQuestionId() { 31 | return fillQuestionMapper.findOnlyQuestionId(); 32 | } 33 | 34 | @Override 35 | public int add(FillQuestion fillQuestion) { 36 | return fillQuestionMapper.add(fillQuestion); 37 | } 38 | 39 | @Override 40 | public List findBySubject(String subject, Integer pageNo) { 41 | return fillQuestionMapper.findBySubject(subject,pageNo); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 在线考试系统 2 | 3 | * ## 系统介绍 4 | 5 | 该项目是一个前后端分离,后端使用 SpringBoot,前端使用 VUE 和 Element-UI 组件库配合完成开发。 6 | 7 | * ## 在线浏览地址 8 | 温馨提示:请登录后台的朋友,不要删除计算机网络这套试卷,因为目前只添加了这套试卷的题目作为测试,删了,其他人就不能答题了。 9 | 10 | [在线考试系统](http://124.223.53.193/ "在线考试系统") 11 | 12 | 13 | * ## 页面截图 14 | ![登录](https://github.com/YXJ2018/SpringBoot-Vue-OnlineExam/blob/master/img/%E7%99%BB%E5%BD%95.png?raw=true) 15 | 16 |
登录
17 | 18 | ![试卷列表](https://github.com/YXJ2018/SpringBoot-Vue-OnlineExam/blob/master/img/%E8%AF%95%E5%8D%B7%E5%88%97%E8%A1%A8.png?raw=true) 19 | 20 |
试卷列表
21 | 22 | ![答题模块](https://github.com/YXJ2018/SpringBoot-Vue-OnlineExam/blob/master/img/%E7%AD%94%E9%A2%98%E6%A8%A1%E5%9D%97.png?raw=true) 23 | 24 |
答题模块
25 | 26 | ![练习模式](https://github.com/YXJ2018/SpringBoot-Vue-OnlineExam/blob/master/img/%E7%BB%83%E4%B9%A0%E6%A8%A1%E5%BC%8F.png?raw=true) 27 | 28 |
练习模式
29 | 30 | ![留言模块](https://github.com/YXJ2018/SpringBoot-Vue-OnlineExam/blob/master/img/%E7%95%99%E8%A8%80%E6%A8%A1%E5%9D%97.png?raw=true) 31 | 32 |
留言模块
33 | 34 | ![后台管理](https://github.com/YXJ2018/SpringBoot-Vue-OnlineExam/blob/master/img/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86.png?raw=true) 35 | 36 |
后台管理
37 | 38 | ![学生成绩](https://github.com/YXJ2018/SpringBoot-Vue-OnlineExam/blob/master/img/%E5%AD%A6%E7%94%9F%E6%88%90%E7%BB%A9%E6%8A%98%E7%BA%BF%E5%9B%BE.png?raw=true) 39 | 40 |
学生成绩
41 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/mapper/JudgeQuestionMapper.java: -------------------------------------------------------------------------------- 1 | package com.exam.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.exam.entity.JudgeQuestion; 6 | import org.apache.ibatis.annotations.Insert; 7 | import org.apache.ibatis.annotations.Mapper; 8 | import org.apache.ibatis.annotations.Select; 9 | 10 | import java.util.List; 11 | 12 | //判断题 13 | 14 | @Mapper 15 | public interface JudgeQuestionMapper { 16 | 17 | @Select("select * from judge_question where questionId in (select questionId from paper_manage where questionType = 3 and paperId = #{paperId})") 18 | List findByIdAndType(Integer paperId); 19 | 20 | @Select("select * from judge_question") 21 | IPage findAll(Page page); 22 | 23 | /** 24 | * 查询最后一条记录的questionId 25 | * @return JudgeQuestion 26 | */ 27 | @Select("select questionId from judge_question order by questionId desc limit 1") 28 | JudgeQuestion findOnlyQuestionId(); 29 | 30 | @Insert("insert into judge_question(subject,question,answer,analysis,level,section) values " + 31 | "(#{subject},#{question},#{answer},#{analysis},#{level},#{section})") 32 | int add(JudgeQuestion judgeQuestion); 33 | 34 | @Select("select questionId from judge_question where subject=#{subject} order by rand() desc limit #{pageNo}") 35 | List findBySubject(String subject,Integer pageNo); 36 | } 37 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/serviceimpl/MultiQuestionServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.exam.serviceimpl; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.exam.entity.MultiQuestion; 6 | import com.exam.mapper.MultiQuestionMapper; 7 | import com.exam.service.MultiQuestionService; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Service; 10 | 11 | import java.util.List; 12 | 13 | @Service 14 | public class MultiQuestionServiceImpl implements MultiQuestionService { 15 | 16 | @Autowired 17 | private MultiQuestionMapper multiQuestionMapper; 18 | @Override 19 | public List findByIdAndType(Integer PaperId) { 20 | return multiQuestionMapper.findByIdAndType(PaperId); 21 | } 22 | 23 | @Override 24 | public IPage findAll(Page page) { 25 | return multiQuestionMapper.findAll(page); 26 | } 27 | 28 | @Override 29 | public MultiQuestion findOnlyQuestionId() { 30 | return multiQuestionMapper.findOnlyQuestionId(); 31 | } 32 | 33 | @Override 34 | public int add(MultiQuestion multiQuestion) { 35 | return multiQuestionMapper.add(multiQuestion); 36 | } 37 | 38 | @Override 39 | public List findBySubject(String subject, Integer pageNo) { 40 | return multiQuestionMapper.findBySubject(subject,pageNo); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/serviceimpl/JudgeQuestionServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.exam.serviceimpl; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.exam.entity.JudgeQuestion; 6 | import com.exam.mapper.JudgeQuestionMapper; 7 | import com.exam.service.JudgeQuestionService; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Service; 10 | 11 | import java.util.List; 12 | 13 | @Service 14 | public class JudgeQuestionServiceImpl implements JudgeQuestionService { 15 | 16 | @Autowired 17 | private JudgeQuestionMapper judgeQuestionMapper; 18 | 19 | @Override 20 | public List findByIdAndType(Integer paperId) { 21 | return judgeQuestionMapper.findByIdAndType(paperId); 22 | } 23 | 24 | @Override 25 | public IPage findAll(Page page) { 26 | return judgeQuestionMapper.findAll(page); 27 | } 28 | 29 | @Override 30 | public JudgeQuestion findOnlyQuestionId() { 31 | return judgeQuestionMapper.findOnlyQuestionId(); 32 | } 33 | 34 | @Override 35 | public int add(JudgeQuestion judgeQuestion) { 36 | return judgeQuestionMapper.add(judgeQuestion); 37 | } 38 | 39 | @Override 40 | public List findBySubject(String subject, Integer pageNo) { 41 | return judgeQuestionMapper.findBySubject(subject,pageNo); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /exam/build/check-versions.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const chalk = require('chalk') 3 | const semver = require('semver') 4 | const packageConfig = require('../package.json') 5 | const shell = require('shelljs') 6 | 7 | function exec (cmd) { 8 | return require('child_process').execSync(cmd).toString().trim() 9 | } 10 | 11 | const versionRequirements = [ 12 | { 13 | name: 'node', 14 | currentVersion: semver.clean(process.version), 15 | versionRequirement: packageConfig.engines.node 16 | } 17 | ] 18 | 19 | if (shell.which('npm')) { 20 | versionRequirements.push({ 21 | name: 'npm', 22 | currentVersion: exec('npm --version'), 23 | versionRequirement: packageConfig.engines.npm 24 | }) 25 | } 26 | 27 | module.exports = function () { 28 | const warnings = [] 29 | 30 | for (let i = 0; i < versionRequirements.length; i++) { 31 | const mod = versionRequirements[i] 32 | 33 | if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { 34 | warnings.push(mod.name + ': ' + 35 | chalk.red(mod.currentVersion) + ' should be ' + 36 | chalk.green(mod.versionRequirement) 37 | ) 38 | } 39 | } 40 | 41 | if (warnings.length) { 42 | console.log('') 43 | console.log(chalk.yellow('To use this template, you must update following to modules:')) 44 | console.log() 45 | 46 | for (let i = 0; i < warnings.length; i++) { 47 | const warning = warnings[i] 48 | console.log(' ' + warning) 49 | } 50 | 51 | console.log() 52 | process.exit(1) 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/controller/LoginController.java: -------------------------------------------------------------------------------- 1 | package com.exam.controller; 2 | 3 | import com.exam.entity.*; 4 | import com.exam.serviceimpl.LoginServiceImpl; 5 | import com.exam.util.ApiResultHandler; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.web.bind.annotation.GetMapping; 8 | import org.springframework.web.bind.annotation.PostMapping; 9 | import org.springframework.web.bind.annotation.RequestBody; 10 | import org.springframework.web.bind.annotation.RestController; 11 | 12 | 13 | @RestController 14 | public class LoginController { 15 | 16 | @Autowired 17 | private LoginServiceImpl loginService; 18 | 19 | @PostMapping("/login") 20 | public ApiResult login(@RequestBody Login login) { 21 | 22 | Integer username = login.getUsername(); 23 | String password = login.getPassword(); 24 | Admin adminRes = loginService.adminLogin(username, password); 25 | if (adminRes != null) { 26 | return ApiResultHandler.buildApiResult(200, "请求成功", adminRes); 27 | } 28 | 29 | Teacher teacherRes = loginService.teacherLogin(username,password); 30 | if (teacherRes != null) { 31 | return ApiResultHandler.buildApiResult(200, "请求成功", teacherRes); 32 | } 33 | 34 | Student studentRes = loginService.studentLogin(username,password); 35 | if (studentRes != null) { 36 | return ApiResultHandler.buildApiResult(200, "请求成功", studentRes); 37 | } 38 | 39 | return ApiResultHandler.buildApiResult(400, "请求失败", null); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/serviceimpl/ExamManageServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.exam.serviceimpl; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.exam.entity.ExamManage; 6 | import com.exam.mapper.ExamManageMapper; 7 | import com.exam.service.ExamManageService; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Service; 10 | 11 | import java.util.List; 12 | 13 | @Service 14 | public class ExamManageServiceImpl implements ExamManageService { 15 | @Autowired 16 | private ExamManageMapper examManageMapper; 17 | 18 | 19 | @Override 20 | public List findAll() { 21 | return examManageMapper.findAll(); 22 | } 23 | 24 | @Override 25 | public IPage findAll(Page page) { 26 | return examManageMapper.findAll(page); 27 | } 28 | 29 | @Override 30 | public ExamManage findById(Integer examCode) { 31 | return examManageMapper.findById(examCode); 32 | } 33 | 34 | @Override 35 | public int delete(Integer examCode) { 36 | return examManageMapper.delete(examCode); 37 | } 38 | 39 | @Override 40 | public int update(ExamManage exammanage) { 41 | return examManageMapper.update(exammanage); 42 | } 43 | 44 | @Override 45 | public int add(ExamManage exammanage) { 46 | return examManageMapper.add(exammanage); 47 | } 48 | 49 | @Override 50 | public ExamManage findOnlyPaperId() { 51 | return examManageMapper.findOnlyPaperId(); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/controller/AdminController.java: -------------------------------------------------------------------------------- 1 | package com.exam.controller; 2 | 3 | import com.exam.entity.Admin; 4 | import com.exam.entity.ApiResult; 5 | import com.exam.serviceimpl.AdminServiceImpl; 6 | import com.exam.util.ApiResultHandler; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.web.bind.annotation.*; 9 | 10 | @RestController 11 | public class AdminController { 12 | 13 | private AdminServiceImpl adminService; 14 | @Autowired 15 | public AdminController(AdminServiceImpl adminService){ 16 | this.adminService = adminService; 17 | } 18 | 19 | @GetMapping("/admins") 20 | public ApiResult findAll(){ 21 | System.out.println("查询全部"); 22 | return ApiResultHandler.success(adminService.findAll()); 23 | } 24 | 25 | @GetMapping("/admin/{adminId}") 26 | public ApiResult findById(@PathVariable("adminId") Integer adminId){ 27 | System.out.println("根据ID查找"); 28 | return ApiResultHandler.success(adminService.findById(adminId)); 29 | } 30 | 31 | @DeleteMapping("/admin/{adminId}") 32 | public ApiResult deleteById(@PathVariable("adminId") Integer adminId){ 33 | adminService.deleteById(adminId); 34 | return ApiResultHandler.success(); 35 | } 36 | 37 | @PutMapping("/admin/{adminId}") 38 | public ApiResult update(@PathVariable("adminId") Integer adminId, Admin admin){ 39 | return ApiResultHandler.success(adminService.update(admin)); 40 | } 41 | 42 | @PostMapping("/admin") 43 | public ApiResult add(Admin admin){ 44 | return ApiResultHandler.success(adminService.add(admin)); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/mapper/ScoreMapper.java: -------------------------------------------------------------------------------- 1 | package com.exam.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.exam.entity.Score; 6 | import org.apache.ibatis.annotations.Insert; 7 | import org.apache.ibatis.annotations.Mapper; 8 | import org.apache.ibatis.annotations.Options; 9 | import org.apache.ibatis.annotations.Select; 10 | 11 | import java.util.List; 12 | 13 | @Mapper 14 | public interface ScoreMapper { 15 | /** 16 | * @param score 添加一条成绩记录 17 | * @return 18 | */ 19 | @Options(useGeneratedKeys = true,keyProperty = "scoreId") 20 | @Insert("insert into score(examCode,studentId,subject,ptScore,etScore,score,answerDate) values(#{examCode},#{studentId},#{subject},#{ptScore},#{etScore},#{score},#{answerDate})") 21 | int add(Score score); 22 | 23 | @Select("select scoreId,examCode,studentId,subject,ptScore,etScore,score,answerDate from score order by scoreId desc") 24 | List findAll(); 25 | 26 | // 分页 27 | @Select("select scoreId,examCode,studentId,subject,ptScore,etScore,score,answerDate from score where studentId = #{studentId} order by scoreId desc") 28 | IPage findById(Page page, Integer studentId); 29 | 30 | // 不分页 31 | @Select("select scoreId,examCode,studentId,subject,ptScore,etScore,score,answerDate from score where studentId = #{studentId}") 32 | List findById(Integer studentId); 33 | 34 | /** 35 | * 36 | * @return 查询每位学生的学科分数。 max其实是假的,为了迷惑老师,达到一次考试考生只参加了一次的效果 37 | */ 38 | @Select("select max(etScore) as etScore from score where examCode = #{examCode} group by studentId") 39 | List findByExamCode(Integer examCode); 40 | } 41 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/controller/MessageController.java: -------------------------------------------------------------------------------- 1 | package com.exam.controller; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.exam.entity.ApiResult; 6 | import com.exam.entity.Message; 7 | import com.exam.serviceimpl.MessageServiceImpl; 8 | import com.exam.util.ApiResultHandler; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.web.bind.annotation.*; 11 | 12 | @RestController 13 | public class MessageController { 14 | 15 | @Autowired 16 | private MessageServiceImpl messageService; 17 | 18 | @GetMapping("/messages/{page}/{size}") 19 | public ApiResult findAll(@PathVariable("page") Integer page, @PathVariable("size") Integer size) { 20 | Page messagePage = new Page<>(page,size); 21 | IPage all = messageService.findAll(messagePage); 22 | return ApiResultHandler.buildApiResult(200,"查询所有留言",all); 23 | } 24 | 25 | @GetMapping("/message/{id}") 26 | public ApiResult findById(@PathVariable("id") Integer id) { 27 | Message res = messageService.findById(id); 28 | return ApiResultHandler.buildApiResult(200,"根据Id查询",res); 29 | } 30 | 31 | @DeleteMapping("/message/{id}") 32 | public int delete(@PathVariable("id") Integer id) { 33 | int res = messageService.delete(id); 34 | return res; 35 | } 36 | 37 | @PostMapping("/message") 38 | public ApiResult add(@RequestBody Message message) { 39 | int res = messageService.add(message); 40 | if (res == 0) { 41 | return ApiResultHandler.buildApiResult(400,"添加失败",res); 42 | } else { 43 | return ApiResultHandler.buildApiResult(200,"添加成功",res); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/mapper/StudentMapper.java: -------------------------------------------------------------------------------- 1 | package com.exam.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.exam.entity.Student; 6 | import org.apache.ibatis.annotations.*; 7 | 8 | import java.util.List; 9 | 10 | @Mapper 11 | public interface StudentMapper { 12 | 13 | /** 14 | * 分页查询所有学生 15 | * @param page 16 | * @return List 17 | */ 18 | @Select("select * from student") 19 | IPage findAll(Page page); 20 | 21 | @Select("select * from student where studentId = #{studentId}") 22 | Student findById(Integer studentId); 23 | 24 | @Delete("delete from student where studentId = #{studentId}") 25 | int deleteById(Integer studentId); 26 | 27 | /** 28 | *更新所有学生信息 29 | * @param student 传递一个对象 30 | * @return 受影响的记录条数 31 | */ 32 | @Update("update student set studentName = #{studentName},grade = #{grade},major = #{major},clazz = #{clazz}," + 33 | "institute = #{institute},tel = #{tel},email = #{email},pwd = #{pwd},cardId = #{cardId},sex = #{sex},role = #{role} " + 34 | "where studentId = #{studentId}") 35 | int update(Student student); 36 | 37 | /** 38 | * 更新密码 39 | * @param student 40 | * @return 受影响的记录条数 41 | */ 42 | @Update("update student set pwd = #{pwd} where studentId = #{studentId}") 43 | int updatePwd(Student student); 44 | 45 | 46 | @Options(useGeneratedKeys = true,keyProperty = "studentId") 47 | @Insert("insert into student(studentName,grade,major,clazz,institute,tel,email,pwd,cardId,sex,role) values " + 48 | "(#{studentName},#{grade},#{major},#{clazz},#{institute},#{tel},#{email},#{pwd},#{cardId},#{sex},#{role})") 49 | int add(Student student); 50 | } 51 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/mapper/ExamManageMapper.java: -------------------------------------------------------------------------------- 1 | package com.exam.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.exam.entity.ExamManage; 6 | import org.apache.ibatis.annotations.*; 7 | 8 | import java.util.List; 9 | 10 | @Mapper 11 | public interface ExamManageMapper { 12 | @Select("select * from exam_manage") 13 | List findAll(); 14 | 15 | @Select("select * from exam_manage") 16 | IPage findAll(Page page); 17 | 18 | @Select("select * from exam_manage where examCode = #{examCode}") 19 | ExamManage findById(Integer examCode); 20 | 21 | @Delete("delete from exam_manage where examCode = #{examCode}") 22 | int delete(Integer examCode); 23 | 24 | @Update("update exam_manage set description = #{description},source = #{source},paperId = #{paperId}," + 25 | "examDate = #{examDate},totalTime = #{totalTime},grade = #{grade},term = #{term}," + 26 | "major = #{major},institute = #{institute},totalScore = #{totalScore}," + 27 | "type = #{type},tips = #{tips} where examCode = #{examCode}") 28 | int update(ExamManage exammanage); 29 | 30 | @Options(useGeneratedKeys = true,keyProperty = "examCode") 31 | @Insert("insert into exam_manage(description,source,paperId,examDate,totalTime,grade,term,major,institute,totalScore,type,tips)" + 32 | " values(#{description},#{source},#{paperId},#{examDate},#{totalTime},#{grade},#{term},#{major},#{institute},#{totalScore},#{type},#{tips})") 33 | int add(ExamManage exammanage); 34 | 35 | /** 36 | * 查询最后一条记录的paperId,返回给前端达到自增效果 37 | * @return paperId 38 | */ 39 | @Select("select paperId from exam_manage order by paperId desc limit 1") 40 | ExamManage findOnlyPaperId(); 41 | } 42 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/mapper/MultiQuestionMapper.java: -------------------------------------------------------------------------------- 1 | package com.exam.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.exam.entity.MultiQuestion; 6 | import org.apache.ibatis.annotations.Insert; 7 | import org.apache.ibatis.annotations.Mapper; 8 | import org.apache.ibatis.annotations.Options; 9 | import org.apache.ibatis.annotations.Select; 10 | 11 | import java.util.List; 12 | 13 | //选择题 14 | @Mapper 15 | public interface MultiQuestionMapper { 16 | /** 17 | * select * from multiquestions where questionId in ( 18 | * select questionId from papermanage where questionType = 1 and paperId = 1001 19 | * ) 20 | */ 21 | @Select("select * from multi_question where questionId in (select questionId from paper_manage where questionType = 1 and paperId = #{paperId})") 22 | List findByIdAndType(Integer PaperId); 23 | 24 | @Select("select * from multi_question") 25 | IPage findAll(Page page); 26 | 27 | /** 28 | * 查询最后一条记录的questionId 29 | * @return MultiQuestion 30 | */ 31 | @Select("select questionId from multi_question order by questionId desc limit 1") 32 | MultiQuestion findOnlyQuestionId(); 33 | 34 | @Options(useGeneratedKeys = true,keyProperty = "questionId") 35 | @Insert("insert into multi_question(subject,question,answerA,answerB,answerC,answerD,rightAnswer,analysis,section,level) " + 36 | "values(#{subject},#{question},#{answerA},#{answerB},#{answerC},#{answerD},#{rightAnswer},#{analysis},#{section},#{level})") 37 | int add(MultiQuestion multiQuestion); 38 | 39 | @Select("select questionId from multi_question where subject =#{subject} order by rand() desc limit #{pageNo}") 40 | List findBySubject(String subject,Integer pageNo); 41 | 42 | 43 | } 44 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/entity/Admin.java: -------------------------------------------------------------------------------- 1 | package com.exam.entity; 2 | 3 | public class Admin { 4 | private Integer adminId; 5 | 6 | private String adminName; 7 | 8 | private String sex; 9 | 10 | private String tel; 11 | 12 | private String email; 13 | 14 | private String pwd; 15 | 16 | private String cardId; 17 | 18 | private String role; 19 | 20 | public Integer getAdminId() { 21 | return adminId; 22 | } 23 | 24 | public void setAdminId(Integer adminId) { 25 | this.adminId = adminId; 26 | } 27 | 28 | public String getAdminName() { 29 | return adminName; 30 | } 31 | 32 | public void setAdminName(String adminName) { 33 | this.adminName = adminName == null ? null : adminName.trim(); 34 | } 35 | 36 | public String getSex() { 37 | return sex; 38 | } 39 | 40 | public void setSex(String sex) { 41 | this.sex = sex == null ? null : sex.trim(); 42 | } 43 | 44 | public String getTel() { 45 | return tel; 46 | } 47 | 48 | public void setTel(String tel) { 49 | this.tel = tel == null ? null : tel.trim(); 50 | } 51 | 52 | public String getEmail() { 53 | return email; 54 | } 55 | 56 | public void setEmail(String email) { 57 | this.email = email == null ? null : email.trim(); 58 | } 59 | 60 | public String getPwd() { 61 | return pwd; 62 | } 63 | 64 | public void setPwd(String pwd) { 65 | this.pwd = pwd == null ? null : pwd.trim(); 66 | } 67 | 68 | public String getCardId() { 69 | return cardId; 70 | } 71 | 72 | public void setCardId(String cardId) { 73 | this.cardId = cardId == null ? null : cardId.trim(); 74 | } 75 | 76 | public String getRole() { 77 | return role; 78 | } 79 | 80 | public void setRole(String role) { 81 | this.role = role == null ? null : role.trim(); 82 | } 83 | } -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/controller/TeacherController.java: -------------------------------------------------------------------------------- 1 | package com.exam.controller; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.exam.entity.ApiResult; 6 | import com.exam.entity.Teacher; 7 | import com.exam.serviceimpl.TeacherServiceImpl; 8 | import com.exam.util.ApiResultHandler; 9 | import com.exam.vo.AnswerVO; 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.web.bind.annotation.*; 12 | 13 | @RestController 14 | public class TeacherController { 15 | 16 | private TeacherServiceImpl teacherService; 17 | @Autowired 18 | public TeacherController(TeacherServiceImpl teacherService){ 19 | this.teacherService = teacherService; 20 | } 21 | 22 | @GetMapping("/teachers/{page}/{size}") 23 | public ApiResult findAll(@PathVariable Integer page, @PathVariable Integer size){ 24 | Page teacherPage = new Page<>(page,size); 25 | IPage teacherIPage = teacherService.findAll(teacherPage); 26 | 27 | return ApiResultHandler.buildApiResult(200,"查询所有教师",teacherIPage); 28 | } 29 | 30 | @GetMapping("/teacher/{teacherId}") 31 | public ApiResult findById(@PathVariable("teacherId") Integer teacherId){ 32 | return ApiResultHandler.success(teacherService.findById(teacherId)); 33 | } 34 | 35 | @DeleteMapping("/teacher/{teacherId}") 36 | public ApiResult deleteById(@PathVariable("teacherId") Integer teacherId){ 37 | return ApiResultHandler.success(teacherService.deleteById(teacherId)); 38 | } 39 | 40 | @PutMapping("/teacher") 41 | public ApiResult update(@RequestBody Teacher teacher){ 42 | return ApiResultHandler.success(teacherService.update(teacher)); 43 | } 44 | 45 | @PostMapping("/teacher") 46 | public ApiResult add(@RequestBody Teacher teacher){ 47 | return ApiResultHandler.success(teacherService.add(teacher)); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /exam/src/components/common/hello.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 45 | 46 | 47 | 81 | 82 | -------------------------------------------------------------------------------- /exam/src/components/charts/grade.vue: -------------------------------------------------------------------------------- 1 | // 成绩统计页面 2 | 10 | 11 | 65 | 66 | 80 | -------------------------------------------------------------------------------- /exam/src/vuex/store.js: -------------------------------------------------------------------------------- 1 | import VUE from 'vue' 2 | import VUEX from 'vuex' 3 | 4 | VUE.use(VUEX) 5 | 6 | const state = { 7 | isPractice: false, //练习模式标志 8 | flag: false, //菜单栏左右滑动标志 9 | userInfo: null, 10 | menu: [{ 11 | index: '1', 12 | title: '考试管理', 13 | icon: 'icon-kechengbiao', 14 | content:[{item1:'功能介绍',path:'/examDescription'},{item2:'考试查询',path:'selectExam'},{item3:'添加考试',path:'/addExam'}], 15 | }, 16 | { 17 | index: '2', 18 | title: '题库管理', 19 | icon: 'icon-tiku', 20 | content:[{item1:'功能介绍',path:'/answerDescription'},{item2:'所有题库',path:'/selectAnswer'},{item3:'增加题库',path:'/addAnswer'},{path: '/addAnswerChildren'}], 21 | }, 22 | { 23 | index: '3', 24 | title: '成绩查询', 25 | icon: 'icon-performance', 26 | content:[{item1:'学生成绩查询',path:'/allStudentsGrade'},{path: '/grade'},{item2: '成绩分段查询',path: '/selectExamToPart'},{path: '/scorePart'}], 27 | }, 28 | { 29 | index: '4', 30 | title: '学生管理', 31 | icon: 'icon-role', 32 | content:[{item1:'学生管理',path:'/studentManage'},{item2: '添加学生',path: '/addStudent'}], 33 | }, 34 | // { 35 | // index: '5', 36 | // title: '教师管理', 37 | // icon: 'icon-Userselect', 38 | // content:[{item1:'教师管理',path:'/teacherManage'},{item2: '添加教师',path: '/addTeacher'}], 39 | // }, 40 | // { 41 | // index: '7', 42 | // title: '模块管理', 43 | // icon: 'icon-module4mokuai', 44 | // content:[{item1:'模块操作',path:'/module'}], 45 | // } 46 | ], 47 | } 48 | const mutations = { 49 | practice(state,status) { 50 | state.isPractice = status 51 | }, 52 | toggle(state) { 53 | state.flag = !state.flag 54 | }, 55 | changeUserInfo(state,info) { 56 | state.userInfo = info 57 | } 58 | } 59 | const getters = { 60 | 61 | } 62 | const actions = { 63 | getUserInfo(context,info) { 64 | context.commit('changeUserInfo',info) 65 | }, 66 | getPractice(context,status) { 67 | context.commit('practice',status) 68 | } 69 | } 70 | export default new VUEX.Store({ 71 | state, 72 | mutations, 73 | getters, 74 | actions, 75 | // store 76 | }) 77 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/controller/PaperController.java: -------------------------------------------------------------------------------- 1 | package com.exam.controller; 2 | 3 | import com.exam.entity.*; 4 | import com.exam.serviceimpl.FillQuestionServiceImpl; 5 | import com.exam.serviceimpl.JudgeQuestionServiceImpl; 6 | import com.exam.serviceimpl.MultiQuestionServiceImpl; 7 | import com.exam.serviceimpl.PaperServiceImpl; 8 | import com.exam.util.ApiResultHandler; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.web.bind.annotation.*; 11 | 12 | import java.util.HashMap; 13 | import java.util.List; 14 | import java.util.Map; 15 | 16 | @RestController 17 | public class PaperController { 18 | 19 | @Autowired 20 | private PaperServiceImpl paperService; 21 | 22 | @Autowired 23 | private JudgeQuestionServiceImpl judgeQuestionService; 24 | 25 | @Autowired 26 | private MultiQuestionServiceImpl multiQuestionService; 27 | 28 | @Autowired 29 | private FillQuestionServiceImpl fillQuestionService; 30 | @GetMapping("/papers") 31 | public ApiResult findAll() { 32 | ApiResult res = ApiResultHandler.buildApiResult(200,"请求成功",paperService.findAll()); 33 | return res; 34 | } 35 | 36 | @GetMapping("/paper/{paperId}") 37 | public Map> findById(@PathVariable("paperId") Integer paperId) { 38 | List multiQuestionRes = multiQuestionService.findByIdAndType(paperId); //选择题题库 1 39 | List fillQuestionsRes = fillQuestionService.findByIdAndType(paperId); //填空题题库 2 40 | List judgeQuestionRes = judgeQuestionService.findByIdAndType(paperId); //判断题题库 3 41 | Map> map = new HashMap<>(); 42 | map.put(1,multiQuestionRes); 43 | map.put(2,fillQuestionsRes); 44 | map.put(3,judgeQuestionRes); 45 | return map; 46 | } 47 | 48 | @PostMapping("/paperManage") 49 | public ApiResult add(@RequestBody PaperManage paperManage) { 50 | int res = paperService.add(paperManage); 51 | if (res != 0) { 52 | return ApiResultHandler.buildApiResult(200,"添加成功",res); 53 | } 54 | return ApiResultHandler.buildApiResult(400,"添加失败",res); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /exam/src/components/admin/addTeacher.vue: -------------------------------------------------------------------------------- 1 | 2 | 33 | 34 | 78 | 84 | 85 | -------------------------------------------------------------------------------- /exam/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vue-init", 3 | "version": "1.0.0", 4 | "description": "vue demo", 5 | "author": "", 6 | "private": true, 7 | "scripts": { 8 | "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", 9 | "start": "npm run dev", 10 | "build": "node build/build.js" 11 | }, 12 | "dependencies": { 13 | "@babel/preset-es2015": "^7.0.0-beta.53", 14 | "axios": "^0.18.0", 15 | "echarts": "^4.2.0-rc.2", 16 | "element-ui": "^2.4.11", 17 | "global": "^4.4.0", 18 | "vis": "^4.21.0", 19 | "vue": "^2.5.2", 20 | "vue-cookies": "^1.5.12", 21 | "vue-router": "^3.0.1", 22 | "vuex": "^3.0.1", 23 | "vuex-persistedstate": "^2.5.4" 24 | }, 25 | "devDependencies": { 26 | "less": "^4.1.3", 27 | "less-loader": "5.0.0", 28 | "@babel/core": "^7.2.2", 29 | "@babel/preset-env": "^7.2.3", 30 | "autoprefixer": "^7.1.2", 31 | "babel-core": "^6.22.1", 32 | "babel-helper-vue-jsx-merge-props": "^2.0.3", 33 | "babel-loader": "^7.1.5", 34 | "babel-plugin-syntax-jsx": "^6.18.0", 35 | "babel-plugin-transform-runtime": "^6.22.0", 36 | "babel-plugin-transform-vue-jsx": "^3.5.0", 37 | "babel-preset-env": "^1.3.2", 38 | "babel-preset-stage-2": "^6.22.0", 39 | "chalk": "^2.0.1", 40 | "copy-webpack-plugin": "^4.0.1", 41 | "css-loader": "^0.28.0", 42 | "extract-text-webpack-plugin": "^3.0.0", 43 | "file-loader": "^1.1.4", 44 | "friendly-errors-webpack-plugin": "^1.6.1", 45 | "html-webpack-plugin": "^2.30.1", 46 | "node-notifier": "^5.1.2", 47 | "optimize-css-assets-webpack-plugin": "^3.2.0", 48 | "ora": "^1.2.0", 49 | "portfinder": "^1.0.13", 50 | "postcss-import": "^11.0.0", 51 | "postcss-loader": "^2.0.8", 52 | "postcss-url": "^7.2.1", 53 | "rimraf": "^2.6.0", 54 | "semver": "^5.3.0", 55 | "shelljs": "^0.7.6", 56 | "uglifyjs-webpack-plugin": "^1.1.1", 57 | "url-loader": "^0.5.8", 58 | "vue-loader": "^13.3.0", 59 | "vue-style-loader": "^3.0.1", 60 | "vue-template-compiler": "^2.5.2", 61 | "webpack": "^3.12.0", 62 | "webpack-bundle-analyzer": "^2.9.0", 63 | "webpack-dev-server": "^2.9.1", 64 | "webpack-merge": "^4.1.0" 65 | }, 66 | "engines": { 67 | "node": ">= 6.0.0", 68 | "npm": ">= 3.0.0" 69 | }, 70 | "browserslist": [ 71 | "> 1%", 72 | "last 2 versions", 73 | "not ie <= 8" 74 | ] 75 | } 76 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/controller/ScoreController.java: -------------------------------------------------------------------------------- 1 | package com.exam.controller; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.exam.entity.ApiResult; 6 | import com.exam.entity.Message; 7 | import com.exam.entity.Score; 8 | import com.exam.serviceimpl.ScoreServiceImpl; 9 | import com.exam.util.ApiResultHandler; 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.web.bind.annotation.*; 12 | 13 | import java.util.List; 14 | 15 | @RestController 16 | public class ScoreController { 17 | @Autowired 18 | private ScoreServiceImpl scoreService; 19 | 20 | @GetMapping("/scores") 21 | public ApiResult findAll() { 22 | List res = scoreService.findAll(); 23 | return ApiResultHandler.buildApiResult(200,"查询所有学生成绩",res); 24 | } 25 | // 分页 26 | @GetMapping("/score/{page}/{size}/{studentId}") 27 | public ApiResult findById(@PathVariable("page") Integer page, @PathVariable("size") Integer size, @PathVariable("studentId") Integer studentId) { 28 | Page scorePage = new Page<>(page, size); 29 | IPage res = scoreService.findById(scorePage, studentId); 30 | return ApiResultHandler.buildApiResult(200, "根据ID查询成绩", res); 31 | } 32 | 33 | // 不分页 34 | @GetMapping("/score/{studentId}") 35 | public ApiResult findById(@PathVariable("studentId") Integer studentId) { 36 | List res = scoreService.findById(studentId); 37 | if (!res.isEmpty()) { 38 | return ApiResultHandler.buildApiResult(200, "根据ID查询成绩", res); 39 | } else { 40 | return ApiResultHandler.buildApiResult(400, "ID不存在", res); 41 | } 42 | } 43 | 44 | @PostMapping("/score") 45 | public ApiResult add(@RequestBody Score score) { 46 | int res = scoreService.add(score); 47 | if (res == 0) { 48 | return ApiResultHandler.buildApiResult(400,"成绩添加失败",res); 49 | }else { 50 | return ApiResultHandler.buildApiResult(200,"成绩添加成功",res); 51 | } 52 | } 53 | 54 | @GetMapping("/scores/{examCode}") 55 | public ApiResult findByExamCode(@PathVariable("examCode") Integer examCode) { 56 | List scores = scoreService.findByExamCode(examCode); 57 | return ApiResultHandler.buildApiResult(200,"查询成功",scores); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/controller/StudentController.java: -------------------------------------------------------------------------------- 1 | package com.exam.controller; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.exam.entity.ApiResult; 6 | import com.exam.entity.Student; 7 | import com.exam.serviceimpl.StudentServiceImpl; 8 | import com.exam.util.ApiResultHandler; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.web.bind.annotation.*; 11 | 12 | @RestController 13 | public class StudentController { 14 | 15 | @Autowired 16 | private StudentServiceImpl studentService; 17 | 18 | @GetMapping("/students/{page}/{size}") 19 | public ApiResult findAll(@PathVariable Integer page, @PathVariable Integer size) { 20 | Page studentPage = new Page<>(page,size); 21 | IPage res = studentService.findAll(studentPage); 22 | return ApiResultHandler.buildApiResult(200,"分页查询所有学生",res); 23 | } 24 | 25 | @GetMapping("/student/{studentId}") 26 | public ApiResult findById(@PathVariable("studentId") Integer studentId) { 27 | Student res = studentService.findById(studentId); 28 | if (res != null) { 29 | return ApiResultHandler.buildApiResult(200,"请求成功",res); 30 | } else { 31 | return ApiResultHandler.buildApiResult(404,"查询的用户不存在",null); 32 | } 33 | } 34 | 35 | @DeleteMapping("/student/{studentId}") 36 | public ApiResult deleteById(@PathVariable("studentId") Integer studentId) { 37 | return ApiResultHandler.buildApiResult(200,"删除成功",studentService.deleteById(studentId)); 38 | } 39 | 40 | @PutMapping("/studentPWD") 41 | public ApiResult updatePwd(@RequestBody Student student) { 42 | studentService.updatePwd(student); 43 | return ApiResultHandler.buildApiResult(200,"密码更新成功",null); 44 | } 45 | @PutMapping("/student") 46 | public ApiResult update(@RequestBody Student student) { 47 | int res = studentService.update(student); 48 | if (res != 0) { 49 | return ApiResultHandler.buildApiResult(200,"更新成功",res); 50 | } 51 | return ApiResultHandler.buildApiResult(400,"更新失败",res); 52 | } 53 | 54 | @PostMapping("/student") 55 | public ApiResult add(@RequestBody Student student) { 56 | int res = studentService.add(student); 57 | if (res == 1) { 58 | return ApiResultHandler.buildApiResult(200,"添加成功",null); 59 | }else { 60 | return ApiResultHandler.buildApiResult(400,"添加失败",null); 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /exam/config/index.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | // Template version: 1.3.1 3 | // see http://vuejs-templates.github.io/webpack for documentation. 4 | 5 | const path = require('path') 6 | 7 | module.exports = { 8 | dev: { 9 | 10 | // Paths 11 | assetsSubDirectory: 'static', 12 | assetsPublicPath: '/', 13 | proxyTable: { 14 | '/api': { 15 | target: 'http://localhost:8080',//本地地址 16 | // target: 'http://gopikachu.top:8080',// 线上部署地址 17 | changeOrigin: true, 18 | pathRewrite: { 19 | '^/api': ''//这里理解成用‘/api’代替target里面的地址,后面组件中我们掉接口时直接用api代替 比如我要调用'http://40.00.100.100:3002/user/add',直接写‘/api/user/add’即可 20 | } 21 | } 22 | }, 23 | 24 | // Various Dev Server settings 25 | host: 'localhost', // can be overwritten by process.env.HOST 26 | port: 8088, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined 27 | autoOpenBrowser: false, 28 | errorOverlay: true, 29 | notifyOnErrors: true, 30 | poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- 31 | 32 | 33 | /** 34 | * Source Maps 35 | */ 36 | 37 | // https://webpack.js.org/configuration/devtool/#development 38 | devtool: 'cheap-module-eval-source-map', 39 | 40 | // If you have problems debugging vue-files in devtools, 41 | // set this to false - it *may* help 42 | // https://vue-loader.vuejs.org/en/options.html#cachebusting 43 | cacheBusting: true, 44 | 45 | cssSourceMap: true 46 | }, 47 | 48 | build: { 49 | // Template for index.html 50 | index: path.resolve(__dirname, '../dist/index.html'), 51 | 52 | // Paths 53 | assetsRoot: path.resolve(__dirname, '../dist'), 54 | assetsSubDirectory: 'static', 55 | assetsPublicPath: '/', 56 | 57 | /** 58 | * Source Maps 59 | */ 60 | 61 | productionSourceMap: true, 62 | // https://webpack.js.org/configuration/devtool/#production 63 | devtool: '#source-map', 64 | 65 | // Gzip off by default as many popular static hosts such as 66 | // Surge or Netlify already gzip all static assets for you. 67 | // Before setting to `true`, make sure to: 68 | // npm install --save-dev compression-webpack-plugin 69 | productionGzip: false, 70 | productionGzipExtensions: ['js', 'css'], 71 | 72 | // Run the build command with an extra argument to 73 | // View the bundle analyzer report after build finishes: 74 | // `npm run build --report` 75 | // Set to `true` or `false` to always turn it on or off 76 | bundleAnalyzerReport: process.env.npm_config_report 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /exam/src/components/teacher/addStudent.vue: -------------------------------------------------------------------------------- 1 | 2 | 42 | 43 | 87 | 93 | 94 | -------------------------------------------------------------------------------- /exam/src/components/teacher/selectAnswer.vue: -------------------------------------------------------------------------------- 1 | //查询所有题库 2 | 24 | 25 | 72 | 98 | -------------------------------------------------------------------------------- /exam/src/components/teacher/allStudentsGrade.vue: -------------------------------------------------------------------------------- 1 | // 所有学生 2 | 30 | 31 | 69 | 93 | -------------------------------------------------------------------------------- /exam/src/components/teacher/addAnswer.vue: -------------------------------------------------------------------------------- 1 | //获取试卷并跳转到添加题库 2 | 32 | 33 | 71 | 85 | -------------------------------------------------------------------------------- /exam/build/utils.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const path = require('path') 3 | const config = require('../config') 4 | const ExtractTextPlugin = require('extract-text-webpack-plugin') 5 | const packageConfig = require('../package.json') 6 | 7 | exports.assetsPath = function (_path) { 8 | const assetsSubDirectory = process.env.NODE_ENV === 'production' 9 | ? config.build.assetsSubDirectory 10 | : config.dev.assetsSubDirectory 11 | 12 | return path.posix.join(assetsSubDirectory, _path) 13 | } 14 | 15 | exports.cssLoaders = function (options) { 16 | options = options || {} 17 | 18 | const cssLoader = { 19 | loader: 'css-loader', 20 | options: { 21 | sourceMap: options.sourceMap 22 | } 23 | } 24 | 25 | const postcssLoader = { 26 | loader: 'postcss-loader', 27 | options: { 28 | sourceMap: options.sourceMap 29 | } 30 | } 31 | 32 | // generate loader string to be used with extract text plugin 33 | function generateLoaders (loader, loaderOptions) { 34 | const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] 35 | 36 | if (loader) { 37 | loaders.push({ 38 | loader: loader + '-loader', 39 | options: Object.assign({}, loaderOptions, { 40 | sourceMap: options.sourceMap 41 | }) 42 | }) 43 | } 44 | 45 | // Extract CSS when that option is specified 46 | // (which is the case during production build) 47 | if (options.extract) { 48 | return ExtractTextPlugin.extract({ 49 | use: loaders, 50 | fallback: 'vue-style-loader' 51 | }) 52 | } else { 53 | return ['vue-style-loader'].concat(loaders) 54 | } 55 | } 56 | 57 | // https://vue-loader.vuejs.org/en/configurations/extract-css.html 58 | return { 59 | css: generateLoaders(), 60 | postcss: generateLoaders(), 61 | less: generateLoaders('less'), 62 | stylus: generateLoaders('stylus'), 63 | styl: generateLoaders('stylus') 64 | } 65 | } 66 | 67 | // Generate loaders for standalone style files (outside of .vue) 68 | exports.styleLoaders = function (options) { 69 | const output = [] 70 | const loaders = exports.cssLoaders(options) 71 | 72 | for (const extension in loaders) { 73 | const loader = loaders[extension] 74 | output.push({ 75 | test: new RegExp('\\.' + extension + '$'), 76 | use: loader 77 | }) 78 | } 79 | 80 | return output 81 | } 82 | 83 | exports.createNotifierCallback = () => { 84 | const notifier = require('node-notifier') 85 | 86 | return (severity, errors) => { 87 | if (severity !== 'error') return 88 | 89 | const error = errors[0] 90 | const filename = error.file && error.file.split('!').pop() 91 | 92 | notifier.notify({ 93 | title: packageConfig.name, 94 | message: severity + ': ' + error.name, 95 | subtitle: filename || '', 96 | icon: path.join(__dirname, 'logo.png') 97 | }) 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /exam/src/components/teacher/selectExamToPart.vue: -------------------------------------------------------------------------------- 1 | //查询所有考试跳转到分段页面 2 | 32 | 33 | 72 | 86 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/entity/Student.java: -------------------------------------------------------------------------------- 1 | package com.exam.entity; 2 | 3 | public class Student { 4 | private Integer studentId; 5 | 6 | private String studentName; 7 | 8 | private String grade; 9 | 10 | private String major; 11 | 12 | private String clazz; 13 | 14 | private String institute; 15 | 16 | private String tel; 17 | 18 | private String email; 19 | 20 | private String pwd; 21 | 22 | private String cardId; 23 | 24 | private String sex; 25 | 26 | private String role; 27 | 28 | public Integer getStudentId() { 29 | return studentId; 30 | } 31 | 32 | public void setStudentId(Integer studentId) { 33 | this.studentId = studentId; 34 | } 35 | 36 | public String getStudentName() { 37 | return studentName; 38 | } 39 | 40 | public void setStudentName(String studentName) { 41 | this.studentName = studentName == null ? null : studentName.trim(); 42 | } 43 | 44 | public String getGrade() { 45 | return grade; 46 | } 47 | 48 | public void setGrade(String grade) { 49 | this.grade = grade == null ? null : grade.trim(); 50 | } 51 | 52 | public String getMajor() { 53 | return major; 54 | } 55 | 56 | public void setMajor(String major) { 57 | this.major = major == null ? null : major.trim(); 58 | } 59 | 60 | public String getClazz() { 61 | return clazz; 62 | } 63 | 64 | public void setClazz(String clazz) { 65 | this.clazz = clazz == null ? null : clazz.trim(); 66 | } 67 | 68 | public String getInstitute() { 69 | return institute; 70 | } 71 | 72 | public void setInstitute(String institute) { 73 | this.institute = institute == null ? null : institute.trim(); 74 | } 75 | 76 | public String getTel() { 77 | return tel; 78 | } 79 | 80 | public void setTel(String tel) { 81 | this.tel = tel == null ? null : tel.trim(); 82 | } 83 | 84 | public String getEmail() { 85 | return email; 86 | } 87 | 88 | public void setEmail(String email) { 89 | this.email = email == null ? null : email.trim(); 90 | } 91 | 92 | public String getPwd() { 93 | return pwd; 94 | } 95 | 96 | public void setPwd(String pwd) { 97 | this.pwd = pwd == null ? null : pwd.trim(); 98 | } 99 | 100 | public String getCardId() { 101 | return cardId; 102 | } 103 | 104 | public void setCardId(String cardId) { 105 | this.cardId = cardId == null ? null : cardId.trim(); 106 | } 107 | 108 | public String getSex() { 109 | return sex; 110 | } 111 | 112 | public void setSex(String sex) { 113 | this.sex = sex == null ? null : sex.trim(); 114 | } 115 | 116 | public String getRole() { 117 | return role; 118 | } 119 | 120 | public void setRole(String role) { 121 | this.role = role == null ? null : role.trim(); 122 | } 123 | } -------------------------------------------------------------------------------- /exam/build/webpack.base.conf.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const path = require('path') 3 | const utils = require('./utils') 4 | const config = require('../config') 5 | const vueLoaderConfig = require('./vue-loader.conf') 6 | 7 | function resolve (dir) { 8 | return path.join(__dirname, '..', dir) 9 | } 10 | 11 | 12 | 13 | module.exports = { 14 | context: path.resolve(__dirname, '../'), 15 | entry: { 16 | app: './src/main.js' 17 | }, 18 | output: { 19 | path: config.build.assetsRoot, 20 | filename: '[name].js', 21 | publicPath: process.env.NODE_ENV === 'production' 22 | ? config.build.assetsPublicPath 23 | : config.dev.assetsPublicPath 24 | }, 25 | resolve: { 26 | extensions: ['.js', '.vue', '.json'], 27 | alias: { 28 | 'vue$': 'vue/dist/vue.esm.js', 29 | '@': resolve('src'), 30 | } 31 | }, 32 | module: { 33 | rules: [ 34 | { 35 | test: /\.less$/, 36 | loader: "style-loader!css-loader!less-loader" 37 | }, 38 | { 39 | test: /\.vue$/, 40 | loader: 'vue-loader', 41 | options: vueLoaderConfig 42 | }, 43 | { 44 | test: /\.js$/, 45 | loader: 'babel-loader', 46 | include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] 47 | }, 48 | { 49 | test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, 50 | loader: 'url-loader', 51 | options: { 52 | limit: 10000, 53 | name: utils.assetsPath('img/[name].[hash:7].[ext]') 54 | } 55 | }, 56 | { 57 | test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, 58 | loader: 'url-loader', 59 | options: { 60 | limit: 10000, 61 | name: utils.assetsPath('media/[name].[hash:7].[ext]') 62 | } 63 | }, 64 | { 65 | test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, 66 | loader: 'url-loader', 67 | options: { 68 | limit: 10000, 69 | name: utils.assetsPath('fonts/[name].[hash:7].[ext]') 70 | } 71 | }, 72 | // { 73 | // test: /node_modules[\\\/]vis[\\\/].*\.js$/, 74 | // loader: 'babel-loader', 75 | // query: { 76 | // cacheDirectory: true, 77 | // presets: [ "babel-preset-es2015" ].map(require.resolve), 78 | // plugins: [ 79 | // "transform-es3-property-literals", // #2452 80 | // "transform-es3-member-expression-literals", // #2566 81 | // "transform-runtime" // #2566 82 | // ] 83 | // } 84 | // } 85 | ] 86 | }, 87 | node: { 88 | // prevent webpack from injecting useless setImmediate polyfill because Vue 89 | // source contains it (although only uses it if it's native). 90 | setImmediate: false, 91 | // prevent webpack from injecting mocks to Node native modules 92 | // that does not make sense for the client 93 | dgram: 'empty', 94 | fs: 'empty', 95 | net: 'empty', 96 | tls: 'empty', 97 | child_process: 'empty' 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /exam/src/components/common/mainLeft.vue: -------------------------------------------------------------------------------- 1 | 2 | 30 | 31 | 69 | 70 | 105 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/controller/ItemController.java: -------------------------------------------------------------------------------- 1 | package com.exam.controller; 2 | 3 | import com.exam.entity.ApiResult; 4 | import com.exam.entity.PaperManage; 5 | import com.exam.service.PaperService; 6 | import com.exam.serviceimpl.FillQuestionServiceImpl; 7 | import com.exam.serviceimpl.JudgeQuestionServiceImpl; 8 | import com.exam.serviceimpl.MultiQuestionServiceImpl; 9 | import com.exam.util.ApiResultHandler; 10 | import com.exam.vo.Item; 11 | import org.springframework.beans.factory.annotation.Autowired; 12 | import org.springframework.web.bind.annotation.PostMapping; 13 | import org.springframework.web.bind.annotation.RequestBody; 14 | import org.springframework.web.bind.annotation.RestController; 15 | 16 | import java.util.List; 17 | 18 | @RestController 19 | public class ItemController { 20 | 21 | @Autowired 22 | MultiQuestionServiceImpl multiQuestionService; 23 | 24 | @Autowired 25 | FillQuestionServiceImpl fillQuestionService; 26 | 27 | @Autowired 28 | JudgeQuestionServiceImpl judgeQuestionService; 29 | 30 | @Autowired 31 | PaperService paperService; 32 | 33 | 34 | 35 | @PostMapping("/item") 36 | public ApiResult ItemController(@RequestBody Item item) { 37 | // 选择题 38 | Integer changeNumber = item.getChangeNumber(); 39 | // 填空题 40 | Integer fillNumber = item.getFillNumber(); 41 | // 判断题 42 | Integer judgeNumber = item.getJudgeNumber(); 43 | //出卷id 44 | Integer paperId = item.getPaperId(); 45 | 46 | // 选择题数据库获取 47 | List changeNumbers = multiQuestionService.findBySubject(item.getSubject(), changeNumber); 48 | if(changeNumbers==null){ 49 | return ApiResultHandler.buildApiResult(400,"选择题数据库获取失败",null); 50 | } 51 | for (Integer number : changeNumbers) { 52 | PaperManage paperManage = new PaperManage(paperId,1,number); 53 | int index = paperService.add(paperManage); 54 | if(index==0) 55 | return ApiResultHandler.buildApiResult(400,"选择题组卷保存失败",null); 56 | } 57 | 58 | // 填空题 59 | List fills = fillQuestionService.findBySubject(item.getSubject(), fillNumber); 60 | if(fills==null) 61 | return ApiResultHandler.buildApiResult(400,"填空题数据库获取失败",null); 62 | for (Integer fillNum : fills) { 63 | PaperManage paperManage = new PaperManage(paperId,2,fillNum); 64 | int index = paperService.add(paperManage); 65 | if(index==0) 66 | return ApiResultHandler.buildApiResult(400,"填空题题组卷保存失败",null); 67 | } 68 | // 判断题 69 | List judges = judgeQuestionService.findBySubject(item.getSubject(), judgeNumber); 70 | if(fills==null) 71 | return ApiResultHandler.buildApiResult(400,"判断题数据库获取失败",null); 72 | for (Integer judge : judges) { 73 | PaperManage paperManage = new PaperManage(paperId,3,judge); 74 | int index = paperService.add(paperManage); 75 | if(index==0) 76 | return ApiResultHandler.buildApiResult(400,"判断题题组卷保存失败",null); 77 | } 78 | 79 | 80 | return ApiResultHandler.buildApiResult(200,"试卷组卷成功",null); 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/controller/ExamManageController.java: -------------------------------------------------------------------------------- 1 | package com.exam.controller; 2 | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.exam.entity.ApiResult; 6 | import com.exam.entity.ExamManage; 7 | import com.exam.serviceimpl.ExamManageServiceImpl; 8 | import com.exam.util.ApiResultHandler; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.web.bind.annotation.*; 11 | 12 | @RestController 13 | public class ExamManageController { 14 | 15 | @Autowired 16 | private ExamManageServiceImpl examManageService; 17 | 18 | @GetMapping("/exams") 19 | public ApiResult findAll(){ 20 | System.out.println("不分页查询所有试卷"); 21 | ApiResult apiResult; 22 | apiResult = ApiResultHandler.buildApiResult(200, "请求成功!", examManageService.findAll()); 23 | return apiResult; 24 | } 25 | 26 | @GetMapping("/exams/{page}/{size}") 27 | public ApiResult findAll(@PathVariable("page") Integer page, @PathVariable("size") Integer size){ 28 | System.out.println("分页查询所有试卷"); 29 | ApiResult apiResult; 30 | Page examManage = new Page<>(page,size); 31 | IPage all = examManageService.findAll(examManage); 32 | apiResult = ApiResultHandler.buildApiResult(200, "请求成功!", all); 33 | return apiResult; 34 | } 35 | 36 | @GetMapping("/exam/{examCode}") 37 | public ApiResult findById(@PathVariable("examCode") Integer examCode){ 38 | System.out.println("根据ID查找"); 39 | ExamManage res = examManageService.findById(examCode); 40 | if(res == null) { 41 | return ApiResultHandler.buildApiResult(10000,"考试编号不存在",null); 42 | } 43 | return ApiResultHandler.buildApiResult(200,"请求成功!",res); 44 | } 45 | 46 | @DeleteMapping("/exam/{examCode}") 47 | public ApiResult deleteById(@PathVariable("examCode") Integer examCode){ 48 | int res = examManageService.delete(examCode); 49 | return ApiResultHandler.buildApiResult(200,"删除成功",res); 50 | } 51 | 52 | @PutMapping("/exam") 53 | public ApiResult update(@RequestBody ExamManage exammanage){ 54 | int res = examManageService.update(exammanage); 55 | // if (res == 0) { 56 | // return ApiResultHandler.buildApiResult(20000,"请求参数错误"); 57 | // } 58 | System.out.print("更新操作执行---"); 59 | return ApiResultHandler.buildApiResult(200,"更新成功",res); 60 | } 61 | 62 | @PostMapping("/exam") 63 | public ApiResult add(@RequestBody ExamManage exammanage){ 64 | int res = examManageService.add(exammanage); 65 | if (res ==1) { 66 | return ApiResultHandler.buildApiResult(200, "添加成功", res); 67 | } else { 68 | return ApiResultHandler.buildApiResult(400,"添加失败",res); 69 | } 70 | } 71 | 72 | @GetMapping("/examManagePaperId") 73 | public ApiResult findOnlyPaperId() { 74 | ExamManage res = examManageService.findOnlyPaperId(); 75 | if (res != null) { 76 | return ApiResultHandler.buildApiResult(200,"请求成功",res); 77 | } 78 | return ApiResultHandler.buildApiResult(400,"请求失败",res); 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /exam/src/components/student/manager.vue: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 90 | 91 | -------------------------------------------------------------------------------- /exam/build/webpack.dev.conf.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const utils = require('./utils') 3 | const webpack = require('webpack') 4 | const config = require('../config') 5 | const merge = require('webpack-merge') 6 | const path = require('path') 7 | const baseWebpackConfig = require('./webpack.base.conf') 8 | const CopyWebpackPlugin = require('copy-webpack-plugin') 9 | const HtmlWebpackPlugin = require('html-webpack-plugin') 10 | const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') 11 | const portfinder = require('portfinder') 12 | 13 | const HOST = process.env.HOST 14 | const PORT = process.env.PORT && Number(process.env.PORT) 15 | 16 | const devWebpackConfig = merge(baseWebpackConfig, { 17 | module: { 18 | rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) 19 | }, 20 | // cheap-module-eval-source-map is faster for development 21 | devtool: config.dev.devtool, 22 | 23 | // these devServer options should be customized in /config/index.js 24 | devServer: { 25 | clientLogLevel: 'warning', 26 | historyApiFallback: { 27 | rewrites: [ 28 | { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, 29 | ], 30 | }, 31 | hot: true, 32 | contentBase: false, // since we use CopyWebpackPlugin. 33 | compress: true, 34 | host: HOST || config.dev.host, 35 | port: PORT || config.dev.port, 36 | open: config.dev.autoOpenBrowser, 37 | overlay: config.dev.errorOverlay 38 | ? { warnings: false, errors: true } 39 | : false, 40 | publicPath: config.dev.assetsPublicPath, 41 | proxy: config.dev.proxyTable, 42 | quiet: true, // necessary for FriendlyErrorsPlugin 43 | watchOptions: { 44 | poll: config.dev.poll, 45 | } 46 | }, 47 | plugins: [ 48 | new webpack.DefinePlugin({ 49 | 'process.env': require('../config/dev.env') 50 | }), 51 | new webpack.HotModuleReplacementPlugin(), 52 | new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. 53 | new webpack.NoEmitOnErrorsPlugin(), 54 | // https://github.com/ampedandwired/html-webpack-plugin 55 | new HtmlWebpackPlugin({ 56 | filename: 'index.html', 57 | template: 'index.html', 58 | inject: true 59 | }), 60 | // copy custom static assets 61 | new CopyWebpackPlugin([ 62 | { 63 | from: path.resolve(__dirname, '../static'), 64 | to: config.dev.assetsSubDirectory, 65 | ignore: ['.*'] 66 | } 67 | ]) 68 | ] 69 | }) 70 | 71 | module.exports = new Promise((resolve, reject) => { 72 | portfinder.basePort = process.env.PORT || config.dev.port 73 | portfinder.getPort((err, port) => { 74 | if (err) { 75 | reject(err) 76 | } else { 77 | // publish the new Port, necessary for e2e tests 78 | process.env.PORT = port 79 | // add port to devServer config 80 | devWebpackConfig.devServer.port = port 81 | 82 | // Add FriendlyErrorsPlugin 83 | devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ 84 | compilationSuccessInfo: { 85 | messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], 86 | }, 87 | onErrors: config.dev.notifyOnErrors 88 | ? utils.createNotifierCallback() 89 | : undefined 90 | })) 91 | 92 | resolve(devWebpackConfig) 93 | } 94 | }) 95 | }) 96 | -------------------------------------------------------------------------------- /exam/src/components/charts/scorePart.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 105 | 106 | 115 | 116 | 117 | -------------------------------------------------------------------------------- /exam/src/router/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Router from 'vue-router' 3 | Vue.use(Router) 4 | 5 | export default new Router({ 6 | routes: [ 7 | { 8 | path: '/', 9 | name: 'login', //登录界面 10 | component: () => import('@/components/common/login') 11 | }, 12 | { 13 | path: '/index', //教师主页 14 | component: () => import('@/components/admin/index'), 15 | children: [ 16 | { 17 | path: '/', //首页默认路由 18 | component: () => import('@/components/common/hello') 19 | }, 20 | { 21 | path:'/grade', //学生成绩 22 | component: () => import('@/components/charts/grade') 23 | }, 24 | { 25 | path: '/selectExamToPart', //学生分数段 26 | component: () => import('@/components/teacher/selectExamToPart') 27 | }, 28 | { 29 | path: '/scorePart', 30 | component: () => import('@/components/charts/scorePart') 31 | }, 32 | { 33 | path: '/allStudentsGrade', //所有学生成绩统计 34 | component: () => import('@/components/teacher/allStudentsGrade') 35 | }, 36 | { 37 | path: '/examDescription', //考试管理功能描述 38 | component: () => import('@/components/teacher/examDescription') 39 | }, 40 | { 41 | path: '/selectExam', //查询所有考试 42 | component: () => import('@/components/teacher/selectExam') 43 | }, 44 | { 45 | path: '/addExam', //添加考试 46 | component: () => import('@/components/teacher/addExam') 47 | }, 48 | { 49 | path: '/answerDescription', //题库管理功能介绍 50 | component: ()=> import('@/components/teacher/answerDescription') 51 | }, 52 | { 53 | path: '/selectAnswer', //查询所有题库 54 | component: () => import('@/components/teacher/selectAnswer') 55 | }, 56 | { 57 | path: '/addAnswer', //增加题库主界面 58 | component: () => import('@/components/teacher/addAnswer') 59 | }, 60 | { 61 | path: '/addAnswerChildren', //点击试卷跳转到添加题库页面 62 | component: () => import('@/components/teacher/addAnswerChildren') 63 | }, 64 | { 65 | path: '/studentManage', //学生管理界面 66 | component: () => import('@/components/teacher/studentManage') 67 | }, 68 | { 69 | path: '/addStudent', //添加学生 70 | component: () => import('@/components/teacher/addStudent') 71 | }, 72 | { 73 | path: '/teacherManage', 74 | component: () => import('@/components/admin/tacherManage') 75 | }, 76 | { 77 | path: '/addTeacher', 78 | component: () => import ('@/components/admin/addTeacher') 79 | } 80 | ] 81 | }, 82 | { 83 | path: '/student', 84 | component: () => import('@/components/student/index'), 85 | children: [ 86 | {path:"/",component: ()=> import('@/components/student/myExam')}, 87 | {path:'/startExam', component: () => import('@/components/student/startExam')}, 88 | {path: '/manager', component: () => import('@/components/student/manager')}, 89 | {path: '/examMsg', component: () => import('@/components/student/examMsg')}, 90 | {path: '/message', component: () => import('@/components/student/message')}, 91 | {path: '/studentScore', component: () => import("@/components/student/answerScore")}, 92 | {path: '/scoreTable', component: () => import("@/components/student/scoreTable")} 93 | ] 94 | }, 95 | {path: '/answer',component: () => import('@/components/student/answer')} 96 | ] 97 | }) 98 | -------------------------------------------------------------------------------- /exam/src/components/teacher/addExam.vue: -------------------------------------------------------------------------------- 1 | 2 | 44 | 45 | 104 | 110 | 111 | -------------------------------------------------------------------------------- /exam/src/components/student/index.vue: -------------------------------------------------------------------------------- 1 | 2 | 30 | 31 | 78 | 79 | 147 | -------------------------------------------------------------------------------- /exam/src/components/student/scoreTable.vue: -------------------------------------------------------------------------------- 1 | //显示学生成绩 2 | 46 | 47 | 111 | 112 | 128 | -------------------------------------------------------------------------------- /exam/src/components/common/header.vue: -------------------------------------------------------------------------------- 1 | 2 | 28 | 29 | 74 | 75 | 155 | -------------------------------------------------------------------------------- /springboot/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.springframework.boot 7 | spring-boot-starter-parent 8 | 2.1.2.RELEASE 9 | 10 | 11 | com.exam 12 | exam 13 | 0.0.1-SNAPSHOT 14 | examsystem 15 | online examsystem project for Spring Boot 16 | 17 | 18 | 1.8 19 | 20 | 21 | 22 | 23 | 24 | com.baomidou 25 | mybatis-plus-boot-starter 26 | 3.1.0 27 | 28 | 29 | org.projectlombok 30 | lombok 31 | 1.18.6 32 | provided 33 | 34 | 35 | org.springframework.boot 36 | spring-boot-starter-jdbc 37 | 38 | 39 | org.springframework.boot 40 | spring-boot-starter-web 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | mysql 50 | mysql-connector-java 51 | runtime 52 | 53 | 54 | org.springframework.boot 55 | spring-boot-starter-test 56 | test 57 | 58 | 59 | com.alibaba 60 | druid 61 | 1.1.8 62 | 63 | 64 | 65 | org.springframework.boot 66 | spring-boot-devtools 67 | true 68 | 69 | 70 | org.springframework 71 | spring-tx 72 | 4.3.9.RELEASE 73 | 74 | 75 | 76 | 77 | 78 | 79 | org.springframework.boot 80 | spring-boot-maven-plugin 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | -------------------------------------------------------------------------------- /exam/src/components/student/answerScore.vue: -------------------------------------------------------------------------------- 1 | 33 | 34 | 73 | 74 | 184 | 185 | -------------------------------------------------------------------------------- /exam/build/webpack.prod.conf.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const path = require('path') 3 | const utils = require('./utils') 4 | const webpack = require('webpack') 5 | const config = require('../config') 6 | const merge = require('webpack-merge') 7 | const baseWebpackConfig = require('./webpack.base.conf') 8 | const CopyWebpackPlugin = require('copy-webpack-plugin') 9 | const HtmlWebpackPlugin = require('html-webpack-plugin') 10 | const ExtractTextPlugin = require('extract-text-webpack-plugin') 11 | const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') 12 | const UglifyJsPlugin = require('uglifyjs-webpack-plugin') 13 | 14 | const env = require('../config/prod.env') 15 | 16 | const webpackConfig = merge(baseWebpackConfig, { 17 | module: { 18 | rules: utils.styleLoaders({ 19 | sourceMap: config.build.productionSourceMap, 20 | extract: true, 21 | usePostCSS: true 22 | }) 23 | }, 24 | devtool: config.build.productionSourceMap ? config.build.devtool : false, 25 | output: { 26 | path: config.build.assetsRoot, 27 | filename: utils.assetsPath('js/[name].[chunkhash].js'), 28 | chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') 29 | }, 30 | plugins: [ 31 | // http://vuejs.github.io/vue-loader/en/workflow/production.html 32 | new webpack.DefinePlugin({ 33 | 'process.env': env 34 | }), 35 | new UglifyJsPlugin({ 36 | uglifyOptions: { 37 | compress: { 38 | warnings: false 39 | } 40 | }, 41 | sourceMap: config.build.productionSourceMap, 42 | parallel: true 43 | }), 44 | // extract css into its own file 45 | new ExtractTextPlugin({ 46 | filename: utils.assetsPath('css/[name].[contenthash].css'), 47 | // Setting the following option to `false` will not extract CSS from codesplit chunks. 48 | // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. 49 | // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, 50 | // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 51 | allChunks: true, 52 | }), 53 | // Compress extracted CSS. We are using this plugin so that possible 54 | // duplicated CSS from different components can be deduped. 55 | new OptimizeCSSPlugin({ 56 | cssProcessorOptions: config.build.productionSourceMap 57 | ? { safe: true, map: { inline: false } } 58 | : { safe: true } 59 | }), 60 | // generate dist index.html with correct asset hash for caching. 61 | // you can customize output by editing /index.html 62 | // see https://github.com/ampedandwired/html-webpack-plugin 63 | new HtmlWebpackPlugin({ 64 | filename: config.build.index, 65 | template: 'index.html', 66 | inject: true, 67 | minify: { 68 | removeComments: true, 69 | collapseWhitespace: true, 70 | removeAttributeQuotes: true 71 | // more options: 72 | // https://github.com/kangax/html-minifier#options-quick-reference 73 | }, 74 | // necessary to consistently work with multiple chunks via CommonsChunkPlugin 75 | chunksSortMode: 'dependency' 76 | }), 77 | // keep module.id stable when vendor modules does not change 78 | new webpack.HashedModuleIdsPlugin(), 79 | // enable scope hoisting 80 | new webpack.optimize.ModuleConcatenationPlugin(), 81 | // split vendor js into its own file 82 | new webpack.optimize.CommonsChunkPlugin({ 83 | name: 'vendor', 84 | minChunks (module) { 85 | // any required modules inside node_modules are extracted to vendor 86 | return ( 87 | module.resource && 88 | /\.js$/.test(module.resource) && 89 | module.resource.indexOf( 90 | path.join(__dirname, '../node_modules') 91 | ) === 0 92 | ) 93 | } 94 | }), 95 | // extract webpack runtime and module manifest to its own file in order to 96 | // prevent vendor hash from being updated whenever app bundle is updated 97 | new webpack.optimize.CommonsChunkPlugin({ 98 | name: 'manifest', 99 | minChunks: Infinity 100 | }), 101 | // This instance extracts shared chunks from code splitted chunks and bundles them 102 | // in a separate chunk, similar to the vendor chunk 103 | // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk 104 | new webpack.optimize.CommonsChunkPlugin({ 105 | name: 'app', 106 | async: 'vendor-async', 107 | children: true, 108 | minChunks: 3 109 | }), 110 | 111 | // copy custom static assets 112 | new CopyWebpackPlugin([ 113 | { 114 | from: path.resolve(__dirname, '../static'), 115 | to: config.build.assetsSubDirectory, 116 | ignore: ['.*'] 117 | } 118 | ]) 119 | ] 120 | }) 121 | 122 | if (config.build.productionGzip) { 123 | const CompressionWebpackPlugin = require('compression-webpack-plugin') 124 | 125 | webpackConfig.plugins.push( 126 | new CompressionWebpackPlugin({ 127 | asset: '[path].gz[query]', 128 | algorithm: 'gzip', 129 | test: new RegExp( 130 | '\\.(' + 131 | config.build.productionGzipExtensions.join('|') + 132 | ')$' 133 | ), 134 | threshold: 10240, 135 | minRatio: 0.8 136 | }) 137 | ) 138 | } 139 | 140 | if (config.build.bundleAnalyzerReport) { 141 | const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin 142 | webpackConfig.plugins.push(new BundleAnalyzerPlugin()) 143 | } 144 | 145 | module.exports = webpackConfig 146 | -------------------------------------------------------------------------------- /exam/src/components/student/myExam.vue: -------------------------------------------------------------------------------- 1 | // 我的试卷页面 2 | 36 | 37 | 100 | 101 | 214 | -------------------------------------------------------------------------------- /exam/src/components/admin/tacherManage.vue: -------------------------------------------------------------------------------- 1 | // 教师管理页面 2 | 67 | 68 | 152 | 176 | -------------------------------------------------------------------------------- /exam/src/components/teacher/studentManage.vue: -------------------------------------------------------------------------------- 1 | // 学生管理页面 2 | 67 | 68 | 152 | 176 | -------------------------------------------------------------------------------- /exam/src/components/teacher/selectExam.vue: -------------------------------------------------------------------------------- 1 | //查询所有考试 2 | 80 | 81 | 165 | 179 | --------------------------------------------------------------------------------