|
@@ -95,7 +95,7 @@
|
|
|
<span>{{ resultItem.markItem.maxScore }}分</span>
|
|
|
</div>
|
|
|
<div class="pull-left item-number3">
|
|
|
- 间隔:{{ resultItem.markItem.scoreInterval }}
|
|
|
+ 间隔:{{ itemScoreStep(resultItem.markItem.scoreInterval) }}
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="item-score">
|
|
@@ -259,7 +259,8 @@ export default {
|
|
|
"markTaskId",
|
|
|
"resultItems",
|
|
|
"markedResult",
|
|
|
- "paperMark"
|
|
|
+ "paperMark",
|
|
|
+ "scoreStep"
|
|
|
],
|
|
|
methods: {
|
|
|
...mapActions([USER_SIGNOUT]),
|
|
@@ -367,7 +368,6 @@ export default {
|
|
|
checkScore(resultItem) {
|
|
|
var score = resultItem.score + "";
|
|
|
var maxScore = resultItem.markItem.maxScore + "";
|
|
|
- var scoreInterval = resultItem.markItem.scoreInterval + "";
|
|
|
if (score.trim().length === 0) {
|
|
|
this.$notify({
|
|
|
message: "分数不能为空",
|
|
@@ -376,10 +376,10 @@ export default {
|
|
|
});
|
|
|
return false;
|
|
|
} else {
|
|
|
- let regex = scoreInterval == 1 ? "^\\d+$" : "^\\d+(\\.[5])?$";
|
|
|
+ let regex = "^\\d+(\\.[\\d])?$";
|
|
|
if (!score.match(regex)) {
|
|
|
this.$notify({
|
|
|
- message: "分数必须为数字,且格式要正确(包括间隔分)",
|
|
|
+ message: "分数必须为数字",
|
|
|
type: "error",
|
|
|
duration: 1000
|
|
|
});
|
|
@@ -539,10 +539,8 @@ export default {
|
|
|
if (document.getElementById("remark")) {
|
|
|
remarkValue = document.getElementById("remark").value;
|
|
|
}
|
|
|
- console.log("remarkValue: " + remarkValue);
|
|
|
if (!this.markedResult.id) {
|
|
|
//正常提交情况
|
|
|
- console.log("提交resultItems", this.resultItems);
|
|
|
this.$httpWithMsg
|
|
|
.post(
|
|
|
MARKING_API +
|
|
@@ -559,7 +557,6 @@ export default {
|
|
|
.then(
|
|
|
response => {
|
|
|
this.saveMarkSign();
|
|
|
- console.log(response);
|
|
|
if (response.data.id) {
|
|
|
this.$notify({
|
|
|
message: "提交成功",
|
|
@@ -580,7 +577,6 @@ export default {
|
|
|
},
|
|
|
error => {
|
|
|
// 响应错误回调
|
|
|
- console.log(error);
|
|
|
if (error.response.data.desc) {
|
|
|
var errorInfo = error.response.data.desc;
|
|
|
if (errorInfo.includes("超时")) {
|
|
@@ -592,7 +588,6 @@ export default {
|
|
|
{
|
|
|
confirmButtonText: "确定",
|
|
|
callback: () => {
|
|
|
- console.log("sessionStorage", sessionStorage);
|
|
|
this.$http
|
|
|
.post(CORE_API + "/auth/logout")
|
|
|
.then(() => {
|
|
@@ -647,15 +642,13 @@ export default {
|
|
|
}
|
|
|
);
|
|
|
} else {
|
|
|
- console.log("markedResult", this.markedResult);
|
|
|
this.markedResult.resultItems = this.resultItems;
|
|
|
this.markedResult.remark = remarkValue;
|
|
|
this.$httpWithMsg
|
|
|
.put(MARKING_API + "/markResults", this.markedResult)
|
|
|
.then(
|
|
|
- response => {
|
|
|
+ () => {
|
|
|
this.saveMarkSign();
|
|
|
- console.log(response);
|
|
|
this.$notify({
|
|
|
message: "提交成功",
|
|
|
type: "success"
|
|
@@ -701,6 +694,27 @@ export default {
|
|
|
} else {
|
|
|
this.textareaflag = true;
|
|
|
}
|
|
|
+ },
|
|
|
+ accAdd(num1, num2) {
|
|
|
+ let sq1, sq2, m;
|
|
|
+ try {
|
|
|
+ sq1 = num1.toString().split(".")[1].length;
|
|
|
+ } catch (e) {
|
|
|
+ sq1 = 0;
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ sq2 = num2.toString().split(".")[1].length;
|
|
|
+ } catch (e) {
|
|
|
+ sq2 = 0;
|
|
|
+ }
|
|
|
+ m = Math.pow(10, Math.max(sq1, sq2));
|
|
|
+ return (num1 * m + num2 * m) / m;
|
|
|
+ },
|
|
|
+ itemScoreStep(scoreInterval) {
|
|
|
+ if (this.scoreStep != null) {
|
|
|
+ return this.scoreStep;
|
|
|
+ }
|
|
|
+ return scoreInterval;
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
@@ -774,12 +788,20 @@ export default {
|
|
|
itemScores() {
|
|
|
var itemScores = [];
|
|
|
var scoreInterval = this.resultItem.markItem.scoreInterval;
|
|
|
- for (
|
|
|
- let i = 0, j = 0;
|
|
|
- i <= this.resultItem.markItem.maxScore;
|
|
|
- i += scoreInterval, j++
|
|
|
- ) {
|
|
|
+ if (this.scoreStep != null) {
|
|
|
+ scoreInterval = this.scoreStep;
|
|
|
+ }
|
|
|
+ let i = 0;
|
|
|
+ let j = 0;
|
|
|
+ do {
|
|
|
itemScores[j] = i;
|
|
|
+ i = this.accAdd(i, scoreInterval);
|
|
|
+ j++;
|
|
|
+ } while (i <= this.resultItem.markItem.maxScore);
|
|
|
+ if (
|
|
|
+ itemScores[itemScores.length - 1] < this.resultItem.markItem.maxScore
|
|
|
+ ) {
|
|
|
+ itemScores[itemScores.length] = this.resultItem.markItem.maxScore;
|
|
|
}
|
|
|
return itemScores;
|
|
|
},
|