|
|
@ -643,6 +643,7 @@ export default { |
|
|
|
let briefCount = selected.filter(n => n.name == '简答题').length |
|
|
|
let briefCount = selected.filter(n => n.name == '简答题').length |
|
|
|
|
|
|
|
|
|
|
|
if(this.id && this.isFirstSubmitMana){ |
|
|
|
if(this.id && this.isFirstSubmitMana){ |
|
|
|
|
|
|
|
// 计算每种题型的数量 |
|
|
|
this.singleCount = Number(this.singleCount) + singleCount |
|
|
|
this.singleCount = Number(this.singleCount) + singleCount |
|
|
|
this.multipleCount = Number(this.multipleCount) + multipleCount |
|
|
|
this.multipleCount = Number(this.multipleCount) + multipleCount |
|
|
|
this.fillBlankCount = Number(this.fillBlankCount) + fillBlankCount |
|
|
|
this.fillBlankCount = Number(this.fillBlankCount) + fillBlankCount |
|
|
@ -751,6 +752,7 @@ export default { |
|
|
|
let invalid = false |
|
|
|
let invalid = false |
|
|
|
let everyUnchecked = true |
|
|
|
let everyUnchecked = true |
|
|
|
let everyIsZero = true |
|
|
|
let everyIsZero = true |
|
|
|
|
|
|
|
// 检测每种题型输入的数量是否都是0,必须要有至少一种题型的数量大于0 |
|
|
|
for(let i in this.countCheck){ |
|
|
|
for(let i in this.countCheck){ |
|
|
|
if(this.countCheck[i]){ |
|
|
|
if(this.countCheck[i]){ |
|
|
|
everyUnchecked = false |
|
|
|
everyUnchecked = false |
|
|
@ -758,12 +760,6 @@ export default { |
|
|
|
if(this[`countNumberInput${index}`]){ |
|
|
|
if(this[`countNumberInput${index}`]){ |
|
|
|
everyIsZero = false |
|
|
|
everyIsZero = false |
|
|
|
invalid = true |
|
|
|
invalid = true |
|
|
|
// if(this[`countNumberInput${index}`] < this.pointRules[index-1]){ |
|
|
|
|
|
|
|
// invalid = true |
|
|
|
|
|
|
|
// }else if(this[`countNumberInput${index}`] > this.pointRules[index-1]){ |
|
|
|
|
|
|
|
// util.errorMsg('题目数量不能大于可选题数') |
|
|
|
|
|
|
|
// return false |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}else{ |
|
|
|
}else{ |
|
|
|
invalid = true |
|
|
|
invalid = true |
|
|
@ -777,8 +773,8 @@ export default { |
|
|
|
let index = i.replace('countCheck','') |
|
|
|
let index = i.replace('countCheck','') |
|
|
|
if(this.countCheck[i]) totalCount += this[`countNumberInput${index}`] |
|
|
|
if(this.countCheck[i]) totalCount += this[`countNumberInput${index}`] |
|
|
|
} |
|
|
|
} |
|
|
|
let remainder = 100 % totalCount |
|
|
|
let remainder = 100 % totalCount // 计算余数 |
|
|
|
let avgPoint = 100 / totalCount |
|
|
|
let avgPoint = 100 / totalCount // 计算平均给每个题型分配的分数 |
|
|
|
if(remainder) avgPoint = (100 - remainder) / totalCount |
|
|
|
if(remainder) avgPoint = (100 - remainder) / totalCount |
|
|
|
this.singleCount = '' |
|
|
|
this.singleCount = '' |
|
|
|
this.multipleCount = '' |
|
|
|
this.multipleCount = '' |
|
|
@ -831,10 +827,11 @@ export default { |
|
|
|
return false |
|
|
|
return false |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if(remainder){ |
|
|
|
if(remainder){// 如果有余数,就是未满100分 |
|
|
|
let remainScore = 0 |
|
|
|
let remainScore = 0 |
|
|
|
let remainPlusAvg = remainder + avgPoint |
|
|
|
let remainPlusAvg = remainder + avgPoint |
|
|
|
let invalid = false |
|
|
|
let invalid = false |
|
|
|
|
|
|
|
// 把多余的分数分配给剩余题型 |
|
|
|
if(this.typeValid(5)){ |
|
|
|
if(this.typeValid(5)){ |
|
|
|
remainScore = this.briefCount * avgPoint + remainder |
|
|
|
remainScore = this.briefCount * avgPoint + remainder |
|
|
|
if(remainScore % this.briefCount){ |
|
|
|
if(remainScore % this.briefCount){ |
|
|
|