Răsfoiți Sursa

新增重置密钥,修复数据检查和人工确认<转义问题

ting.yin 4 ani în urmă
părinte
comite
934f147336

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

@@ -14,6 +14,7 @@ import cn.com.qmth.stmms.common.enums.LogType;
 import net.sf.json.JSONArray;
 import net.sf.json.JSONArray;
 import net.sf.json.JSONObject;
 import net.sf.json.JSONObject;
 
 
+import org.apache.commons.lang.StringEscapeUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.lang.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.stereotype.Controller;
@@ -106,6 +107,7 @@ public class AnswerCheckController extends BaseExamController {
     public Object save(HttpServletRequest request, @RequestParam Integer studentId, @RequestParam String answers,
     public Object save(HttpServletRequest request, @RequestParam Integer studentId, @RequestParam String answers,
             @RequestParam(required = false) Boolean absent, @RequestParam String paperType) {
             @RequestParam(required = false) Boolean absent, @RequestParam String paperType) {
         ExamStudent student = studentService.findById(studentId);
         ExamStudent student = studentService.findById(studentId);
+        answers = StringEscapeUtils.unescapeHtml(StringUtils.trimToNull(answers));
         if (student != null) {
         if (student != null) {
             if (absent != null) {
             if (absent != null) {
                 student.setAbsent(absent);
                 student.setAbsent(absent);

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

@@ -9,6 +9,8 @@ import cn.com.qmth.stmms.biz.file.service.FileService;
 import cn.com.qmth.stmms.common.annotation.Logging;
 import cn.com.qmth.stmms.common.annotation.Logging;
 import cn.com.qmth.stmms.common.enums.CheckType;
 import cn.com.qmth.stmms.common.enums.CheckType;
 import cn.com.qmth.stmms.common.enums.LogType;
 import cn.com.qmth.stmms.common.enums.LogType;
+
+import org.apache.commons.lang.StringEscapeUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.lang.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.stereotype.Controller;
@@ -80,6 +82,7 @@ public class CheckStudentController extends BaseExamController {
     @ResponseBody
     @ResponseBody
     public Object save(HttpServletRequest request, @RequestParam Integer studentId, @RequestParam String answers) {
     public Object save(HttpServletRequest request, @RequestParam Integer studentId, @RequestParam String answers) {
         ExamStudent student = studentService.findById(studentId);
         ExamStudent student = studentService.findById(studentId);
+        answers = StringEscapeUtils.unescapeHtml(StringUtils.trimToNull(answers));
         CheckStudent cs = checkStudentService.findByStudentId(studentId);
         CheckStudent cs = checkStudentService.findByStudentId(studentId);
         if (student != null && cs != null) {
         if (student != null && cs != null) {
             student.setAnswers(answers);
             student.setAnswers(answers);

+ 10 - 0
stmms-web/src/main/java/cn/com/qmth/stmms/admin/school/SchoolController.java

@@ -197,4 +197,14 @@ public class SchoolController extends BaseController {
         return viewerInit(request, user.getSchoolId(), message);
         return viewerInit(request, user.getSchoolId(), message);
     }
     }
 
 
+    @RequestMapping(value = "/restAccess", method = RequestMethod.GET)
+    public ModelAndView restAccess(HttpServletRequest request, @RequestParam Integer id) {
+        School school = schoolService.findById(id);
+        if (school != null) {
+            school.resetAccessKeyAndSecret();
+        }
+        ModelAndView view = new ModelAndView("modules/sys/schoolEdit");
+        view.addObject("school", school);
+        return view;
+    }
 }
 }

+ 1 - 1
stmms-web/src/main/java/cn/com/qmth/stmms/common/controller/BaseController.java

@@ -278,8 +278,8 @@ public class BaseController {
             student.setObjectiveScoreList(null);
             student.setObjectiveScoreList(null);
             student.setSubjectiveScore(0d);
             student.setSubjectiveScore(0d);
             student.setSubjectiveScoreList(null);
             student.setSubjectiveScoreList(null);
-            studentService.updateSubjectiveStatusAndScore(student.getId(), SubjectiveStatus.UNMARK, 0, null);
             studentService.save(student);
             studentService.save(student);
+            studentService.updateSubjectiveStatusAndScore(student.getId(), SubjectiveStatus.UNMARK, 0, null);
         }
         }
         boolean success = studentService.updateScanInfo(student);
         boolean success = studentService.updateScanInfo(student);
         if (success) {
         if (success) {

+ 5 - 2
stmms-web/src/main/webapp/WEB-INF/views/modules/sys/schoolEdit.jsp

@@ -57,13 +57,13 @@
     <div class="control-group">
     <div class="control-group">
         <label class="control-label">AccessKey</label>
         <label class="control-label">AccessKey</label>
         <div class="controls">
         <div class="controls">
-            <form:label path="accessKey"/>
+            <input name="accessKey" value="${school. accessKey}" disabled="disabled"/>
         </div>
         </div>
     </div>
     </div>
     <div class="control-group">
     <div class="control-group">
         <label class="control-label">AccessSecret</label>
         <label class="control-label">AccessSecret</label>
         <div class="controls">
         <div class="controls">
-            <form:label path="accessSecret"/>
+            <input name="accessSecret" value="${school. accessSecret}" disabled="disabled"/>
         </div>
         </div>
     </div>
     </div>
     <div class="control-group">
     <div class="control-group">
@@ -76,6 +76,9 @@
             <%-- <shiro:hasPermission name="exam:course:edit"> --%>
             <%-- <shiro:hasPermission name="exam:course:edit"> --%>
         <input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;
         <input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;
             <%-- </shiro:hasPermission> --%>
             <%-- </shiro:hasPermission> --%>
+		<c:if test="${school.id!=null }">
+	        <a href="${ctx}/admin/sys/school/restAccess?id=${school.id}" class="btn btn-warning" type="button">重置密钥</a>&nbsp;
+		</c:if>
         <input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
         <input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
     </div>
     </div>
 </form:form>
 </form:form>