ting.yin 3 lat temu
rodzic
commit
0f58cd540a

+ 1 - 1
stmms-web/src/main/java/cn/com/qmth/stmms/admin/config/SystemAuthController.java

@@ -113,7 +113,7 @@ public class SystemAuthController extends BaseController {
                     authCache.setAuth(true);
                     if (json.has("control") && json.getJSONObject("control").has("expireTime")
                             && StringUtils.isNotBlank(json.getJSONObject("control").getString("expireTime"))) {
-                        long expireTime = json.getJSONObject("control").getLong("expireTime");
+                        Long expireTime = json.getJSONObject("control").getLong("expireTime");
                         authCache.setExpireTime(expireTime);
                         List<School> list = schoolService.parseJson(json.getString("orgs"));
                         schoolService.updateOrg(list);

+ 1 - 1
stmms-web/src/main/java/cn/com/qmth/stmms/admin/dto/ObjectiveQuestionDTO.java

@@ -65,7 +65,7 @@ public class ObjectiveQuestionDTO implements QuestionDTO {
         question.setGroupNumber(0);
         question.setObjective(true);
         question.setMainTitle(StringUtils.trimToNull(title));
-        question.setAnswer(StringUtils.trimToNull(answer));
+        question.setAnswer(StringUtils.trimToNull(answer) == null ? null : StringUtils.trimToNull(answer).toUpperCase());
         question.setTotalScore(totalScore);
         question.setIntervalScore(1d);
         question.setType(QuestionType.findByValue(type));

+ 1 - 1
stmms-web/src/main/java/cn/com/qmth/stmms/admin/exam/AnswerCheckController.java

@@ -109,7 +109,7 @@ public class AnswerCheckController extends BaseExamController {
             if (absent != null) {
                 student.setAbsent(absent);
             }
-            student.setAnswers(answers);
+            student.setAnswers(answers.toUpperCase());
             if (paperType.matches(PAPER_TYPES_REGEX)) {
                 student.setPaperType(paperType);
             }

+ 1 - 1
stmms-web/src/main/java/cn/com/qmth/stmms/admin/exam/CheckStudentController.java

@@ -83,7 +83,7 @@ public class CheckStudentController extends BaseExamController {
         answers = StringEscapeUtils.unescapeHtml(StringUtils.trimToNull(answers));
         CheckStudent cs = checkStudentService.findByStudentId(studentId);
         if (student != null && cs != null) {
-            student.setAnswers(answers);
+            student.setAnswers(answers.toUpperCase());
             studentService.save(student);
             cs.setChecked(true);
             cs.setUpdateTime(new Date());

+ 3 - 0
stmms-web/src/main/java/cn/com/qmth/stmms/admin/exam/PaperController.java

@@ -701,6 +701,9 @@ public class PaperController extends BaseExamController {
             error.add("有名称不一致的记录");
             return false;
         }
+        if (question.isObjective()) {
+            question.setAnswer(question.getAnswer().toUpperCase());
+        }
         return true;
     }
 }

+ 2 - 4
stmms-web/src/main/java/cn/com/qmth/stmms/admin/report/ReportSubjectRangeController.java

@@ -174,10 +174,8 @@ public class ReportSubjectRangeController extends BaseExamController {
             writer.write(new ByteArrayInputStream(className), subjectName, "班级分析.xlsx");
             byte[] teacher = fileService.downloadReport(examId, subjectName, "任课老师统计", FormatType.XLSX);
             writer.write(new ByteArrayInputStream(teacher), subjectName, "任课老师统计.xlsx");
-            if (fileService.reportExist(examId, subjectName, "客观题分析", FormatType.XLSX)) {
-                byte[] objective = fileService.downloadReport(examId, subjectName, "客观题分析", FormatType.XLSX);
-                writer.write(new ByteArrayInputStream(objective), subjectName, "客观题分析.xlsx");
-            }
+            byte[] objective = fileService.downloadReport(examId, subjectName, "客观题分析", FormatType.XLSX);
+            writer.write(new ByteArrayInputStream(objective), subjectName, "客观题分析.xlsx");
             byte[] subjective = fileService.downloadReport(examId, subjectName, "主观题分析", FormatType.XLSX);
             writer.write(new ByteArrayInputStream(subjective), subjectName, "主观题分析.xlsx");
             byte[] group = fileService.downloadReport(examId, subjectName, "分组统计分析", FormatType.XLSX);

+ 10 - 28
stmms-web/src/main/java/cn/com/qmth/stmms/admin/thread/ScoreReportThread.java

@@ -242,18 +242,12 @@ public class ScoreReportThread implements Runnable {
         query.setPageNumber(1);
         query.setPageSize(Integer.MAX_VALUE);
         List<ReportSubjectGroup> list = reportSubjectGroupService.findByQuery(query);
-        if (list.isEmpty()) {
-            return;
-        }
         for (ReportSubjectGroup r : list) {
             r.setAvgScore(new BigDecimal(r.getAvgScore()).setScale(2, RoundingMode.HALF_UP).doubleValue());
             r.setScoreRate(new BigDecimal(r.getScoreRate()).setScale(2, RoundingMode.HALF_UP).doubleValue());
             r.setStdev(new BigDecimal(r.getStdev()).setScale(2, RoundingMode.HALF_UP).doubleValue());
             r.setCoefficient(new BigDecimal(r.getCoefficient()).setScale(2, RoundingMode.HALF_UP).doubleValue());
         }
-        if (list.isEmpty()) {
-            return;
-        }
         ByteArrayOutputStream os = new ByteArrayOutputStream();
         new ExportExcel(name, ReportSubjectGroup.class).setDataList(list).write(os);
         os.flush();
@@ -278,9 +272,6 @@ public class ScoreReportThread implements Runnable {
             r.setScoreRate(new BigDecimal(r.getScoreRate()).setScale(2, RoundingMode.HALF_UP).doubleValue());
             r.setFullScoreRate(new BigDecimal(r.getFullScoreRate()).setScale(2, RoundingMode.HALF_UP).doubleValue());
         }
-        if (list.isEmpty()) {
-            return;
-        }
         ByteArrayOutputStream os = new ByteArrayOutputStream();
         new ExportExcel(name, ReportSubjectQuestion.class).setDataList(list).write(os);
         os.flush();
@@ -305,9 +296,6 @@ public class ScoreReportThread implements Runnable {
             r.setRelativeAvgScore(new BigDecimal(r.getRelativeAvgScore()).setScale(2, RoundingMode.HALF_UP)
                     .doubleValue());
         }
-        if (list.isEmpty()) {
-            return;
-        }
         ByteArrayOutputStream os = new ByteArrayOutputStream();
         new ExportExcel(name, ReportSubjectTeacher.class).setDataList(list).write(os);
         os.flush();
@@ -330,9 +318,6 @@ public class ScoreReportThread implements Runnable {
             r.setExcellentRate(new BigDecimal(r.getExcellentRate()).setScale(2, RoundingMode.HALF_UP).doubleValue());
             r.setPassRate(new BigDecimal(r.getPassRate()).setScale(2, RoundingMode.HALF_UP).doubleValue());
         }
-        if (list.isEmpty()) {
-            return;
-        }
         ByteArrayOutputStream os = new ByteArrayOutputStream();
         new ExportExcel(name, ReportSubjectClass.class).setDataList(list).write(os);
         os.flush();
@@ -355,9 +340,6 @@ public class ScoreReportThread implements Runnable {
             r.setExcellentRate(new BigDecimal(r.getExcellentRate()).setScale(2, RoundingMode.HALF_UP).doubleValue());
             r.setPassRate(new BigDecimal(r.getPassRate()).setScale(2, RoundingMode.HALF_UP).doubleValue());
         }
-        if (list.isEmpty()) {
-            return;
-        }
         ByteArrayOutputStream os = new ByteArrayOutputStream();
         new ExportExcel(name, ReportSubjectCollege.class).setDataList(list).write(os);
         os.flush();
@@ -371,16 +353,16 @@ public class ScoreReportThread implements Runnable {
             Exception {
         List<ReportSubjectRangeDTO> list = new ArrayList<ReportSubjectRangeDTO>();
         ReportSubject subject = reportSubjectService.findOne(examId, subjectCode);
-        JSONArray array = getScoreRange(subject.getScoreRange(), subject.getTotalScore(), subject.getRealityCount(), 10);
-        for (int i = 0; i < array.size(); i++) {
-            JSONObject jsonObject = array.getJSONObject(i);
-            String score = jsonObject.getInt("score") + "-";
-            Integer rangeCount = jsonObject.getInt("rangeCount");
-            Double rangeRate = jsonObject.getDouble("rangeRate");
-            list.add(new ReportSubjectRangeDTO(score, rangeCount, rangeRate));
-        }
-        if (list.isEmpty()) {
-            return;
+        if (subject != null) {
+            JSONArray array = getScoreRange(subject.getScoreRange(), subject.getTotalScore(),
+                    subject.getRealityCount(), 10);
+            for (int i = 0; i < array.size(); i++) {
+                JSONObject jsonObject = array.getJSONObject(i);
+                String score = jsonObject.getInt("score") + "-";
+                Integer rangeCount = jsonObject.getInt("rangeCount");
+                Double rangeRate = jsonObject.getDouble("rangeRate");
+                list.add(new ReportSubjectRangeDTO(score, rangeCount, rangeRate));
+            }
         }
         ByteArrayOutputStream os = new ByteArrayOutputStream();
         new ExportExcel(name, ReportSubjectRangeDTO.class).setDataList(list).write(os);

+ 1 - 0
stmms-web/src/main/java/cn/com/qmth/stmms/api/controller/CoreController.java

@@ -595,6 +595,7 @@ public class CoreController extends BaseApiController {
             validate("mainTitle", q.getMainTitle(), true, 32);
             if (objective) {
                 validate("answer", q.getAnswer(), true, 16);
+                q.setAnswer(q.getAnswer().toUpperCase());
             }
             q.setExamId(examId);
             q.setSubjectCode(subjectCode);

+ 16 - 1
stmms-web/src/main/webapp/WEB-INF/views/modules/exam/studentList.jsp

@@ -115,7 +115,7 @@
         <label>考场</label>
         <input type="text" name="examRoom" value="${query.examRoom}" maxlength="64" class="input-mini"/>
         <label>扫描张数</label>
-        <input type="number" name="sheetCount" value="${query.sheetCount}" maxlength="64" class="input-mini"/>
+        <input type="number" name="sheetCount" value="${query.sheetCount}" maxlength="64" class="input-mini digits"/>
         <br><br>
         &nbsp;<input id="btnSubmit" class="btn btn-primary" type="button" value="查询" onclick="goSearch()"/>
         <c:if test="${web_user.schoolAdmin==true}">
@@ -278,6 +278,21 @@
             initImagePopover($(this).attr('data-title'), '${fileServer}', $(this).attr('data-image-url'));
             return false;
         });
+        $("#searchForm").validate({
+            submitHandler: function (form) {
+                loading('正在提交,请稍等...');
+                form.submit();
+            },
+            errorContainer: "#messageBox",
+            errorPlacement: function (error, element) {
+                $("#messageBox").text("输入有误,请先更正。");
+                if (element.is(":checkbox") || element.is(":radio") || element.parent().is(".input-append")) {
+                    error.appendTo(element.parent().parent());
+                } else {
+                    error.insertAfter(element);
+                }
+            }
+        });
     });
 
     $('#packageCode').click(function () {

+ 5 - 5
stmms-web/src/main/webapp/WEB-INF/views/modules/report/reportSubjectClass.jsp

@@ -97,15 +97,15 @@
             $(this).children('td').each(function (j) {
                 if(j == 0){
                     classs.push($(this).text());
-                } else if(j == 1){
+                } else if(j == 3){
                     avgScores.push($(this).text());
-                } else if(j == 2){
+                } else if(j == 4){
                     maxScores.push($(this).text());
-                } else if(j == 3){
-                    minScores.push($(this).text());
                 } else if(j == 5){
-                    passRates.push($(this).text()*100);
+                    minScores.push($(this).text());
                 } else if(j == 7){
+                    passRates.push($(this).text()*100);
+                } else if(j == 9){
                     excellentRates.push($(this).text()*100);
                 }
             });

+ 5 - 5
stmms-web/src/main/webapp/WEB-INF/views/modules/report/reportSubjectCollege.jsp

@@ -109,15 +109,15 @@ $("#export-button").click(function(){
             $(this).children('td').each(function (j) {
                 if(j == 0){
                     colleges.push($(this).text());
-                } else if(j == 1){
+                } else if(j == 3){
                     avgScores.push($(this).text());
-                } else if(j == 2){
+                } else if(j == 4){
                     maxScores.push($(this).text());
-                } else if(j == 3){
-                    minScores.push($(this).text());
                 } else if(j == 5){
-                    passRates.push($(this).text()*100);
+                    minScores.push($(this).text());
                 } else if(j == 7){
+                    passRates.push($(this).text()*100);
+                } else if(j == 9){
                     excellentRates.push($(this).text()*100);
                 }
             });

+ 6 - 6
stmms-web/src/main/webapp/WEB-INF/views/modules/report/reportSubjectTeacher.jsp

@@ -112,17 +112,17 @@ $("#export-button").click(function(){
             $(this).children('td').each(function (j) {
                 if(j == 0){
                     tearchers.push($(this).text());
-                } else if(j == 8){
+                } else if(j == 9){
                     avgScores.push($(this).text());
-                } else if(j == 4){
-                    maxScores.push($(this).text());
                 } else if(j == 5){
-                    minScores.push($(this).text());
+                    maxScores.push($(this).text());
                 } else if(j == 6){
-                    passRates.push($(this).text()*100);
+                    minScores.push($(this).text());
                 } else if(j == 7){
+                    passRates.push($(this).text()*100);
+                } else if(j == 8){
                     excellentRates.push($(this).text()*100);
-                } else if(j == 9){
+                } else if(j == 10){
                     relativeAvgScore.push($(this).text());
                 }
             });