瀏覽代碼

修复评卷界面js精度问题的bug

luoshi 5 年之前
父節點
當前提交
4e6f15410a

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

@@ -1,9 +1,9 @@
 #jdbc config
 driverClassName=com.mysql.jdbc.Driver
 #jdbc config
-url=jdbc:mysql://192.168.10.30:3306/stmms_ft_online?useUnicode=true&characterEncoding=UTF-8
+url=jdbc:mysql://192.168.10.208:3306/stmms_ft_201805?useUnicode=true&characterEncoding=UTF-8
 username=root
-password=root
+password=123456
 
 #cookie config
 cookie.max.age=36000

+ 16 - 8
stmms-web/src/main/webapp/static/mark-new/js/mark-control.js

@@ -292,9 +292,9 @@ MarkControl.prototype.initTriggers = function(option) {
         context.submitting = false;
     });
     this.on('task.submit.success', this, function(event, context, eventObject) {
-    	context.submitting = false;
-    	context.task = undefined;
-    	self.getTask();
+        context.submitting = false;
+        context.task = undefined;
+        self.getTask();
     });
     this.on('task.submit.error', this, function(event, context, eventObject) {
         context.submitting = false;
@@ -591,11 +591,11 @@ MarkControl.prototype.submitTask = function(submitUrl) {
                     markControl.context.status = status;
                     markControl.trigger('mark.status.change', status);
                 }
-                if(task.previous==true){
-                	markControl.trigger('history.submit.success',task);
-            	}else{
-            		markControl.trigger('task.submit.success');
-            	}
+                if (task.previous == true) {
+                    markControl.trigger('history.submit.success', task);
+                } else {
+                    markControl.trigger('task.submit.success');
+                }
             }, function(message) {
                 markControl.trigger('task.submit.error', message);
             });
@@ -700,6 +700,14 @@ Date.prototype.format = function(fmt) { //author: meizz
     return fmt;
 }
 
+function parseNumber(number) {
+    return Math.round(parseFloat(number) * 10) / 10;
+}
+
+function numberAdd(n1, n2) {
+    return (n1 * 10 + n2 * 10) / 10;
+}
+
 function getDom(content, markControl) {
     if (markControl != undefined && markControl.option.staticServer != undefined) {
         content = content.replace(/{staticServer}/g, markControl.option.staticServer);

+ 8 - 6
stmms-web/src/main/webapp/static/mark-new/js/modules/arbitration-process.js

@@ -36,8 +36,10 @@ ArbitrationProcess.prototype.render = function(task) {
     var historyList = task.arbitrationList;
     this.container.list.empty();
     if (isArray(historyList) && historyList.length > 0) {
-		for (var i in historyList) {
-			var history = historyList[i];
+        for (var i in historyList) {
+            var history = historyList[i];
+            history.totalScore = parseNumber(history.totalScore);
+
             var row = getDom(this.history_row_dom, this.markControl).appendTo(this.container.list);
             row.find('.history-name').html(history.markerName);
 
@@ -45,11 +47,11 @@ ArbitrationProcess.prototype.render = function(task) {
             date.setTime(history.markTime);
             row.find('.history-time').html(date.format('hh:mm:ss'));
             row.find('.history-score').html(history.totalScore);
-            row.find('.history-scoreList').html('详情:'+history.scoreList+'<span class="jiao"></span>');
-    	}
+            row.find('.history-scoreList').html('详情:' + history.scoreList + '<span class="jiao"></span>');
+        }
     }
-	this.markControl.trigger('mark.sidebar.open');
-	this.container.show();
+    this.markControl.trigger('mark.sidebar.open');
+    this.container.show();
 }
 
 ArbitrationProcess.prototype.header_dom = '<div class="header">\

+ 11 - 5
stmms-web/src/main/webapp/static/mark-new/js/modules/mark-board.js

@@ -226,13 +226,13 @@ MarkBoard.prototype.initByTask = function(task) {
     this.currentStep = undefined;
     this.stepCount = this.stepList != undefined ? this.stepList.length : 0;
 
-    task.totalScore = parseFloat(task.totalScore);
+    task.totalScore = parseNumber(task.totalScore);
     var markFinish = true;
     var scoreList = task.scoreList != undefined && task.scoreList != '' ? task.scoreList.split(',') : [];
     for (var j in task.markStepList) {
         var step = task.markStepList[j];
         if (scoreList != undefined && scoreList.length > j) {
-            step.markScore = parseFloat(scoreList[j]);
+            step.markScore = parseNumber(scoreList[j]);
             step.score = new String(step.markScore);
             step.markFinish = true;
         } else {
@@ -398,7 +398,7 @@ MarkBoard.prototype.updateTotalScore = function() {
         var finish = true;
         for (var i in this.stepList) {
             if (this.stepList[i].markScore != undefined) {
-                totalScore = totalScore + this.stepList[i].markScore;
+                totalScore = numberAdd(totalScore, this.stepList[i].markScore);
             } else {
                 finish = false;
             }
@@ -414,7 +414,7 @@ MarkBoard.prototype.allZeroSubmit = function() {
             this.stepList[i].markScore = 0;
         }
         for (var i in this.task.markStepList) {
-        	this.task.markStepList[i].markScore = 0;
+            this.task.markStepList[i].markScore = 0;
         }
         this.onTaskSubmit();
     }
@@ -427,7 +427,7 @@ MarkBoard.prototype.onTaskSubmit = function() {
     for (var i in this.stepList) {
         var score = this.stepList[i].markScore;
         if (score != undefined) {
-            totalScore = totalScore + score;
+            totalScore = numberAdd(totalScore, score);
             scoreList.push(score);
         } else {
             finish = false;
@@ -500,6 +500,10 @@ MarkBoard.prototype.render = function(task) {
         this.scoreBoard.stepArray = [];
         for (var i in task.markStepList) {
             var step = task.markStepList[i];
+            step.max = parseNumber(step.max);
+            step.min = parseNumber(step.min);
+            step.score = parseNumber(step.score);
+            step.interval = parseNumber(step.interval);
             //初始化步骤列表
             var dom = getDom(this.step_dom, this.markControl);
             dom.attr('data-number', step.number);
@@ -523,6 +527,8 @@ MarkBoard.prototype.render = function(task) {
             dom2.find('.number').html(step.title);
             var scoreHolder = dom2.find('.fraction');
             for (var j in step.scoreList) {
+                step.scoreList[j] = parseNumber(step.scoreList[j]);
+
                 var dom3 = getDom(this.scoreBoard_score_dom, this.markControl);
                 var score = step.scoreList[j];
                 dom3.attr('data-step-number', step.number);

+ 87 - 87
stmms-web/src/main/webapp/static/mark-new/js/modules/mark-history.js

@@ -14,7 +14,7 @@ function MarkHistory(option) {
     this.loading = false;
     this.order = "time"
     this.sort = "desc";
-    var isTag = false; 
+    var isTag = false;
 
     this.markControl.initMarkFunction();
     this.container.toggleButton = getDom(this.toggle_button_dom, this.markControl).appendTo(this.markControl.container.assistant.functionList);
@@ -31,17 +31,17 @@ function MarkHistory(option) {
             this.taskList = taskList;
             for (var i in taskList) {
                 var task = taskList[i];
+                task.totalScore = parseNumber(task.totalScore);
                 var row = getDom(this.history_row_dom, this.markControl).appendTo(this.container.list);
                 row.find('.history-secret-number').html(task.studentId);
-                if(task.tags!=undefined && task.tags!=null ){
-                	row.find('.history-secret-number').addClass('tips');
+                if (task.tags != undefined && task.tags != null) {
+                    row.find('.history-secret-number').addClass('tips');
                 }
                 var date = new Date();
                 date.setTime(task.markTime);
                 row.find('.history-time').html(date.format('hh:mm:ss'));
                 row.find('.history-score').html(task.totalScore);
                 row.attr('data-index', i);
-                
 
                 //回评任务处理
                 task.previous = true;
@@ -65,7 +65,7 @@ function MarkHistory(option) {
         });
         this.pageNumber = data.pageNumber;
         this.updatePage();
-        this.updateSort(this.order,this.sort);
+        this.updateSort(this.order, this.sort);
 
         if (this.taskList.length > 0) {
             this.onTaskSelect(0);
@@ -83,9 +83,9 @@ function MarkHistory(option) {
         this.loading = false;
     });
     this.markControl.on('history.submit.success', this, function(event, context, task) {
-    	if(task.previous==true){
-    		this.updateTaskScore(task.totalScore);
-    	}
+        if (task.previous == true) {
+            this.updateTaskScore(task.totalScore);
+        }
     });
 }
 
@@ -96,8 +96,8 @@ MarkHistory.prototype.init = function() {
     this.container.header = getDom(this.header_dom, this.markControl).appendTo(this.container);
     this.container.search = getDom(this.history_search_dom, this.markControl).appendTo(this.container).find('#history-search');
     this.container.list = getDom(this.history_list_dom, this.markControl).appendTo(this.container).find('#history-list');
-    
-	var self = this;
+
+    var self = this;
     this.container.header.find('#close-history-button').click(this, function(event) {
         event.data.toggle(false);
         self.markControl.context.task = undefined;
@@ -106,43 +106,43 @@ MarkHistory.prototype.init = function() {
     this.container.paginator.find('#last-page-button').click(this, function(event) {
         var markHistory = event.data;
         if (markHistory.taskList.length < markHistory.pageSize) {
-        	return ;
+            return;
         }
         if (self.container.search.find('#history-isTag').prop("checked")) {
-        	markHistory.isTag=true;
-        }  else{
-        	markHistory.isTag=false;
+            markHistory.isTag = true;
+        } else {
+            markHistory.isTag = false;
         }
-        markHistory.onSearch(markHistory.pageNumber + 1,markHistory.order,markHistory.sort,markHistory.isTag);
+        markHistory.onSearch(markHistory.pageNumber + 1, markHistory.order, markHistory.sort, markHistory.isTag);
     });
     this.container.paginator.find('#next-page-button').click(this, function(event) {
         var markHistory = event.data;
         if (markHistory.pageNumber == 1) {
-        	return ;
+            return;
         }
         if (markHistory.pageNumber > 1) {
             if (self.container.search.find('#history-isTag').prop("checked")) {
-            	markHistory.isTag=true;
-            }  else{
-            	markHistory.isTag=false;
+                markHistory.isTag = true;
+            } else {
+                markHistory.isTag = false;
             }
-            markHistory.onSearch(markHistory.pageNumber - 1,markHistory.order,markHistory.sort,markHistory.isTag);
+            markHistory.onSearch(markHistory.pageNumber - 1, markHistory.order, markHistory.sort, markHistory.isTag);
         }
     });
     this.container.find('#studentId-search').click(this, function(event) {
-    	var markHistory = event.data;
-    	var studentId = self.container.find('#studentId-in').val();
-    	var re = /^[1-9]+[0-9]*]*$/ ;
-    	if(!re.test(studentId)){
-    		alert("请输入数字");
-    		return ;
-    	}
-    	if (self.container.search.find('#history-isTag').prop("checked")) {
-        	markHistory.isTag=true;
-        }  else{
-        	markHistory.isTag=false;
+        var markHistory = event.data;
+        var studentId = self.container.find('#studentId-in').val();
+        var re = /^[1-9]+[0-9]*]*$/;
+        if (!re.test(studentId)) {
+            alert("请输入数字");
+            return;
         }
-    	markHistory.onSearch(0,markHistory.order,markHistory.sort,markHistory.isTag,studentId);
+        if (self.container.search.find('#history-isTag').prop("checked")) {
+            markHistory.isTag = true;
+        } else {
+            markHistory.isTag = false;
+        }
+        markHistory.onSearch(0, markHistory.order, markHistory.sort, markHistory.isTag, studentId);
     });
     this.container.find('#time-sort-th').click(this, function(event) {
         self.orderSearch("time");
@@ -153,27 +153,27 @@ MarkHistory.prototype.init = function() {
     this.container.find('#score-sort-th').click(this, function(event) {
         self.orderSearch("score");
     });
-    
-    self.updateSort(self.order,self.sort);
+
+    self.updateSort(self.order, self.sort);
     self.updateLoading();
-    
+
     this.container.find('#studentId-in').click(this, function(event) {
-    	self.markControl.trigger('mark.focus.change');
+        self.markControl.trigger('mark.focus.change');
     });
 }
 MarkHistory.prototype.orderSearch = function(order) {
-	this.order = order;
-	if(this.sort == "asc"){
-		this.sort = "desc";
-	}else if(this.sort == "desc"){
-		this.sort = "asc";
-	}
-	if (this.container.search.find('#history-isTag').prop("checked")) {
-		this.isTag=true;
-	} else{
-		this.isTag=false;
-	}
-	this.onSearch(this.pageNumber,this.order,this.sort,this.isTag);
+    this.order = order;
+    if (this.sort == "asc") {
+        this.sort = "desc";
+    } else if (this.sort == "desc") {
+        this.sort = "asc";
+    }
+    if (this.container.search.find('#history-isTag').prop("checked")) {
+        this.isTag = true;
+    } else {
+        this.isTag = false;
+    }
+    this.onSearch(this.pageNumber, this.order, this.sort, this.isTag);
 }
 
 MarkHistory.prototype.toggle = function(enable) {
@@ -199,62 +199,62 @@ MarkHistory.prototype.updatePage = function() {
     this.container.paginator.find('#history-start').html(this.pageSize * (this.pageNumber - 1));
     this.container.paginator.find('#history-end').html(this.pageSize * this.pageNumber);
 
-//    if (this.pageNumber == 1) {
-//        this.container.paginator.find('#next-page-button').hide();
-//    }else{
-//    	this.container.paginator.find('#next-page-button').show();
-//    }
-//    if (this.taskList.length < this.pageSize) {
-//        this.container.paginator.find('#last-page-button').hide();
-//    } else{
-//    	this.container.paginator.find('#last-page-button').show();
-//    }
-    
+    //    if (this.pageNumber == 1) {
+    //        this.container.paginator.find('#next-page-button').hide();
+    //    }else{
+    //      this.container.paginator.find('#next-page-button').show();
+    //    }
+    //    if (this.taskList.length < this.pageSize) {
+    //        this.container.paginator.find('#last-page-button').hide();
+    //    } else{
+    //      this.container.paginator.find('#last-page-button').show();
+    //    }
+
 }
 MarkHistory.prototype.updateLoading = function() {
     if (this.loading) {
         this.container.find('#history-loading').show();
-    }else{
-    	this.container.find('#history-loading').hide();
+    } else {
+        this.container.find('#history-loading').hide();
     }
 }
 
-MarkHistory.prototype.updateSort = function(order,sort) {
-	this.container.find('#time-sort').removeClass();
-	this.container.find('#studentId-sort').removeClass();
-	this.container.find('#score-sort').removeClass();
-	if(sort == 'desc'){
-		this.container.find('#'+order+'-sort').addClass("down");
-	}else{
-		this.container.find('#'+order+'-sort').addClass("up");
-	}
-	
-	
+MarkHistory.prototype.updateSort = function(order, sort) {
+    this.container.find('#time-sort').removeClass();
+    this.container.find('#studentId-sort').removeClass();
+    this.container.find('#score-sort').removeClass();
+    if (sort == 'desc') {
+        this.container.find('#' + order + '-sort').addClass("down");
+    } else {
+        this.container.find('#' + order + '-sort').addClass("up");
+    }
+
+
 }
 
-MarkHistory.prototype.onSearch = function(pageNumber,order,sort,isTag,studentId) {
+MarkHistory.prototype.onSearch = function(pageNumber, order, sort, isTag, studentId) {
     if (pageNumber == undefined || pageNumber < 1) {
         pageNumber = 1;
     }
-    if (order == undefined ) {
-    	order = "time";
+    if (order == undefined) {
+        order = "time";
     }
-    if (sort == undefined ) {
-    	sort = "desc";
+    if (sort == undefined) {
+        sort = "desc";
     }
-    if (isTag == undefined ) {
-    	isTag = false;
+    if (isTag == undefined) {
+        isTag = false;
     }
-    if (studentId == undefined || studentId=="") {
-    	studentId = null;
+    if (studentId == undefined || studentId == "") {
+        studentId = null;
     }
     this.markControl.getHistory({
         pageNumber: pageNumber,
         pageSize: this.pageSize,
-        order : order,
-        sort : sort,
-        isTag : isTag,
-        studentId :studentId
+        order: order,
+        sort: sort,
+        isTag: isTag,
+        studentId: studentId
     });
 }
 
@@ -276,9 +276,9 @@ MarkHistory.prototype.onTaskSelect = function(index) {
 }
 
 MarkHistory.prototype.updateTaskScore = function(score) {
-	this.container.list.find('tr').each(function(index, obj) {
+    this.container.list.find('tr').each(function(index, obj) {
         if ($(obj).hasClass("active")) {
-        	$(obj).find('td').last().html(score);
+            $(obj).find('td').last().html(score);
         }
     });
 }

+ 13 - 5
stmms-web/src/main/webapp/static/mark-track/js/mark-control.js

@@ -604,11 +604,11 @@ MarkControl.prototype.submitTask = function(submitUrl) {
                     markControl.trigger('mark.status.change', status);
                 }
                 // markControl.context.task = undefined;
-                if(task.previous==true){
-                	markControl.trigger('history.submit.success',task);
-            	}else{
-            		markControl.trigger('task.submit.success');
-            	}
+                if (task.previous == true) {
+                    markControl.trigger('history.submit.success', task);
+                } else {
+                    markControl.trigger('task.submit.success');
+                }
                 markControl.trigger('mark.specialTag.success');
                 // markControl.getTask();
             }, function(message) {
@@ -694,6 +694,14 @@ Date.prototype.format = function(fmt) { // author: meizz
     return fmt;
 }
 
+function parseNumber(number) {
+    return Math.round(parseFloat(number) * 10) / 10;
+}
+
+function numberAdd(n1, n2) {
+    return (n1 * 10 + n2 * 10) / 10;
+}
+
 function getDom(content, markControl) {
     if (markControl != undefined && markControl.option.staticServer != undefined) {
         content = content.replace(/{staticServer}/g, markControl.option.staticServer);

+ 391 - 384
stmms-web/src/main/webapp/static/mark-track/js/modules/mark-board.js

@@ -1,73 +1,73 @@
 //给分板模块
 var mark_board = function(option, success) {
-	var object = new MarkBoard(option);
-	success();
-	return object;
+    var object = new MarkBoard(option);
+    success();
+    return object;
 }
 
 function MarkBoard(option) {
-	this.markControl = option.markControl;
-	this.timeoutSecond = 0.4;
-	this.needConfirm = option.needConfirm === true ? true : false;
-	this.autoSubmit = option.autoSubmit === false ? false : true;
-	this.enableSkip = option.enableSkip === true ? true : false;
-	this.init(this.markControl.option.forceSpecialTag);
-	this.markControl.on('task.get.before', this, function(event, context, eventObject) {
-		this.task = undefined;
-		this.stepList = undefined;
-		this.currentStep = undefined;
-		this.stepCount = undefined;
-		this.render();
-	});
-	this.markControl.on('task.load.finish', this, function(event, context, eventObject) {
-		this.initByTask(context.task);
-	});
+    this.markControl = option.markControl;
+    this.timeoutSecond = 0.4;
+    this.needConfirm = option.needConfirm === true ? true : false;
+    this.autoSubmit = option.autoSubmit === false ? false : true;
+    this.enableSkip = option.enableSkip === true ? true : false;
+    this.init(this.markControl.option.forceSpecialTag);
+    this.markControl.on('task.get.before', this, function(event, context, eventObject) {
+        this.task = undefined;
+        this.stepList = undefined;
+        this.currentStep = undefined;
+        this.stepCount = undefined;
+        this.render();
+    });
+    this.markControl.on('task.load.finish', this, function(event, context, eventObject) {
+        this.initByTask(context.task);
+    });
     this.markControl.on('history.submit.success', this, function(event, context, eventObject) {
         this.initByTask(context.task);
     });
     this.markControl.on('mark.focus.change', this, function(event, context, eventObject) {
-    	this.onFocusChange();
+        this.onFocusChange();
+    });
+    this.markControl.on('special.tag.enable', this, function(event, context, eventObject) {
+        this.specialTag = true;
+    });
+    this.markControl.on('special.tag.disable', this, function(event, context, eventObject) {
+        this.specialTag = false;
+    });
+    this.markControl.on('image.click.event', this, function(event, context, track) {
+        if (track != undefined && this.currentStep != undefined &&
+            this.currentStep.currentScore != undefined &&
+            this.specialTag != true) {
+            track.score = this.currentStep.currentScore;
+            track.questionNumber = this.currentStep.questionNumber;
+            track.number = this.currentStep.trackList.length + 1;
+            this.currentStep.trackList.push(track);
+            this.resetScore();
+            this.updateStepScore();
+            this.trySetScore(track.score);
+            this.markControl.trigger('mark.tag.show', {
+                content: track.score,
+                positionX: track.positionX,
+                positionY: track.positionY
+            });
+        }
     });
-	this.markControl.on('special.tag.enable', this, function(event, context, eventObject) {
-		this.specialTag=true;
-	});
-	this.markControl.on('special.tag.disable', this, function(event, context, eventObject) {
-		this.specialTag=false;
-	});
-	this.markControl.on('image.click.event', this, function(event, context, track) {
-		if(track != undefined && this.currentStep != undefined 
-			&& this.currentStep.currentScore != undefined
-			&& this.specialTag!=true) {
-			track.score = this.currentStep.currentScore;
-			track.questionNumber = this.currentStep.questionNumber;
-			track.number = this.currentStep.trackList.length + 1;
-			this.currentStep.trackList.push(track);
-			this.resetScore();
-			this.updateStepScore();
-			this.trySetScore(track.score);
-			this.markControl.trigger('mark.tag.show', {
-				content: track.score,
-				positionX: track.positionX,
-				positionY: track.positionY
-			});
-		}
-	});
-	//图片重新加载后,恢复显示所有标记
+    //图片重新加载后,恢复显示所有标记
     this.markControl.on('image.reload.event', this, function(event, context, eventObject) {
-		for(var i = 0; i < this.stepList.length; i++) {
-			var step = this.stepList[i];
-			for(var j = 0; j < step.trackList.length; j++) {
-				this.markControl.trigger('mark.tag.show', {
-					content: step.trackList[j].score,
-					positionX: step.trackList[j].positionX,
-					positionY: step.trackList[j].positionY
-				});
-			}
-		}
+        for (var i = 0; i < this.stepList.length; i++) {
+            var step = this.stepList[i];
+            for (var j = 0; j < step.trackList.length; j++) {
+                this.markControl.trigger('mark.tag.show', {
+                    content: step.trackList[j].score,
+                    positionX: step.trackList[j].positionX,
+                    positionY: step.trackList[j].positionY
+                });
+            }
+        }
     });
-	this.markControl.on('key.press', this, function(e, context, event) {
+    this.markControl.on('key.press', this, function(e, context, event) {
         var code = event.keyCode;
-//        console.log('key press:' + code);
+        //        console.log('key press:' + code);
         var self = this;
         if (this.currentStep != undefined && this.task != undefined) {
             if (code >= 48 && code <= 57) {
@@ -86,406 +86,413 @@ function MarkBoard(option) {
             }
         }
     });
-	this.markControl.on('key.up', this, function(e, context, event) {
+    this.markControl.on('key.up', this, function(e, context, event) {
         var code = event.keyCode;
         //console.log('key up:' + code);
         var self = this;
         if (this.currentStep != undefined && this.task != undefined) {
-        	if (code == 37) {
+            if (code == 37) {
                 //← 按键,切换到上一个步骤
                 if (this.currentStep.number > 1) {
-                	self.onStepSelect(this.currentStep.number - 1);
+                    self.onStepSelect(this.currentStep.number - 1);
                     event.preventDefault();
                     return false;
                 }
             } else if (code == 39) {
                 // →按键,切换到下一个步骤
-                if (this.currentStep.number < this.stepCount ) {
-                	self.onStepSelect(this.currentStep.number + 1);
+                if (this.currentStep.number < this.stepCount) {
+                    self.onStepSelect(this.currentStep.number + 1);
                     event.preventDefault();
                     return false;
                 }
-            } 
+            }
         }
     });
 }
 
 MarkBoard.prototype.init = function(forceSpecialTag) {
-	var self = this;
-	this.stepBoard = getDom(this.step_board_dom, this.markControl).appendTo(this.markControl.container.centerContainer);
-	this.stepBoard.height(this.markControl.container.centerContent.height());
-
-	var stepDom = this.stepBoard.find('.step-list');
-	stepDom.height((this.stepBoard.height() - 153) * 0.5);
-	this.stepBoard.stepContainer = stepDom.find('ul');
-
-	var scoreDom = this.stepBoard.find('.score_board');
-	scoreDom.height((this.stepBoard.height() - 153) * 0.5);
-	this.stepBoard.scoreContainer = scoreDom.find('ul');
-
-	this.stepBoard.find('.task-submit-button').click(this, function(event) {
-		self.onTaskSubmit();
-	});
-	//给分板上是否显示全零分
-	if(forceSpecialTag===true){
-		this.stepBoard.find('.all-zero-button').attr("type","hidden");
-	}
-	this.stepBoard.find('.all-zero-button').click(this, function(event) {
-		self.allZeroSubmit();
-	});
-	this.stepBoard.find('.undo-last-track-button').click(this, function() {
-		if(self.currentStep != undefined && self.currentStep.trackList.length>0) {
-			self.currentStep.trackList.pop();
-			self.updateStepScore();
-			self.refreshTrack();
-		}
-	});
-	this.stepBoard.find('.clear-current-track-button').click(this, function() {
-		if(self.currentStep != undefined) {
-			self.currentStep.currentScore = undefined;
-			self.currentStep.trackList = [];
-			self.updateStepScore();
-			self.refreshTrack();
-		}
-	});
-	this.stepBoard.find('.clear-all-track-button').click(this, function() {
-		if(self.stepList != undefined) {
-			for(var i = 0; i < self.stepList.length; i++) {
-				self.stepList[i].currentScore = undefined;
-				self.stepList[i].trackList = [];
-				self.updateStepScore(self.stepList[i]);
-			}
-			self.refreshTrack();
-		}
-	});
+    var self = this;
+    this.stepBoard = getDom(this.step_board_dom, this.markControl).appendTo(this.markControl.container.centerContainer);
+    this.stepBoard.height(this.markControl.container.centerContent.height());
+
+    var stepDom = this.stepBoard.find('.step-list');
+    stepDom.height((this.stepBoard.height() - 153) * 0.5);
+    this.stepBoard.stepContainer = stepDom.find('ul');
+
+    var scoreDom = this.stepBoard.find('.score_board');
+    scoreDom.height((this.stepBoard.height() - 153) * 0.5);
+    this.stepBoard.scoreContainer = scoreDom.find('ul');
+
+    this.stepBoard.find('.task-submit-button').click(this, function(event) {
+        self.onTaskSubmit();
+    });
+    //给分板上是否显示全零分
+    if (forceSpecialTag === true) {
+        this.stepBoard.find('.all-zero-button').attr("type", "hidden");
+    }
+    this.stepBoard.find('.all-zero-button').click(this, function(event) {
+        self.allZeroSubmit();
+    });
+    this.stepBoard.find('.undo-last-track-button').click(this, function() {
+        if (self.currentStep != undefined && self.currentStep.trackList.length > 0) {
+            self.currentStep.trackList.pop();
+            self.updateStepScore();
+            self.refreshTrack();
+        }
+    });
+    this.stepBoard.find('.clear-current-track-button').click(this, function() {
+        if (self.currentStep != undefined) {
+            self.currentStep.currentScore = undefined;
+            self.currentStep.trackList = [];
+            self.updateStepScore();
+            self.refreshTrack();
+        }
+    });
+    this.stepBoard.find('.clear-all-track-button').click(this, function() {
+        if (self.stepList != undefined) {
+            for (var i = 0; i < self.stepList.length; i++) {
+                self.stepList[i].currentScore = undefined;
+                self.stepList[i].trackList = [];
+                self.updateStepScore(self.stepList[i]);
+            }
+            self.refreshTrack();
+        }
+    });
 
 }
 
 MarkBoard.prototype.initByTask = function(task) {
-	this.task = task;
-	this.stepList = task.markStepList;
-	this.currentStep = undefined;
-	this.stepCount = this.stepList != undefined ? this.stepList.length : 0;
-
-	task.totalScore = parseFloat(task.totalScore);
-	var markFinish = true;
-	var scoreList = task.scoreList != undefined && task.scoreList != '' ? task.scoreList.split(',') : [];
-	for(var j = 0; j < task.markStepList.length; j++) {
-		var step = task.markStepList[j];
-		step.scoreArray = [];
-		if(step.trackList == undefined) {
-			step.trackList = [];
-		}
-		if(scoreList != undefined && scoreList.length > j) {
-			step.markScore = parseFloat(scoreList[j]);
-			step.markFinish = true;
-		} else {
-			step.markFinish = false;
-			markFinish = false;
-		}
-	}
-	task.markFinish = task.totalScore != undefined && markFinish == true;
-
-	this.render(task);
-	this.refreshTrack();
-	if(this.stepCount > 0) {
-		this.onStepSelect(1);
-	}
+    this.task = task;
+    this.stepList = task.markStepList;
+    this.currentStep = undefined;
+    this.stepCount = this.stepList != undefined ? this.stepList.length : 0;
+
+    task.totalScore = parseFloat(task.totalScore);
+    var markFinish = true;
+    var scoreList = task.scoreList != undefined && task.scoreList != '' ? task.scoreList.split(',') : [];
+    for (var j = 0; j < task.markStepList.length; j++) {
+        var step = task.markStepList[j];
+        step.scoreArray = [];
+        if (step.trackList == undefined) {
+            step.trackList = [];
+        }
+        if (scoreList != undefined && scoreList.length > j) {
+            step.markScore = parseFloat(scoreList[j]);
+            step.markFinish = true;
+        } else {
+            step.markFinish = false;
+            markFinish = false;
+        }
+    }
+    task.markFinish = task.totalScore != undefined && markFinish == true;
+
+    this.render(task);
+    this.refreshTrack();
+    if (this.stepCount > 0) {
+        this.onStepSelect(1);
+    }
 }
 
 MarkBoard.prototype.render = function(task) {
-	if(task != undefined) {
-		var self = this;
-		this.stepBoard.stepContainer.empty();
-		this.stepBoard.scoreContainer.empty();
-		this.stepArray = [];
-
-		if(task.markFinish === true) {
-			this.stepBoard.find('#total-score').html(task.totalScore + '');
- 
-		} else {
-			this.stepBoard.find('#total-score').html('');
-		}
-
-		for( var i in task.markStepList) {
-			var step = task.markStepList[i];
-			// 初始化步骤列表
-			var dom = getDom(this.step_dom, this.markControl).appendTo(this.stepBoard.stepContainer);
-			dom.attr('data-number', step.number);
-			dom.find('p').html(step.title);
-			dom.find('p').attr('title',step.title);
-			dom.find('h2').html(step.markScore != undefined ? step.markScore : '');
-			dom.click(function() {
-				self.onStepSelect($(this).attr('data-number'));
-			});
-			this.stepArray.push(dom);
-			step.dom = dom;
-		}
-	} else {
-		this.stepBoard.stepContainer.empty();
-		this.stepBoard.scoreContainer.empty();
-		this.stepArray = [];
-		this.stepBoard.find('#total-score').html('');
+    if (task != undefined) {
+        var self = this;
+        this.stepBoard.stepContainer.empty();
+        this.stepBoard.scoreContainer.empty();
+        this.stepArray = [];
+
+        if (task.markFinish === true) {
+            this.stepBoard.find('#total-score').html(task.totalScore + '');
+
+        } else {
+            this.stepBoard.find('#total-score').html('');
+        }
+
+        for (var i in task.markStepList) {
+            var step = task.markStepList[i];
+            step.max = parseNumber(step.max);
+            step.min = parseNumber(step.min);
+            step.interval = parseNumber(step.interval);
+            step.score = parseNumber(step.score);
+            for (var j = 0; j < step.scoreList.length; j++) {
+                step.scoreList[j] = parseNumber(step.scoreList[j])
+            }
+            // 初始化步骤列表
+            var dom = getDom(this.step_dom, this.markControl).appendTo(this.stepBoard.stepContainer);
+            dom.attr('data-number', step.number);
+            dom.find('p').html(step.title);
+            dom.find('p').attr('title', step.title);
+            dom.find('h2').html(step.markScore != undefined ? step.markScore : '');
+            dom.click(function() {
+                self.onStepSelect($(this).attr('data-number'));
+            });
+            this.stepArray.push(dom);
+            step.dom = dom;
+        }
+    } else {
+        this.stepBoard.stepContainer.empty();
+        this.stepBoard.scoreContainer.empty();
+        this.stepArray = [];
+        this.stepBoard.find('#total-score').html('');
         this.stepBoard.find('#subject-score').html('');
         this.stepBoard.find('#ObjectiveAndSubjectScore').html('');
-	}
+    }
 }
 
 //切换步骤时,重置当前步骤的状态
 //若当前分数未提交,则还原之前已给的分数;若之前还未给分,则清空分数显示
 MarkBoard.prototype.resetCurrentStep = function() {
-  var step = this.currentStep;
-  if (step != undefined) {
-      if (step.markScore != undefined) {
-          step.markFinish = true;
-          step.score = new String(step.markScore);
-      } else {
-          step.markFinish = false;
-          step.score = '';
-      }
-      this.markControl.trigger('mark.score.change');
-  }
+    var step = this.currentStep;
+    if (step != undefined) {
+        if (step.markScore != undefined) {
+            step.markFinish = true;
+            step.score = new String(step.markScore);
+        } else {
+            step.markFinish = false;
+            step.score = '';
+        }
+        this.markControl.trigger('mark.score.change');
+    }
 }
 
 MarkBoard.prototype.onStepSelect = function(stepNumber) {
-	if(stepNumber <= this.stepCount && stepNumber > 0) {
-		var self = this;
-		// 还是点击当前步骤,不触发任何动作
-		if(this.currentStep != undefined && this.currentStep.number == stepNumber) {
-			return;
-		}
-
-		// 修改原step状态
-		if(this.currentStep != undefined) {
-			this.currentStep.dom.removeClass('selected');
-			this.currentStep.currentScore = undefined;
-			this.currentStep.scoreArray = [];
-		}
-
-		this.currentStep = this.stepList[stepNumber - 1];
-		this.currentStep.currentScore = undefined;
-		this.currentStep.scoreArray = [];
-		this.currentStep.dom.addClass('selected');
-
-		this.stepBoard.scoreContainer.empty();
-		for(var i = 0; i < this.currentStep.scoreList.length; i++) {
-			var score = this.currentStep.scoreList[i];
-			var dom2 = getDom(this.score_dom, this.markControl).appendTo(self.stepBoard.scoreContainer);
-			dom2.find('p').html(score);
-			dom2.attr('data-score', score);
-			dom2.attr('data-number', (i + 1));
-			this.currentStep.scoreArray.push(dom2);
-
-			if(this.currentStep.markScore != undefined && score > (this.currentStep.max - this.currentStep.markScore)) {
-				dom2.hide();
-			}
-
-			dom2.click(function() {
-				self.onScoreClick($(this).attr('data-number'));
-			});
-		}
-	}
+    if (stepNumber <= this.stepCount && stepNumber > 0) {
+        var self = this;
+        // 还是点击当前步骤,不触发任何动作
+        if (this.currentStep != undefined && this.currentStep.number == stepNumber) {
+            return;
+        }
+
+        // 修改原step状态
+        if (this.currentStep != undefined) {
+            this.currentStep.dom.removeClass('selected');
+            this.currentStep.currentScore = undefined;
+            this.currentStep.scoreArray = [];
+        }
+
+        this.currentStep = this.stepList[stepNumber - 1];
+        this.currentStep.currentScore = undefined;
+        this.currentStep.scoreArray = [];
+        this.currentStep.dom.addClass('selected');
+
+        this.stepBoard.scoreContainer.empty();
+        for (var i = 0; i < this.currentStep.scoreList.length; i++) {
+            var score = this.currentStep.scoreList[i];
+            var dom2 = getDom(this.score_dom, this.markControl).appendTo(self.stepBoard.scoreContainer);
+            dom2.find('p').html(score);
+            dom2.attr('data-score', score);
+            dom2.attr('data-number', (i + 1));
+            this.currentStep.scoreArray.push(dom2);
+
+            if (this.currentStep.markScore != undefined && score > (this.currentStep.max - this.currentStep.markScore)) {
+                dom2.hide();
+            }
+
+            dom2.click(function() {
+                self.onScoreClick($(this).attr('data-number'));
+            });
+        }
+    }
 }
 
 MarkBoard.prototype.onNumberInput = function(number) {
-	var self = this;
-	if(this.currentStep == undefined){
-		return;
-	}
-	if(this.numberInput == undefined){
-		this.numberInput = '0';
-	}
-	this.numberInput = this.numberInput + number;
-	if(this.timeoutId != undefined){
-		clearTimeout(this.timeoutId);
-	}
-	this.timeoutId = setTimeout(function(){
-		self.inputTimeout();
-	}, this.timeoutSecond * 1000);
+    var self = this;
+    if (this.currentStep == undefined) {
+        return;
+    }
+    if (this.numberInput == undefined) {
+        this.numberInput = '0';
+    }
+    this.numberInput = this.numberInput + number;
+    if (this.timeoutId != undefined) {
+        clearTimeout(this.timeoutId);
+    }
+    this.timeoutId = setTimeout(function() {
+        self.inputTimeout();
+    }, this.timeoutSecond * 1000);
 }
 
 MarkBoard.prototype.inputTimeout = function() {
-	if(this.currentStep!=undefined && this.numberInput!=undefined && this.numberInput.length>0){
-		if(this.numberInput.endWith('.')){
-			this.numberInput = this.numberInput + '5';
-		}
-		this.trySetScore(parseFloat(this.numberInput));
-	}
-	this.numberInput=undefined;
-	this.timeoutId=undefined;
+    if (this.currentStep != undefined && this.numberInput != undefined && this.numberInput.length > 0) {
+        if (this.numberInput.endWith('.')) {
+            this.numberInput = this.numberInput + '5';
+        }
+        this.trySetScore(parseFloat(this.numberInput));
+    }
+    this.numberInput = undefined;
+    this.timeoutId = undefined;
 }
 
 MarkBoard.prototype.onScoreClick = function(scoreNumber) {
-	if(this.task == undefined || this.currentStep == undefined) {
-		return;
-	}
-	for(var i = 0; i < this.currentStep.scoreArray.length; i++) {
-		var dom = this.currentStep.scoreArray[i];
-		if(scoreNumber == dom.attr('data-number')) {
-			if(dom.hasClass('selected')) {
-				dom.removeClass('selected');
-				this.currentStep.currentScore = undefined;
-			} else {
-				dom.addClass('selected');
-				this.currentStep.currentScore = parseFloat(dom.attr('data-score'));
-			}
-		} else {
-			dom.removeClass('selected');
-		}
-	}
+    if (this.task == undefined || this.currentStep == undefined) {
+        return;
+    }
+    for (var i = 0; i < this.currentStep.scoreArray.length; i++) {
+        var dom = this.currentStep.scoreArray[i];
+        if (scoreNumber == dom.attr('data-number')) {
+            if (dom.hasClass('selected')) {
+                dom.removeClass('selected');
+                this.currentStep.currentScore = undefined;
+            } else {
+                dom.addClass('selected');
+                this.currentStep.currentScore = parseFloat(dom.attr('data-score'));
+            }
+        } else {
+            dom.removeClass('selected');
+        }
+    }
 }
 
 MarkBoard.prototype.trySetScore = function(score) {
-	var scoreNumber = undefined;
-	if(this.currentStep != undefined && score != undefined) {
-		for(var i = 0; i < this.currentStep.scoreArray.length; i++) {
-			var dom = this.currentStep.scoreArray[i];
-			if(!dom.is(':hidden') && parseFloat(dom.attr('data-score'))==score){
-				scoreNumber = dom.attr('data-number');
-				dom.removeClass('selected');
-			}
-		}
-	}
-	if(scoreNumber!=undefined){
-		this.onScoreClick(scoreNumber);
-	}
+    var scoreNumber = undefined;
+    if (this.currentStep != undefined && score != undefined) {
+        for (var i = 0; i < this.currentStep.scoreArray.length; i++) {
+            var dom = this.currentStep.scoreArray[i];
+            if (!dom.is(':hidden') && parseFloat(dom.attr('data-score')) == score) {
+                scoreNumber = dom.attr('data-number');
+                dom.removeClass('selected');
+            }
+        }
+    }
+    if (scoreNumber != undefined) {
+        this.onScoreClick(scoreNumber);
+    }
 }
 
 MarkBoard.prototype.resetScore = function() {
-	if(this.currentStep != undefined) {
-		for(var i = 0; i < this.currentStep.scoreArray.length; i++) {
-			this.currentStep.scoreArray[i].removeClass('selected');
-		}
-		this.currentStep.currentScore = undefined;
-	}
+    if (this.currentStep != undefined) {
+        for (var i = 0; i < this.currentStep.scoreArray.length; i++) {
+            this.currentStep.scoreArray[i].removeClass('selected');
+        }
+        this.currentStep.currentScore = undefined;
+    }
 }
 
 MarkBoard.prototype.refreshTrack = function() {
-	if(this.stepList == undefined) {
-		return;
-	}
-	this.markControl.trigger('mark.tag.clear');
+    if (this.stepList == undefined) {
+        return;
+    }
+    this.markControl.trigger('mark.tag.clear');
 }
 
 MarkBoard.prototype.updateStepScore = function(step) {
-	if(step == undefined) {
-		step = this.currentStep;
-	}
-	if(step == undefined) {
-		return;
-	}
-	var totalScore = undefined;
-	for(var i = 0; i < step.trackList.length; i++) {
-		if(totalScore == undefined) {
-			totalScore = 0;
-		}
-		totalScore += parseFloat(step.trackList[i].score);
-	}
-	var leftScore = totalScore != undefined ? (step.max - totalScore) : step.max;
-	for(var i = 0; i < step.scoreArray.length; i++) {
-		var dom = step.scoreArray[i];
-		dom.removeClass('selected');
-		if(parseFloat(dom.attr('data-score')) > leftScore) {
-			dom.hide();
-		} else {
-			dom.show();
-			if(step.currentScore!=undefined && step.currentScore==parseFloat(dom.attr('data-score'))){
-				dom.addClass('selected');
-			}
-		}
-	}
-	if(totalScore != undefined) {
-		step.markFinish = true;
-		step.markScore = totalScore;
-		step.dom.find('h2').html(this.currentStep.markScore);
-	} else {
-		step.markFinish = false;
-		step.markScore = undefined;
-		step.dom.find('h2').html('');
-	}
-	this.updateTotalScore();
+    if (step == undefined) {
+        step = this.currentStep;
+    }
+    if (step == undefined) {
+        return;
+    }
+    var totalScore = undefined;
+    for (var i = 0; i < step.trackList.length; i++) {
+        if (totalScore == undefined) {
+            totalScore = 0;
+        }
+        totalScore += parseFloat(step.trackList[i].score);
+    }
+    var leftScore = totalScore != undefined ? (step.max - totalScore) : step.max;
+    for (var i = 0; i < step.scoreArray.length; i++) {
+        var dom = step.scoreArray[i];
+        dom.removeClass('selected');
+        if (parseFloat(dom.attr('data-score')) > leftScore) {
+            dom.hide();
+        } else {
+            dom.show();
+            if (step.currentScore != undefined && step.currentScore == parseFloat(dom.attr('data-score'))) {
+                dom.addClass('selected');
+            }
+        }
+    }
+    if (totalScore != undefined) {
+        step.markFinish = true;
+        step.markScore = totalScore;
+        step.dom.find('h2').html(this.currentStep.markScore);
+    } else {
+        step.markFinish = false;
+        step.markScore = undefined;
+        step.dom.find('h2').html('');
+    }
+    this.updateTotalScore();
 }
 
 MarkBoard.prototype.updateTotalScore = function() {
-	if(this.task != undefined) {
-		var totalScore = '';
-		var finish = true;
-		for(var i = 0; i < this.stepList.length; i++) {
-			if(this.stepList[i].markScore != undefined) {
-				if(totalScore == '') {
-					totalScore = 0;
-				}
-				totalScore += this.stepList[i].markScore;
-			} else {
-				finish = false;
-			}
-		}
-		this.task.totalScore = totalScore;
-		this.task.markFinish = finish;
-		this.stepBoard.find('#total-score').html(totalScore);
-		
-	}
+    if (this.task != undefined) {
+        var totalScore = '';
+        var finish = true;
+        for (var i = 0; i < this.stepList.length; i++) {
+            if (this.stepList[i].markScore != undefined) {
+                if (totalScore == '') {
+                    totalScore = 0;
+                }
+                totalScore += this.stepList[i].markScore;
+            } else {
+                finish = false;
+            }
+        }
+        this.task.totalScore = totalScore;
+        this.task.markFinish = finish;
+        this.stepBoard.find('#total-score').html(totalScore);
+
+    }
 }
 
 MarkBoard.prototype.allZeroSubmit = function() {
-	if(this.task != undefined && this.stepList != undefined && this.stepList.length > 0 && confirm('确认要提交全零分吗?')) {
-		for(var i = 0; i < this.stepList.length; i++) {
-			this.stepList[i].markFinish = true;
-			this.stepList[i].markScore = 0;
-			this.stepList[i].trackList = [];
-			this.stepList[i].trackList.push({
-			    questionNumber: this.stepList[i].questionNumber,
-			    number: 1,
-			    score: 0,
-			    positionX: 0,
-			    positionY: 0
-			});
-		}
-		for (var i in this.task.markStepList) {
-        	this.task.markStepList[i].markScore = 0;
-        	this.task.markStepList[i].trackList = [];
+    if (this.task != undefined && this.stepList != undefined && this.stepList.length > 0 && confirm('确认要提交全零分吗?')) {
+        for (var i = 0; i < this.stepList.length; i++) {
+            this.stepList[i].markFinish = true;
+            this.stepList[i].markScore = 0;
+            this.stepList[i].trackList = [];
+            this.stepList[i].trackList.push({
+                questionNumber: this.stepList[i].questionNumber,
+                number: 1,
+                score: 0,
+                positionX: 0,
+                positionY: 0
+            });
         }
-		this.onTaskSubmit();
-	}
+        for (var i in this.task.markStepList) {
+            this.task.markStepList[i].markScore = 0;
+            this.task.markStepList[i].trackList = [];
+        }
+        this.onTaskSubmit();
+    }
 }
 
 MarkBoard.prototype.onTaskSubmit = function() {
-	if(this.task == undefined) {
-		return;
-	}
-	var totalScore = 0;
-	var scoreList = [];
-	var trackList = [];
-	var finish = true;
-	for( var i in this.stepList) {
-		var score = this.stepList[i].markScore;
-		var tracks = this.stepList[i].trackList;
-		if(score != undefined) {
-			totalScore = totalScore + score;
-			scoreList.push(score);
-		} else {
-			finish = false;
-		}
-		if(tracks != undefined) {
-			trackList = trackList.concat(tracks);
-		}
-	}
-	if(!finish) {
-		alert('当前任务还有未给分的题,请继续给分');
-	} else if(!this.needConfirm || confirm('总分为' + totalScore + ', 确认要提交吗?')) {
-		this.task.totalScore = totalScore;
-		this.task.scoreList = scoreList.join(',');
-		this.task.trackList = trackList;
-		this.markControl.submitTask();
-	}
+    if (this.task == undefined) {
+        return;
+    }
+    var totalScore = 0;
+    var scoreList = [];
+    var trackList = [];
+    var finish = true;
+    for (var i in this.stepList) {
+        var score = this.stepList[i].markScore;
+        var tracks = this.stepList[i].trackList;
+        if (score != undefined) {
+            totalScore = numberAdd(totalScore, score);
+            scoreList.push(score);
+        } else {
+            finish = false;
+        }
+        if (tracks != undefined) {
+            trackList = trackList.concat(tracks);
+        }
+    }
+    if (!finish) {
+        alert('当前任务还有未给分的题,请继续给分');
+    } else if (!this.needConfirm || confirm('总分为' + totalScore + ', 确认要提交吗?')) {
+        this.task.totalScore = totalScore;
+        this.task.scoreList = scoreList.join(',');
+        this.task.trackList = trackList;
+        this.markControl.submitTask();
+    }
 }
 
 MarkBoard.prototype.onFocusChange = function() {
-	this.currentStep = null;
+    this.currentStep = null;
 }
 
 MarkBoard.prototype.step_board_dom = '<div class="span3 mark-steps"><div class="step-board">\
-	<div class="sublist"><p class="fraction">总分 <i id="total-score">5</i></p></div>\
+    <div class="sublist"><p class="fraction">总分 <i id="total-score">5</i></p></div>\
 <div class="button">\
 <input type="submit" value="全零分" class="btn1 all-zero-button"/>\
 <input type="submit" value="提&nbsp;交" class="btn2 task-submit-button"/></div>\