|
@@ -90,55 +90,75 @@ public class ReportController {
|
|
|
query.setSubjectCode(subjectCode);
|
|
|
query.setPaperType(paperType);
|
|
|
query.setPageSize(Integer.MAX_VALUE);
|
|
|
+ ReportSubject reportSubject = reportSubjectService.findOne(query.getExamId(), query.getSubjectCode());
|
|
|
+ result.accumulate("basic_paper", getPaperJson(reportSubject));
|
|
|
result.accumulate("basic_question_objective", getQuestionJson(query, true));
|
|
|
result.accumulate("basic_question_subjective", getQuestionJson(query, true));
|
|
|
result.accumulate("basic_class", getClassJson(query));
|
|
|
result.accumulate("basic_teacher", getTeacerJson(query));
|
|
|
result.accumulate("basic_college", getCollegeJson(query));
|
|
|
result.accumulate("basic_main_question", getGroupJson(query));
|
|
|
- result.accumulate("basic_question_option", getOptionJson(query));
|
|
|
- result.accumulate("discrimination_level", getDiscrimination(query));
|
|
|
- result.accumulate("difficulty_level", getDifficulty(query));
|
|
|
- result.accumulate("range_level", getRangeLevel(query));
|
|
|
-// result.accumulate("range_10_totalScore", getRange10(query));
|
|
|
- result.accumulate("range_1_totalScore", getRange1(query));
|
|
|
-// result.accumulate("range_segment_6", getRange6(query));
|
|
|
+ result.accumulate("basic_question_option", getOptionJson(query, reportSubject));
|
|
|
+ result.accumulate("discrimination_level", getDiscrimination(query, reportSubject));
|
|
|
+ result.accumulate("difficulty_level", getDifficulty(query, reportSubject));
|
|
|
+ result.accumulate("range_level", getRangeLevel(query, reportSubject));
|
|
|
+ // result.accumulate("range_10_totalScore", getRange10(query));
|
|
|
+ // result.accumulate("range_1_totalScore", getRange1(query));
|
|
|
+ // result.accumulate("range_segment_6", getRange6(query));
|
|
|
model.addAttribute("data", result);
|
|
|
return "modules/report/pdf";
|
|
|
}
|
|
|
|
|
|
-// private String getRange6(ReportSubjectQuery query) {
|
|
|
-// // TODO Auto-generated method stub
|
|
|
-// }
|
|
|
-
|
|
|
- private String getRange1(ReportSubjectQuery query) {
|
|
|
- JSONObject result = new JSONObject();
|
|
|
- ReportSubject reportSubject = reportSubjectService.findOne(query.getExamId(), query.getSubjectCode());
|
|
|
- JSONArray array = new JSONArray();
|
|
|
-// result.accumulate("total", getScoreRange(array,reportSubject.getScoreRange(),100,1));
|
|
|
- JSONArray classes = new JSONArray();
|
|
|
- List<ReportSubjectClass> list = classService.findByQuery(query);
|
|
|
- for (ReportSubjectClass reportSubjectClass : list) {
|
|
|
-
|
|
|
- }
|
|
|
- result.accumulate("classes", classes);
|
|
|
- return result.toString();
|
|
|
+ private String getPaperJson(ReportSubject r) {
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
+ jsonObject.accumulate("fullScore", r.getTotalScore());
|
|
|
+ jsonObject.accumulate("maxScore", r.getMaxScore());
|
|
|
+ jsonObject.accumulate("minScore", r.getMinScore());
|
|
|
+ jsonObject.accumulate("avgScore", r.getAvgScore());
|
|
|
+ jsonObject.accumulate("stdevScore", r.getStdev());
|
|
|
+ jsonObject.accumulate("coefficient", r.getCoefficient());
|
|
|
+ jsonObject.accumulate("difficulty", r.getDifficulty());
|
|
|
+ jsonObject.accumulate("discrimination", r.getDiscrimination());
|
|
|
+ jsonObject.accumulate("totalCount", r.getRealityCount());
|
|
|
+ jsonObject.accumulate("zeroCount", r.getZeroCount());
|
|
|
+ jsonObject.accumulate("fullCount", r.getFullCount());
|
|
|
+ return jsonObject.toString();
|
|
|
}
|
|
|
|
|
|
-// private JSONArray getScoreRange(JSONArray array, String scoreRange, int totalScore, int range) {
|
|
|
-// JSONObject value = new JSONObject();
|
|
|
-// value.accumulate(key, value);
|
|
|
-// array.add(value);
|
|
|
-// return array;
|
|
|
-// }
|
|
|
-
|
|
|
-// private String getRange10(ReportSubjectQuery query) {
|
|
|
-// // TODO Auto-generated method stub
|
|
|
-// }
|
|
|
-
|
|
|
- private String getRangeLevel(ReportSubjectQuery query) {
|
|
|
+ // private String getRange6(ReportSubjectQuery query) {
|
|
|
+ // // TODO Auto-generated method stub
|
|
|
+ // }
|
|
|
+
|
|
|
+ // private String getRange1(ReportSubjectQuery query) {
|
|
|
+ // JSONObject result = new JSONObject();
|
|
|
+ // ReportSubject reportSubject =
|
|
|
+ // reportSubjectService.findOne(query.getExamId(), query.getSubjectCode());
|
|
|
+ // JSONArray array = new JSONArray();
|
|
|
+ // // result.accumulate("total",
|
|
|
+ // // getScoreRange(array,reportSubject.getScoreRange(),100,1));
|
|
|
+ // JSONArray classes = new JSONArray();
|
|
|
+ // List<ReportSubjectClass> list = classService.findByQuery(query);
|
|
|
+ // for (ReportSubjectClass reportSubjectClass : list) {
|
|
|
+ //
|
|
|
+ // }
|
|
|
+ // result.accumulate("classes", classes);
|
|
|
+ // return result.toString();
|
|
|
+ // }
|
|
|
+
|
|
|
+ // private JSONArray getScoreRange(JSONArray array, String scoreRange, int
|
|
|
+ // totalScore, int range) {
|
|
|
+ // JSONObject value = new JSONObject();
|
|
|
+ // value.accumulate(key, value);
|
|
|
+ // array.add(value);
|
|
|
+ // return array;
|
|
|
+ // }
|
|
|
+
|
|
|
+ // private String getRange10(ReportSubjectQuery query) {
|
|
|
+ // // TODO Auto-generated method stub
|
|
|
+ // }
|
|
|
+
|
|
|
+ private String getRangeLevel(ReportSubjectQuery query, ReportSubject reportSubject) {
|
|
|
JSONArray array = new JSONArray();
|
|
|
- ReportSubject reportSubject = reportSubjectService.findOne(query.getExamId(), query.getSubjectCode());
|
|
|
JSONObject value = JSONObject.fromObject(reportSubject.getRangeLevel());
|
|
|
value.accumulate("name", "全部");
|
|
|
value.accumulate("totalCount", reportSubject.getRealityCount());
|
|
@@ -147,19 +167,24 @@ public class ReportController {
|
|
|
for (ReportSubjectClass reportSubjectClass : classes) {
|
|
|
JSONObject classValue = JSONObject.fromObject(reportSubjectClass.getRangeLevel());
|
|
|
classValue.accumulate("name", reportSubjectClass.getClassName());
|
|
|
-// value.accumulate("totalCount", reportSubjectClass.getRealityCount());
|
|
|
- array.add(value);
|
|
|
+ classValue.accumulate("totalCount", reportSubject.getTotalCount());
|
|
|
+ array.add(classValue);
|
|
|
}
|
|
|
return array.toString();
|
|
|
}
|
|
|
|
|
|
- private String getDifficulty(ReportSubjectQuery query) {
|
|
|
- JSONArray array = new JSONArray();
|
|
|
+ private String getDifficulty(ReportSubjectQuery query, ReportSubject reportSubject) {
|
|
|
+ JSONArray result = new JSONArray();
|
|
|
// 全部
|
|
|
- ReportSubject reportSubject = reportSubjectService.findOne(query.getExamId(), query.getSubjectCode());
|
|
|
- JSONObject value = new JSONObject();
|
|
|
- value.accumulate("name", "全部");
|
|
|
+ JSONObject obj = new JSONObject();
|
|
|
JSONArray groups = new JSONArray();
|
|
|
+ JSONObject value = new JSONObject();
|
|
|
+ value.accumulate("name", "全卷");
|
|
|
+ value.accumulate("questionCount", reportSubject.getQuestionCount());
|
|
|
+ value.accumulate("fullScore", reportSubject.getTotalScore());
|
|
|
+ value.accumulate("difficulty", reportSubject.getDifficulty());
|
|
|
+ value.accumulate("levels", reportSubject.getDifficulityLevel());
|
|
|
+ groups.add(value);
|
|
|
List<ReportSubjectGroup> list = groupService.findByQuery(query);
|
|
|
for (ReportSubjectGroup r : list) {
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
@@ -170,14 +195,22 @@ public class ReportController {
|
|
|
jsonObject.accumulate("levels", r.getDifficulityLevel());
|
|
|
groups.add(jsonObject);
|
|
|
}
|
|
|
- value.accumulate("groups", groups);
|
|
|
- array.add(value);
|
|
|
+ obj.accumulate("name", "全部");
|
|
|
+ obj.accumulate("groups", groups);
|
|
|
+ result.add(obj);
|
|
|
// 班级
|
|
|
List<ReportSubjectClass> classes = classService.findByQuery(query);
|
|
|
for (ReportSubjectClass reportSubjectClass : classes) {
|
|
|
JSONObject classValue = new JSONObject();
|
|
|
value.accumulate("name", reportSubjectClass.getClassName());
|
|
|
JSONArray classGroups = new JSONArray();
|
|
|
+ JSONObject group = new JSONObject();
|
|
|
+ group.accumulate("name", "全卷");
|
|
|
+ group.accumulate("questionCount", reportSubject.getQuestionCount());
|
|
|
+ group.accumulate("fullScore", reportSubject.getTotalScore());
|
|
|
+ group.accumulate("difficulty", reportSubjectClass.getDifficulty());
|
|
|
+ group.accumulate("levels", reportSubjectClass.getDifficulityLevel());
|
|
|
+ classGroups.add(group);
|
|
|
query.setClassName(reportSubjectClass.getClassName());
|
|
|
List<ReportSubjectClassGroup> classGroupsList = classGroupService.findByQuery(query);
|
|
|
for (ReportSubjectClassGroup r : classGroupsList) {
|
|
@@ -185,23 +218,28 @@ public class ReportController {
|
|
|
jsonObject.accumulate("name", r.getGroupName());
|
|
|
jsonObject.accumulate("questionCount", r.getQuestionCount());
|
|
|
jsonObject.accumulate("fullScore", r.getTotalScore());
|
|
|
-// jsonObject.accumulate("difficulty", r.getDifficulty());
|
|
|
+ jsonObject.accumulate("difficulty", r.getDifficulty());
|
|
|
jsonObject.accumulate("levels", r.getDifficulityLevel());
|
|
|
groups.add(jsonObject);
|
|
|
}
|
|
|
- value.accumulate("groups", classGroups);
|
|
|
- array.add(classValue);
|
|
|
+ classValue.accumulate("groups", classGroups);
|
|
|
+ result.add(classValue);
|
|
|
}
|
|
|
- return array.toString();
|
|
|
+ return result.toString();
|
|
|
}
|
|
|
|
|
|
- private String getDiscrimination(ReportSubjectQuery query) {
|
|
|
- JSONArray array = new JSONArray();
|
|
|
+ private String getDiscrimination(ReportSubjectQuery query, ReportSubject reportSubject) {
|
|
|
+ JSONArray result = new JSONArray();
|
|
|
// 全部
|
|
|
- ReportSubject reportSubject = reportSubjectService.findOne(query.getExamId(), query.getSubjectCode());
|
|
|
- JSONObject value = new JSONObject();
|
|
|
- value.accumulate("name", "全部");
|
|
|
+ JSONObject obj = new JSONObject();
|
|
|
JSONArray groups = new JSONArray();
|
|
|
+ JSONObject value = new JSONObject();
|
|
|
+ value.accumulate("name", "全卷");
|
|
|
+ value.accumulate("questionCount", reportSubject.getQuestionCount());
|
|
|
+ value.accumulate("fullScore", reportSubject.getTotalScore());
|
|
|
+ value.accumulate("coefficient", reportSubject.getCoefficient());
|
|
|
+ value.accumulate("levels", reportSubject.getDiscriminationLevel());
|
|
|
+ groups.add(value);
|
|
|
List<ReportSubjectGroup> list = groupService.findByQuery(query);
|
|
|
for (ReportSubjectGroup r : list) {
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
@@ -212,14 +250,22 @@ public class ReportController {
|
|
|
jsonObject.accumulate("levels", r.getDiscriminationLevel());
|
|
|
groups.add(jsonObject);
|
|
|
}
|
|
|
- value.accumulate("groups", groups);
|
|
|
- array.add(value);
|
|
|
+ obj.accumulate("name", "全部");
|
|
|
+ obj.accumulate("groups", groups);
|
|
|
+ result.add(obj);
|
|
|
// 班级
|
|
|
List<ReportSubjectClass> classes = classService.findByQuery(query);
|
|
|
for (ReportSubjectClass reportSubjectClass : classes) {
|
|
|
JSONObject classValue = new JSONObject();
|
|
|
value.accumulate("name", reportSubjectClass.getClassName());
|
|
|
JSONArray classGroups = new JSONArray();
|
|
|
+ JSONObject group = new JSONObject();
|
|
|
+ group.accumulate("name", "全卷");
|
|
|
+ group.accumulate("questionCount", reportSubject.getQuestionCount());
|
|
|
+ group.accumulate("fullScore", reportSubject.getTotalScore());
|
|
|
+ group.accumulate("coefficient", reportSubjectClass.getCoefficient());
|
|
|
+ group.accumulate("levels", reportSubjectClass.getDiscriminationLevel());
|
|
|
+ classGroups.add(group);
|
|
|
query.setClassName(reportSubjectClass.getClassName());
|
|
|
List<ReportSubjectClassGroup> classGroupsList = classGroupService.findByQuery(query);
|
|
|
for (ReportSubjectClassGroup r : classGroupsList) {
|
|
@@ -227,31 +273,30 @@ public class ReportController {
|
|
|
jsonObject.accumulate("name", r.getGroupName());
|
|
|
jsonObject.accumulate("questionCount", r.getQuestionCount());
|
|
|
jsonObject.accumulate("fullScore", r.getTotalScore());
|
|
|
-// jsonObject.accumulate("coefficient", r.getCoefficient());
|
|
|
+ jsonObject.accumulate("coefficient", r.getCoefficient());
|
|
|
jsonObject.accumulate("levels", r.getDiscriminationLevel());
|
|
|
groups.add(jsonObject);
|
|
|
}
|
|
|
- value.accumulate("groups", classGroups);
|
|
|
- array.add(classValue);
|
|
|
+ classValue.accumulate("groups", classGroups);
|
|
|
+ result.add(classValue);
|
|
|
}
|
|
|
- return array.toString();
|
|
|
+ return result.toString();
|
|
|
}
|
|
|
|
|
|
- private String getOptionJson(ReportSubjectQuery query) {
|
|
|
+ private String getOptionJson(ReportSubjectQuery query, ReportSubject reportSubject) {
|
|
|
JSONObject value = new JSONObject();
|
|
|
- ReportSubject reportSubject = reportSubjectService.findOne(query.getExamId(), query.getSubjectCode());
|
|
|
value.accumulate("options", reportSubject.getOptions());
|
|
|
JSONArray array = new JSONArray();
|
|
|
query.setObjective(true);
|
|
|
List<ReportSubjectQuestion> list = questionService.findByQuery(query);
|
|
|
for (ReportSubjectQuestion r : list) {
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
- jsonObject.accumulate("number", r.getMainNumber()+"-"+r.getSubNumber());
|
|
|
+ jsonObject.accumulate("number", r.getMainNumber() + "-" + r.getSubNumber());
|
|
|
jsonObject.accumulate("totalCount", r.getRealityCount());
|
|
|
-// jsonObject.accumulate("correctCount", r.getf);
|
|
|
+ jsonObject.accumulate("correctCount", r.getFullCount());
|
|
|
jsonObject.accumulate("difficulty", r.getDifficulty());
|
|
|
jsonObject.accumulate("discrimination", r.getDiscrimination());
|
|
|
-// jsonObject.accumulate("answer", r.get);
|
|
|
+ jsonObject.accumulate("answer", r.getAnswer());
|
|
|
jsonObject.accumulate("options", r.getOptions());
|
|
|
array.add(jsonObject);
|
|
|
}
|
|
@@ -265,8 +310,18 @@ public class ReportController {
|
|
|
for (ReportSubjectGroup r : list) {
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.accumulate("name", r.getGroupName());
|
|
|
- jsonObject.accumulate("difficulty", r.getDifficulty());
|
|
|
jsonObject.accumulate("objective", r.getObjective());
|
|
|
+ jsonObject.accumulate("fullScore", r.getTotalScore());
|
|
|
+ jsonObject.accumulate("maxScore", r.getMaxScore());
|
|
|
+ jsonObject.accumulate("minScore", r.getMinScore());
|
|
|
+ jsonObject.accumulate("avgScore", r.getAvgScore());
|
|
|
+ jsonObject.accumulate("stdevScore", r.getStdev());
|
|
|
+ jsonObject.accumulate("coefficient", r.getCoefficient());
|
|
|
+ jsonObject.accumulate("difficulty", r.getDifficulty());
|
|
|
+ jsonObject.accumulate("discrimination", r.getDiscrimination());
|
|
|
+ jsonObject.accumulate("totalCount", r.getRealityCount());
|
|
|
+ jsonObject.accumulate("zeroCount", r.getZeroCount());
|
|
|
+ jsonObject.accumulate("fullCount", r.getScoreRate());
|
|
|
array.add(jsonObject);
|
|
|
}
|
|
|
return array.toString();
|