|
|
@@ -22,38 +22,41 @@ public class ExamServiceImpl implements ExamService {
|
|
|
this.evalService = evalService;
|
|
|
}
|
|
|
|
|
|
- public JSONArray getCoderRecommendExams() {
|
|
|
+ @Override
|
|
|
+ public JSONArray findCoderRecommendExams() {
|
|
|
JSONArray result = new JSONArray();
|
|
|
- JSONObject groupedExams = this.getCoderRecommendExamsGroupByCourse();
|
|
|
+ JSONObject groupedExams = this.findCoderRecommendExamsGroupByCourse();
|
|
|
for (String key : groupedExams.keySet()) {
|
|
|
result.addAll(groupedExams.getJSONArray(key));
|
|
|
}
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
- public JSONObject getCoderRecommendExamsGroupByCourse() {
|
|
|
+ @Override
|
|
|
+ public JSONObject findCoderRecommendExamsGroupByCourse() {
|
|
|
JSONObject result = new JSONObject();
|
|
|
- for (CourseVO courseVO : courseService.getExampleCourses()) {
|
|
|
+ for (CourseVO courseVO : courseService.findRecommendCourses()) {
|
|
|
if (courseVO.getCoderId() != null) {
|
|
|
result.put(courseVO.getName(),
|
|
|
- coderService.getRecommendExamsByCourseId(courseVO.getCoderId()).getJSONObject("res").getJSONArray("content"));
|
|
|
+ coderService.findRecommendExamsByCourseId(courseVO.getCoderId()).getJSONObject("res").getJSONArray("content"));
|
|
|
}
|
|
|
}
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public JSONObject getCoderStudentExams(int page, int limit) {
|
|
|
- return coderService.getStudentExams(page, limit, 0);
|
|
|
+ public JSONObject findCoderStudentExams(int page, int limit) {
|
|
|
+ return coderService.findStudentExams(page, limit, 0);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public JSONObject getCoderTeacherExams(int page, int limit) {
|
|
|
- return coderService.getTeacherExams(page, limit, 0);
|
|
|
+ public JSONObject findCoderTeacherExams(int page, int limit) {
|
|
|
+ return coderService.findTeacherExams(page, limit, 0);
|
|
|
}
|
|
|
|
|
|
- public JSONObject getCoderExamsByStudentGroupByCourse() {
|
|
|
- JSONArray exams = coderService.getStudentExams(1, 1000, 0).getJSONArray("res");
|
|
|
+ @Override
|
|
|
+ public JSONObject findCoderExamsByStudentGroupByCourse() {
|
|
|
+ JSONArray exams = coderService.findStudentExams(1, 1000, 0).getJSONArray("res");
|
|
|
JSONObject result = new JSONObject();
|
|
|
for (int i = 0; i < exams.size(); i++) {
|
|
|
JSONObject exam = exams.getJSONObject(i);
|
|
|
@@ -77,8 +80,9 @@ public class ExamServiceImpl implements ExamService {
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
- public JSONObject getCoderExamsByTeacherGroupByCourse() {
|
|
|
- JSONArray exams = coderService.getTeacherExams(1, 1000, 0).getJSONArray("res");
|
|
|
+ @Override
|
|
|
+ public JSONObject findCoderExamsByTeacherGroupByCourse() {
|
|
|
+ JSONArray exams = coderService.findTeacherExams(1, 1000, 0).getJSONArray("res");
|
|
|
JSONObject result = new JSONObject();
|
|
|
for (int i = 0; i < exams.size(); i++) {
|
|
|
JSONObject exam = exams.getJSONObject(i);
|
|
|
@@ -103,37 +107,40 @@ public class ExamServiceImpl implements ExamService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public JSONArray getCoderTeacherExamsByCourseId(int courseId) {
|
|
|
- return coderService.getTeacherExamsByCourseId(courseId).getJSONArray("array");
|
|
|
+ public JSONArray findCoderTeacherExamsByCourseId(int courseId) {
|
|
|
+ return coderService.findTeacherExamsByCourseId(courseId).getJSONArray("array");
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public JSONArray getCoderStudentExamsByCourseId(int courseId) {
|
|
|
- return coderService.getStudentExamsByCourseId(courseId).getJSONArray("array");
|
|
|
+ public JSONArray findCoderStudentExamsByCourseId(int courseId) {
|
|
|
+ return coderService.findStudentExamsByCourseId(courseId).getJSONArray("array");
|
|
|
}
|
|
|
|
|
|
- public JSONArray getEvalRecommendExams() {
|
|
|
+ @Override
|
|
|
+ public JSONArray findEvalRecommendExams() {
|
|
|
JSONArray result = new JSONArray();
|
|
|
- JSONObject groupedExams = this.getEvalRecommendExamsGroupByCourse();
|
|
|
+ JSONObject groupedExams = this.findEvalRecommendExamsGroupByCourse();
|
|
|
for (String key : groupedExams.keySet()) {
|
|
|
result.addAll(groupedExams.getJSONArray(key));
|
|
|
}
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
- public JSONObject getEvalRecommendExamsGroupByCourse() {
|
|
|
+ @Override
|
|
|
+ public JSONObject findEvalRecommendExamsGroupByCourse() {
|
|
|
JSONObject result = new JSONObject();
|
|
|
- for (CourseVO courseVO : courseService.getExampleCourses()) {
|
|
|
+ for (CourseVO courseVO : courseService.findRecommendCourses()) {
|
|
|
if (courseVO.getEvalId() != null) {
|
|
|
- result.put(courseVO.getName(), evalService.getRecommendExamsByCourseId(courseVO.getEvalId()).getJSONArray("result"));
|
|
|
+ result.put(courseVO.getName(), evalService.findRecommendExamsByCourseId(courseVO.getEvalId()).getJSONArray("result"));
|
|
|
}
|
|
|
}
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
- public JSONArray getEvalExamsByStudent(Long userId) {
|
|
|
+ @Override
|
|
|
+ public JSONArray findEvalExamsByStudent(Long userId) {
|
|
|
JSONArray result = new JSONArray();
|
|
|
- JSONObject groupedExams = this.getEvalExamsByStudentGroupByCourse(userId);
|
|
|
+ JSONObject groupedExams = this.findEvalExamsByStudentGroupByCourse(userId);
|
|
|
for (String key : groupedExams.keySet()) {
|
|
|
result.addAll(groupedExams.getJSONArray(key));
|
|
|
}
|
|
|
@@ -141,23 +148,25 @@ public class ExamServiceImpl implements ExamService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public JSONObject getEvalExamsByTeacher(int pageNum, int pageSize, int state) {
|
|
|
- return evalService.getTeacherExams(pageNum, pageSize, state).getJSONObject("result");
|
|
|
+ public JSONObject findEvalExamsByTeacher(int pageNum, int pageSize, int state) {
|
|
|
+ return evalService.findTeacherExams(pageNum, pageSize, state).getJSONObject("result");
|
|
|
}
|
|
|
|
|
|
- public JSONObject getEvalExamsByStudentGroupByCourse(Long userId) {
|
|
|
+ @Override
|
|
|
+ public JSONObject findEvalExamsByStudentGroupByCourse(Long userId) {
|
|
|
JSONObject result = new JSONObject();
|
|
|
- List<CourseVO> studentCourses = courseService.getStudentCourses(userId);
|
|
|
+ List<CourseVO> studentCourses = courseService.findStudentCourses(userId);
|
|
|
for (CourseVO courseVO : studentCourses) {
|
|
|
if (courseVO.getEvalId() != null) {
|
|
|
- result.put(courseVO.getName(), evalService.getStudentExamsByCourseId(courseVO.getEvalId()).getJSONArray("result"));
|
|
|
+ result.put(courseVO.getName(), evalService.findStudentExamsByCourseId(courseVO.getEvalId()).getJSONArray("result"));
|
|
|
}
|
|
|
}
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
- public JSONObject getEvalExamsByTeacherGroupByCourse() {
|
|
|
- JSONArray exams = evalService.getTeacherExams(1, 1000, 0).getJSONObject("result").getJSONArray("examVOList");
|
|
|
+ @Override
|
|
|
+ public JSONObject findEvalExamsByTeacherGroupByCourse() {
|
|
|
+ JSONArray exams = evalService.findTeacherExams(1, 1000, 0).getJSONObject("result").getJSONArray("examVOList");
|
|
|
JSONObject result = new JSONObject();
|
|
|
for (int i = 0; i < exams.size(); i++) {
|
|
|
JSONObject exam = exams.getJSONObject(i);
|
|
|
@@ -182,12 +191,12 @@ public class ExamServiceImpl implements ExamService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public JSONArray getEvalStudentExamsByCourseId(int courseId) {
|
|
|
- return evalService.getTeacherExamsByCourseId(courseId).getJSONArray("result");
|
|
|
+ public JSONArray findEvalStudentExamsByCourseId(int courseId) {
|
|
|
+ return evalService.findTeacherExamsByCourseId(courseId).getJSONArray("result");
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public JSONArray getEvalTeacherExamsByCourseId(int courseId) {
|
|
|
- return evalService.getStudentExamsByCourseId(courseId).getJSONArray("result");
|
|
|
+ public JSONArray findEvalTeacherExamsByCourseId(int courseId) {
|
|
|
+ return evalService.findStudentExamsByCourseId(courseId).getJSONArray("result");
|
|
|
}
|
|
|
}
|