From 0e62c15e4b010ffa2d5cff9474f3fd389e369338 Mon Sep 17 00:00:00 2001 From: EricsHu <hrr145632> Date: 星期五, 24 十一月 2023 14:31:46 +0800 Subject: [PATCH] 优化作业、考试、试卷、题库 --- src/main/java/com/qxueyou/scc/exercise/action/ExerciseInfoController.java | 144 ++++++++++++++++++++++++------------------------ 1 files changed, 72 insertions(+), 72 deletions(-) diff --git a/src/main/java/com/qxueyou/scc/exercise/action/ExerciseInfoController.java b/src/main/java/com/qxueyou/scc/exercise/action/ExerciseInfoController.java index 5d3a686..d373a91 100644 --- a/src/main/java/com/qxueyou/scc/exercise/action/ExerciseInfoController.java +++ b/src/main/java/com/qxueyou/scc/exercise/action/ExerciseInfoController.java @@ -43,12 +43,12 @@ import javax.servlet.http.HttpServletRequest; /** - * 作业管理 + * 浣滀笟绠$悊 * * @author kevin * */ -@Api(tags = "作业管理接口") +@Api(tags = "浣滀笟绠$悊鎺ュ彛") @Controller @CrossOrigin(origins="*",maxAge=3600) @RequestMapping(value = "/exercise/info") @@ -73,25 +73,25 @@ @Autowired private IExerciseCompleteService exerciseCompleteService; - /** 练习V2.0版本接口service */ + /** 缁冧範V2.0鐗堟湰鎺ュ彛service */ @Autowired private IExerciseVerService exerciseVerService; - //------------------------------------------------app接口------------------------------------------- + //------------------------------------------------app鎺ュ彛------------------------------------------- /** - * 获取作业详情 + * 鑾峰彇浣滀笟璇︽儏 * * @param examId * @return */ - @ApiOperation(value = "获取作业详情", notes = "") + @ApiOperation(value = "鑾峰彇浣滀笟璇︽儏", notes = "") @ApiImplicitParams({ - @ApiImplicitParam(name = "exerciseInfoId", value = "作业id", required = true, paramType="query", dataType = "String"), + @ApiImplicitParam(name = "exerciseInfoId", value = "浣滀笟id", required = true, paramType="query", dataType = "String"), }) @RequestMapping(value = "/app/detail", method = RequestMethod.GET) public @ResponseBody Result queryDetail(String exerciseInfoId) { if (StringUtils.isEmpty(exerciseInfoId)) { - return new Result(false, "参数错误"); + return new Result(false, "鍙傛暟閿欒"); } ExerciseInfo exerciseInfo = this.commonDAO.read(ExerciseInfo.class, exerciseInfoId); @@ -122,10 +122,10 @@ } - //-------------------------------------------------后台端接口----------------------------------------- + //-------------------------------------------------鍚庡彴绔帴鍙�----------------------------------------- /** - * 考试列表 + * 浣滀笟鍒楄〃 * * @return */ @@ -134,7 +134,7 @@ pageSize = pageSize != null && pageSize > 0 ? pageSize : DEFAULT_PAGE_SIZE; pageNum = pageNum != null && pageNum > 0 ? pageNum : DEFAULT_PAGE_NUM; - //作业数量 + //浣滀笟鏁伴噺 int totalCount = exerciseInfoService.listCount(keyword == null ? "" : keyword.trim(),classId,status); Pager pager = new Pager(pageSize,pageNum); pager.setTotalCount(totalCount); @@ -168,7 +168,7 @@ } /** - * 保存作业基础信息 + * 淇濆瓨浣滀笟鍩虹淇℃伅 * * @return */ @@ -179,7 +179,7 @@ } /** - * 删除作业 + * 鍒犻櫎浣滀笟 * * @param examId * @return @@ -187,13 +187,13 @@ @RequestMapping(value = "/delete", method = RequestMethod.GET) public @ResponseBody Result deleteExercise(String exerciseInfoId) { if (StringUtils.isEmpty(exerciseInfoId)) { - return new Result(false, "参数错误"); + return new Result(false, "鍙傛暟閿欒"); } return this.exerciseInfoService.deleteExerciseInfo(exerciseInfoId); } /** - * 发布作业 + * 鍙戝竷浣滀笟 * * @param exerciseIds * @return @@ -201,13 +201,13 @@ @RequestMapping(value = "/publish", method = RequestMethod.GET) public @ResponseBody Result publishExerciseInfo(String exerciseIds) { if (StringUtils.isEmpty(exerciseIds)) { - return new Result(false, "参数错误"); + return new Result(false, "鍙傛暟閿欒"); } return this.exerciseInfoService.doPublishExercise(exerciseIds.split(",")); } /** - * 撤回作业 + * 鎾ゅ洖浣滀笟 * * @param exerciseIds * @return @@ -215,14 +215,14 @@ @RequestMapping(value = "/revoke", method = RequestMethod.GET) public @ResponseBody Result revokeExerciseInfo(String exerciseIds) { if (StringUtils.isEmpty(exerciseIds)) { - return new Result(false, "参数错误"); + return new Result(false, "鍙傛暟閿欒"); } return this.exerciseInfoService.doRevokeExercise(exerciseIds.split(",")); } /** - * 撤回作业校验 + * 鎾ゅ洖浣滀笟鏍¢獙 * * @param exerciseIds * @return @@ -232,29 +232,29 @@ int count= this.commonDAO.findCountByComplexHql("from ExerciseInfo f where f.startTime<=:startTime and f.exerciseInfoId in (:exerciseIds)", CollectionUtils.newObjectMap("startTime",new Date(),"exerciseIds",exerciseIds)); - return count>0?new Result(false,"已开始的作业不能撤回"):new Result(true); + return count>0?new Result(false,"宸插紑濮嬬殑浣滀笟涓嶈兘鎾ゅ洖"):new Result(true); } /** - * 获取作业详情 + * 鑾峰彇浣滀笟璇︽儏 * * @param examId * @return */ - @ApiOperation(value = "获取作业详情", notes = "") + @ApiOperation(value = "鑾峰彇浣滀笟璇︽儏", notes = "") @ApiImplicitParams({ - @ApiImplicitParam(name = "exerciseInfoId", value = "作业id", required = true, paramType="query", dataType = "String"), + @ApiImplicitParam(name = "exerciseInfoId", value = "浣滀笟id", required = true, paramType="query", dataType = "String"), }) @RequestMapping(value = "/detail", method = RequestMethod.GET) public @ResponseBody Result initExerciseInfo(String exerciseInfoId) { Result result = new Result(true); if (StringUtils.isEmpty(exerciseInfoId)) { - new Result(false, "参数错误"); + new Result(false, "鍙傛暟閿欒"); } ExerciseInfo exerciseInfo = this.commonDAO.read(ExerciseInfo.class, exerciseInfoId); exerciseInfo.setSubjectName(exerciseInfo.getSubject().getName()); - // 获取关联班机信息 + // 鑾峰彇鍏宠仈鐝満淇℃伅 if (exerciseInfo.getReClasses() != null) { List<ExerciseExamReClass> reClasses = new ArrayList<ExerciseExamReClass>( exerciseInfo.getReClasses().size()); @@ -270,13 +270,13 @@ exerciseInfo.setReClasses(reClasses); } - //答题作业取题目信息 + //绛旈浣滀笟鍙栭鐩俊鎭� if(exerciseInfo.getType()== ExerciseInfo.EXERCISE_TYPE_ANSWER){ String groupId = exerciseInfoService.queryExerciseInfoRelatedGroupId(exerciseInfoId); @SuppressWarnings("deprecation") List<ExerciseItem> lstItem = exerciseVerService.queryExerciseItemList(groupId); - // 3.组装返回参数 + // 3.缁勮杩斿洖鍙傛暟 ExerItemResponseData responseData = new ExerItemResponseData(); responseData.setExerciseGroupId(groupId); responseData.setItems(lstItem); @@ -289,12 +289,12 @@ /** - * 作业题型配置 + * 浣滀笟棰樺瀷閰嶇疆 * * @param examId * @return */ - @ApiOperation(value = "作业题型配置查询") + @ApiOperation(value = "浣滀笟棰樺瀷閰嶇疆鏌ヨ") @RequestMapping(value = "/itemset/list", method = RequestMethod.GET) public @ResponseBody List<Map<String, Object>> examItemTypeList(String exerciseInfoId) { return this.commonDAO.findListWithMapByHql("select blankScore as blankScore,halfRightScore as halfRightScore," @@ -304,14 +304,14 @@ } /** - * 作业布置班级列表 + * 浣滀笟甯冪疆鐝骇鍒楄〃 * * @param examId * @return */ @RequestMapping(value = "/relatedclass/list", method = RequestMethod.GET) public @ResponseBody List<Map<String, Object>> classList(String exerciseInfoId) { - // TODO 作业布置查询班级需要修改 + // TODO 浣滀笟甯冪疆鏌ヨ鐝骇闇�瑕佷慨鏀� return this.commonDAO.findListWithMapByHql( "select s.classId as classId,s.name as className from ExerciseExamReClass c,ClsClass s where c.deleteFlag is false and s.deleteFlag is false" + " and s.classId = c.classId and c.examId = :exerciseInfoId", @@ -319,7 +319,7 @@ } /** - * 作业题库来源列表 + * 浣滀笟棰樺簱鏉ユ簮鍒楄〃 * * @param examId * @return @@ -334,15 +334,15 @@ /** - * 学员得分详情列表 + * 瀛﹀憳寰楀垎璇︽儏鍒楄〃 * * @param groupId * @return */ - @ApiOperation(value = "学员得分详情列表", notes = "") + @ApiOperation(value = "瀛﹀憳寰楀垎璇︽儏鍒楄〃", notes = "") @ApiImplicitParams({ - @ApiImplicitParam(name = "exerciseInfoId", value = "作业id", required = false, paramType="query", dataType = "String"), - @ApiImplicitParam(name = "subjectId", value = "课程id", required = false, paramType="query", dataType = "String"), + @ApiImplicitParam(name = "exerciseInfoId", value = "浣滀笟id", required = false, paramType="query", dataType = "String"), + @ApiImplicitParam(name = "subjectId", value = "璇剧▼id", required = false, paramType="query", dataType = "String"), }) @RequestMapping(value = "/teacher/answerresultlist", method = RequestMethod.GET) public @ResponseBody Result resultList(String keyword,String exerciseInfoId,String subjectId, Short status,Integer pageSize, @@ -350,7 +350,7 @@ pageSize = pageSize != null && pageSize > 0 ? pageSize : DEFAULT_PAGE_SIZE; pageNum = pageNum != null && pageNum > 0 ? pageNum : DEFAULT_PAGE_NUM; - //作业数量 + //浣滀笟鏁伴噺 int totalCount = exerciseInfoService.queryStuExerciseListCount(keyword,exerciseInfoId,null,subjectId,status); Pager pager = new Pager(pageSize,pageNum); pager.setTotalCount(totalCount); @@ -365,18 +365,18 @@ return new Result(true,"",CollectionUtils.newObjectMap("list", listResult,"pager", pager)); } - //查询个人需要做的作业 - @ApiOperation(value = "查询个人需要做的作业列表", notes = "") + //鏌ヨ涓汉闇�瑕佸仛鐨勪綔涓� + @ApiOperation(value = "鏌ヨ涓汉闇�瑕佸仛鐨勪綔涓氬垪琛�", notes = "") @ApiImplicitParams({ - @ApiImplicitParam(name = "classId", value = "班级id", required = true, paramType="query", dataType = "String"), - @ApiImplicitParam(name = "subjectId", value = "课程id", required = true, paramType="query", dataType = "String"), - @ApiImplicitParam(name = "status", value = "作业状态查询(默认全部,0待完成,1已提交 ,2:已批阅,3需重写,4:逾期未交)", required = true, paramType="query", dataType = "Short"), + @ApiImplicitParam(name = "classId", value = "鐝骇id", required = true, paramType="query", dataType = "String"), + @ApiImplicitParam(name = "subjectId", value = "璇剧▼id", required = true, paramType="query", dataType = "String"), + @ApiImplicitParam(name = "status", value = "浣滀笟鐘舵�佹煡璇紙榛樿鍏ㄩ儴锛�0寰呭畬鎴愶紝1宸叉彁浜� ,2:宸叉壒闃�,3闇�閲嶅啓,4:閫炬湡鏈氦锛�", required = true, paramType="query", dataType = "Short"), }) @RequestMapping(value = "/student/list", method = RequestMethod.GET) public @ResponseBody Result queryStudentExerciseList(String keyword, String subjectId, Short status, Integer pageSize, Integer pageNum, HttpServletRequest request) { pageSize = pageSize != null && pageSize > 0 ? pageSize : DEFAULT_PAGE_SIZE; pageNum = pageNum != null && pageNum > 0 ? pageNum : DEFAULT_PAGE_NUM; - //作业数量 + //浣滀笟鏁伴噺 int totalCount = exerciseInfoService.queryStuExerciseListCount(keyword,null,ClientUtils.getUserId(),subjectId,status); List<ExerciseResultV> list = exerciseInfoService.queryStuExerciselist(keyword,null,ClientUtils.getUserId(),subjectId,status,pageSize, pageNum); List<Map<String, Object>> listResult =QBeanUtils.listBean2ListMap(list, @@ -388,22 +388,22 @@ } /** - * 开始做作业 + * 寮�濮嬪仛浣滀笟 * * @param examId * @return */ - @ApiOperation(value = "开始做作业", notes = "") + @ApiOperation(value = "寮�濮嬪仛浣滀笟", notes = "") @ApiImplicitParams({ - @ApiImplicitParam(name = "exerciseInfoId", value = "作业id", required = false, paramType="query", dataType = "String"), - @ApiImplicitParam(name = "classId", value = "班级id", required = true, paramType="query", dataType = "String"), + @ApiImplicitParam(name = "exerciseInfoId", value = "浣滀笟id", required = false, paramType="query", dataType = "String"), + @ApiImplicitParam(name = "classId", value = "鐝骇id", required = true, paramType="query", dataType = "String"), @ApiImplicitParam(name = "studentUserId", value = "userId", required = true, paramType="query", dataType = "String"), }) @RequestMapping(value = "/student/startexercise", method = RequestMethod.GET) public @ResponseBody Result doStartExercise(String exerciseInfoId, String classId,String studentUserId) { - System.out.println(ClientUtils.getUserId()+"做作业"+ClientUtils.getClassName()+"aaa"+ClientUtils.getClassId()); + System.out.println(ClientUtils.getUserId()+"鍋氫綔涓�"+ClientUtils.getClassName()+"aaa"+ClientUtils.getClassId()); if (StringUtils.isEmpty(exerciseInfoId)) { - return new Result(false, "参数错误"); + return new Result(false, "鍙傛暟閿欒"); } if(StringUtils.isEmpty(studentUserId)){ @@ -414,18 +414,18 @@ } /** - * 提交文件和写作作业 + * 鎻愪氦鏂囦欢鍜屽啓浣滀綔涓� * * @param examId * @return */ - @ApiOperation(value = "提交文件和写作作业", notes = "") + @ApiOperation(value = "鎻愪氦鏂囦欢鍜屽啓浣滀綔涓�", notes = "") @ApiImplicitParams({ - @ApiImplicitParam(name = "exerciseCompleteInfoId", value = "提交记录id", required = false, paramType="query", dataType = "String"), - @ApiImplicitParam(name = "content", value = "内容", required = true, paramType="query", dataType = "String"), - @ApiImplicitParam(name = "fileId", value = "文件id", required = true, paramType="query", dataType = "String"), - @ApiImplicitParam(name = "filePath", value = "文件路径", required = true, paramType="query", dataType = "String"), - @ApiImplicitParam(name = "submitType", value = "提交方式(1:已提交作业,待批阅 2:已批阅 3:需重写 重写完后重新提交状态变为 1)", required = true, paramType="query", dataType = "short"), + @ApiImplicitParam(name = "exerciseCompleteInfoId", value = "鎻愪氦璁板綍id", required = false, paramType="query", dataType = "String"), + @ApiImplicitParam(name = "content", value = "鍐呭", required = true, paramType="query", dataType = "String"), + @ApiImplicitParam(name = "fileId", value = "鏂囦欢id", required = true, paramType="query", dataType = "String"), + @ApiImplicitParam(name = "filePath", value = "鏂囦欢璺緞", required = true, paramType="query", dataType = "String"), + @ApiImplicitParam(name = "submitType", value = "鎻愪氦鏂瑰紡锛�1锛氬凡鎻愪氦浣滀笟锛屽緟鎵归槄 2锛氬凡鎵归槄 3锛氶渶閲嶅啓 閲嶅啓瀹屽悗閲嶆柊鎻愪氦鐘舵�佸彉涓� 1锛�", required = true, paramType="query", dataType = "short"), }) @RequestMapping(value = "/student/submitexercise", method = RequestMethod.POST) public @ResponseBody Result doSubmitFileExercise( @@ -434,14 +434,14 @@ @RequestParam(value = "filePath") String filePath, @RequestParam(value = "submitType") short submitType) { if (StringUtils.isEmpty(completeInfoId)) { - return new Result(false, "参数错误"); + return new Result(false, "鍙傛暟閿欒"); } return this.exerciseInfoService.doSubmitOtherExerciseInfo(completeInfoId, content, fileId, filePath,submitType); } /** - * 提交答题作业 + * 鎻愪氦绛旈浣滀笟 * * @param examId * @return @@ -449,11 +449,11 @@ * @throws JsonMappingException * @throws JsonParseException */ - @ApiOperation(value = "提交答题作业", notes = "") + @ApiOperation(value = "鎻愪氦绛旈浣滀笟", notes = "") @ApiImplicitParams({ - @ApiImplicitParam(name = "exerciseCompleteInfoId", value = "提交记录id", required = false, paramType="query", dataType = "String"), - @ApiImplicitParam(name = "exerciseInfoId", value = "作业id", required = false, paramType="query", dataType = "String"), - @ApiImplicitParam(name = "answers", value = "答题内容", required = true, paramType="query", dataType = "String"), + @ApiImplicitParam(name = "exerciseCompleteInfoId", value = "鎻愪氦璁板綍id", required = false, paramType="query", dataType = "String"), + @ApiImplicitParam(name = "exerciseInfoId", value = "浣滀笟id", required = false, paramType="query", dataType = "String"), + @ApiImplicitParam(name = "answers", value = "绛旈鍐呭", required = true, paramType="query", dataType = "String"), }) @RequestMapping(value = "/student/submitanswer", method = RequestMethod.POST) public @ResponseBody Result doSubmitAnswerExercise(@RequestParam(value = "answers") String answers, @@ -461,7 +461,7 @@ @RequestParam(value = "exerciseCompleteId") String exerciseCompleteId) throws Exception { if (StringUtils.isEmpty(answers)) { - return new Result(false, "参数错误"); + return new Result(false, "鍙傛暟閿欒"); } ExerciseSubmitAnswerData answerData = new ObjectMapper().readValue(answers, ExerciseSubmitAnswerData.class); @@ -469,29 +469,29 @@ return this.exerciseInfoService.doSubmitAnswerExerciseInfo(answerData, exerciseInfoId, exerciseCompleteId); } - @ApiOperation(value = "老师阅卷") - @ApiImplicitParams({@ApiImplicitParam(name="answerData", dataType="String", paramType="query", value="提交答案", required=true)}) + @ApiOperation(value = "鑰佸笀闃呭嵎") + @ApiImplicitParams({@ApiImplicitParam(name="answerData", dataType="String", paramType="query", value="鎻愪氦绛旀", required=true)}) @RequestMapping(value = "/teacher/check", method = RequestMethod.POST) public @ResponseBody Object doCheck(@RequestBody ExerciseSubmitAnswerData answerData) { return this.exerciseInfoService.doSubmitAnswerExerciseInfo(answerData, answerData.getExerciseInfoId(), answerData.getExerciseCompleteId()); } /** - * 前端查看作业详情 + * 鍓嶇鏌ョ湅浣滀笟璇︽儏 * * @param examId * @return */ - @ApiOperation(value = "查看学生作业详情", notes = "") + @ApiOperation(value = "鏌ョ湅瀛︾敓浣滀笟璇︽儏", notes = "") @ApiImplicitParams({ - @ApiImplicitParam(name = "exerciseCompleteInfoId", value = "提交记录id", required = false, paramType="query", dataType = "String"), - @ApiImplicitParam(name = "classId", value = "班级id", required = false, paramType="query", dataType = "String"), + @ApiImplicitParam(name = "exerciseCompleteInfoId", value = "鎻愪氦璁板綍id", required = false, paramType="query", dataType = "String"), + @ApiImplicitParam(name = "classId", value = "鐝骇id", required = false, paramType="query", dataType = "String"), @ApiImplicitParam(name = "studentUserId", value = "userId", required = true, paramType="query", dataType = "String"), }) @RequestMapping(value = "/student/detail", method = RequestMethod.GET) public @ResponseBody Result queryStudentExerciseDetail(String exerciseInfoId, String classId,String studentUserId) { if (StringUtils.isEmpty(exerciseInfoId)) { - return new Result(false, "参数错误"); + return new Result(false, "鍙傛暟閿欒"); } Map<String, Object> detailMap = new HashMap<String,Object>(30); ExerciseInfo exerciseInfo = this.commonDAO.read(ExerciseInfo.class, exerciseInfoId); @@ -525,7 +525,7 @@ } /** - * 初始化平均成绩和最高成绩 + * 鍒濆鍖栧钩鍧囨垚缁╁拰鏈�楂樻垚缁� * * @param groupId * @return @@ -537,7 +537,7 @@ } /** - * 每道题得分详情 + * 姣忛亾棰樺緱鍒嗚鎯� * * @param groupId * @return -- Gitblit v1.8.0