|
@@ -75,20 +75,10 @@ public class ExamStudentController extends BaseApiController {
|
|
User user = RequestUtils.getApiUser(request);
|
|
User user = RequestUtils.getApiUser(request);
|
|
Exam exam = examService.findById(examId);
|
|
Exam exam = examService.findById(examId);
|
|
if (exam != null && exam.getSchoolId().equals(user.getSchoolId())) {
|
|
if (exam != null && exam.getSchoolId().equals(user.getSchoolId())) {
|
|
- JSONArray array = new JSONArray();
|
|
|
|
for (MenualAbsentDTO dto : datas) {
|
|
for (MenualAbsentDTO dto : datas) {
|
|
- ExamStudent student = examStudentService.findByExamIdAndSubjectCodeAndStudentCode(examId,
|
|
|
|
- dto.getSubjectCode(), dto.getStudentCode());
|
|
|
|
- if (student != null) {
|
|
|
|
- if (student.isManualAbsent() != dto.isAbsent()) {
|
|
|
|
- examStudentService.updateManualAbsent(student.getId(), dto.isAbsent());
|
|
|
|
- }
|
|
|
|
- array.add(student.getExamNumber());
|
|
|
|
- } else {
|
|
|
|
- array.add("");
|
|
|
|
- }
|
|
|
|
|
|
+ examStudentService.updateManualAbsent(examId, dto.getExamNumber(), dto.isAbsent());
|
|
}
|
|
}
|
|
- return array;
|
|
|
|
|
|
+ return true;
|
|
} else {
|
|
} else {
|
|
throw ApiException.EXAM_NOT_ACCESSIBLED;
|
|
throw ApiException.EXAM_NOT_ACCESSIBLED;
|
|
}
|
|
}
|