deason 3 лет назад
Родитель
Сommit
5959e685f3

+ 19 - 9
src/main/java/cn/com/qmth/examcloud/app/controller/PracticeExamRestController.java

@@ -30,10 +30,13 @@ import static cn.com.qmth.examcloud.app.model.Constants.PARAM_APP_TOKEN;
 @RequestMapping("${$rmp}/v2")
 @Api(tags = "在线练习相关接口")
 public class PracticeExamRestController {
+
     @Autowired
     private CoreExamWorkService examWorkService;
+
     @Autowired
     private CoreOeService oeService;
+
     @Autowired
     private CoreQuestionService questionService;
 
@@ -61,11 +64,18 @@ public class PracticeExamRestController {
         return oeService.startPracticeExamRecord(key, token, examStudentId);
     }
 
+    @ApiOperation(value = "记录切屏次数接口")
+    @PostMapping(value = "/exam/record/switch/screen")
+    public Result switchScreen(@RequestHeader(name = PARAM_APP_KEY) String key, @RequestHeader(name = PARAM_APP_TOKEN) String token, @RequestParam String examRecordDataId) throws Exception {
+        return oeService.switchScreen(key, token, examRecordDataId);
+    }
+
     @ApiOperation(value = "获取结束练习的试卷大题结构信息接口")
     @RequestMapping(value = "/exam/admin/record/paper/struct/list", method = {RequestMethod.POST})
-    public Result getExamAdminRecordPaperStructList(@RequestHeader(name = PARAM_APP_KEY) String key, @RequestHeader(name = PARAM_APP_TOKEN) String token, @RequestParam String examRecordId,@RequestParam(required = false) String fromCache) throws Exception {
-        return oeService.getAdminExamPaperStructList(key, token, examRecordId,fromCache);
+    public Result getExamAdminRecordPaperStructList(@RequestHeader(name = PARAM_APP_KEY) String key, @RequestHeader(name = PARAM_APP_TOKEN) String token, @RequestParam String examRecordId, @RequestParam(required = false) String fromCache) throws Exception {
+        return oeService.getAdminExamPaperStructList(key, token, examRecordId, fromCache);
     }
+
     @ApiOperation(value = "获取当前练习的试卷大题结构信息接口")
     @RequestMapping(value = "/exam/student/record/paper/struct/list", method = {RequestMethod.POST})
     public Result getExamStudentRecordPaperStructList(@RequestHeader(name = PARAM_APP_KEY) String key, @RequestHeader(name = PARAM_APP_TOKEN) String token, @RequestParam String examRecordId) throws Exception {
@@ -92,8 +102,8 @@ public class PracticeExamRestController {
 
     @ApiOperation(value = "保存或更新考生作答的某个试题答案接口")
     @RequestMapping(value = "/exam/record/paper/question/answer/update", method = {RequestMethod.POST})
-    public Result updateExamRecordPaperQuestionAnswer(@RequestHeader(name = PARAM_APP_KEY) String key, @RequestHeader(name = PARAM_APP_TOKEN) String token, @RequestParam Integer order, @RequestParam String studentAnswer,@RequestParam(required = false) String audioPlayTimes) throws Exception {
-        return oeService.updateExamRecordPaperQuestionAnswer(key, token, order, studentAnswer,audioPlayTimes);
+    public Result updateExamRecordPaperQuestionAnswer(@RequestHeader(name = PARAM_APP_KEY) String key, @RequestHeader(name = PARAM_APP_TOKEN) String token, @RequestParam Integer order, @RequestParam String studentAnswer, @RequestParam(required = false) String audioPlayTimes) throws Exception {
+        return oeService.updateExamRecordPaperQuestionAnswer(key, token, order, studentAnswer, audioPlayTimes);
     }
 
     @ApiOperation(value = "当前练习的交卷接口")
@@ -116,8 +126,8 @@ public class PracticeExamRestController {
 
     @ApiOperation(value = "获取成绩报告的答题情况统计接口")
     @RequestMapping(value = "/exam/record/total", method = {RequestMethod.POST})
-    public Result getExamRecordTotalInfo(@RequestHeader(name = PARAM_APP_KEY) String key, @RequestHeader(name = PARAM_APP_TOKEN) String token, @RequestParam String examRecordId,@RequestParam(required = false) String fromCache) throws Exception {
-        return oeService.getExamRecordTotalInfo(key, token, examRecordId,fromCache);
+    public Result getExamRecordTotalInfo(@RequestHeader(name = PARAM_APP_KEY) String key, @RequestHeader(name = PARAM_APP_TOKEN) String token, @RequestParam String examRecordId, @RequestParam(required = false) String fromCache) throws Exception {
+        return oeService.getExamRecordTotalInfo(key, token, examRecordId, fromCache);
     }
 
     @ApiOperation(value = "获取作答的题列表接口")
@@ -146,14 +156,14 @@ public class PracticeExamRestController {
 
     @ApiOperation(value = "查询练习记录配置信息")
     @RequestMapping(value = "/exam/practice/end/findExamRecordDataEntity/{examRecordDataId}", method = {RequestMethod.POST})
-    public Result findExamRecordDataEntity(@RequestHeader(name = PARAM_APP_KEY) String key, @RequestHeader(name = PARAM_APP_TOKEN) String token, @PathVariable Long examRecordDataId,@RequestParam(required = false) String fromCache) throws Exception {
+    public Result findExamRecordDataEntity(@RequestHeader(name = PARAM_APP_KEY) String key, @RequestHeader(name = PARAM_APP_TOKEN) String token, @PathVariable Long examRecordDataId, @RequestParam(required = false) String fromCache) throws Exception {
         return oeService.findExamRecordDataEntity(key, token, examRecordDataId, fromCache);
     }
 
     @ApiOperation(value = "查询练习记录试题列表")
     @RequestMapping(value = "/exam/practice/end/getExamRecordQuestions/{examRecordDataId}", method = {RequestMethod.POST})
-    public Result getExamRecordQuestions(@RequestHeader(name = PARAM_APP_KEY) String key, @RequestHeader(name = PARAM_APP_TOKEN) String token, @PathVariable Long examRecordDataId,@RequestParam(required = false) String fromCache) throws Exception {
-        return oeService.getExamRecordQuestions(key, token, examRecordDataId,fromCache);
+    public Result getExamRecordQuestions(@RequestHeader(name = PARAM_APP_KEY) String key, @RequestHeader(name = PARAM_APP_TOKEN) String token, @PathVariable Long examRecordDataId, @RequestParam(required = false) String fromCache) throws Exception {
+        return oeService.getExamRecordQuestions(key, token, examRecordDataId, fromCache);
     }
 
     @ApiOperation(value = "查询某个试题内容")

+ 22 - 13
src/main/java/cn/com/qmth/examcloud/app/service/CoreOeService.java

@@ -6,10 +6,9 @@
 
 package cn.com.qmth.examcloud.app.service;
 
-import org.springframework.web.multipart.MultipartFile;
-
 import cn.com.qmth.examcloud.app.model.GetYunSignatureReq;
 import cn.com.qmth.examcloud.app.model.Result;
+import org.springframework.web.multipart.MultipartFile;
 
 /**
  * 网考业务服务接口
@@ -63,7 +62,7 @@ public interface CoreOeService {
      * @throws Exception
      */
     Result uploadPaperAnswer(String key, String token, String examRecordId, byte[] fileBytes, String fileName,
-            String md5) throws Exception;
+                             String md5) throws Exception;
 
     /**
      * 获取某考试批次下的课程列表
@@ -97,6 +96,8 @@ public interface CoreOeService {
      */
     Result startPracticeExamRecord(String key, String token, String examStudentId) throws Exception;
 
+    Result switchScreen(String key, String token, String examRecordDataId) throws Exception;
+
     /**
      * 获取当前练习的试卷大题结构信息
      *
@@ -151,7 +152,7 @@ public interface CoreOeService {
      * @return
      * @throws Exception
      */
-    Result updateExamRecordPaperQuestionAnswer(String key, String token, Integer order, String studentAnswer,String audioPlayTimes)
+    Result updateExamRecordPaperQuestionAnswer(String key, String token, Integer order, String studentAnswer, String audioPlayTimes)
             throws Exception;
 
     /**
@@ -255,7 +256,7 @@ public interface CoreOeService {
 
     /**
      * 查询考生的考试批次属性集
-     * 
+     *
      * @param key
      * @param token
      * @param examId
@@ -268,7 +269,7 @@ public interface CoreOeService {
 
     /**
      * 根据Id获取试卷
-     * 
+     *
      * @param key
      * @param token
      * @param paperId
@@ -276,7 +277,9 @@ public interface CoreOeService {
      */
     Result getPaperById(String key, String token, String paperId) throws Exception;
 
-    /**获取文件上传签名
+    /**
+     * 获取文件上传签名
+     *
      * @param key
      * @param token
      * @param req
@@ -285,14 +288,18 @@ public interface CoreOeService {
      */
     Result getYunSignature(String key, String token, GetYunSignatureReq req) throws Exception;
 
-    /**获取在线考试待考列表
+    /**
+     * 获取在线考试待考列表
+     *
      * @param key
      * @param token
      * @return
      */
     Result queryExamList(String key, String token) throws Exception;
 
-    /**获取考试记录信息
+    /**
+     * 获取考试记录信息
+     *
      * @param key
      * @param token
      * @param examRecordDataId
@@ -300,7 +307,9 @@ public interface CoreOeService {
      */
     Result getEndExamInfo(String key, String token, Long examRecordDataId) throws Exception;
 
-    /**根据examStudentId获取客观分信息
+    /**
+     * 根据examStudentId获取客观分信息
+     *
      * @param key
      * @param token
      * @param examStudentId
@@ -308,9 +317,9 @@ public interface CoreOeService {
      */
     Result queryObjectiveScoreList(String key, String token, Long examStudentId) throws Exception;
 
-	Result startAnswer(String key, String token, Long examRecordDataId) throws Exception;
+    Result startAnswer(String key, String token, Long examRecordDataId) throws Exception;
 
-	Result uploadPaperAnswerBatch(String key, String token, Long examRecordDataId, MultipartFile[] fileArray,
-			String fileType, String[] fileMd5Array) throws Exception;
+    Result uploadPaperAnswerBatch(String key, String token, Long examRecordDataId, MultipartFile[] fileArray,
+                                  String fileType, String[] fileMd5Array) throws Exception;
 
 }

+ 87 - 77
src/main/java/cn/com/qmth/examcloud/app/service/impl/CoreOeServiceImpl.java

@@ -7,20 +7,21 @@
 
 package cn.com.qmth.examcloud.app.service.impl;
 
+import cn.com.qmth.examcloud.api.commons.enums.ExamType;
+import cn.com.qmth.examcloud.app.core.SysProperty;
 import cn.com.qmth.examcloud.app.core.exception.ApiException;
 import cn.com.qmth.examcloud.app.core.utils.DateUtils;
 import cn.com.qmth.examcloud.app.core.utils.HttpUtils;
+import cn.com.qmth.examcloud.app.model.Constants;
+import cn.com.qmth.examcloud.app.model.GetYunSignatureReq;
+import cn.com.qmth.examcloud.app.model.Result;
+import cn.com.qmth.examcloud.app.service.CoreOeService;
 import cn.com.qmth.examcloud.commons.util.JsonMapper;
 import cn.com.qmth.examcloud.support.cache.CacheHelper;
 import cn.com.qmth.examcloud.support.cache.bean.ExamPropertyCacheBean;
 import cn.com.qmth.examcloud.support.cache.bean.ExamSettingsCacheBean;
 import cn.com.qmth.examcloud.support.enums.ExamProperties;
-import cn.com.qmth.examcloud.app.model.Constants;
-import cn.com.qmth.examcloud.app.model.GetYunSignatureReq;
-import cn.com.qmth.examcloud.app.model.Result;
-import cn.com.qmth.examcloud.app.service.CoreOeService;
-import cn.com.qmth.examcloud.api.commons.enums.ExamType;
-import cn.com.qmth.examcloud.app.core.SysProperty;
+import com.alibaba.fastjson.JSONObject;
 import okhttp3.FormBody;
 import okhttp3.FormBody.Builder;
 import okhttp3.MediaType;
@@ -35,8 +36,6 @@ import org.springframework.stereotype.Service;
 import org.springframework.util.Assert;
 import org.springframework.web.multipart.MultipartFile;
 
-import com.alibaba.fastjson.JSONObject;
-
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -50,7 +49,9 @@ import java.util.Map;
  */
 @Service
 public class CoreOeServiceImpl implements CoreOeService {
+
     private static final Logger log = LoggerFactory.getLogger(CoreOeServiceImpl.class);
+
     @Autowired
     private SysProperty sysProperty;
 
@@ -86,8 +87,8 @@ public class CoreOeServiceImpl implements CoreOeService {
         Assert.notNull(fileName, "ExamRecordId must not be null.");
         String fileType = FilenameUtils.getExtension(fileName.toLowerCase());
         if (!Constants.FILE_TYPE_ZIP.equals(fileType) && !Constants.FILE_TYPE_PDF.equals(fileType)
-        		&& !Constants.FILE_TYPE_JPG.equals(fileType)&& !Constants.FILE_TYPE_JPEG.equals(fileType)
-        		&& !Constants.FILE_TYPE_PNG.equals(fileType)) {
+                && !Constants.FILE_TYPE_JPG.equals(fileType) && !Constants.FILE_TYPE_JPEG.equals(fileType)
+                && !Constants.FILE_TYPE_PNG.equals(fileType)) {
             throw new ApiException("FileType must be zip,pdf,jpg,jpeg,png.");
         }
         if (fileBytes.length == 0) {
@@ -125,16 +126,25 @@ public class CoreOeServiceImpl implements CoreOeService {
     }
 
     @Override
-    public Result getAdminExamPaperStructList(String key, String token, String examRecordId,String fromCache) throws Exception {
+    public Result switchScreen(String key, String token, String examRecordDataId) throws Exception {
+        //封装请求参数
+        final String requestUrl = String.format("%s/api/ecs_oe_student/examControl/switchScreen?examRecordDataId=%s", sysProperty.getApiDomain(), examRecordDataId);
+        RequestBody formBody = FormBody.create(MediaType.parse(Constants.CHARSET_JSON_UTF8), "");
+        return HttpUtils.doPost(requestUrl, formBody, key, token);
+    }
+
+    @Override
+    public Result getAdminExamPaperStructList(String key, String token, String examRecordId, String fromCache) throws Exception {
         //封装请求参数
-        String requestUrl=null;
-        if("1".equals(fromCache)) {
+        String requestUrl = null;
+        if ("1".equals(fromCache)) {
             requestUrl = String.format("%s/api/branch_ecs_oe_admin/examRecordPaperStruct/getExamRecordPaperStruct?fromCache=1&examRecordDataId=%s", sysProperty.getApiDomain(), examRecordId);
-        }else {
+        } else {
             requestUrl = String.format("%s/api/branch_ecs_oe_admin/examRecordPaperStruct/getExamRecordPaperStruct?examRecordDataId=%s", sysProperty.getApiDomain(), examRecordId);
         }
         return HttpUtils.doGet(requestUrl, key, token);
     }
+
     @Override
     public Result getStudentExamPaperStructList(String key, String token, String examRecordId) throws Exception {
         //封装请求参数
@@ -157,7 +167,7 @@ public class CoreOeServiceImpl implements CoreOeService {
     }
 
     @Override
-    public Result updateExamRecordPaperQuestionAnswer(String key, String token, Integer order, String studentAnswer,String audioPlayTimes) throws Exception {
+    public Result updateExamRecordPaperQuestionAnswer(String key, String token, Integer order, String studentAnswer, String audioPlayTimes) throws Exception {
         //封装请求参数
         final String requestUrl = String.format("%s/api/ecs_oe_student/examQuestion/submitQuestionAnswer", sysProperty.getApiDomain());
         List<Map> paramsList = new ArrayList<Map>();
@@ -168,10 +178,10 @@ public class CoreOeServiceImpl implements CoreOeService {
         paramsList.add(params);
         String json = new JsonMapper().toJson(paramsList);
         RequestBody formBody = FormBody.create(MediaType.parse(Constants.CHARSET_JSON_UTF8), json);
-        Map<String,String> headers=new HashMap<>();
+        Map<String, String> headers = new HashMap<>();
         headers.put("REFERER", "app-referer");
         headers.put("USER-AGENT", "app-" + cn.com.qmth.examcloud.support.Constants.ELECTRON_EXAM_SHELL);
-        return HttpUtils.doPost(requestUrl, formBody, key, token,headers);
+        return HttpUtils.doPost(requestUrl, formBody, key, token, headers);
     }
 
     @Override
@@ -185,25 +195,25 @@ public class CoreOeServiceImpl implements CoreOeService {
     public Result checkOnlineExamRecord(String key, String token) throws Exception {
         //封装请求参数
         final String requestUrl = String.format("%s/api/ecs_oe_student/examControl/checkExamInProgress", sysProperty.getApiDomain());
-        Result<String> ret=HttpUtils.doGet(requestUrl, key, token);
-        if(Constants.CODE_200.equals(ret.getCode())&&StringUtils.isNotBlank(ret.getData())) {
-        	JSONObject data=JSONObject.parseObject(ret.getData());
-        	if(Constants.COMMON_SUCCESS_CODE.equals(data.getString("code"))) {
-	        	JSONObject bdata=data.getJSONObject("data");
-	        	if(bdata!=null) {
-		        	Long examId=bdata.getLong("examId");
-		        	if(examId!=null) {
-		        		ExamSettingsCacheBean exam=CacheHelper.getExamSettings(examId);
-		        		if(ExamType.ONLINE.name().equals(exam.getExamType())) {
-			        		ExamPropertyCacheBean es=CacheHelper.getExamProperty(examId, ExamProperties.APP_EXAM_ENABLED.name());
-			        		if(!"true".equals(es.getValue())) {
-			        			ret.setCode(Constants.CODE_409);
-			        			ret.setDesc(Constants.DESC_409);
-			        		}
-		        		}
-		        	}
-	        	}
-        	}
+        Result<String> ret = HttpUtils.doGet(requestUrl, key, token);
+        if (Constants.CODE_200.equals(ret.getCode()) && StringUtils.isNotBlank(ret.getData())) {
+            JSONObject data = JSONObject.parseObject(ret.getData());
+            if (Constants.COMMON_SUCCESS_CODE.equals(data.getString("code"))) {
+                JSONObject bdata = data.getJSONObject("data");
+                if (bdata != null) {
+                    Long examId = bdata.getLong("examId");
+                    if (examId != null) {
+                        ExamSettingsCacheBean exam = CacheHelper.getExamSettings(examId);
+                        if (ExamType.ONLINE.name().equals(exam.getExamType())) {
+                            ExamPropertyCacheBean es = CacheHelper.getExamProperty(examId, ExamProperties.APP_EXAM_ENABLED.name());
+                            if (!"true".equals(es.getValue())) {
+                                ret.setCode(Constants.CODE_409);
+                                ret.setDesc(Constants.DESC_409);
+                            }
+                        }
+                    }
+                }
+            }
         }
         return ret;
     }
@@ -216,12 +226,12 @@ public class CoreOeServiceImpl implements CoreOeService {
     }
 
     @Override
-    public Result getExamRecordTotalInfo(String key, String token, String examRecordId,String fromCache) throws Exception {
+    public Result getExamRecordTotalInfo(String key, String token, String examRecordId, String fromCache) throws Exception {
         //封装请求参数
-        String requestUrl=null;
-        if("1".equals(fromCache)) {
+        String requestUrl = null;
+        if ("1".equals(fromCache)) {
             requestUrl = String.format("%s/api/branch_ecs_oe_admin/practice/getPracticeDetailInfo?fromCache=1&examRecordDataId=%s", sysProperty.getApiDomain(), examRecordId);
-        }else {
+        } else {
             requestUrl = String.format("%s/api/branch_ecs_oe_admin/practice/getPracticeDetailInfo?examRecordDataId=%s", sysProperty.getApiDomain(), examRecordId);
         }
         return HttpUtils.doGet(requestUrl, key, token);
@@ -253,12 +263,12 @@ public class CoreOeServiceImpl implements CoreOeService {
     }
 
     @Override
-    public Result findExamRecordDataEntity(String key, String token, Long examRecordDataId,String fromCache) throws Exception {
+    public Result findExamRecordDataEntity(String key, String token, Long examRecordDataId, String fromCache) throws Exception {
         //封装请求参数
-        String requestUrl=null;
-        if("1".equals(fromCache)) {
+        String requestUrl = null;
+        if ("1".equals(fromCache)) {
             requestUrl = String.format("%s/api/branch_ecs_oe_admin/exam/record/data/findExamRecordDataEntity?fromCache=1&examRecordDataId=%s", sysProperty.getApiDomain(), examRecordDataId);
-        }else {
+        } else {
             requestUrl = String.format("%s/api/branch_ecs_oe_admin/exam/record/data/findExamRecordDataEntity?examRecordDataId=%s", sysProperty.getApiDomain(), examRecordDataId);
         }
         Result<String> result = HttpUtils.doGet(requestUrl, key, token);
@@ -270,12 +280,12 @@ public class CoreOeServiceImpl implements CoreOeService {
     }
 
     @Override
-    public Result getExamRecordQuestions(String key, String token, Long examRecordDataId,String fromCache) throws Exception {
+    public Result getExamRecordQuestions(String key, String token, Long examRecordDataId, String fromCache) throws Exception {
         //封装请求参数
-        String requestUrl=null;
-        if("1".equals(fromCache)) {
+        String requestUrl = null;
+        if ("1".equals(fromCache)) {
             requestUrl = String.format("%s/api/branch_ecs_oe_admin/examRecordQuestions/getExamRecordQuestions?fromCache=1&examRecordDataId=%s", sysProperty.getApiDomain(), examRecordDataId);
-        }else {
+        } else {
             requestUrl = String.format("%s/api/branch_ecs_oe_admin/examRecordQuestions/getExamRecordQuestions?examRecordDataId=%s", sysProperty.getApiDomain(), examRecordDataId);
         }
         Result<String> result = HttpUtils.doGet(requestUrl, key, token);
@@ -287,34 +297,34 @@ public class CoreOeServiceImpl implements CoreOeService {
     }
 
     @Override
-    public Result getExamPropertyFromCacheByStudentSession(String key, String token,Long examId,String keys) throws Exception {
+    public Result getExamPropertyFromCacheByStudentSession(String key, String token, Long examId, String keys) throws Exception {
         //封装请求参数
-        final String requestUrl = String.format("%s/api/ecs_exam_work/exam/getExamPropertyFromCacheByStudentSession/"+examId+"/"+keys, sysProperty.getApiDomain());
+        final String requestUrl = String.format("%s/api/ecs_exam_work/exam/getExamPropertyFromCacheByStudentSession/" + examId + "/" + keys, sysProperty.getApiDomain());
         Result<String> result = HttpUtils.doGet(requestUrl, key, token);
         return result;
     }
 
     @Override
     public Result getPaperById(String key, String token, String paperId) throws Exception {
-        final String requestUrl = String.format("%s/api/branch_ecs_ques/paper/"+paperId, sysProperty.getApiDomain());
+        final String requestUrl = String.format("%s/api/branch_ecs_ques/paper/" + paperId, sysProperty.getApiDomain());
         Result<String> result = HttpUtils.doGet(requestUrl, key, token);
         return result;
     }
-    
+
     @Override
     public Result getYunSignature(String key, String token, GetYunSignatureReq req) throws Exception {
         //封装请求参数
         final String requestUrl = String.format("%s/api/ecs_oe_student/examControl/yunSignature", sysProperty.getApiDomain());
-        Builder b= new FormBody.Builder()
+        Builder b = new FormBody.Builder()
                 .add("examRecordDataId", req.getExamRecordDataId())
                 .add("order", req.getOrder())
                 .add("fileMd5", req.getFileMd5())
                 .add("fileSuffix", req.getFileSuffix());
-        if(StringUtils.isNotBlank(req.getExt())) {
-                b.add("ext", req.getExt());
+        if (StringUtils.isNotBlank(req.getExt())) {
+            b.add("ext", req.getExt());
         }
-        RequestBody formBody =b.build();
-                 
+        RequestBody formBody = b.build();
+
         return HttpUtils.doPost(requestUrl, formBody, key, token);
     }
 
@@ -326,46 +336,46 @@ public class CoreOeServiceImpl implements CoreOeService {
 
     @Override
     public Result getEndExamInfo(String key, String token, Long examRecordDataId) throws Exception {
-        final String requestUrl = String.format("%s/api/ecs_oe_student/examControl/getEndExamInfo?examRecordDataId="+examRecordDataId, sysProperty.getApiDomain());
+        final String requestUrl = String.format("%s/api/ecs_oe_student/examControl/getEndExamInfo?examRecordDataId=" + examRecordDataId, sysProperty.getApiDomain());
         return HttpUtils.doGet(requestUrl, key, token);
     }
 
     @Override
     public Result queryObjectiveScoreList(String key, String token, Long examStudentId) throws Exception {
-        final String requestUrl = String.format("%s/api/branch_ecs_oe_admin/exam/score/queryObjectiveScoreList?examStudentId="+examStudentId, sysProperty.getApiDomain());
+        final String requestUrl = String.format("%s/api/branch_ecs_oe_admin/exam/score/queryObjectiveScoreList?examStudentId=" + examStudentId, sysProperty.getApiDomain());
         return HttpUtils.doGet(requestUrl, key, token);
     }
 
-	@Override
-	public Result startAnswer(String key, String token, Long examRecordDataId) throws Exception {
-		final String requestUrl = String.format("%s/api/ecs_oe_student/examControl/startAnswer", sysProperty.getApiDomain());
-		RequestBody formBody = new FormBody.Builder()
+    @Override
+    public Result startAnswer(String key, String token, Long examRecordDataId) throws Exception {
+        final String requestUrl = String.format("%s/api/ecs_oe_student/examControl/startAnswer", sysProperty.getApiDomain());
+        RequestBody formBody = new FormBody.Builder()
                 .add("examRecordDataId", examRecordDataId.toString())
                 .build();
         return HttpUtils.doPost(requestUrl, formBody, key, token);
-	}
+    }
 
-	@Override
-	public Result uploadPaperAnswerBatch(String key, String token, Long examRecordDataId, MultipartFile[] fileArray,
-			String fileType, String[] fileMd5Array) throws Exception {
+    @Override
+    public Result uploadPaperAnswerBatch(String key, String token, Long examRecordDataId, MultipartFile[] fileArray,
+                                         String fileType, String[] fileMd5Array) throws Exception {
         if (!Constants.FILE_TYPE_ZIP.equals(fileType) && !Constants.FILE_TYPE_PDF.equals(fileType)
-        		&& !Constants.FILE_TYPE_JPG.equals(fileType)&& !Constants.FILE_TYPE_JPEG.equals(fileType)
-        		&& !Constants.FILE_TYPE_PNG.equals(fileType)) {
+                && !Constants.FILE_TYPE_JPG.equals(fileType) && !Constants.FILE_TYPE_JPEG.equals(fileType)
+                && !Constants.FILE_TYPE_PNG.equals(fileType)) {
             throw new ApiException("FileType must be zip,pdf,jpg,jpeg,png.");
         }
         //封装请求参数									
-        final String requestUrl = String.format("%s/api/branch_ecs_oe_admin/offlineExam/batchSubmitPaper?examRecordDataId="+examRecordDataId+"&fileType="+fileType, sysProperty.getApiDomain());
+        final String requestUrl = String.format("%s/api/branch_ecs_oe_admin/offlineExam/batchSubmitPaper?examRecordDataId=" + examRecordDataId + "&fileType=" + fileType, sysProperty.getApiDomain());
         MultipartBody.Builder form = new MultipartBody.Builder().setType(MultipartBody.FORM);
-        for(MultipartFile file:fileArray) {
-	        RequestBody body = RequestBody.create(MediaType.parse("application/octet-stream"), file.getBytes());
-	        form.addFormDataPart("fileArray", file.getOriginalFilename(), body);
+        for (MultipartFile file : fileArray) {
+            RequestBody body = RequestBody.create(MediaType.parse("application/octet-stream"), file.getBytes());
+            form.addFormDataPart("fileArray", file.getOriginalFilename(), body);
         }
         form.addFormDataPart("fileType", fileType);
-        for(String md5:fileMd5Array) {
-        	form.addFormDataPart("fileMd5Array", md5 != null ? md5 : "");
+        for (String md5 : fileMd5Array) {
+            form.addFormDataPart("fileMd5Array", md5 != null ? md5 : "");
         }
-        
+
         return HttpUtils.doPost(requestUrl, form.build(), key, token);
-	}
+    }
 
 }