|
@@ -23,6 +23,9 @@ function MarkBoard(option) {
|
|
this.markControl.on('task.load.finish', this, function(event, context, eventObject) {
|
|
this.markControl.on('task.load.finish', this, function(event, context, eventObject) {
|
|
this.initByTask(context.task);
|
|
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('mark.step.change', this, this.onStepSelect);
|
|
this.markControl.on('key.press', this, function(e, context, event) {
|
|
this.markControl.on('key.press', this, function(e, context, event) {
|
|
var code = event.keyCode;
|
|
var code = event.keyCode;
|
|
@@ -41,22 +44,6 @@ function MarkBoard(option) {
|
|
this.onDecimalInput();
|
|
this.onDecimalInput();
|
|
event.preventDefault();
|
|
event.preventDefault();
|
|
return false;
|
|
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) {
|
|
} else if (code == 13 || code == 108) {
|
|
//回车键
|
|
//回车键
|
|
if (this.currentStep.markFinish === true && this.task.markFinish === true) {
|
|
if (this.currentStep.markFinish === true && this.task.markFinish === true) {
|
|
@@ -86,12 +73,28 @@ function MarkBoard(option) {
|
|
} else if (code == 80 && this.enableSkip) {
|
|
} else if (code == 80 && this.enableSkip) {
|
|
//P键,跳过当前任务
|
|
//P键,跳过当前任务
|
|
this.markControl.trigger('task.pass.success');
|
|
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) {
|
|
this.markControl.on('key.up', this, function(e, context, event) {
|
|
var code = event.keyCode;
|
|
var code = event.keyCode;
|
|
- //console.log('key down:' + code);
|
|
|
|
|
|
+ //console.log('key up:' + code);
|
|
if (this.currentStep != undefined && this.task != undefined) {
|
|
if (this.currentStep != undefined && this.task != undefined) {
|
|
if (code == 32) {
|
|
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">\
|
|
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>\
|
|
<a href="#" class="header" id="show-score-board-button"><< 鼠标给分</a>\
|
|
<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>\
|