Selaa lähdekoodia

轨迹还原到原图功能开发

luoshi 6 vuotta sitten
vanhempi
commit
7950b6822b

+ 1 - 1
stmms-biz/src/main/java/cn/com/qmth/stmms/biz/exam/service/ExamStudentService.java

@@ -110,6 +110,6 @@ public interface ExamStudentService {
     List<Object[]> statisticsByAbsentAndBreach(Integer examId, String code, Boolean upload, boolean absent,
             boolean breach);
 
-	Map<Integer, List<PictureTag>> buildPictureConfig(ExamStudent student);
+	Map<Integer, List<PictureTag>> buildSheetTags(ExamStudent student);
 
 }

+ 80 - 74
stmms-biz/src/main/java/cn/com/qmth/stmms/biz/exam/service/impl/ExamStudentServiceImpl.java

@@ -1,5 +1,6 @@
 package cn.com.qmth.stmms.biz.exam.service.impl;
 
+import java.text.DecimalFormat;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.HashMap;
@@ -30,11 +31,13 @@ import cn.com.qmth.stmms.biz.common.BaseQueryService;
 import cn.com.qmth.stmms.biz.exam.dao.ExamStudentDao;
 import cn.com.qmth.stmms.biz.exam.model.Exam;
 import cn.com.qmth.stmms.biz.exam.model.ExamPackage;
+import cn.com.qmth.stmms.biz.exam.model.ExamQuestion;
 import cn.com.qmth.stmms.biz.exam.model.ExamStudent;
 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.query.ExamStudentSearchQuery;
 import cn.com.qmth.stmms.biz.exam.service.ExamPackageService;
+import cn.com.qmth.stmms.biz.exam.service.ExamQuestionService;
 import cn.com.qmth.stmms.biz.exam.service.ExamService;
 import cn.com.qmth.stmms.biz.exam.service.ExamStudentService;
 import cn.com.qmth.stmms.biz.exam.service.ExamSubjectService;
@@ -51,9 +54,6 @@ import cn.com.qmth.stmms.biz.utils.PictureConfigTransform;
 import cn.com.qmth.stmms.biz.utils.PictureTag;
 import cn.com.qmth.stmms.biz.utils.ScoreItem;
 import cn.com.qmth.stmms.common.enums.ExamSubjectStatus;
-import cn.com.qmth.stmms.common.enums.ScorePolicy;
-
-import com.google.common.collect.Lists;
 
 @Service
 public class ExamStudentServiceImpl extends BaseQueryService<ExamStudent> implements ExamStudentService {
@@ -70,19 +70,24 @@ public class ExamStudentServiceImpl extends BaseQueryService<ExamStudent> implem
     @Autowired
     private ExamSubjectService subjectService;
 
+    @Autowired
+    private ExamQuestionService questionService;
+
     @Autowired
     private ExamService examService;
+
     @Autowired
     private MarkLibraryService libraryService;
+
     @Autowired
     private MarkGroupService groupService;
+
     @Autowired
-    private 
-    MarkTrackService trackService;
+    private MarkTrackService trackService;
+
     @Autowired
-    private 
-    MarkSpecialTagService specialTagService;
-    
+    private MarkSpecialTagService specialTagService;
+
     public static final String LOGINNAME_SPLITE = "-";
 
     public static final String USER_PASSWORD = "123456";
@@ -707,76 +712,77 @@ public class ExamStudentServiceImpl extends BaseQueryService<ExamStudent> implem
             boolean breach) {
         return studentDao.statisticsByAbsentAndBreach(examId, code, upload, absent, breach);
     }
-    
+
     /**
      * 根据考生还原图片上轨迹和特殊标记并拼接
      */
     @Override
-    public Map<Integer, List<PictureTag>> buildPictureConfig(ExamStudent student) {
-    	Exam exam = examService.findById(student.getExamId());
-    	List<PictureConfigItem> sliceConfigs = PictureConfigItem.parse(exam.getSliceConfig());
-    	Map<MarkGroup, List<OriginTag>> groups = new HashMap<MarkGroup, List<OriginTag>>();
-    	List<MarkGroup> markGroups = groupService.findByExamAndSubject(student.getExamId(), student.getSubjectCode());
-    	for (MarkGroup markGroup : markGroups) {
-            double score = 0;
-            int count = 0;
-            double scoreCount = 0;
-    		List<OriginTag> originTags = Lists.newArrayList();
-    		List<MarkLibrary> libraries = libraryService.findByStudentAndGroup(student.getId(), markGroup.getNumber());
-    		MarkLibrary library = null;
-    		ScorePolicy policy = markGroup.getScorePolicy() != null ? markGroup.getScorePolicy() : ScorePolicy.AVG;
-    		for (MarkLibrary markLibrary : libraries) {
-    			count++;
-    			Double current = (markLibrary.getHeaderScore() != null ? markLibrary.getHeaderScore() : markLibrary.getMarkerScore());
-    			List<ScoreItem> scores = library.getScoreList();
-    			if(count == 1){
-            		// 首份评卷任务,直接取总分与明细
-                    score = current;
-                    library = markLibrary;
-            	}else{
-            		switch (policy) {
-            		case AVG:
-            			// 平均分 累加
-            			scoreCount+=current;
-            			break;
-            		case MAX:
-            			// 高分优先
-            			if(current > score){
-            				library = markLibrary;
-            			}
-            			break;
-            		case MIN:
-            			// 低分优先
-            			if(current < score){
-            				library = markLibrary;
-            			}
-            			break;
-            		default:
-            			break;
-            		}
-            	}
-    		}
-            // 取平均分策略下,累计分数需要重新计算一次
-            if (policy == ScorePolicy.AVG && count > 1) {
-                score = scoreCount / count;
+    public Map<Integer, List<PictureTag>> buildSheetTags(ExamStudent student) {
+        Map<MarkGroup, List<OriginTag>> tagMap = new HashMap<MarkGroup, List<OriginTag>>();
+        Exam exam = examService.findById(student.getExamId());
+        List<PictureConfigItem> sliceConfig = PictureConfigItem.parse(exam.getSliceConfig());
+        if (!sliceConfig.isEmpty()) {
+            // 裁切图配置存在时才继续下面内容
+            DecimalFormat format = new DecimalFormat("###.#");
+            List<ExamQuestion> questions = questionService.findByExamAndSubjectAndObjective(student.getExamId(),
+                    student.getSubjectCode(), false);
+            List<ScoreItem> scoreList = student.getScoreList(false);
+            List<MarkGroup> markGroups = groupService.findByExamAndSubject(student.getExamId(),
+                    student.getSubjectCode());
+            for (MarkGroup group : markGroups) {
+                // 从考生主观题得分中拆解出本大题得分
+                double score = 0;
+                List<Double> details = new ArrayList<>();
+                int i = -1;
+                for (ExamQuestion question : questions) {
+                    i++;
+                    if (question.getMainNumber().equals(group.getNumber())) {
+                        double value = scoreList.size() > i ? scoreList.get(i).getScore() : 0;
+                        score += value;
+                        details.add(value);
+                    }
+                }
+                // 原图中需要显示的内容列表
+                List<OriginTag> originTags = new LinkedList<>();
+                // 首先添加本大题总得分
+                originTags.add(new OriginTag(format.format(score), 0, 0));
+                // 检测应该使用哪个评卷任务的轨迹记录
+                MarkLibrary selected = null;
+                List<MarkLibrary> libraries = libraryService.findByStudentAndGroup(student.getId(), group.getNumber());
+                for (MarkLibrary library : libraries) {
+                    if (checkScore(library, score, details)) {
+                        selected = library;
+                        break;
+                    }
+                }
+                if (selected != null) {
+                    // 添加轨迹分
+                    List<MarkTrack> tracks = trackService.findByLibraryId(selected.getId());
+                    for (MarkTrack markTrack : tracks) {
+                        originTags.add(new OriginTag(format.format(markTrack.getScore()), markTrack.getPositionX(),
+                                markTrack.getPositionY()));
+                    }
+                    // 添加特殊标记
+                    List<MarkSpecialTag> specialTags = specialTagService.findByLibraryId(selected.getId());
+                    for (MarkSpecialTag markSpecialTag : specialTags) {
+                        originTags.add(new OriginTag(markSpecialTag.getTagName(), markSpecialTag.getPositionX(),
+                                markSpecialTag.getPositionY()));
+                    }
+                }
+                tagMap.put(group, originTags);
             }
-    		if(library!=null){
-    			List<MarkTrack> tracks = trackService.findByLibraryId(library.getId());
-    			for (MarkTrack markTrack : tracks) {
-    				OriginTag originTag = new OriginTag(markTrack.getScore().toString(),markTrack.getPositionX(),markTrack.getPositionY());
-    				originTags.add(originTag);
-    			}
-    			List<MarkSpecialTag> specialTags = specialTagService.findByLibraryId(library.getId());
-    			for (MarkSpecialTag markSpecialTag : specialTags) {
-    				OriginTag originTag = new OriginTag(markSpecialTag.getTagName().toString(),markSpecialTag.getPositionX(),markSpecialTag.getPositionY());
-    				originTags.add(originTag);
-    			}
-    		}else{
-    			OriginTag originTag = new OriginTag(String.valueOf(score),0,0);
-				originTags.add(originTag);
-    		}
-    		groups.put(markGroup, originTags);
-		}
-    	return PictureConfigTransform.process(sliceConfigs, groups);
+        }
+        return PictureConfigTransform.process(sliceConfig, tagMap);
     }
+
+    private boolean checkScore(MarkLibrary library, double score, List<Double> details) {
+        if (library.getMarkerScore() == null) {
+            return false;
+        }
+        if (library.getMarkerScore().doubleValue() != score) {
+            return false;
+        }
+        return true;
+    }
+
 }

+ 1 - 0
stmms-biz/src/main/java/cn/com/qmth/stmms/biz/mark/service/Impl/MarkServiceImpl.java

@@ -386,6 +386,7 @@ public class MarkServiceImpl implements MarkService {
                 libraryDao.updateByStudentIdAndGroupNumber(library.getStudentId(), library.getGroupNumber(),
                         LibraryStatus.WAIT_ARBITRATE);
             }
+            updateLibraryCount(library.getExamId(), library.getSubjectCode(), library.getGroupNumber());
             return true;
         } catch (Exception e) {
             throw e;

+ 6 - 6
stmms-biz/src/main/java/cn/com/qmth/stmms/biz/utils/OriginTag.java

@@ -7,15 +7,15 @@ public class OriginTag {
     private double poxitionX;
 
     private double poxitionY;
-    
+
     public OriginTag() {
 
     }
-    
-    public OriginTag(String content,double poxitionX,double poxitionY) {
-    	this.content = content;
-    	this.poxitionX = poxitionX;
-    	this.poxitionY = poxitionY;
+
+    public OriginTag(String content, double poxitionX, double poxitionY) {
+        this.content = content;
+        this.poxitionX = poxitionX;
+        this.poxitionY = poxitionY;
     }
 
     public String getContent() {

+ 2 - 2
stmms-biz/src/main/java/cn/com/qmth/stmms/biz/utils/PictureConfigTransform.java

@@ -108,10 +108,10 @@ public class PictureConfigTransform {
             tag.setLeft(left + config.getX() + sliceConfig.getX());
             tag.setTop(top + config.getY() + sliceConfig.getY());
 
-            List<PictureTag> list = tags.get(config.getI());
+            List<PictureTag> list = tags.get(sliceConfig.getI());
             if (list == null) {
                 list = new LinkedList<>();
-                tags.put(config.getI(), list);
+                tags.put(sliceConfig.getI(), list);
             }
             list.add(tag);
         }

+ 0 - 26
stmms-web/src/main/java/cn/com/qmth/stmms/admin/exam/ScoreController.java

@@ -299,30 +299,4 @@ public class ScoreController extends BaseExamController {
         }
     }
 
-    public String getStudentIdsByMarkLoginAndMarkName(String markLogin, String markName) {
-        String ids = "";
-        if (StringUtils.isNotBlank(markLogin)) {
-            ids += studentService.findIdsByMarkLogin(markLogin);
-            if (ids.equals("")) {
-                ids = "-1";
-            }
-        }
-        if (StringUtils.isNotBlank(markName)) {
-            String s = studentService.findIdsByMarkName(markName);
-            if (StringUtils.isBlank(ids)) {
-                if (s.equals("")) {
-                    ids = "-1";
-                } else {
-                    ids += s;
-                }
-            } else {
-                if (!ids.equals("-1")) {
-                    if (StringUtils.isBlank(s)) {
-                        ids = "-1";
-                    }
-                }
-            }
-        }
-        return ids;
-    }
 }

+ 13 - 0
stmms-web/src/main/java/cn/com/qmth/stmms/admin/exam/StudentController.java

@@ -17,6 +17,8 @@ import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
 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.multipart.MultipartFile;
 import org.springframework.web.servlet.mvc.support.RedirectAttributes;
 
@@ -311,6 +313,17 @@ public class StudentController extends BaseExamController {
         return "redirect:/admin/exam/student";
     }
 
+    @RequestMapping("/sheetTag")
+    @ResponseBody
+    public Object getSheetTag(HttpServletRequest request, @RequestParam Integer id) {
+        ExamStudent student = studentService.findById(id);
+        if (student != null) {
+            return studentService.buildSheetTags(student);
+        } else {
+            return new HashMap<>();
+        }
+    }
+
     private boolean checkExamNumber(ExamStudent student, Map<String, ExamStudent> current,
             Map<String, ExamStudent> saveMap) {
         ExamStudent previous = saveMap.get(student.getExamNumber());

+ 3 - 3
stmms-web/src/main/webapp/WEB-INF/application.properties

@@ -11,9 +11,9 @@ cookie.domain=
 cookie.path=/
 
 #server config
-slice.image.server=http://ft-slice.markingcloud.com
-sheet.image.server=http://ft-sheet.markingcloud.com
-package.image.server=http://ft-package.markingcloud.com
+slice.image.server=https://ft-slice.markingcloud.com
+sheet.image.server=https://ft-sheet.markingcloud.com
+package.image.server=https://ft-package.markingcloud.com
 card.server=http://ft-card.markingcloud.com
 ##slice.image.server=http://${local.ip}:9000/gx-slice
 ##sheet.image.server=http://${local.ip}:9000/gx-sheet

+ 65 - 47
stmms-web/src/main/webapp/WEB-INF/views/include/sheetTagView.jsp

@@ -1,72 +1,90 @@
 <%@ page contentType="text/html;charset=UTF-8"%>
-<script type="text/javascript" src="${ctxStatic}/mark-new/js/jquery-ui.min.js"></script>
-<script type="text/javascript" src="${ctxStatic}/mark-new/js/jquery.mousewheel.min.js"></script>
-
 <link rel="stylesheet" type="text/css" href="${ctxStatic}/jBox/Source/jBox.css">
 <script type="text/javascript" src="${ctxStatic}/jBox/Source/jBox.min.js"></script>
-
 <script type="text/javascript">
-var sheetModal = new jBox('Modal');
+var sheetTagModal = new jBox('Modal');
+var sheetTagContainer = $('#sheet-tag-content');
+
 $(document).ready(function() {
-	//$('#sheet-view-content').find('object').each(function(index, obj){
-		//obj.width = $(window).width()*0.4;
-		//obj.height = $(window).height()*0.83;
-	//});
-	$('#left-answer-div').find('iframe').height($(window).height()*0.83);
+    sheetTagContainer.find('iframe').height($(window).height()*0.83);
 });
-function initSheetPopover(title, sheetServer, sheetUrl, answerUrl) {
-	//if(sheetModal!=undefined){
-	//	sheetModal.destroy();
-	//}
-	initSheetPopoverContent(sheetServer, sheetUrl.split(','), answerUrl);
 
-	sheetModal.setWidth($(window).width()*0.9);
-	sheetModal.setHeight($(window).height()*0.85);
-	sheetModal.setTitle(title);
-	sheetModal.setContent($('#sheet-view-content'));
-	sheetModal.open();
+function initSheetTagPopover(id, title, sheetServer, sheetUrl, answerUrl) {
+    $.post('${ctx}/admin/exam/student/sheetTag', {id: id}, function(tags){
+        //暂时屏蔽答案PDF显示
+        initSheetTagPopoverContent(sheetServer, sheetUrl.split(','), '', tags, function(){
+            sheetTagModal.setTitle(title);
+            sheetTagModal.setContent($('#sheet-tag-content'));
+        });
+    });
+    
+    $('#sheet-tag-tab-nav').empty();
+    $('#sheet-tag-tab-content').empty();
+    
+	sheetTagModal.setWidth($(window).width()*0.9);
+	sheetTagModal.setHeight($(window).height()*0.85);
+	sheetTagModal.setTitle('正在加载');
+	sheetTagModal.open();
 }
-function initSheetPopoverContent(sheetServer, sheetUrls, answerUrl, tags){
-	if(answerUrl!=undefined && answerUrl.length>0){
-		$('#right-sheet-div').removeClass('span12');
-		$('#right-sheet-div').addClass('span6');
-		$('#left-answer-div').find('iframe').attr('src', answerUrl);
-		$('#left-answer-div').show();
+
+function initSheetTagPopoverContent(sheetServer, sheetUrls, answerUrl, tags, callback){
+    var leftDiv = $('#sheet-tag-left');  
+    var rightDiv = $('#sheet-tag-right');
+    var tabNav = $('#sheet-tag-tab-nav');
+    var tabContent = $('#sheet-tag-tab-content');
+    if(answerUrl!=undefined && answerUrl.length>0){
+        rightDiv.removeClass('span12');
+        rightDiv.addClass('span6');
+		leftDiv.find('iframe').attr('src', answerUrl);
+		leftDiv.show();
 	}else{
-		$('#right-sheet-div').removeClass('span6');
-		$('#right-sheet-div').addClass('span12');
-		$('#left-answer-div').find('iframe').attr('src', '');
-		$('#left-answer-div').hide();
+	    rightDiv.removeClass('span6');
+	    rightDiv.addClass('span12');
+		leftDiv.find('iframe').attr('src', '');
+		leftDiv.hide();
 	}
 
-	$('#right-nav, #right-content').empty();
+    tabNav.empty();
+    tabContent.empty();
+    var loadCount=0;
 	for(var i=0;i<sheetUrls.length;i++){
-		var url = sheetServer+sheetUrls[i];
-		$('#right-nav').append('<li><a href="#sheet_'+i+'" data-toggle="tab">第'+(i+1)+'页</a></li>');
-		
-		var pane = $('<div class="tab-pane fade" id="sheet_'+i+'" style="overflow: scroll;"><canvas></canvas></div>').appendTo($('#right-content'));
-		var canvas = pane.find('canvas')[0];
+		tabNav.append($('<li><a href="#sheet_tag_'+i+'" data-toggle="tab">第'+(i+1)+'页</a></li>'));
+		tabContent.append($('<div class="tab-pane fade" id="sheet_tag_'+i+'" style="overflow: scroll;"><canvas id="sheet-tag-canvas-'+i+'"></canvas></div>'));
+	
 		var image = new Image();
+		image.tagList = tags[i+1] || [];
+		image.canvas = $('#sheet-tag-canvas-'+i)[0];
 		image.onload = function(){
-		    canvas.width = image.width;
-		    canvas.height = image.height;
-		    var ctx = canvas.getContext("2d");
-		    ctx.drawImage(image, 0, 0, canvas.width, canvas.height, 0, 0, canvas.width, canvas.height);
+		    this.canvas.width = Math.min(this.width, tabContent.width()>0?tabContent.width():($(window).width()*0.9-40));
+		    this.scaleRate = this.canvas.width / this.width;
+		    this.canvas.height = this.height * this.scaleRate;
+		    this.ctx = this.canvas.getContext("2d");
+		    this.ctx.drawImage(this, 0, 0, this.width, this.height, 0, 0, this.canvas.width, this.canvas.height);
+		    this.ctx.font ="20px Arial";
+            this.ctx.fillStyle ='red';
+		    for(var j=0;j<this.tagList.length;j++) {
+		        var tag = this.tagList[j];
+		        this.ctx.fillText(tag.content, tag.left * this.scaleRate, tag.top * this.scaleRate);
+		    }
+		    loadCount++;
+		    if(loadCount==sheetUrls.length) {
+		        callback();
+		    }
 		};
-		image.src = url;
+		image.src = sheetServer + sheetUrls[i] + '?' + new Date().getTime();
 	}
-	$('#right-nav a:first').trigger('click');
+	tabNav.find('a:first').trigger('click');
 }
 </script>
-<div id="sheet-view-content" class="container-fluid" style="display:none">
+<div id="sheet-tag-content" class="container-fluid" style="display:none">
 	<div class="row-fluid">
-		<div id="left-answer-div" class="span6" style="overflow:scroll">
+		<div class="span6" style="overflow:scroll" id="sheet-tag-left">
 			<iframe src="" border="0" scrolling="yes" width="100%"></iframe>
 		</div>
-		<div id="right-sheet-div" class="span6">
-			<ul id="right-nav" class="nav nav-tabs">
+		<div class="span6" id="sheet-tag-right">
+			<ul class="nav nav-tabs" id="sheet-tag-tab-nav">
 			</ul>
-			<div id="right-content" class="tab-content">
+			<div class="tab-content" id="sheet-tag-tab-content">
 			</div>
 		</div>
 	</div>

+ 106 - 106
stmms-web/src/main/webapp/WEB-INF/views/modules/exam/scoreDetail.jsp

@@ -1,107 +1,107 @@
-<%@ page contentType="text/html;charset=UTF-8" %>
-<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
-<html>
-<head>
-	<title>分数查询</title>
-	<meta name="decorator" content="default"/>
-	<%@include file="/WEB-INF/views/include/head.jsp" %>
-	<style type="text/css">.sort{color:#0663A2;cursor:pointer;}</style>
-	
-	<link rel="stylesheet" type="text/css" href="${ctx}/static/jBox/Source/jBox.css">
-	<script type="text/javascript" src="${ctx}/static/jBox/Source/jBox.min.js"></script>
-</head>
-<body>
-	<form id="searchForm" action="" method="post" class="breadcrumb form-search">
-		<div>
-			<label>姓名:${student.name}</label>
-			<label>准考证号:${student.examNumber}</label>
-			<label>学号:${student.studentCode}</label>
-			<label>科目:${student.subjectCode}-${student.subjectName}</label>
-			<label>客观总分:${student.objectiveScore}</label>
-			<label>主观总分:${student.subjectiveScore}</label>
-			<label>试卷总分:${student.totalScore}</label>
-			<br/>
-			&nbsp;
-			<a class="btn sheet-link" href="##" data-sheet-url="${student.sheetUrlString}" data-answer-url="<c:if test="${student.answerUrl!=null}">${cardServer}${student.answerUrl}</c:if>" data-title="${student.examNumber}&nbsp;&nbsp;${student.name}&nbsp;&nbsp;客观总分${student.objectiveScoreString}&nbsp;&nbsp;主观总分${student.subjectiveScoreString}&nbsp;&nbsp;全卷总分${student.totalScoreString}">原图</a>
-			&nbsp;
-			<a class="btn package-link" href="##" data-image-url="${student.packageUrlString}" data-title="${student.packageCode}">签到表</a>		
-			<c:if test="${web_user.schoolAdmin==true}">
-			&nbsp;
-			<a class="btn btn-warning" href="##" id="edit-button">保存</a>
-			</c:if>
-			&nbsp;
-			<a class="btn" href="${ctx}/admin/exam/score?${queryString}">返回</a>
-		</div>
-	</form>
-	<table id="contentTable" class="table table-striped table-bordered table-condensed">
-		<thead>
-			<tr>
-				<th>题目</th>
-				<th>分数</th>
-				<th>答案</th>
-			</tr>
-		</thead>
-		<tbody>
-		<c:forEach items="${scoreList}" var="item">
-			<tr class="score-tr" data-objective="${item.objective}">
-				<td>${item.title}</td>
-				<td><input class="score-input" value="${item.scoreString}"/></td>
-				<td>
-				<c:if test="${item.objective==true}">
-				<input class="answer-input" value="${item.answer}"/>
-				</c:if>
-				<c:if test="${item.objective==false}">
-				&nbsp;
-				</c:if>
-				</td>
-			</tr>
-		</c:forEach>
-		</tbody>
-	</table>
-	<%@include file="/WEB-INF/views/include/sheetView.jsp" %>
-	<%@include file="/WEB-INF/views/include/imageView.jsp" %>
-<script type="text/javascript">
-var examNumber = '${student.examNumber}';
-$(document).ready(function() {
-    /* new jBox('Image', {
-    	imageFade: 0,
-    	delayOpen: 0,
-    	delayClose: 0,
-    	maxHeight: $(window).height()*0.88
-    }); */
-    $('.sheet-link').click(function(){
-    	initSheetPopover($(this).attr('data-title'), '${imageServer}', $(this).attr('data-sheet-url'), $(this).attr('data-answer-url'));
-    	return false;
-    });
-    $('.package-link').click(function(){
-    	initImagePopover($(this).attr('data-title'), '${packageServer}', $(this).attr('data-image-url'));
-    	return false;
-    });
-    $('#edit-button').click(function(){
-    	var o = [];
-    	var s = [];
-    	$('tr.score-tr').each(function(index, obj){
-    		var tr = $(obj);
-    		if(tr.attr('data-objective')=='true'){
-    			o.push(tr.find('.answer-input').val()+':'+tr.find('.score-input').val());
-    		}else{
-    			s.push(tr.find('.score-input').val());
-    		}
-    	});
-    	$.post('${ctx}/admin/exam/score/edit', {
-    		examNumber: examNumber,
-    		objectiveItems: o.join(';'),
-    		subjectiveItems: s.join(';')
-    	}, function(result){
-    		if(result.success==true){
-    			alert('修改成功');
-    			window.location.reload();
-    		}else{
-    			alert(result.message);
-    		}
-    	});
-    });
-});
-</script>	
-</body>
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
+<html>
+<head>
+	<title>分数查询</title>
+	<meta name="decorator" content="default"/>
+	<%@include file="/WEB-INF/views/include/head.jsp" %>
+	<style type="text/css">.sort{color:#0663A2;cursor:pointer;}</style>
+	
+	<link rel="stylesheet" type="text/css" href="${ctxStatic}/jBox/Source/jBox.css">
+	<script type="text/javascript" src="${ctxStatic}/jBox/Source/jBox.min.js"></script>
+</head>
+<body>
+	<form id="searchForm" action="" method="post" class="breadcrumb form-search">
+		<div>
+			<label>姓名:${student.name}</label>
+			<label>准考证号:${student.examNumber}</label>
+			<label>学号:${student.studentCode}</label>
+			<label>科目:${student.subjectCode}-${student.subjectName}</label>
+			<label>客观总分:${student.objectiveScore}</label>
+			<label>主观总分:${student.subjectiveScore}</label>
+			<label>试卷总分:${student.totalScore}</label>
+			<br/>
+			&nbsp;
+			<a class="btn sheet-link" href="##" data-sheet-url="${student.sheetUrlString}" data-answer-url="<c:if test="${student.answerUrl!=null}">${cardServer}${student.answerUrl}</c:if>" data-title="${student.examNumber}&nbsp;&nbsp;${student.name}&nbsp;&nbsp;客观总分${student.objectiveScoreString}&nbsp;&nbsp;主观总分${student.subjectiveScoreString}&nbsp;&nbsp;全卷总分${student.totalScoreString}">原图</a>
+			&nbsp;
+			<a class="btn package-link" href="##" data-image-url="${student.packageUrlString}" data-title="${student.packageCode}">签到表</a>		
+			<c:if test="${web_user.schoolAdmin==true}">
+			&nbsp;
+			<a class="btn btn-warning" href="##" id="edit-button">保存</a>
+			</c:if>
+			&nbsp;
+			<a class="btn" href="${ctx}/admin/exam/score?${queryString}">返回</a>
+		</div>
+	</form>
+	<table id="contentTable" class="table table-striped table-bordered table-condensed">
+		<thead>
+			<tr>
+				<th>题目</th>
+				<th>分数</th>
+				<th>答案</th>
+			</tr>
+		</thead>
+		<tbody>
+		<c:forEach items="${scoreList}" var="item">
+			<tr class="score-tr" data-objective="${item.objective}">
+				<td>${item.title}</td>
+				<td><input class="score-input" value="${item.scoreString}"/></td>
+				<td>
+				<c:if test="${item.objective==true}">
+				<input class="answer-input" value="${item.answer}"/>
+				</c:if>
+				<c:if test="${item.objective==false}">
+				&nbsp;
+				</c:if>
+				</td>
+			</tr>
+		</c:forEach>
+		</tbody>
+	</table>
+	<%@include file="/WEB-INF/views/include/sheetView.jsp" %>
+	<%@include file="/WEB-INF/views/include/imageView.jsp" %>
+<script type="text/javascript">
+var examNumber = '${student.examNumber}';
+$(document).ready(function() {
+    /* new jBox('Image', {
+    	imageFade: 0,
+    	delayOpen: 0,
+    	delayClose: 0,
+    	maxHeight: $(window).height()*0.88
+    }); */
+    $('.sheet-link').click(function(){
+    	initSheetPopover($(this).attr('data-title'), '${imageServer}', $(this).attr('data-sheet-url'), $(this).attr('data-answer-url'));
+    	return false;
+    });
+    $('.package-link').click(function(){
+    	initImagePopover($(this).attr('data-title'), '${packageServer}', $(this).attr('data-image-url'));
+    	return false;
+    });
+    $('#edit-button').click(function(){
+    	var o = [];
+    	var s = [];
+    	$('tr.score-tr').each(function(index, obj){
+    		var tr = $(obj);
+    		if(tr.attr('data-objective')=='true'){
+    			o.push(tr.find('.answer-input').val()+':'+tr.find('.score-input').val());
+    		}else{
+    			s.push(tr.find('.score-input').val());
+    		}
+    	});
+    	$.post('${ctx}/admin/exam/score/edit', {
+    		examNumber: examNumber,
+    		objectiveItems: o.join(';'),
+    		subjectiveItems: s.join(';')
+    	}, function(result){
+    		if(result.success==true){
+    			alert('修改成功');
+    			window.location.reload();
+    		}else{
+    			alert(result.message);
+    		}
+    	});
+    });
+});
+</script>	
+</body>
 </html>

+ 8 - 12
stmms-web/src/main/webapp/WEB-INF/views/modules/exam/scoreList.jsp

@@ -12,7 +12,7 @@
 		<input type="hidden" id="pageNumber" name="pageNumber" value="${query.pageNumber }"/>
 		<input type="hidden" id="pageSize" name="pageSize" value="${query.pageSize }"/>
 		<div>
-			<label>姓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名</label>
+			<label>姓名</label>
 			<input type="text" name="name" value="${query.name}"  maxlength="10" class="input-mini"/>
 			<label>准考证号</label>
 			<input type="text" name="examNumber" value="${query.examNumber}" maxlength="50" class="input-small"/>
@@ -163,19 +163,19 @@
                     </c:if>
                 </td>
 				<td>
-					<a class="sheet-link" href="##" data-sheet-url="${student.sheetUrlString}" data-answer-url="<c:if test="${student.answerUrl!=null}">${cardServer}${student.answerUrl}</c:if>" data-title="${student.examNumber}&nbsp;&nbsp;${student.name}&nbsp;&nbsp;客观总分${student.objectiveScoreString}&nbsp;&nbsp;主观总分${student.subjectiveScoreString}&nbsp;&nbsp;全卷总分${student.totalScoreString}">原图</a>
-					<%--
-					<a class="track-link" href="##" data-image-url="${ctx}/admin/exam/track?studentId=${student.id}" data-title="${student.examNumber}&nbsp;&nbsp;${student.name}">阅卷轨迹</a> 
-					--%>
+				    <c:if test="${student.upload==true}">
+					<a class="sheet-link" href="##" data-id="${student.id}" data-sheet-url="${student.sheetUrlString}" data-answer-url="<c:if test="${student.answerUrl!=null}">${cardServer}${student.answerUrl}</c:if>" data-title="${student.examNumber}&nbsp;&nbsp;${student.name}&nbsp;&nbsp;客观总分${student.objectiveScoreString}&nbsp;&nbsp;主观总分${student.subjectiveScoreString}&nbsp;&nbsp;全卷总分${student.totalScoreString}">原图</a>
+					</c:if>
+					<c:if test="${student.packageUrlString!=null && student.packageUrlString!=''}">
 					<a class="package-link" href="##" data-image-url="${student.packageUrlString}" data-title="${student.packageCode}">签到表</a>
+					</c:if>
 				</td>
 			</tr>
 		</c:forEach>
 		</tbody>
 	</table>
 	<div class="pagination">${query}</div>
-	<%@include file="/WEB-INF/views/include/trackView.jsp" %>
-	<%@include file="/WEB-INF/views/include/sheetView.jsp" %>
+	<%@include file="/WEB-INF/views/include/sheetTagView.jsp" %>
 	<%@include file="/WEB-INF/views/include/imageView.jsp" %>
 <script type="text/javascript">
 $(document).ready(function() {
@@ -192,17 +192,13 @@ $(document).ready(function() {
     	window.location.href = url;
     });
     $('.sheet-link').click(function(){
-    	initSheetPopover($(this).attr('data-title'), '${imageServer}', $(this).attr('data-sheet-url'), $(this).attr('data-answer-url'));
+    	initSheetTagPopover($(this).attr('data-id'), $(this).attr('data-title'), '${imageServer}', $(this).attr('data-sheet-url'), $(this).attr('data-answer-url'));
     	return false;
     });
     $('.package-link').click(function(){
     	initImagePopover($(this).attr('data-title'), '${packageServer}', $(this).attr('data-image-url'));
     	return false;
     });
-    $('.track-link').click(function(){
-    	initTrackPopover($(this).attr('data-title'),$(this).attr('data-image-url'));
-    	return false;
-    });
 });
 function page(n,s){
 	$("#pageNumber").val(n);