yin 6 months ago
parent
commit
b9343b81ac

+ 34 - 40
stmms-web/src/main/java/cn/com/qmth/stmms/admin/exam/ArbitrateController.java

@@ -1,19 +1,9 @@
 package cn.com.qmth.stmms.admin.exam;
 
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
+import java.util.*;
 
 import javax.servlet.http.HttpServletRequest;
 
-import cn.com.qmth.stmms.biz.exam.model.*;
-import cn.com.qmth.stmms.biz.exam.service.*;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
 import org.apache.commons.lang.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -23,19 +13,16 @@ import org.springframework.data.domain.Sort;
 import org.springframework.data.domain.Sort.Direction;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.*;
 
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+import cn.com.qmth.stmms.biz.exam.model.*;
+import cn.com.qmth.stmms.biz.exam.service.*;
 import cn.com.qmth.stmms.biz.file.service.FileService;
 import cn.com.qmth.stmms.biz.lock.LockService;
-import cn.com.qmth.stmms.biz.mark.model.ArbitrateHistory;
-import cn.com.qmth.stmms.biz.mark.model.ArbitrationDTO;
-import cn.com.qmth.stmms.biz.mark.model.MarkLibrary;
-import cn.com.qmth.stmms.biz.mark.model.MarkResult;
-import cn.com.qmth.stmms.biz.mark.model.Task;
+import cn.com.qmth.stmms.biz.mark.model.*;
 import cn.com.qmth.stmms.biz.mark.query.ArbitrateHistorySearchQuery;
 import cn.com.qmth.stmms.biz.mark.service.ArbitrateHistoryService;
 import cn.com.qmth.stmms.biz.mark.service.MarkLibraryService;
@@ -45,13 +32,7 @@ import cn.com.qmth.stmms.biz.user.service.UserService;
 import cn.com.qmth.stmms.common.annotation.Logging;
 import cn.com.qmth.stmms.common.annotation.RoleRequire;
 import cn.com.qmth.stmms.common.domain.WebUser;
-import cn.com.qmth.stmms.common.enums.ArbitrateType;
-import cn.com.qmth.stmms.common.enums.HistoryStatus;
-import cn.com.qmth.stmms.common.enums.LibraryStatus;
-import cn.com.qmth.stmms.common.enums.LockType;
-import cn.com.qmth.stmms.common.enums.LogType;
-import cn.com.qmth.stmms.common.enums.MarkMode;
-import cn.com.qmth.stmms.common.enums.Role;
+import cn.com.qmth.stmms.common.enums.*;
 import cn.com.qmth.stmms.common.utils.RequestUtils;
 import net.sf.json.JSONObject;
 
@@ -195,11 +176,12 @@ public class ArbitrateController extends BaseExamController {
         List<CollationLabel> list = collationLabelService.list(examId);
         ObjectMapper mapper = new ObjectMapper();
         try {
-            setting.accumulate("collationLabelList",mapper.writeValueAsString(list));
+            setting.accumulate("collationLabelList", mapper.writeValueAsString(list));
         } catch (JsonProcessingException e) {
             log.error("MarkController-整理异常获取出错", e);
         }
     }
+
     private void setMode(JSONObject setting, MarkGroup group, Exam exam) {
         MarkMode mode = null;
         boolean forceMode = false;
@@ -242,20 +224,32 @@ public class ArbitrateController extends BaseExamController {
             @RequestParam(required = false) String reason) {
         JSONObject obj = new JSONObject();
         WebUser wu = RequestUtils.getWebUser(request);
+        if (ids.length > 20) {
+            obj.accumulate("success", false);
+            obj.accumulate("message", "一次支持打回最多20条");
+            return obj;
+        }
         int count = 0;
-        for (Integer historyId: ids) {
+        for (Integer historyId : ids) {
             ArbitrateHistory history = arbitrateService.findById(historyId);
-            MarkGroup group = groupService.findOne(history.getExamId(), history.getSubjectCode(), history.getGroupNumber());
+            MarkGroup group = groupService.findOne(history.getExamId(), history.getSubjectCode(),
+                    history.getGroupNumber());
             if (history != null && group != null
                     && subjectCheck(history.getSubjectCode(), RequestUtils.getWebUser(request))) {
                 if (!ArbitrateType.QUESTION.equals(group.getArbitrateType())) {
+                    if (ids.length == 1) {
+                        obj.accumulate("success", false);
+                        obj.accumulate("message", "仅支持小题仲裁模式打回");
+                        return obj;
+                    }
                     continue;
-//                    obj.accumulate("success", false);
-//                    obj.accumulate("message", "仅支持小题仲裁模式打回");
                 } else if (history.getStatus() != HistoryStatus.WAITING) {
+                    if (ids.length == 1) {
+                        obj.accumulate("success", false);
+                        obj.accumulate("message", "该仲裁卷已被处理");
+                        return obj;
+                    }
                     continue;
-//                    obj.accumulate("success", false);
-//                    obj.accumulate("message", "该仲裁卷已被处理");
                 } else {
                     try {
                         lockService.watch(LockType.EXAM_SUBJECT, history.getExamId(), history.getSubjectCode());
@@ -265,11 +259,11 @@ public class ArbitrateController extends BaseExamController {
                         markService.backArbitrate(historyId, wu.getUser().getId(), reason);
                         releaseTask(history.getId());
                         count++;
-//                        obj.accumulate("success", true);
+                        // obj.accumulate("success", true);
                     } catch (Exception e) {
                         log.error("ArbitrateController-打回仲裁卷出错", e);
-//                        obj.accumulate("success", false);
-//                        obj.accumulate("message", "仲裁任务打回失败");
+                        // obj.accumulate("success", false);
+                        // obj.accumulate("message", "仲裁任务打回失败");
                     } finally {
                         lockService.unlock(LockType.STUDENT, history.getStudentId());
                         lockService.unwatch(LockType.GROUP, history.getExamId(), history.getSubjectCode(),
@@ -279,9 +273,9 @@ public class ArbitrateController extends BaseExamController {
                 }
             }
         }
-        if(count>0){
+        if (count > 0) {
             obj.accumulate("success", true);
-        }else{
+        } else {
             obj.accumulate("success", false);
             obj.accumulate("message", "仲裁任务打回失败");
         }

+ 15 - 4
stmms-web/src/main/java/cn/com/qmth/stmms/admin/exam/MarkQualityController.java

@@ -7,6 +7,8 @@ import java.util.Map;
 
 import javax.servlet.http.HttpServletRequest;
 
+import cn.com.qmth.stmms.biz.exam.model.Exam;
+import cn.com.qmth.stmms.biz.exam.service.*;
 import org.apache.commons.lang.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -26,10 +28,6 @@ import cn.com.qmth.stmms.biz.exam.model.ExamSubject;
 import cn.com.qmth.stmms.biz.exam.model.MarkGroup;
 import cn.com.qmth.stmms.biz.exam.model.Marker;
 import cn.com.qmth.stmms.biz.exam.query.MarkerSearchQuery;
-import cn.com.qmth.stmms.biz.exam.service.ExamQuestionService;
-import cn.com.qmth.stmms.biz.exam.service.ExamSubjectService;
-import cn.com.qmth.stmms.biz.exam.service.MarkGroupService;
-import cn.com.qmth.stmms.biz.exam.service.MarkerService;
 import cn.com.qmth.stmms.biz.lock.LockService;
 import cn.com.qmth.stmms.biz.mark.model.Task;
 import cn.com.qmth.stmms.biz.mark.model.TrialLibrary;
@@ -88,6 +86,11 @@ public class MarkQualityController extends BaseExamController {
     @Autowired
     private UserService userService;
 
+    @Autowired
+    private ExamService examService;
+
+    private static final String DEFAULT_SECRET_NUMBER = "***";
+
     @Logging(menu = "质量监控查询", type = LogType.QUERY)
     @RequestMapping
     public String list(Model model, HttpServletRequest request, MarkerSearchQuery query) {
@@ -323,6 +326,14 @@ public class MarkQualityController extends BaseExamController {
                 list.add(task);
             }
         }
+        int examId = getSessionExamId(request);
+        Exam exam = examService.findById(examId);
+        WebUser user = RequestUtils.getWebUser(request);
+        for (Task task : list) {
+            if (exam.isForbiddenInfo() && !Role.SCHOOL_ADMIN.equals(user.getRole())) {
+                task.setSecretNumber(DEFAULT_SECRET_NUMBER);
+            }
+        }
         return list;
     }
 }

+ 18 - 0
stmms-web/src/main/webapp/WEB-INF/views/modules/exam/arbitrateList.jsp

@@ -256,6 +256,24 @@
 <div class="pagination">${query}</div>
 <script type="text/javascript">
     var check_list;
+    $("#ids").change(function () {
+        if ($("#ids").is(':checked')) {
+            $(".ids").attr("checked", true);
+        } else {
+            $(".ids").attr("checked", false);
+        }
+    });
+
+    $(".ids").change(function () {
+        var all = true;
+        $("input[name='ids']").each(function () {
+            if (!$(this).is(':checked')) {
+                all = false;
+            }
+        })
+        $("#ids").attr("checked", all);
+    });
+
     function goBack() {
         check_list = [];
         $("input[name='ids']:checked").each(function () {

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

@@ -93,7 +93,7 @@
 		<div class="control-group">
 			<label class="control-label">给分次数</label>
 			<div class="controls">
-				<input <c:if test="${!examQuestion.objective && !enableUpdate}">disabled</c:if> name="trackCount" value="${examQuestion.trackCount }" type="number" htmlEscape="false" max="10000" min="1" />
+				<input <c:if test="${!examQuestion.objective && !enableUpdate}">disabled</c:if> name="trackCount" value="<c:if test="${examQuestion.trackCount>0 }">${examQuestion.trackCount }</c:if>" type="number" htmlEscape="false" max="10000" min="1" />
 			</div>
 		</div>
 		<div class="control-group">

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

@@ -296,9 +296,9 @@
             <td>${student.teacher}</td>
             <td>${student.examSite}</td>
             <td>${student.examRoom}</td>
-            <td><span title="${result.collationLabel}">
-            	<c:if test="${result.collationLabel.length()>10}">${result.collationLabel.substring(0,10) }...</c:if>
-            	<c:if test="${result.collationLabel.length()<=10}">${result.collationLabel}</c:if>
+            <td><span title="${student.collationLabel}">
+            	<c:if test="${student.collationLabel.length()>10}">${student.collationLabel.substring(0,10) }...</c:if>
+            	<c:if test="${student.collationLabel.length()<=10}">${student.collationLabel}</c:if>
             	</span>
             </td>
             <td>