浏览代码

设置分组开启双评时默认小题分组且双评比例为1;新增全选小题

yin 1 月之前
父节点
当前提交
d0a44feb09

+ 3 - 11
stmms-web/src/main/java/cn/com/qmth/stmms/admin/exam/MarkGroupController.java

@@ -9,6 +9,7 @@ import java.util.Map;
 import javax.servlet.http.HttpServletRequest;
 
 import cn.com.qmth.stmms.biz.exam.dao.SelectiveStudentDao;
+import cn.com.qmth.stmms.common.enums.*;
 import org.apache.commons.lang.StringEscapeUtils;
 import org.apache.commons.lang.StringUtils;
 import org.slf4j.Logger;
@@ -55,16 +56,6 @@ import cn.com.qmth.stmms.biz.school.service.SchoolService;
 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.ExamType;
-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.MarkStatus;
-import cn.com.qmth.stmms.common.enums.Role;
-import cn.com.qmth.stmms.common.enums.ScorePolicy;
-import cn.com.qmth.stmms.common.enums.SubjectiveStatus;
-import cn.com.qmth.stmms.common.enums.ThirdPolicy;
 import cn.com.qmth.stmms.common.utils.RequestUtils;
 import net.sf.json.JSONArray;
 import net.sf.json.JSONObject;
@@ -356,7 +347,8 @@ public class MarkGroupController extends BaseExamController {
         model.addAttribute("markModeList", MarkMode.values());
 
         model.addAttribute("scorePolicyList", ScorePolicy.getList());
-        model.addAttribute("arbitrateTypeList", ArbitrateType.values());
+        ArbitrateType[] arbitrateTypeList = { ArbitrateType.QUESTION, ArbitrateType.GROUP };
+        model.addAttribute("arbitrateTypeList",arbitrateTypeList );
         model.addAttribute("thirdPolicyList", ThirdPolicy.values());
         model.addAttribute("exam", examService.findById(examId));
         List<ExamQuestion> questions = questionService.findByExamAndSubjectAndObjective(examId, subjectCode, false);

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

@@ -27,6 +27,7 @@
             $(".doubleDiv").hide();
             $("#openDouble").change(function () {
                 if ($("#openDouble").is(':checked')) {
+                    $("#doubleRate").attr("value", 1);
                     $(".doubleDiv").show();
                 } else {
                     $("#doubleRate").attr("value", "");
@@ -38,7 +39,7 @@
                     });
                 }
             });
-            $(".arbitrateTypeQuestion").hide();
+            $(".arbitrateTypeGroup").hide();
             $("#arbitrateType").change(function () {
                 if ($("#arbitrateType").val() == 0) {
                     $(".arbitrateTypeQuestion").hide();
@@ -102,6 +103,27 @@
                     $("#enableAllZero").attr("checked",false);
                 }
             });
+
+            $("#checkAll").change(function () {
+                if ($("#checkAll").is(':checked')) {
+                    $("input[name='questionIds']").each(function(){
+                        if(!$(this).is(':disabled')){
+                            $(this).attr("checked", true);
+                        }
+                    })
+                } else {
+                    $(".questionIds").attr("checked", false);
+                }
+            });
+            $(".questionIds").change(function () {
+                var all = true;
+                $("input[name='questionIds']").each(function(){
+                    if(!$(this).is(':checked')){
+                        all = false;
+                    }
+                })
+                $("#checkAll").attr("checked", all);
+            });
         });
     </script>
 </head>
@@ -124,7 +146,7 @@
                 </caption>
                 <thead>
                 <tr>
-                    <th width="50px"></th>
+                    <th width="50px"><input type="checkbox" id="checkAll"></th>
                     <th width="50px">大题号</th>
                     <th  width="50px">小题号</th>
                     <th>名称</th>
@@ -137,7 +159,7 @@
                 </thead>
                 <c:forEach items="${questionList}" var="item">
                     <tr>
-                        <td><input type="checkbox" name="questionIds" value="${item.id }" <c:if
+                        <td><input type="checkbox" class="questionIds" name="questionIds" value="${item.id }" <c:if
                                 test="${item.groupNumber!=null}"> disabled="disabled"</c:if>></td>
                         <td>${item.mainNumber }</td>
                         <td>${item.subNumber }</td>

+ 24 - 2
stmms-web/src/main/webapp/WEB-INF/views/modules/exam/groupEditFull.jsp

@@ -155,6 +155,7 @@
 
             $("#openDouble").change(function () {
                 if ($("#openDouble").is(':checked')) {
+                    $("#doubleRate").attr("value", 1);
                     $(".doubleDiv").show();
                 } else {
                     $("#doubleRate").attr("value", "");
@@ -237,6 +238,27 @@
                     $("#enableAllZero").attr("checked", false);
                 }
             });
+
+            $("#checkAll").change(function () {
+                if ($("#checkAll").is(':checked')) {
+                    $("input[name='questionIds']").each(function(){
+                        if(!$(this).is(':disabled')){
+                            $(this).attr("checked", true);
+                        }
+                    })
+                } else {
+                    $(".questionIds").attr("checked", false);
+                }
+            });
+            $(".questionIds").change(function () {
+                var all = true;
+                $("input[name='questionIds']").each(function(){
+                    if(!$(this).is(':checked')){
+                        all = false;
+                    }
+                })
+                $("#checkAll").attr("checked", all);
+            });
         });
     </script>
 </head>
@@ -265,7 +287,7 @@
                 </caption>
                 <thead>
                 <tr>
-                    <th width="50px"></th>
+                    <th width="50px"><input type="checkbox" id="checkAll"></th>
                     <th width="50px">大题号</th>
                     <th width="50px">小题号</th>
                     <th>名称</th>
@@ -278,7 +300,7 @@
                 </thead>
                 <c:forEach items="${questionList}" var="item">
                     <tr>
-                        <td><input type="checkbox" name="questionIds" value="${item.id }"
+                        <td><input type="checkbox" class="questionIds" name="questionIds" value="${item.id }"
                         <c:if test="${item.groupNumber!=null && item.groupNumber!=group.number}">
                                        disabled="disabled"</c:if> <c:if test="${item.groupNumber==group.number}">
                                    checked</c:if>></td>