| | |
| | | import com.qxueyou.scc.base.util.CollectionUtils; |
| | | |
| | | /** |
| | | * 学习端 考试前端控制器 |
| | | * 学习端 考试前端控制器 |
| | | * |
| | | * @author chenjunliang |
| | | * |
| | |
| | | @RequestMapping(value = "/stu/exam") |
| | | public class StuExamController { |
| | | /** |
| | | * 获取考试列表 |
| | | * 获取考试列表 |
| | | * |
| | | * @param limit |
| | | * 每页显示几条 |
| | | * 每页显示几条 |
| | | * @param pageNum |
| | | * 页码 |
| | | * 页码 |
| | | * @param classId |
| | | * 班级id |
| | | * 班级id |
| | | * |
| | | * @return percent(状态说明:0,草稿。1,待完成。2,已完成。3,逾期未交) |
| | | * @return percent(状态说明:0,草稿。1,待完成。2,已完成。3,逾期未交) |
| | | */ |
| | | @GetMapping(value = "getExamLst") |
| | | public Result getExamLst(Integer limit, Integer pageNum, String classId) { |
| | | |
| | | return new Result(true, "success", CollectionUtils.newObjectMap("examLst", |
| | | CollectionUtils.newList( |
| | | CollectionUtils.newObjectMap("examId", "11111", "examName", "虚拟现实技术入门体检与制作1", "percent", 0, |
| | | CollectionUtils.newObjectMap("examId", "11111", "examName", "虚拟现实技术入门体检与制作1", "percent", 0, |
| | | "startTime", new Date(), "endTime", new Date(), "score", 30), |
| | | CollectionUtils.newObjectMap("examId", "2222", "examName", "虚拟现实技术入门体检与制作2", "percent", 1, |
| | | CollectionUtils.newObjectMap("examId", "2222", "examName", "虚拟现实技术入门体检与制作2", "percent", 1, |
| | | "startTime", new Date(), "endTime", new Date(), "score", 30), |
| | | CollectionUtils.newObjectMap("examId", "3333", "examName", "虚拟现实技术入门体检与制作3", "percent", 2, |
| | | CollectionUtils.newObjectMap("examId", "3333", "examName", "虚拟现实技术入门体检与制作3", "percent", 2, |
| | | "startTime", new Date(), "endTime", new Date(), "score", 30), |
| | | CollectionUtils.newObjectMap("examId", "4444", "examName", "虚拟现实技术入门体检与制作4", "percent", 3, |
| | | CollectionUtils.newObjectMap("examId", "4444", "examName", "虚拟现实技术入门体检与制作4", "percent", 3, |
| | | "startTime", new Date(), "endTime", new Date(), "score", 30)), |
| | | "examCount", 4)); |
| | | } |
| | | |
| | | /** |
| | | * 获取考试详情 |
| | | * 获取考试详情 |
| | | * |
| | | * @param examId |
| | | * 考试id |
| | | * 考试id |
| | | * |
| | | * |
| | | * |
| | |
| | | Map<String, Object> typeTwo = CollectionUtils.newObjectMap("type", 2, "count", 3); |
| | | Map<String, Object> typeThree = CollectionUtils.newObjectMap("type", 3, "count", 3); |
| | | |
| | | return new Result(true, "success", CollectionUtils.newObjectMap("examName", "虚拟现实技术入门基础考试", "subjectName", "物流", |
| | | return new Result(true, "success", CollectionUtils.newObjectMap("examName", "虚拟现实技术入门基础考试", "subjectName", "物流", |
| | | "duration", 30, "maxLateMin", "", "showType", 1, "showScore", 1, "startTime", new Date(), "endTime", |
| | | new Date(), "totalScore", 100, "paperType", 1, "shouScoreDays", "", "difficultLevel", 5, "passingScore", |
| | | 60, "questionTypes", CollectionUtils.newList(typeOne, typeTwo, typeThree), "percent", 0, "goal", 88)); |
| | | } |
| | | |
| | | /** |
| | | * 开始考试获取考试题目 |
| | | * 开始考试获取考试题目 |
| | | */ |
| | | @GetMapping(value = "getExamItems") |
| | | public Result getItems(String examId) { |
| | | Map<String, Object> optionA = CollectionUtils.newObjectMap("optionId", 1111, "content", "体检VR眼睛的参数功能,形成报告A", |
| | | Map<String, Object> optionA = CollectionUtils.newObjectMap("optionId", 1111, "content", "体检VR眼睛的参数功能,形成报告A", |
| | | "optionOrder", "A", "imgPath", "/web/path", "check", false); |
| | | Map<String, Object> optionB = CollectionUtils.newObjectMap("optionId", 2222, "content", "体检VR眼睛的参数功能,形成报告B", |
| | | Map<String, Object> optionB = CollectionUtils.newObjectMap("optionId", 2222, "content", "体检VR眼睛的参数功能,形成报告B", |
| | | "optionOrder", "B", "imgPath", "/web/path", "check", false); |
| | | Map<String, Object> optionC = CollectionUtils.newObjectMap("optionId", 3333, "content", "体检VR眼睛的参数功能,形成报告C", |
| | | Map<String, Object> optionC = CollectionUtils.newObjectMap("optionId", 3333, "content", "体检VR眼睛的参数功能,形成报告C", |
| | | "optionOrder", "C", "imgPath", "/web/path", "check", false); |
| | | Map<String, Object> optionD = CollectionUtils.newObjectMap("optionId", 4444, "content", "体检VR眼睛的参数功能,形成报告D", |
| | | Map<String, Object> optionD = CollectionUtils.newObjectMap("optionId", 4444, "content", "体检VR眼睛的参数功能,形成报告D", |
| | | "optionOrder", "D", "imgPath", "/web/path", "check", false); |
| | | // 判断题 |
| | | Map<String, Object> checkoptionA = CollectionUtils.newObjectMap("optionId", 5555, "content", "李白是李白他爸爸生的", |
| | | // 判断题 |
| | | Map<String, Object> checkoptionA = CollectionUtils.newObjectMap("optionId", 5555, "content", "李白是李白他爸爸生的", |
| | | "optionOrder", false, "imgPath", "/web/path", "check", false); |
| | | Map<String, Object> checkoptionB = CollectionUtils.newObjectMap("optionId", 6666, "content", "李白是李白他妈妈生的", |
| | | Map<String, Object> checkoptionB = CollectionUtils.newObjectMap("optionId", 6666, "content", "李白是李白他妈妈生的", |
| | | "optionOrder", true, "imgPath", "/web/path", "check", false); |
| | | |
| | | // 显示题目 列表; |
| | | Map<String, Object> two = CollectionUtils.newObjectMap("socre", 5, "exerciseId", "11111", "title", "这是多选题", |
| | | // 显示题目 列表; |
| | | Map<String, Object> two = CollectionUtils.newObjectMap("socre", 5, "exerciseId", "11111", "title", "这是多选题", |
| | | "type", 2, "options", CollectionUtils.newList(optionA, optionB, optionC, optionD), "answer", "A,B", |
| | | "analisis", "这是答案解析", "isRight", true); |
| | | Map<String, Object> one = CollectionUtils.newObjectMap("socre", 6, "exerciseId", "22222", "title", "这是单选题", |
| | | "analisis", "这是答案解析", "isRight", true); |
| | | Map<String, Object> one = CollectionUtils.newObjectMap("socre", 6, "exerciseId", "22222", "title", "这是单选题", |
| | | "type", 1, "options", CollectionUtils.newList(optionA, optionB, optionC, optionD), "answer", "A", |
| | | "analisis", "这是答案解析", "isRight", true); |
| | | "analisis", "这是答案解析", "isRight", true); |
| | | |
| | | Map<String, Object> three = CollectionUtils.newObjectMap("socre", 8, "exerciseId", "33333", "title", "这是判断题", |
| | | Map<String, Object> three = CollectionUtils.newObjectMap("socre", 8, "exerciseId", "33333", "title", "这是判断题", |
| | | "type", 3, "options", CollectionUtils.newList(checkoptionA, checkoptionB), "answer", "A", "analisis", |
| | | "这是答案解析", "isRight", true); |
| | | // fileType1 图片; 2 文档 3 视频 4 音频,5 压缩包 |
| | | "这是答案解析", "isRight", true); |
| | | // fileType1 图片; 2 文档 3 视频 4 音频,5 压缩包 |
| | | |
| | | return new Result(true, "success", |
| | | |
| | | CollectionUtils.newList( |
| | | CollectionUtils.newObjectMap("examPaperSectionId", "1111", "sectionName", "第一部分", "sectionDesc", |
| | | "根据题目信息选择正确答案", "itemLst", CollectionUtils.newList(one, two)), |
| | | CollectionUtils.newObjectMap("examPaperSectionId", "2222", "sectionName", "第二部分", "sectionDesc", |
| | | "根据题目信息选择正确答案", "itemLst", CollectionUtils.newList(three)))); |
| | | CollectionUtils.newObjectMap("examPaperSectionId", "1111", "sectionName", "第一部分", "sectionDesc", |
| | | "根据题目信息选择正确答案", "itemLst", CollectionUtils.newList(one, two)), |
| | | CollectionUtils.newObjectMap("examPaperSectionId", "2222", "sectionName", "第二部分", "sectionDesc", |
| | | "根据题目信息选择正确答案", "itemLst", CollectionUtils.newList(three)))); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 提交试卷 |
| | | * 提交试卷 |
| | | * |
| | | * @param answerItem |
| | | * [{"exerciseId":"11111","optionId":"4444,2222,3333"},{"exerciseId":"22222","optionId":"2222"},{"exerciseId":"33333","optionId":""}] |
| | | * @param status |
| | | * 提交状态(1,保存草稿。2,提交作业。) |
| | | * 提交状态(1,保存草稿。2,提交作业。) |
| | | */ |
| | | @PostMapping(value = "saveExam") |
| | | public Result saveExam(String examId, String answerItem, Integer durationTime, Integer status) { |