|
@@ -61,7 +61,8 @@ function MarkBoard(option) {
|
|
});
|
|
});
|
|
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;
|
|
- //console.log('key press:' + code);
|
|
|
|
|
|
+// console.log('key press:' + code);
|
|
|
|
+ var self = this;
|
|
if (this.currentStep != undefined && this.task != undefined) {
|
|
if (this.currentStep != undefined && this.task != undefined) {
|
|
if (code >= 48 && code <= 57) {
|
|
if (code >= 48 && code <= 57) {
|
|
this.onNumberInput(code - 48);
|
|
this.onNumberInput(code - 48);
|
|
@@ -71,12 +72,26 @@ function MarkBoard(option) {
|
|
this.onNumberInput(code - 96);
|
|
this.onNumberInput(code - 96);
|
|
event.preventDefault();
|
|
event.preventDefault();
|
|
return false;
|
|
return false;
|
|
- } else if (code == 46 || code == 110 || code == 190) {
|
|
|
|
- //小数点
|
|
|
|
- this.onNumberInput('.');
|
|
|
|
- event.preventDefault();
|
|
|
|
- return false;
|
|
|
|
- }
|
|
|
|
|
|
+// } else if (code == 46 || code == 110 || code == 190) {
|
|
|
|
+// //小数点
|
|
|
|
+// this.onNumberInput('.');
|
|
|
|
+// event.preventDefault();
|
|
|
|
+// return false;
|
|
|
|
+ } else if (code == 44) {
|
|
|
|
+ //<按键,切换到上一个步骤
|
|
|
|
+ if (this.currentStep.number > 1) {
|
|
|
|
+ self.onStepSelect(this.currentStep.number - 1);
|
|
|
|
+ event.preventDefault();
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ } else if (code == 46) {
|
|
|
|
+ //>按键,切换到下一个步骤
|
|
|
|
+ if (this.currentStep.number < this.stepCount && this.currentStep.markScore != undefined) {
|
|
|
|
+ self.onStepSelect(this.currentStep.number + 1);
|
|
|
|
+ event.preventDefault();
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|
|
@@ -201,6 +216,22 @@ MarkBoard.prototype.render = function(task) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+//切换步骤时,重置当前步骤的状态
|
|
|
|
+//若当前分数未提交,则还原之前已给的分数;若之前还未给分,则清空分数显示
|
|
|
|
+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');
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
MarkBoard.prototype.onStepSelect = function(stepNumber) {
|
|
MarkBoard.prototype.onStepSelect = function(stepNumber) {
|
|
if(stepNumber <= this.stepCount && stepNumber > 0) {
|
|
if(stepNumber <= this.stepCount && stepNumber > 0) {
|
|
var self = this;
|
|
var self = this;
|