├── exam ├── static │ ├── .gitkeep │ └── img │ │ ├── icon.png │ │ └── userimg.png ├── 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 ├── config │ ├── prod.env.js │ ├── dev.env.js │ └── index.js ├── src │ ├── assets │ │ ├── logo.png │ │ └── img │ │ │ ├── icon.png │ │ │ ├── loginbg.png │ │ │ └── userimg.png │ ├── components │ │ ├── student │ │ │ ├── answerExam.vue │ │ │ ├── myFooter.vue │ │ │ ├── manager.vue │ │ │ ├── index.vue │ │ │ ├── startExam.vue │ │ │ ├── myExam.vue │ │ │ ├── message.vue │ │ │ ├── examMsg.vue │ │ │ └── answer.vue │ │ ├── common │ │ │ ├── mainTop.vue │ │ │ ├── grade.vue │ │ │ ├── navigator.vue │ │ │ ├── mainLeft.vue │ │ │ ├── header.vue │ │ │ └── login.vue │ │ └── admin │ │ │ └── index.vue │ ├── App.vue │ ├── vuex │ │ ├── Demo.vue │ │ └── store.js │ ├── main.js │ └── router │ │ └── index.js ├── .editorconfig ├── .gitignore ├── .babelrc ├── .postcssrc.js ├── index.html ├── README.md └── package.json ├── springboot ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── src │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── exam │ │ │ │ ├── entity │ │ │ │ ├── PaperManage.java │ │ │ │ ├── Answer.java │ │ │ │ ├── FillQuestion.java │ │ │ │ ├── JudgeQuestion.java │ │ │ │ ├── Replay.java │ │ │ │ ├── Teacher.java │ │ │ │ ├── Login.java │ │ │ │ ├── Message.java │ │ │ │ ├── MultiQuestion.java │ │ │ │ ├── ExamManage.java │ │ │ │ ├── ApiResult.java │ │ │ │ ├── SubjectInfo.java │ │ │ │ ├── ScoreManage.java │ │ │ │ ├── Admin.java │ │ │ │ └── Student.java │ │ │ │ ├── service │ │ │ │ ├── FillQuestionService.java │ │ │ │ ├── JudgeQuestionService.java │ │ │ │ ├── MultiQuestionService.java │ │ │ │ ├── AdminService.java │ │ │ │ ├── PaperService.java │ │ │ │ ├── TeacherService.java │ │ │ │ ├── LoginService.java │ │ │ │ ├── StudentService.java │ │ │ │ ├── ReplayService.java │ │ │ │ ├── MessageService.java │ │ │ │ └── ExamManageService.java │ │ │ │ ├── ExamsystemApplication.java │ │ │ │ ├── mapper │ │ │ │ ├── FillQuestionMapper.java │ │ │ │ ├── JudgeQuestionMapper.java │ │ │ │ ├── PaperMapper.java │ │ │ │ ├── MultiQuestionMapper.java │ │ │ │ ├── LoginMapper.java │ │ │ │ ├── AdminMapper.java │ │ │ │ ├── ReplayMapper.java │ │ │ │ ├── TeacherMapper.java │ │ │ │ ├── MessageMapper.java │ │ │ │ ├── StudentMapper.java │ │ │ │ └── ExamManageMapper.java │ │ │ │ ├── serviceimpl │ │ │ │ ├── FillQuestionServiceImpl.java │ │ │ │ ├── MultiQuestionServiceImpl.java │ │ │ │ ├── JudgeQuestionServiceImpl.java │ │ │ │ ├── PaperServiceImpl.java │ │ │ │ ├── LoginServiceImpl.java │ │ │ │ ├── AdminServiceImpl.java │ │ │ │ ├── TeacherServiceImpl.java │ │ │ │ ├── MessageServiceImpl.java │ │ │ │ ├── ReplayServiceImpl.java │ │ │ │ ├── StudentServiceImpl.java │ │ │ │ └── ExamManageServiceImpl.java │ │ │ │ ├── MybatisPlusConfig.java │ │ │ │ ├── util │ │ │ │ └── ApiResultHandler.java │ │ │ │ ├── controller │ │ │ │ ├── ReplayController.java │ │ │ │ ├── TeacherController.java │ │ │ │ ├── AdminController.java │ │ │ │ ├── LoginController.java │ │ │ │ ├── MessageController.java │ │ │ │ ├── PaperController.java │ │ │ │ ├── StudentController.java │ │ │ │ └── ExamManageController.java │ │ │ │ └── structure │ │ │ │ └── Tree.java │ │ └── resources │ │ │ └── application.properties │ └── test │ │ └── java │ │ └── com │ │ └── exam │ │ └── ExamsystemApplicationTests.java ├── .gitignore ├── pom.xml ├── mvnw.cmd └── mvnw └── README.md /exam/static/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /exam/build/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hysian/springboot-vue/HEAD/exam/build/logo.png -------------------------------------------------------------------------------- /exam/config/prod.env.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | module.exports = { 3 | NODE_ENV: '"production"' 4 | } 5 | -------------------------------------------------------------------------------- /exam/src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hysian/springboot-vue/HEAD/exam/src/assets/logo.png -------------------------------------------------------------------------------- /exam/static/img/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hysian/springboot-vue/HEAD/exam/static/img/icon.png -------------------------------------------------------------------------------- /exam/src/assets/img/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hysian/springboot-vue/HEAD/exam/src/assets/img/icon.png -------------------------------------------------------------------------------- /exam/static/img/userimg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hysian/springboot-vue/HEAD/exam/static/img/userimg.png -------------------------------------------------------------------------------- /exam/src/components/student/answerExam.vue: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /exam/src/assets/img/loginbg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hysian/springboot-vue/HEAD/exam/src/assets/img/loginbg.png -------------------------------------------------------------------------------- /exam/src/assets/img/userimg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hysian/springboot-vue/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/Hysian/springboot-vue/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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # springboot-vue在线考试系统 2 | * springboot+vue前后端分离的一个项目,记录自己毕业设计完成的情况 3 | * 在线预览 http://gopikachu.top 4 | * 前台考试页面http://localhost:8080/#/student 5 | * 后台管理页面http://localhost:8080/#/index 6 | -------------------------------------------------------------------------------- /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 | .idea 10 | .vscode 11 | *.suo 12 | *.ntvs* 13 | *.njsproj 14 | *.sln 15 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/entity/PaperManage.java: -------------------------------------------------------------------------------- 1 | package com.exam.entity; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class PaperManage { 7 | private Integer paperId; 8 | 9 | private Integer questionType; 10 | 11 | private Integer questionId; 12 | } -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/service/FillQuestionService.java: -------------------------------------------------------------------------------- 1 | package com.exam.service; 2 | 3 | import com.exam.entity.FillQuestion; 4 | 5 | import java.util.List; 6 | 7 | public interface FillQuestionService { 8 | 9 | List findByIdAndType(Integer paperId); 10 | } 11 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/service/JudgeQuestionService.java: -------------------------------------------------------------------------------- 1 | package com.exam.service; 2 | 3 | import com.exam.entity.JudgeQuestion; 4 | 5 | import java.util.List; 6 | 7 | public interface JudgeQuestionService { 8 | 9 | List findByIdAndType(Integer paperId); 10 | } 11 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/service/MultiQuestionService.java: -------------------------------------------------------------------------------- 1 | package com.exam.service; 2 | 3 | import com.exam.entity.MultiQuestion; 4 | 5 | import java.util.List; 6 | 7 | public interface MultiQuestionService { 8 | 9 | List findByIdAndType(Integer PaperId); 10 | } 11 | -------------------------------------------------------------------------------- /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/entity/Answer.java: -------------------------------------------------------------------------------- 1 | package com.exam.entity; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class Answer { 7 | private Integer examCode; 8 | 9 | private Integer studentId; 10 | 11 | private String subject; 12 | 13 | private Integer questionId; 14 | 15 | private Integer questionType; 16 | 17 | private String answer; 18 | } -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | } -------------------------------------------------------------------------------- /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/TeacherService.java: -------------------------------------------------------------------------------- 1 | package com.exam.service; 2 | 3 | import com.exam.entity.Teacher; 4 | 5 | import java.util.List; 6 | 7 | public interface TeacherService { 8 | 9 | public List findAll(); 10 | 11 | public Teacher findById(Integer teacherId); 12 | 13 | public int deleteById(Integer teacherId); 14 | 15 | public int update(Teacher teacher); 16 | 17 | public int add(Teacher teacher); 18 | } 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/main/java/com/exam/service/StudentService.java: -------------------------------------------------------------------------------- 1 | package com.exam.service; 2 | 3 | import com.exam.entity.Student; 4 | 5 | import java.util.List; 6 | 7 | public interface StudentService { 8 | 9 | List findAll(); 10 | 11 | Student findById(Integer studentId); 12 | 13 | int deleteById(Integer studentId); 14 | 15 | int update(Student student); 16 | 17 | int updatePwd(Student student); 18 | int add(Student student); 19 | } 20 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /exam/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 去吧皮卡丘 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /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/README.md: -------------------------------------------------------------------------------- 1 | # vue-init 2 | 3 | > vue demo 4 | 5 | ## Build Setup 6 | 7 | ``` bash 8 | # install dependencies 9 | npm install 10 | 11 | # serve with hot reload at localhost:8080 12 | npm run dev 13 | 14 | # build for production with minification 15 | npm run build 16 | 17 | # build for production and view the bundle analyzer report 18 | npm run build --report 19 | ``` 20 | 21 | For a detailed explanation on how things work, check out the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader). 22 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/mapper/FillQuestionMapper.java: -------------------------------------------------------------------------------- 1 | package com.exam.mapper; 2 | 3 | import com.exam.entity.FillQuestion; 4 | import org.apache.ibatis.annotations.Mapper; 5 | import org.apache.ibatis.annotations.Select; 6 | 7 | import java.util.List; 8 | 9 | //填空题 10 | @Mapper 11 | public interface FillQuestionMapper { 12 | 13 | @Select("select * from FillQuestion where questionId in (select questionId from PaperManage where questionType = 2 and paperId = #{paperId})") 14 | List findByIdAndType(Integer paperId); 15 | } 16 | -------------------------------------------------------------------------------- /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/mapper/JudgeQuestionMapper.java: -------------------------------------------------------------------------------- 1 | package com.exam.mapper; 2 | 3 | import com.exam.entity.JudgeQuestion; 4 | import org.apache.ibatis.annotations.Mapper; 5 | import org.apache.ibatis.annotations.Select; 6 | 7 | import java.util.List; 8 | 9 | //判断题 10 | 11 | @Mapper 12 | public interface JudgeQuestionMapper { 13 | 14 | @Select("select * from JudgeQuestion where questionId in (select questionId from PaperManage where questionType = 3 and paperId = #{paperId})") 15 | List findByIdAndType(Integer paperId); 16 | } 17 | -------------------------------------------------------------------------------- /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.Mapper; 5 | import org.apache.ibatis.annotations.Select; 6 | 7 | import java.util.List; 8 | 9 | @Mapper 10 | public interface PaperMapper { 11 | @Select("select paperId, questionType,questionId from PaperManage") 12 | List findAll(); 13 | 14 | @Select("select paperId, questionType,questionId from PaperManage where paperId = #{paperId}") 15 | List findById(Integer paperId); 16 | } 17 | -------------------------------------------------------------------------------- /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 right; 27 | 28 | private Integer score; 29 | 30 | } -------------------------------------------------------------------------------- /exam/src/vuex/Demo.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 27 | -------------------------------------------------------------------------------- /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://47.107.78.99:3306/exam?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=UTC 5 | spring.datasource.url=jdbc:mysql://localhost:3306/exam?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=UTC 6 | spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver 7 | spring.datasource.type=com.alibaba.druid.pool.DruidDataSource 8 | mybatis.configuration.mapUnderscoreToCamelCase=true 9 | logging.level.com.exam.mapper=debug -------------------------------------------------------------------------------- /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/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 Date 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 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/serviceimpl/FillQuestionServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.exam.serviceimpl; 2 | 3 | import com.exam.entity.FillQuestion; 4 | import com.exam.mapper.FillQuestionMapper; 5 | import com.exam.service.FillQuestionService; 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 FillQuestionServiceImpl implements FillQuestionService { 13 | 14 | @Autowired 15 | private FillQuestionMapper fillQuestionMapper; 16 | 17 | @Override 18 | public List findByIdAndType(Integer paperId) { 19 | return fillQuestionMapper.findByIdAndType(paperId); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/mapper/MultiQuestionMapper.java: -------------------------------------------------------------------------------- 1 | package com.exam.mapper; 2 | 3 | import com.exam.entity.MultiQuestion; 4 | import org.apache.ibatis.annotations.Mapper; 5 | import org.apache.ibatis.annotations.Select; 6 | 7 | import java.util.List; 8 | 9 | //选择题 10 | @Mapper 11 | public interface MultiQuestionMapper { 12 | /** 13 | * select * from multiquestions where questionId in ( 14 | * select questionId from papermanage where questionType = 1 and paperId = 1001 15 | * ) 16 | */ 17 | @Select("select * from MultiQuestion where questionId in (select questionId from PaperManage where questionType = 1 and paperId = #{paperId})") 18 | List findByIdAndType(Integer PaperId); 19 | } 20 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/serviceimpl/MultiQuestionServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.exam.serviceimpl; 2 | 3 | import com.exam.entity.MultiQuestion; 4 | import com.exam.mapper.MultiQuestionMapper; 5 | import com.exam.service.MultiQuestionService; 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 MultiQuestionServiceImpl implements MultiQuestionService { 13 | 14 | @Autowired 15 | private MultiQuestionMapper multiQuestionMapper; 16 | @Override 17 | public List findByIdAndType(Integer PaperId) { 18 | return multiQuestionMapper.findByIdAndType(PaperId); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/serviceimpl/JudgeQuestionServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.exam.serviceimpl; 2 | 3 | import com.exam.entity.JudgeQuestion; 4 | import com.exam.mapper.JudgeQuestionMapper; 5 | import com.exam.service.JudgeQuestionService; 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 JudgeQuestionServiceImpl implements JudgeQuestionService { 13 | 14 | @Autowired 15 | private JudgeQuestionMapper judgeQuestionMapper; 16 | 17 | @Override 18 | public List findByIdAndType(Integer paperId) { 19 | return judgeQuestionMapper.findByIdAndType(paperId); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | 12 | Vue.use(ElementUI) 13 | Vue.use(VueCookies) 14 | 15 | Vue.config.productionTip = false 16 | Vue.prototype.bus = new Vue() 17 | Vue.prototype.$echarts = echarts 18 | Vue.prototype.$axios = axios 19 | 20 | new Vue({ 21 | el: '#app', 22 | router, 23 | render: h => h(App), 24 | components: { App }, 25 | template: '' 26 | }) 27 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | } 29 | -------------------------------------------------------------------------------- /exam/src/components/student/myFooter.vue: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 19 | 20 | 42 | -------------------------------------------------------------------------------- /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 admin 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/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 | -------------------------------------------------------------------------------- /exam/src/components/admin/index.vue: -------------------------------------------------------------------------------- 1 | // 展示组件页面 2 | 16 | 17 | 32 | 33 | 47 | 48 | -------------------------------------------------------------------------------- /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 admin") 12 | public List findAll(); 13 | 14 | @Select("select adminName,sex,tel,email,cardId,role from admin where adminId = #{adminId}") 15 | public Admin findById(Integer adminId); 16 | 17 | @Delete("delete from admin 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 | -------------------------------------------------------------------------------- /exam/src/components/common/grade.vue: -------------------------------------------------------------------------------- 1 | // 成绩统计页面 2 | 7 | 8 | 42 | 43 | 49 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/serviceimpl/TeacherServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.exam.serviceimpl; 2 | 3 | import com.exam.entity.Teacher; 4 | import com.exam.mapper.TeacherMapper; 5 | import com.exam.service.TeacherService; 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 TeacherServiceImpl implements TeacherService { 13 | @Autowired 14 | private TeacherMapper teacherMapper; 15 | @Override 16 | public List findAll() { 17 | return teacherMapper.findAll(); 18 | } 19 | 20 | @Override 21 | public Teacher findById(Integer teacherId) { 22 | return teacherMapper.findById(teacherId); 23 | } 24 | 25 | @Override 26 | public int deleteById(Integer teacherId) { 27 | return teacherMapper.deleteById(teacherId); 28 | } 29 | 30 | @Override 31 | public int update(Teacher teacher) { 32 | return teacherMapper.update(teacher); 33 | } 34 | 35 | @Override 36 | public int add(Teacher teacher) { 37 | return teacherMapper.add(teacher); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /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/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/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:'/grade', 18 | component: () => import('@/components/common/grade') 19 | } 20 | ] 21 | }, 22 | { 23 | path: '/student', 24 | component: ()=> import('@/components/student/index'), 25 | children: [ 26 | {path:"/",component: ()=> import('@/components/student/myExam')}, 27 | {path:'/startExam', component: ()=> import('@/components/student/startExam')}, 28 | {path: '/manager', component: ()=> import('@/components/student/manager')}, 29 | {path: '/examMsg', component: ()=> import('@/components/student/examMsg')}, 30 | {path: '/message', component: ()=> import('@/components/student/message')} 31 | ] 32 | }, 33 | {path: '/answer',component: ()=> import('@/components/student/answer')} 34 | ] 35 | }) 36 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/mapper/TeacherMapper.java: -------------------------------------------------------------------------------- 1 | package com.exam.mapper; 2 | 3 | import com.exam.entity.Teacher; 4 | import org.apache.ibatis.annotations.*; 5 | 6 | import java.util.List; 7 | 8 | @Mapper 9 | public interface TeacherMapper { 10 | @Select("select * from teacher") 11 | public List findAll(); 12 | 13 | @Select("select * from teacher where teacherId = #{teacherId}") 14 | public Teacher findById(Integer teacherId); 15 | 16 | @Delete("delete from teacher where teacherId = #{teacherId}") 17 | public int deleteById(Integer teacherId); 18 | 19 | @Update("update teacher set teacherName = #{teacherName},sex = #{sex}," + 20 | "tel = #{tel}, email = #{email},pwd = #{pwd},cardId = #{cardId}," + 21 | "role = #{role},institute = #{institute},type = #{type} where teacherId = #{teacherId}") 22 | public int update(Teacher teacher); 23 | 24 | @Options(useGeneratedKeys = true,keyProperty = "teacherId") 25 | @Insert("insert into teacher(teacherName,sex,tel,email,pwd,cardId,role,type,institute) " + 26 | "values(#{teacherName},#{sex},#{tel},#{email},#{pwd},#{cardId},#{role},#{type},#{institute})") 27 | public int add(Teacher teacher); 28 | } 29 | -------------------------------------------------------------------------------- /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/StudentServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.exam.serviceimpl; 2 | 3 | import com.exam.entity.Student; 4 | import com.exam.mapper.StudentMapper; 5 | import com.exam.service.StudentService; 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 StudentServiceImpl implements StudentService { 13 | @Autowired 14 | private StudentMapper studentMapper; 15 | @Override 16 | public List findAll() { 17 | return studentMapper.findAll(); 18 | } 19 | 20 | @Override 21 | public Student findById(Integer studentId) { 22 | return studentMapper.findById(studentId); 23 | } 24 | 25 | @Override 26 | public int deleteById(Integer studentId) { 27 | return studentMapper.deleteById(studentId); 28 | } 29 | 30 | @Override 31 | public int update(Student student) { 32 | return studentMapper.update(student); 33 | } 34 | 35 | @Override 36 | public int updatePwd(Student student) { 37 | return studentMapper.updatePwd(student); 38 | } 39 | 40 | @Override 41 | public int add(Student student) { 42 | return studentMapper.add(student); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /exam/src/components/common/navigator.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 38 | 39 | 49 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/entity/SubjectInfo.java: -------------------------------------------------------------------------------- 1 | package com.exam.entity; 2 | 3 | public class SubjectInfo { 4 | private Integer subjectId; 5 | 6 | private String subjectName; 7 | 8 | private String institute; 9 | 10 | private Integer instituteId; 11 | 12 | private Integer teacherId; 13 | 14 | public Integer getSubjectId() { 15 | return subjectId; 16 | } 17 | 18 | public void setSubjectId(Integer subjectId) { 19 | this.subjectId = subjectId; 20 | } 21 | 22 | public String getSubjectName() { 23 | return subjectName; 24 | } 25 | 26 | public void setSubjectName(String subjectName) { 27 | this.subjectName = subjectName == null ? null : subjectName.trim(); 28 | } 29 | 30 | public String getInstitute() { 31 | return institute; 32 | } 33 | 34 | public void setInstitute(String institute) { 35 | this.institute = institute == null ? null : institute.trim(); 36 | } 37 | 38 | public Integer getInstituteId() { 39 | return instituteId; 40 | } 41 | 42 | public void setInstituteId(Integer instituteId) { 43 | this.instituteId = instituteId; 44 | } 45 | 46 | public Integer getTeacherId() { 47 | return teacherId; 48 | } 49 | 50 | public void setTeacherId(Integer teacherId) { 51 | this.teacherId = teacherId; 52 | } 53 | } -------------------------------------------------------------------------------- /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/entity/ScoreManage.java: -------------------------------------------------------------------------------- 1 | package com.exam.entity; 2 | 3 | public class ScoreManage { 4 | private Integer examCode; 5 | 6 | private Integer studentId; 7 | 8 | private String subject; 9 | 10 | private Integer ptScore; 11 | 12 | private Integer etScore; 13 | 14 | private Integer score; 15 | 16 | public Integer getExamCode() { 17 | return examCode; 18 | } 19 | 20 | public void setExamCode(Integer examCode) { 21 | this.examCode = examCode; 22 | } 23 | 24 | public Integer getStudentId() { 25 | return studentId; 26 | } 27 | 28 | public void setStudentId(Integer studentId) { 29 | this.studentId = studentId; 30 | } 31 | 32 | public String getSubject() { 33 | return subject; 34 | } 35 | 36 | public void setSubject(String subject) { 37 | this.subject = subject == null ? null : subject.trim(); 38 | } 39 | 40 | public Integer getPtScore() { 41 | return ptScore; 42 | } 43 | 44 | public void setPtScore(Integer ptScore) { 45 | this.ptScore = ptScore; 46 | } 47 | 48 | public Integer getEtScore() { 49 | return etScore; 50 | } 51 | 52 | public void setEtScore(Integer etScore) { 53 | this.etScore = etScore; 54 | } 55 | 56 | public Integer getScore() { 57 | return score; 58 | } 59 | 60 | public void setScore(Integer score) { 61 | this.score = score; 62 | } 63 | } -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/mapper/StudentMapper.java: -------------------------------------------------------------------------------- 1 | package com.exam.mapper; 2 | 3 | import com.exam.entity.Student; 4 | import org.apache.ibatis.annotations.*; 5 | 6 | import java.util.List; 7 | 8 | @Mapper 9 | public interface StudentMapper { 10 | 11 | @Select("select * from student") 12 | List findAll(); 13 | 14 | @Select("select * from student where studentId = #{studentId}") 15 | Student findById(Integer studentId); 16 | 17 | @Delete("delete from student where studentId = #{studentId}") 18 | int deleteById(Integer studentId); 19 | 20 | /** 21 | *更新所有学生信息 22 | * @param student 传递一个对象 23 | * @return 受影响的记录条数 24 | */ 25 | @Update("update student set studentName = #{studentName},grade = #{grade},major = #{major},clazz = #{clazz}," + 26 | "institute = #{institute},tel = #{tel},email = #{email},pwd = #{pwd},cardId = #{cardId},sex = #{sex},role = #{role} " + 27 | "where studentId = #{studentId}") 28 | int update(Student student); 29 | 30 | /** 31 | * 更新密码 32 | * @param student 33 | * @return 受影响的记录条数 34 | */ 35 | @Update("update student set pwd = #{pwd} where studentId = #{studentId}") 36 | int updatePwd(Student student); 37 | 38 | 39 | @Options(useGeneratedKeys = true,keyProperty = "studentId") 40 | @Insert("insert into student(studentName,grade,major,clazz,institute,tel,email,pwd,cardId,sex,role) values " + 41 | "(#{studentName},#{grade},#{major},#{clazz},#{institute},#{tel},#{email},#{pwd},#{cardId},#{sex},#{role})") 42 | int add(Student student); 43 | } 44 | -------------------------------------------------------------------------------- /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 ExamManage") 13 | List findAll(); 14 | 15 | @Select("select * from ExamManage") 16 | IPage findAll(Page page); 17 | 18 | @Select("select * from ExamManage where examCode = #{examCode}") 19 | ExamManage findById(Integer examCode); 20 | 21 | @Delete("delete from ExamManage where examCode = #{examCode}") 22 | int delete(Integer examCode); 23 | 24 | @Update("update ExamManage 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 ExamManage(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 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/controller/TeacherController.java: -------------------------------------------------------------------------------- 1 | package com.exam.controller; 2 | 3 | import com.exam.entity.ApiResult; 4 | import com.exam.entity.Teacher; 5 | import com.exam.serviceimpl.TeacherServiceImpl; 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 TeacherController { 12 | 13 | private TeacherServiceImpl teacherService; 14 | @Autowired 15 | public TeacherController(TeacherServiceImpl teacherService){ 16 | this.teacherService = teacherService; 17 | } 18 | 19 | @GetMapping("/teachers") 20 | public ApiResult findAll(){ 21 | return ApiResultHandler.success(teacherService.findAll()); 22 | } 23 | 24 | @GetMapping("/teacher/{teacherId}") 25 | public ApiResult findById(@PathVariable("teacherId") Integer teacherId){ 26 | return ApiResultHandler.success(teacherService.findById(teacherId)); 27 | } 28 | 29 | @DeleteMapping("/teacher/{teacherId}") 30 | public ApiResult deleteById(@PathVariable("teacherId") Integer teacherId){ 31 | return ApiResultHandler.success(teacherService.deleteById(teacherId)); 32 | } 33 | 34 | @PutMapping("/teacher/{teacherId}") 35 | public ApiResult update(@PathVariable("teacherId") Integer adminId, Teacher teacher){ 36 | return ApiResultHandler.success(teacherService.update(teacher)); 37 | } 38 | 39 | @PostMapping("/teacher") 40 | public ApiResult add(Teacher teacher){ 41 | return ApiResultHandler.success(teacherService.add(teacher)); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /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/controller/LoginController.java: -------------------------------------------------------------------------------- 1 | package com.exam.controller; 2 | 3 | import com.exam.entity.*; 4 | import com.exam.serviceimpl.LoginServiceImpl; 5 | import com.exam.structure.Tree; 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 | import javax.servlet.http.HttpServletRequest; 14 | import java.util.HashMap; 15 | import java.util.List; 16 | import java.util.Map; 17 | 18 | @RestController 19 | public class LoginController { 20 | 21 | @Autowired 22 | private LoginServiceImpl loginService; 23 | 24 | @PostMapping("/login") 25 | public ApiResult login(@RequestBody Login login) { 26 | 27 | Integer username = login.getUsername(); 28 | String password = login.getPassword(); 29 | Admin adminRes = loginService.adminLogin(username, password); 30 | if (adminRes != null) { 31 | return ApiResultHandler.buildApiResult(200, "请求成功", adminRes); 32 | } 33 | 34 | Teacher teacherRes = loginService.teacherLogin(username,password); 35 | if (teacherRes != null) { 36 | return ApiResultHandler.buildApiResult(200, "请求成功", teacherRes); 37 | } 38 | 39 | Student studentRes = loginService.studentLogin(username,password); 40 | if (studentRes != null) { 41 | return ApiResultHandler.buildApiResult(200, "请求成功", studentRes); 42 | } 43 | 44 | return ApiResultHandler.buildApiResult(400, "请求失败", null); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /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/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/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.GetMapping; 11 | import org.springframework.web.bind.annotation.PathVariable; 12 | import org.springframework.web.bind.annotation.RestController; 13 | 14 | import java.util.HashMap; 15 | import java.util.List; 16 | import java.util.Map; 17 | 18 | @RestController 19 | public class PaperController { 20 | 21 | @Autowired 22 | private PaperServiceImpl paperService; 23 | 24 | @Autowired 25 | private JudgeQuestionServiceImpl judgeQuestionService; 26 | 27 | @Autowired 28 | private MultiQuestionServiceImpl multiQuestionService; 29 | 30 | @Autowired 31 | private FillQuestionServiceImpl fillQuestionService; 32 | @GetMapping("/papers") 33 | public ApiResult findAll() { 34 | ApiResult res = ApiResultHandler.buildApiResult(200,"请求成功",paperService.findAll()); 35 | return res; 36 | } 37 | 38 | @GetMapping("/paper/{paperId}") 39 | public Map> findById(@PathVariable("paperId") Integer paperId) { 40 | List multiQuestionRes = multiQuestionService.findByIdAndType(paperId); //选择题题库 1 41 | List fillQuestionsRes = fillQuestionService.findByIdAndType(paperId); //填空题题库 2 42 | List judgeQuestionRes = judgeQuestionService.findByIdAndType(paperId); //判断题题库 3 43 | Map> map = new HashMap<>(); 44 | map.put(1,multiQuestionRes); 45 | map.put(2,fillQuestionsRes); 46 | map.put(3,judgeQuestionRes); 47 | return map; 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /exam/src/vuex/store.js: -------------------------------------------------------------------------------- 1 | import VUE from 'vue' 2 | import VUEX from 'vuex' 3 | // import persistedstate from "vuex-persistedstate" 4 | 5 | VUE.use(VUEX) 6 | 7 | // const store = { 8 | // plugins: [persistedstate()] 9 | // } 10 | 11 | const state = { 12 | flag: false, 13 | userInfo: null, 14 | menu: [{ 15 | index: '1', 16 | title: '课程管理', 17 | icon: 'icon-kechengbiao', 18 | content:[{item1:'增加课程',path:'/addCourse'},{item2:'修改课程',path:'/updateCourse'},{item3:'删除课程',path:'delCourse'}], 19 | }, 20 | { 21 | index: '2', 22 | title: '题库管理', 23 | icon: 'icon-tiku', 24 | content:[{item1:'增加题库',path:'/addAnswer'},{item2:'修改题库',path:'/updateAnswer'},{item3:'删除题库',path:'/delCourse'}], 25 | }, 26 | { 27 | index: '3', 28 | title: '成绩查询', 29 | icon: 'icon-performance', 30 | content:[{item1:'根据班级查询',path:'/classGrede'},{item2:'成绩统计',path:'/grade'}], 31 | }, 32 | { 33 | index: '4', 34 | title: '评分阅卷', 35 | icon: 'icon-pingfen', 36 | content:[{item1:'开始阅卷',path:'/check'},{item2:'阅卷管理',path:'/checkManage'}], 37 | }, 38 | { 39 | index: '5', 40 | title: '角色管理', 41 | icon: 'icon-role', 42 | content:[{item1:'权限设置',path:'/role'}], 43 | }, 44 | { 45 | index: '6', 46 | title: '用户管理', 47 | icon: 'icon-Userselect', 48 | content:[{item1:'用户操作',path:'/user'}], 49 | }, 50 | { 51 | index: '7', 52 | title: '模块管理', 53 | icon: 'icon-module4mokuai', 54 | content:[{item1:'模块操作',path:'/module'}], 55 | } 56 | ], 57 | } 58 | const mutations = { 59 | toggle(state) { 60 | state.flag = !state.flag 61 | }, 62 | changeUserInfo(state,info) { 63 | state.userInfo = info 64 | } 65 | } 66 | const getters = { 67 | 68 | } 69 | const actions = { 70 | getUserInfo(context,info) { 71 | context.commit('changeUserInfo',info) 72 | } 73 | } 74 | export default new VUEX.Store({ 75 | state, 76 | mutations, 77 | getters, 78 | actions, 79 | // store 80 | }) 81 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/controller/StudentController.java: -------------------------------------------------------------------------------- 1 | package com.exam.controller; 2 | 3 | import com.exam.entity.ApiResult; 4 | import com.exam.entity.Student; 5 | import com.exam.serviceimpl.StudentServiceImpl; 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 StudentController { 12 | 13 | @Autowired 14 | private StudentServiceImpl studentService; 15 | 16 | @GetMapping("/students") 17 | public ApiResult findAll() { 18 | return ApiResultHandler.buildApiResult(200,"请求成功",studentService.findAll()); 19 | } 20 | 21 | @GetMapping("/student/{studentId}") 22 | public ApiResult findById(@PathVariable("studentId") Integer studentId) { 23 | Student res = studentService.findById(studentId); 24 | if (res != null) { 25 | return ApiResultHandler.buildApiResult(200,"请求成功",res); 26 | } else { 27 | return ApiResultHandler.buildApiResult(404,"查询的用户不存在",null); 28 | } 29 | } 30 | 31 | @DeleteMapping("/student/{studentId}") 32 | public ApiResult deleteById(@PathVariable("studentId") Integer studentId) { 33 | return ApiResultHandler.buildApiResult(200,"删除成功",studentService.deleteById(studentId)); 34 | } 35 | 36 | @PutMapping("/studentPWD") 37 | public ApiResult updatePwd(@RequestBody Student student) { 38 | studentService.updatePwd(student); 39 | return ApiResultHandler.buildApiResult(200,"密码更新成功",null); 40 | } 41 | @PutMapping("/student") 42 | public int update(@RequestBody Student student) { 43 | int res = studentService.update(student); 44 | // if (res != 0) { 45 | // return ApiResultHandler.buildApiResult(200,"更新成功",res); 46 | // }else { 47 | // return ApiResultHandler.buildApiResult(400,"更新失败",null); 48 | // } 49 | return res; 50 | } 51 | 52 | @PostMapping("/student") 53 | public ApiResult add(@RequestBody Student student) { 54 | int res = studentService.add(student); 55 | if (res == 1) { 56 | return ApiResultHandler.buildApiResult(200,"添加成功",null); 57 | }else { 58 | return ApiResultHandler.buildApiResult(400,"添加失败",null); 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /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 | "vis": "^4.21.0", 18 | "vue": "^2.5.2", 19 | "vue-cookies": "^1.5.12", 20 | "vue-router": "^3.0.1", 21 | "vuex": "^3.0.1", 22 | "vuex-persistedstate": "^2.5.4" 23 | }, 24 | "devDependencies": { 25 | "@babel/core": "^7.2.2", 26 | "@babel/preset-env": "^7.2.3", 27 | "autoprefixer": "^7.1.2", 28 | "babel-core": "^6.22.1", 29 | "babel-helper-vue-jsx-merge-props": "^2.0.3", 30 | "babel-loader": "^7.1.5", 31 | "babel-plugin-syntax-jsx": "^6.18.0", 32 | "babel-plugin-transform-runtime": "^6.22.0", 33 | "babel-plugin-transform-vue-jsx": "^3.5.0", 34 | "babel-preset-env": "^1.3.2", 35 | "babel-preset-stage-2": "^6.22.0", 36 | "chalk": "^2.0.1", 37 | "copy-webpack-plugin": "^4.0.1", 38 | "css-loader": "^0.28.0", 39 | "extract-text-webpack-plugin": "^3.0.0", 40 | "file-loader": "^1.1.4", 41 | "friendly-errors-webpack-plugin": "^1.6.1", 42 | "html-webpack-plugin": "^2.30.1", 43 | "node-notifier": "^5.1.2", 44 | "node-sass": "^4.11.0", 45 | "optimize-css-assets-webpack-plugin": "^3.2.0", 46 | "ora": "^1.2.0", 47 | "portfinder": "^1.0.13", 48 | "postcss-import": "^11.0.0", 49 | "postcss-loader": "^2.0.8", 50 | "postcss-url": "^7.2.1", 51 | "rimraf": "^2.6.0", 52 | "sass-loader": "^7.1.0", 53 | "semver": "^5.3.0", 54 | "shelljs": "^0.7.6", 55 | "uglifyjs-webpack-plugin": "^1.1.1", 56 | "url-loader": "^0.5.8", 57 | "vue-loader": "^13.3.0", 58 | "vue-style-loader": "^3.0.1", 59 | "vue-template-compiler": "^2.5.2", 60 | "webpack": "^3.12.0", 61 | "webpack-bundle-analyzer": "^2.9.0", 62 | "webpack-dev-server": "^2.9.1", 63 | "webpack-merge": "^4.1.0" 64 | }, 65 | "engines": { 66 | "node": ">= 6.0.0", 67 | "npm": ">= 3.0.0" 68 | }, 69 | "browserslist": [ 70 | "> 1%", 71 | "last 2 versions", 72 | "not ie <= 8" 73 | ] 74 | } 75 | -------------------------------------------------------------------------------- /exam/src/components/common/mainLeft.vue: -------------------------------------------------------------------------------- 1 | 2 | 30 | 31 | 58 | 59 | -------------------------------------------------------------------------------- /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',//设置你调用的接口域名和端口号 别忘了加http 16 | changeOrigin: true, 17 | pathRewrite: { 18 | '^/api': ''//这里理解成用‘/api’代替target里面的地址,后面组件中我们掉接口时直接用api代替 比如我要调用'http://40.00.100.100:3002/user/add',直接写‘/api/user/add’即可 19 | } 20 | } 21 | }, 22 | 23 | // Various Dev Server settings 24 | host: 'localhost', // can be overwritten by process.env.HOST 25 | port: 8088, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined 26 | autoOpenBrowser: false, 27 | errorOverlay: true, 28 | notifyOnErrors: true, 29 | poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- 30 | 31 | 32 | /** 33 | * Source Maps 34 | */ 35 | 36 | // https://webpack.js.org/configuration/devtool/#development 37 | devtool: 'cheap-module-eval-source-map', 38 | 39 | // If you have problems debugging vue-files in devtools, 40 | // set this to false - it *may* help 41 | // https://vue-loader.vuejs.org/en/options.html#cachebusting 42 | cacheBusting: true, 43 | 44 | cssSourceMap: true 45 | }, 46 | 47 | build: { 48 | // Template for index.html 49 | index: path.resolve(__dirname, '../dist/index.html'), 50 | 51 | // Paths 52 | assetsRoot: path.resolve(__dirname, '../dist'), 53 | assetsSubDirectory: 'static', 54 | assetsPublicPath: '/', 55 | 56 | /** 57 | * Source Maps 58 | */ 59 | 60 | productionSourceMap: true, 61 | // https://webpack.js.org/configuration/devtool/#production 62 | devtool: '#source-map', 63 | 64 | // Gzip off by default as many popular static hosts such as 65 | // Surge or Netlify already gzip all static assets for you. 66 | // Before setting to `true`, make sure to: 67 | // npm install --save-dev compression-webpack-plugin 68 | productionGzip: false, 69 | productionGzipExtensions: ['js', 'css'], 70 | 71 | // Run the build command with an extra argument to 72 | // View the bundle analyzer report after build finishes: 73 | // `npm run build --report` 74 | // Set to `true` or `false` to always turn it on or off 75 | bundleAnalyzerReport: process.env.npm_config_report 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /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 | } -------------------------------------------------------------------------------- /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 | System.out.println(res); 50 | if (res == 0) { 51 | return ApiResultHandler.buildApiResult(10000,"考试编号不存在",null); 52 | } 53 | return ApiResultHandler.buildApiResult(200,"删除成功",res); 54 | } 55 | 56 | @PutMapping("/exam/{examCode}") 57 | public ApiResult update(@PathVariable("examCode") Integer examCode, ExamManage exammanage){ 58 | int res = examManageService.update(exammanage); 59 | // if (res == 0) { 60 | // return ApiResultHandler.buildApiResult(20000,"请求参数错误"); 61 | // } 62 | System.out.printf("更新操作执行---"); 63 | return ApiResultHandler.buildApiResult(200,"更新成功",res); 64 | } 65 | 66 | @PostMapping("/examCode") 67 | public ApiResult add(ExamManage exammanage){ 68 | int res = examManageService.update(exammanage); 69 | // if (res == 0) { 70 | // return ApiResultHandler.buildApiResult(20000,"请求参数错误",null); 71 | // } 72 | return ApiResultHandler.buildApiResult(200,"添加成功",res); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /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 | sass: generateLoaders('sass', { indentedSyntax: true }), 63 | scss: generateLoaders('sass'), 64 | stylus: generateLoaders('stylus'), 65 | styl: generateLoaders('stylus') 66 | } 67 | } 68 | 69 | // Generate loaders for standalone style files (outside of .vue) 70 | exports.styleLoaders = function (options) { 71 | const output = [] 72 | const loaders = exports.cssLoaders(options) 73 | 74 | for (const extension in loaders) { 75 | const loader = loaders[extension] 76 | output.push({ 77 | test: new RegExp('\\.' + extension + '$'), 78 | use: loader 79 | }) 80 | } 81 | 82 | return output 83 | } 84 | 85 | exports.createNotifierCallback = () => { 86 | const notifier = require('node-notifier') 87 | 88 | return (severity, errors) => { 89 | if (severity !== 'error') return 90 | 91 | const error = errors[0] 92 | const filename = error.file && error.file.split('!').pop() 93 | 94 | notifier.notify({ 95 | title: packageConfig.name, 96 | message: severity + ': ' + error.name, 97 | subtitle: filename || '', 98 | icon: path.join(__dirname, 'logo.png') 99 | }) 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /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: /\.sass$/, 36 | loaders: ['style', 'css', 'sass'] 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/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/common/header.vue: -------------------------------------------------------------------------------- 1 | 2 | 28 | 29 | 50 | 51 | 130 | -------------------------------------------------------------------------------- /exam/src/components/student/index.vue: -------------------------------------------------------------------------------- 1 | 2 | 30 | 31 | 70 | 71 | 139 | -------------------------------------------------------------------------------- /springboot/src/main/java/com/exam/structure/Tree.java: -------------------------------------------------------------------------------- 1 | package com.exam.structure; 2 | 3 | import java.util.*; 4 | 5 | public class Tree { 6 | private int depth; 7 | public static class Node { 8 | private T nodeEntity; 9 | private boolean leaf = true; 10 | private int level; 11 | private int depth; 12 | private List> children; 13 | 14 | public void setNodeEntity(T nodeEntity) { 15 | this.nodeEntity = nodeEntity; 16 | } 17 | 18 | public List> getChildren() { 19 | return children; 20 | } 21 | 22 | public void setChildren(List> children) { 23 | this.children = children; 24 | } 25 | 26 | public boolean isLeaf() { 27 | return leaf; 28 | } 29 | 30 | public void setLeaf(boolean leaf) { 31 | this.leaf = leaf; 32 | } 33 | 34 | public int getLevel() { 35 | return level; 36 | } 37 | 38 | public void setLevel(int level) { 39 | this.level = level; 40 | } 41 | 42 | public int getDepth() { 43 | return depth; 44 | } 45 | 46 | public void setDepth(int depth) { 47 | this.depth = depth; 48 | } 49 | 50 | public T getNodeEntity() { 51 | return nodeEntity; 52 | } 53 | 54 | public void appendChildNode(Node node) { 55 | if (leaf || children == null) { 56 | children = new ArrayList<>(); 57 | } 58 | node.level = level + 1; 59 | node.depth = depth + 1; 60 | children.add(node); 61 | leaf = false; 62 | } 63 | 64 | public void removeChildNode(Node node) { 65 | if (leaf || children == null) { 66 | throw new NoSuchElementException("当前节点为叶子节点,无子节点。"); 67 | } 68 | children.remove(node); 69 | 70 | if (children.isEmpty()) { 71 | leaf = true; 72 | } 73 | } 74 | 75 | @Override 76 | public String toString() { 77 | return "Node{" + 78 | "children=" + children + 79 | ", leaf=" + leaf + 80 | ", level=" + level + 81 | ", depth=" + depth + 82 | ", nodeEntity=" + nodeEntity + 83 | '}'; 84 | } 85 | } 86 | 87 | public Node createNode() { 88 | return new Node<>(); 89 | } 90 | 91 | private Node rootNode; 92 | 93 | public Tree() { 94 | rootNode = createNode(); 95 | } 96 | 97 | public Tree(Node rootNode) { 98 | this.rootNode = rootNode; 99 | } 100 | 101 | public Node getRootNode() { 102 | return rootNode; 103 | } 104 | 105 | public boolean empty() { 106 | return rootNode.children.isEmpty(); 107 | } 108 | 109 | 110 | public static void main(String[] args) { 111 | Tree> mapTree = new Tree<>(); 112 | Node> rootNode = mapTree.getRootNode(); 113 | Map fLevel = new HashMap<>(); 114 | fLevel.put("id", "1"); 115 | Node> fNode = mapTree.createNode(); 116 | fNode.setNodeEntity(fLevel); 117 | 118 | Map sLevel = new HashMap<>(); 119 | sLevel.put("id", "1-1"); 120 | Node> sNode = mapTree.createNode(); 121 | sNode.setNodeEntity(sLevel); 122 | Map sLevel2 = new HashMap<>(); 123 | sLevel2.put("id", "1-2"); 124 | Node> sNode2 = mapTree.createNode(); 125 | sNode2.setNodeEntity(sLevel2); 126 | 127 | rootNode.appendChildNode(fNode); 128 | fNode.appendChildNode(sNode); 129 | fNode.appendChildNode(sNode2); 130 | 131 | System.out.println(rootNode); 132 | } 133 | 134 | } 135 | -------------------------------------------------------------------------------- /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/startExam.vue: -------------------------------------------------------------------------------- 1 | // 我的考试页面 2 | 71 | 72 | 77 | 78 | 173 | -------------------------------------------------------------------------------- /exam/src/components/common/login.vue: -------------------------------------------------------------------------------- 1 | 2 | 42 | 43 | 104 | 105 | 201 | -------------------------------------------------------------------------------- /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 | 97 | 98 | 211 | -------------------------------------------------------------------------------- /springboot/mvnw.cmd: -------------------------------------------------------------------------------- 1 | @REM ---------------------------------------------------------------------------- 2 | @REM Licensed to the Apache Software Foundation (ASF) under one 3 | @REM or more contributor license agreements. See the NOTICE file 4 | @REM distributed with this work for additional information 5 | @REM regarding copyright ownership. The ASF licenses this file 6 | @REM to you under the Apache License, Version 2.0 (the 7 | @REM "License"); you may not use this file except in compliance 8 | @REM with the License. You may obtain a copy of the License at 9 | @REM 10 | @REM http://www.apache.org/licenses/LICENSE-2.0 11 | @REM 12 | @REM Unless required by applicable law or agreed to in writing, 13 | @REM software distributed under the License is distributed on an 14 | @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | @REM KIND, either express or implied. See the License for the 16 | @REM specific language governing permissions and limitations 17 | @REM under the License. 18 | @REM ---------------------------------------------------------------------------- 19 | 20 | @REM ---------------------------------------------------------------------------- 21 | @REM Maven2 Start Up Batch script 22 | @REM 23 | @REM Required ENV vars: 24 | @REM JAVA_HOME - location of a JDK home dir 25 | @REM 26 | @REM Optional ENV vars 27 | @REM M2_HOME - location of maven2's installed home dir 28 | @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands 29 | @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending 30 | @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven 31 | @REM e.g. to debug Maven itself, use 32 | @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 33 | @REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files 34 | @REM ---------------------------------------------------------------------------- 35 | 36 | @REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' 37 | @echo off 38 | @REM set title of command window 39 | title %0 40 | @REM enable echoing my setting MAVEN_BATCH_ECHO to 'on' 41 | @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% 42 | 43 | @REM set %HOME% to equivalent of $HOME 44 | if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") 45 | 46 | @REM Execute a user defined script before this one 47 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre 48 | @REM check for pre script, once with legacy .bat ending and once with .cmd ending 49 | if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" 50 | if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" 51 | :skipRcPre 52 | 53 | @setlocal 54 | 55 | set ERROR_CODE=0 56 | 57 | @REM To isolate internal variables from possible post scripts, we use another setlocal 58 | @setlocal 59 | 60 | @REM ==== START VALIDATION ==== 61 | if not "%JAVA_HOME%" == "" goto OkJHome 62 | 63 | echo. 64 | echo Error: JAVA_HOME not found in your environment. >&2 65 | echo Please set the JAVA_HOME variable in your environment to match the >&2 66 | echo location of your Java installation. >&2 67 | echo. 68 | goto error 69 | 70 | :OkJHome 71 | if exist "%JAVA_HOME%\bin\java.exe" goto init 72 | 73 | echo. 74 | echo Error: JAVA_HOME is set to an invalid directory. >&2 75 | echo JAVA_HOME = "%JAVA_HOME%" >&2 76 | echo Please set the JAVA_HOME variable in your environment to match the >&2 77 | echo location of your Java installation. >&2 78 | echo. 79 | goto error 80 | 81 | @REM ==== END VALIDATION ==== 82 | 83 | :init 84 | 85 | @REM Find the project base dir, i.e. the directory that contains the folder ".mvn". 86 | @REM Fallback to current working directory if not found. 87 | 88 | set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% 89 | IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir 90 | 91 | set EXEC_DIR=%CD% 92 | set WDIR=%EXEC_DIR% 93 | :findBaseDir 94 | IF EXIST "%WDIR%"\.mvn goto baseDirFound 95 | cd .. 96 | IF "%WDIR%"=="%CD%" goto baseDirNotFound 97 | set WDIR=%CD% 98 | goto findBaseDir 99 | 100 | :baseDirFound 101 | set MAVEN_PROJECTBASEDIR=%WDIR% 102 | cd "%EXEC_DIR%" 103 | goto endDetectBaseDir 104 | 105 | :baseDirNotFound 106 | set MAVEN_PROJECTBASEDIR=%EXEC_DIR% 107 | cd "%EXEC_DIR%" 108 | 109 | :endDetectBaseDir 110 | 111 | IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig 112 | 113 | @setlocal EnableExtensions EnableDelayedExpansion 114 | for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a 115 | @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% 116 | 117 | :endReadAdditionalConfig 118 | 119 | SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" 120 | set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" 121 | set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 122 | 123 | set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar" 124 | FOR /F "tokens=1,2 delims==" %%A IN (%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties) DO ( 125 | IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B 126 | ) 127 | 128 | @REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 129 | @REM This allows using the maven wrapper in projects that prohibit checking in binary data. 130 | if exist %WRAPPER_JAR% ( 131 | echo Found %WRAPPER_JAR% 132 | ) else ( 133 | echo Couldn't find %WRAPPER_JAR%, downloading it ... 134 | echo Downloading from: %DOWNLOAD_URL% 135 | powershell -Command "(New-Object Net.WebClient).DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')" 136 | echo Finished downloading %WRAPPER_JAR% 137 | ) 138 | @REM End of extension 139 | 140 | %MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* 141 | if ERRORLEVEL 1 goto error 142 | goto end 143 | 144 | :error 145 | set ERROR_CODE=1 146 | 147 | :end 148 | @endlocal & set ERROR_CODE=%ERROR_CODE% 149 | 150 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost 151 | @REM check for post script, once with legacy .bat ending and once with .cmd ending 152 | if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" 153 | if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" 154 | :skipRcPost 155 | 156 | @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' 157 | if "%MAVEN_BATCH_PAUSE%" == "on" pause 158 | 159 | if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% 160 | 161 | exit /B %ERROR_CODE% 162 | -------------------------------------------------------------------------------- /exam/src/components/student/message.vue: -------------------------------------------------------------------------------- 1 | // 给我留言页面 2 | 56 | 57 | 172 | 173 | 249 | -------------------------------------------------------------------------------- /exam/src/components/student/examMsg.vue: -------------------------------------------------------------------------------- 1 | // 点击试卷后的缩略信息 2 | 88 | 89 | 138 | 139 | 270 | -------------------------------------------------------------------------------- /springboot/mvnw: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # ---------------------------------------------------------------------------- 3 | # Licensed to the Apache Software Foundation (ASF) under one 4 | # or more contributor license agreements. See the NOTICE file 5 | # distributed with this work for additional information 6 | # regarding copyright ownership. The ASF licenses this file 7 | # to you under the Apache License, Version 2.0 (the 8 | # "License"); you may not use this file except in compliance 9 | # with the License. You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, 14 | # software distributed under the License is distributed on an 15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | # KIND, either express or implied. See the License for the 17 | # specific language governing permissions and limitations 18 | # under the License. 19 | # ---------------------------------------------------------------------------- 20 | 21 | # ---------------------------------------------------------------------------- 22 | # Maven2 Start Up Batch script 23 | # 24 | # Required ENV vars: 25 | # ------------------ 26 | # JAVA_HOME - location of a JDK home dir 27 | # 28 | # Optional ENV vars 29 | # ----------------- 30 | # M2_HOME - location of maven2's installed home dir 31 | # MAVEN_OPTS - parameters passed to the Java VM when running Maven 32 | # e.g. to debug Maven itself, use 33 | # set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 34 | # MAVEN_SKIP_RC - flag to disable loading of mavenrc files 35 | # ---------------------------------------------------------------------------- 36 | 37 | if [ -z "$MAVEN_SKIP_RC" ] ; then 38 | 39 | if [ -f /etc/mavenrc ] ; then 40 | . /etc/mavenrc 41 | fi 42 | 43 | if [ -f "$HOME/.mavenrc" ] ; then 44 | . "$HOME/.mavenrc" 45 | fi 46 | 47 | fi 48 | 49 | # OS specific support. $var _must_ be set to either true or false. 50 | cygwin=false; 51 | darwin=false; 52 | mingw=false 53 | case "`uname`" in 54 | CYGWIN*) cygwin=true ;; 55 | MINGW*) mingw=true;; 56 | Darwin*) darwin=true 57 | # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home 58 | # See https://developer.apple.com/library/mac/qa/qa1170/_index.html 59 | if [ -z "$JAVA_HOME" ]; then 60 | if [ -x "/usr/libexec/java_home" ]; then 61 | export JAVA_HOME="`/usr/libexec/java_home`" 62 | else 63 | export JAVA_HOME="/Library/Java/Home" 64 | fi 65 | fi 66 | ;; 67 | esac 68 | 69 | if [ -z "$JAVA_HOME" ] ; then 70 | if [ -r /etc/gentoo-release ] ; then 71 | JAVA_HOME=`java-config --jre-home` 72 | fi 73 | fi 74 | 75 | if [ -z "$M2_HOME" ] ; then 76 | ## resolve links - $0 may be a link to maven's home 77 | PRG="$0" 78 | 79 | # need this for relative symlinks 80 | while [ -h "$PRG" ] ; do 81 | ls=`ls -ld "$PRG"` 82 | link=`expr "$ls" : '.*-> \(.*\)$'` 83 | if expr "$link" : '/.*' > /dev/null; then 84 | PRG="$link" 85 | else 86 | PRG="`dirname "$PRG"`/$link" 87 | fi 88 | done 89 | 90 | saveddir=`pwd` 91 | 92 | M2_HOME=`dirname "$PRG"`/.. 93 | 94 | # make it fully qualified 95 | M2_HOME=`cd "$M2_HOME" && pwd` 96 | 97 | cd "$saveddir" 98 | # echo Using m2 at $M2_HOME 99 | fi 100 | 101 | # For Cygwin, ensure paths are in UNIX format before anything is touched 102 | if $cygwin ; then 103 | [ -n "$M2_HOME" ] && 104 | M2_HOME=`cygpath --unix "$M2_HOME"` 105 | [ -n "$JAVA_HOME" ] && 106 | JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 107 | [ -n "$CLASSPATH" ] && 108 | CLASSPATH=`cygpath --path --unix "$CLASSPATH"` 109 | fi 110 | 111 | # For Mingw, ensure paths are in UNIX format before anything is touched 112 | if $mingw ; then 113 | [ -n "$M2_HOME" ] && 114 | M2_HOME="`(cd "$M2_HOME"; pwd)`" 115 | [ -n "$JAVA_HOME" ] && 116 | JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" 117 | # TODO classpath? 118 | fi 119 | 120 | if [ -z "$JAVA_HOME" ]; then 121 | javaExecutable="`which javac`" 122 | if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then 123 | # readlink(1) is not available as standard on Solaris 10. 124 | readLink=`which readlink` 125 | if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then 126 | if $darwin ; then 127 | javaHome="`dirname \"$javaExecutable\"`" 128 | javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" 129 | else 130 | javaExecutable="`readlink -f \"$javaExecutable\"`" 131 | fi 132 | javaHome="`dirname \"$javaExecutable\"`" 133 | javaHome=`expr "$javaHome" : '\(.*\)/bin'` 134 | JAVA_HOME="$javaHome" 135 | export JAVA_HOME 136 | fi 137 | fi 138 | fi 139 | 140 | if [ -z "$JAVACMD" ] ; then 141 | if [ -n "$JAVA_HOME" ] ; then 142 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 143 | # IBM's JDK on AIX uses strange locations for the executables 144 | JAVACMD="$JAVA_HOME/jre/sh/java" 145 | else 146 | JAVACMD="$JAVA_HOME/bin/java" 147 | fi 148 | else 149 | JAVACMD="`which java`" 150 | fi 151 | fi 152 | 153 | if [ ! -x "$JAVACMD" ] ; then 154 | echo "Error: JAVA_HOME is not defined correctly." >&2 155 | echo " We cannot execute $JAVACMD" >&2 156 | exit 1 157 | fi 158 | 159 | if [ -z "$JAVA_HOME" ] ; then 160 | echo "Warning: JAVA_HOME environment variable is not set." 161 | fi 162 | 163 | CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher 164 | 165 | # traverses directory structure from process work directory to filesystem root 166 | # first directory with .mvn subdirectory is considered project base directory 167 | find_maven_basedir() { 168 | 169 | if [ -z "$1" ] 170 | then 171 | echo "Path not specified to find_maven_basedir" 172 | return 1 173 | fi 174 | 175 | basedir="$1" 176 | wdir="$1" 177 | while [ "$wdir" != '/' ] ; do 178 | if [ -d "$wdir"/.mvn ] ; then 179 | basedir=$wdir 180 | break 181 | fi 182 | # workaround for JBEAP-8937 (on Solaris 10/Sparc) 183 | if [ -d "${wdir}" ]; then 184 | wdir=`cd "$wdir/.."; pwd` 185 | fi 186 | # end of workaround 187 | done 188 | echo "${basedir}" 189 | } 190 | 191 | # concatenates all lines of a file 192 | concat_lines() { 193 | if [ -f "$1" ]; then 194 | echo "$(tr -s '\n' ' ' < "$1")" 195 | fi 196 | } 197 | 198 | BASE_DIR=`find_maven_basedir "$(pwd)"` 199 | if [ -z "$BASE_DIR" ]; then 200 | exit 1; 201 | fi 202 | 203 | ########################################################################################## 204 | # Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 205 | # This allows using the maven wrapper in projects that prohibit checking in binary data. 206 | ########################################################################################## 207 | if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then 208 | if [ "$MVNW_VERBOSE" = true ]; then 209 | echo "Found .mvn/wrapper/maven-wrapper.jar" 210 | fi 211 | else 212 | if [ "$MVNW_VERBOSE" = true ]; then 213 | echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." 214 | fi 215 | jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar" 216 | while IFS="=" read key value; do 217 | case "$key" in (wrapperUrl) jarUrl="$value"; break ;; 218 | esac 219 | done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" 220 | if [ "$MVNW_VERBOSE" = true ]; then 221 | echo "Downloading from: $jarUrl" 222 | fi 223 | wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" 224 | 225 | if command -v wget > /dev/null; then 226 | if [ "$MVNW_VERBOSE" = true ]; then 227 | echo "Found wget ... using wget" 228 | fi 229 | wget "$jarUrl" -O "$wrapperJarPath" 230 | elif command -v curl > /dev/null; then 231 | if [ "$MVNW_VERBOSE" = true ]; then 232 | echo "Found curl ... using curl" 233 | fi 234 | curl -o "$wrapperJarPath" "$jarUrl" 235 | else 236 | if [ "$MVNW_VERBOSE" = true ]; then 237 | echo "Falling back to using Java to download" 238 | fi 239 | javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" 240 | if [ -e "$javaClass" ]; then 241 | if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then 242 | if [ "$MVNW_VERBOSE" = true ]; then 243 | echo " - Compiling MavenWrapperDownloader.java ..." 244 | fi 245 | # Compiling the Java class 246 | ("$JAVA_HOME/bin/javac" "$javaClass") 247 | fi 248 | if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then 249 | # Running the downloader 250 | if [ "$MVNW_VERBOSE" = true ]; then 251 | echo " - Running MavenWrapperDownloader.java ..." 252 | fi 253 | ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") 254 | fi 255 | fi 256 | fi 257 | fi 258 | ########################################################################################## 259 | # End of extension 260 | ########################################################################################## 261 | 262 | export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} 263 | if [ "$MVNW_VERBOSE" = true ]; then 264 | echo $MAVEN_PROJECTBASEDIR 265 | fi 266 | MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" 267 | 268 | # For Cygwin, switch paths to Windows format before running java 269 | if $cygwin; then 270 | [ -n "$M2_HOME" ] && 271 | M2_HOME=`cygpath --path --windows "$M2_HOME"` 272 | [ -n "$JAVA_HOME" ] && 273 | JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` 274 | [ -n "$CLASSPATH" ] && 275 | CLASSPATH=`cygpath --path --windows "$CLASSPATH"` 276 | [ -n "$MAVEN_PROJECTBASEDIR" ] && 277 | MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` 278 | fi 279 | 280 | WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 281 | 282 | exec "$JAVACMD" \ 283 | $MAVEN_OPTS \ 284 | -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ 285 | "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ 286 | ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" 287 | -------------------------------------------------------------------------------- /exam/src/components/student/answer.vue: -------------------------------------------------------------------------------- 1 | 2 | 130 | 131 | 416 | 417 | 698 | --------------------------------------------------------------------------------