1
0
Эх сурвалжийг харах

解决回评焦点切换问题

ting.yin 6 жил өмнө
parent
commit
4dfa635058

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

@@ -146,7 +146,7 @@
 				<th>已评数量</th>
 				<th>正在评卷</th>
 				<th>任务数</th>
-				<th>班级数量</th>
+				<th>绑定班级</th>
 				<th>操作</th>
 			</tr>
 		</thead>

+ 2 - 0
stmms-web/src/main/webapp/static/mark-new/js/mark-control.js

@@ -188,6 +188,8 @@ MarkControl.prototype.initTriggers = function(option) {
         	context.task.spent = new Date().getTime();
         }
     });
+    this.on('mark.focus.change', this, function(event, context, eventObject) {
+    });
     this.on('task.get.finish', this, function(event, context, eventObject) {
         context.prefetchCallback = undefined;
     });

+ 24 - 17
stmms-web/src/main/webapp/static/mark-new/js/modules/mark-board.js

@@ -23,6 +23,9 @@ function MarkBoard(option) {
     this.markControl.on('task.load.finish', this, function(event, context, eventObject) {
         this.initByTask(context.task);
     });
+    this.markControl.on('mark.focus.change', this, function(event, context, eventObject) {
+    	this.onFocusChange();
+    });
     this.markControl.on('mark.step.change', this, this.onStepSelect);
     this.markControl.on('key.press', this, function(e, context, event) {
         var code = event.keyCode;
@@ -41,22 +44,6 @@ function MarkBoard(option) {
                 this.onDecimalInput();
                 event.preventDefault();
                 return false;
-            } else if (code == 45) {
-                //-按键,切换到上一个步骤
-                if (this.currentStep.number > 1) {
-                    this.resetCurrentStep();
-                    this.markControl.trigger('mark.step.change', this.currentStep.number - 1);
-                    event.preventDefault();
-                    return false;
-                }
-            } else if (code == 61 || code == 43) {
-                //+按键,切换到下一个步骤
-                if (this.currentStep.number < this.stepCount && this.currentStep.markScore != undefined) {
-                    this.resetCurrentStep();
-                    this.markControl.trigger('mark.step.change', this.currentStep.number + 1);
-                    event.preventDefault();
-                    return false;
-                }
             } else if (code == 13 || code == 108) {
                 //回车键
                 if (this.currentStep.markFinish === true && this.task.markFinish === true) {
@@ -86,12 +73,28 @@ function MarkBoard(option) {
             } else if (code == 80 && this.enableSkip) {
                 //P键,跳过当前任务
                 this.markControl.trigger('task.pass.success');
+            }else if (code == 37) {
+                //←按键,切换到上一个步骤
+                if (this.currentStep.number > 1) {
+                    this.resetCurrentStep();
+                    this.markControl.trigger('mark.step.change', this.currentStep.number - 1);
+                    event.preventDefault();
+                    return false;
+                }
+            } else if (code == 39) {
+                //→按键,切换到下一个步骤
+                if (this.currentStep.number < this.stepCount && this.currentStep.markScore != undefined) {
+                    this.resetCurrentStep();
+                    this.markControl.trigger('mark.step.change', this.currentStep.number + 1);
+                    event.preventDefault();
+                    return false;
+                }
             }
         }
     });
     this.markControl.on('key.up', this, function(e, context, event) {
         var code = event.keyCode;
-        //console.log('key down:' + code);
+        //console.log('key up:' + code);
         if (this.currentStep != undefined && this.task != undefined) {
             if (code == 32) {
                 //空格键提交步骤分
@@ -643,6 +646,10 @@ MarkBoard.prototype.togglePopover = function(show, text, baseDom) {
     }
 }
 
+MarkBoard.prototype.onFocusChange = function() {
+	this.currentStep = null;
+}
+
 MarkBoard.prototype.step_board_dom = '<div class="span2 mark-steps" style="display:none"><div class="step-board">\
 <a href="#" class="header" id="show-score-board-button"><< 鼠标给分</a>\
 <div class="sublist"><p class="fraction">总分 <i id="total-score">5</i></p><div>\

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

@@ -150,6 +150,11 @@ MarkHistory.prototype.init = function() {
     });
     
     self.updateSort(self.order,self.sort);
+    self.updateLoading();
+    
+    this.container.find('#studentId-in').click(this, function(event) {
+    	self.markControl.trigger('mark.focus.change');
+    });
 }
 MarkHistory.prototype.orderSearch = function(order) {
 	this.order = order;
@@ -201,6 +206,13 @@ MarkHistory.prototype.updatePage = function() {
 //    }
     
 }
+MarkHistory.prototype.updateLoading = function() {
+    if (this.loading) {
+        this.container.find('#history-loading').show();
+    }else{
+    	this.container.find('#history-loading').hide();
+    }
+}
 
 MarkHistory.prototype.updateSort = function(order,sort) {
 	this.container.find('#time-sort').removeClass();
@@ -273,14 +285,14 @@ MarkHistory.prototype.paginator_dom = '<div class="c-page">\
 
 MarkHistory.prototype.history_search_dom = '<div class="c-scbar cl">\
 <table id="history-search" cellpadding="0" cellspacing="0" width="100%">\
-<tr><td class="sc"><span><input type="text" placeholder="查找试卷" id="studentId-in"maxlength="10"/><em id="studentId-search"></em></span></td>\
-<td width="70px"><input type="checkbox" id="history-isTag"><em>标记卷</em></td></tr></table></div>';
+<tr><td class="sc"><span><input type="text" placeholder="查找试卷" id="studentId-in" maxlength="10"/><em id="studentId-search"></em></span></td>\
+</tr></table></div>';
 
 MarkHistory.prototype.history_list_dom = '<div class="sublist"><div class="c-table">\
 <table class="table table-hover" cellpadding="0" cellspacing="0" width="100%">\
 <thead><tr><th id="studentId-sort-th">编号<em class="up" id="studentId-sort"></th>\
 <th id="time-sort-th">时间<em class="up" id="time-sort"></em></th><th id="score-sort-th">总分<em class="up" id="score-sort"></th></tr></thead>\
-<tbody class="loding" style="display:none;"><tr><td colspan="3"><div><img src="{staticServer}/mark-new/images/loding.gif"/></div><p>正在加载请稍候</p></td></tr></tbody>\
+<tbody class="loding" id="history-loading"><tr><td colspan="3"><div><img src="{staticServer}/mark-new/images/loding.gif"/></div><p>正在加载请稍候</p></td></tr></tbody>\
 <tbody id="history-list"></tbody></table></div></div>';
 
 MarkHistory.prototype.history_row_dom = '<tr><td class="history-secret-number"></td>\

+ 2 - 0
stmms-web/src/main/webapp/static/mark-track/js/mark-control.js

@@ -190,6 +190,8 @@ MarkControl.prototype.initTriggers = function(option) {
         	context.task.spent = new Date().getTime();
         }
     });
+    this.on('mark.focus.change', this, function(event, context, eventObject) {
+    });
     this.on('task.get.finish', this, function(event, context, eventObject) {
         context.prefetchCallback = undefined;
     });

+ 24 - 9
stmms-web/src/main/webapp/static/mark-track/js/modules/mark-board.js

@@ -22,6 +22,9 @@ function MarkBoard(option) {
 	this.markControl.on('task.load.finish', this, function(event, context, eventObject) {
 		this.initByTask(context.task);
 	});
+    this.markControl.on('mark.focus.change', this, function(event, context, eventObject) {
+    	this.onFocusChange();
+    });
 	this.markControl.on('special.tag.enable', this, function(event, context, eventObject) {
 		this.specialTag=true;
 	});
@@ -72,20 +75,28 @@ function MarkBoard(option) {
                 this.onNumberInput(code - 96);
                 event.preventDefault();
                 return false;
-//            } else if (code == 46 || code == 110 || code == 190) {
-//                //小数点
-//                this.onNumberInput('.');
-//                event.preventDefault();
-//                return false;
-            } else if (code == 44) {
-                //<按键,切换到上一个步骤
+            } else if (code == 46 || code == 110 || code == 190) {
+                //小数点
+                this.onNumberInput('.');
+                event.preventDefault();
+                return false;
+            }
+        }
+    });
+	this.markControl.on('key.down', this, function(e, context, event) {
+        var code = event.keyCode;
+        //console.log('key down:' + code);
+        var self = this;
+        if (this.currentStep != undefined && this.task != undefined) {
+        	if (code == 37) {
+                //← 按键,切换到上一个步骤
                 if (this.currentStep.number > 1) {
                 	self.onStepSelect(this.currentStep.number - 1);
                     event.preventDefault();
                     return false;
                 }
-            } else if (code == 46) {
-                //>按键,切换到下一个步骤
+            } else if (code == 39) {
+                //按键,切换到下一个步骤
                 if (this.currentStep.number < this.stepCount && this.currentStep.markScore != undefined) {
                 	self.onStepSelect(this.currentStep.number + 1);
                     event.preventDefault();
@@ -461,6 +472,10 @@ MarkBoard.prototype.onTaskSubmit = function() {
 	}
 }
 
+MarkBoard.prototype.onFocusChange = function() {
+	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="button">\