|
@@ -879,4 +879,29 @@ public class CoreController extends BaseApiController {
|
|
}
|
|
}
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @RequestMapping(value = "/exam/student/objective/save", method = RequestMethod.POST)
|
|
|
|
+ @ResponseBody
|
|
|
|
+ @RoleRequire({ Role.SCHOOL_ADMIN, Role.SCHOOL_DEV })
|
|
|
|
+ public JSONObject objectiveSave(HttpServletRequest request, @RequestParam Integer examId,
|
|
|
|
+ @RequestParam String examNumber, @RequestParam Double objectiveScore) {
|
|
|
|
+ ApiUser user = RequestUtils.getApiUser(request);
|
|
|
|
+ Exam exam = examService.findById(examId);
|
|
|
|
+ if (exam == null || !exam.getSchoolId().equals(user.getSchoolId()) || exam.getStatus() != ExamStatus.START
|
|
|
|
+ || exam.getType() != ExamType.MULTI_MEDIA) {
|
|
|
|
+ throw ApiException.EXAM_NOT_ACCESSIBLED;
|
|
|
|
+ }
|
|
|
|
+ examNumber = validate("examNumber", examNumber, true, 64);
|
|
|
|
+ if (objectiveScore == null) {
|
|
|
|
+ throw ApiException.QUERY_PARAM_ERROR.replaceMessage("objectiveScore is required");
|
|
|
|
+ }
|
|
|
|
+ ExamStudent student = studentService.findByExamIdAndExamNumber(examId, examNumber);
|
|
|
|
+ if (student != null) {
|
|
|
|
+ studentService.updateObjectiveScore(student.getId(), objectiveScore, objectiveScore.toString());
|
|
|
|
+ }
|
|
|
|
+ JSONObject result = new JSONObject();
|
|
|
|
+ result.accumulate("updateTime", DateUtils.formatDateTime(new Date()));
|
|
|
|
+ return result;
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|