|
@@ -62,7 +62,7 @@
|
|
|
<!-- 非综合题-->
|
|
|
<div v-if="item.type != 'compose'" style="display:flex;width:100%;padding-top:15px;" :class="['not-compose-box', activeIndex == getScoreIndex(typeIndex,index) ? 'active-qu-wrap' : '']" :id="'qustion'+ getScoreIndex(typeIndex,index)" @click="activeIndex = getScoreIndex(typeIndex,index)">
|
|
|
<div class="scoring-input-box" @click.stop v-if="studentAnswer.scores && studentAnswer.scores.length">
|
|
|
- <InputNumber v-model="studentAnswer.scores[item.index]" size="small" :formatter="value => value < 0 ? '' : `${value}${$t('learnActivity.score.scoreUnit')}`" :parser="value => value.replace($t('learnActivity.score.scoreUnit'), '')" :min="0" :max="item.score" :placeholder="$t('learnActivity.score.zeroScore1')" class="score-input" />
|
|
|
+ <InputNumber @on-change="setUpdStatus" v-model="studentAnswer.scores[item.index]" size="small" :formatter="value => value < 0 ? '' : `${value}${$t('learnActivity.score.scoreUnit')}`" :parser="value => value.replace($t('learnActivity.score.scoreUnit'), '')" :min="0" :max="item.score" :placeholder="$t('learnActivity.score.zeroScore1')" class="score-input" />
|
|
|
<!-- 快速打分 满分 零分 -->
|
|
|
<div style="display:flex;justify-content: space-evenly;margin-top:5px;">
|
|
|
<span class="fast-score-tag" :title="$t('learnActivity.score.fullScore')" @click="fastSetScore(item.index,item.score)">
|
|
@@ -189,7 +189,7 @@
|
|
|
</div>
|
|
|
<div :class="['child-item', activeIndex == getScoreIndex(typeIndex,index,childIndex) ? 'active-qu-wrap' : '']" v-for="(childItem,childIndex) in item.children" :key="childIndex" style="padding-top:15px;" :id="'qustion'+getScoreIndex(typeIndex,index,childIndex)" @click="activeIndex = getScoreIndex(typeIndex,index,childIndex)">
|
|
|
<div class="scoring-input-box" @click.stop v-if="studentAnswer.scores && studentAnswer.scores.length">
|
|
|
- <InputNumber v-model="studentAnswer.scores[childItem.index]" size="small" :formatter="value => value < 0 ? '' : `${value}${$t('learnActivity.score.scoreUnit')}`" :parser="value => value.replace($t('learnActivity.score.scoreUnit'), '')" :min="0" :max="childItem.score" :placeholder="$t('learnActivity.score.zeroScore1')" class="score-input" />
|
|
|
+ <InputNumber @on-change="setUpdStatus" v-model="studentAnswer.scores[childItem.index]" size="small" :formatter="value => value < 0 ? '' : `${value}${$t('learnActivity.score.scoreUnit')}`" :parser="value => value.replace($t('learnActivity.score.scoreUnit'), '')" :min="0" :max="childItem.score" :placeholder="$t('learnActivity.score.zeroScore1')" class="score-input" />
|
|
|
<!-- 快速打分 满分 零分 -->
|
|
|
<div style="display:flex;justify-content: space-evenly;margin-top:5px;">
|
|
|
<span class="fast-score-tag" :title="$t('learnActivity.score.fullScore')" @click="fastSetScore(childItem.index,childItem.score)">
|
|
@@ -353,7 +353,7 @@ export default {
|
|
|
type: Object,
|
|
|
default: () => { }
|
|
|
},
|
|
|
- studentAnswer: {
|
|
|
+ pStudentAnswer: {
|
|
|
type: Object,
|
|
|
default: () => { }
|
|
|
},
|
|
@@ -364,6 +364,8 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ isUpd: false,
|
|
|
+ studentAnswer: {},
|
|
|
viewIndex: 0,
|
|
|
viewStatus: false,
|
|
|
isDefOrder: false, //是否默认排序 默认/题型
|
|
@@ -389,6 +391,9 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ setUpdStatus() {
|
|
|
+ this.isUpd = true
|
|
|
+ },
|
|
|
markByQu() {
|
|
|
this.$emit('toggleMarkType', 'byQu')
|
|
|
},
|
|
@@ -574,11 +579,13 @@ export default {
|
|
|
//快速打分
|
|
|
fastSetScore(index, score) {
|
|
|
this.$set(this.studentAnswer.scores, index, score)
|
|
|
+ this.setUpdStatus()
|
|
|
},
|
|
|
// 加分
|
|
|
scoreUp(index, totalScore) {
|
|
|
if (this.studentAnswer.scores[index] < totalScore) {
|
|
|
this.$set(this.studentAnswer.scores, index, ++this.studentAnswer.scores[index])
|
|
|
+ this.setUpdStatus()
|
|
|
} else {
|
|
|
this.$Message.warning(this.$t('learnActivity.score.isFullTips'))
|
|
|
}
|
|
@@ -587,6 +594,7 @@ export default {
|
|
|
scoreDown(index) {
|
|
|
if (this.studentAnswer.scores[index] > 0) {
|
|
|
this.$set(this.studentAnswer.scores, index, --this.studentAnswer.scores[index])
|
|
|
+ this.setUpdStatus()
|
|
|
} else {
|
|
|
this.$Message.warning(this.$t('learnActivity.score.isZeroTips'))
|
|
|
}
|
|
@@ -607,6 +615,8 @@ export default {
|
|
|
this.$api.learnActivity.UpsertAllRecord(requestData).then(res => {
|
|
|
if (res.error == null) {
|
|
|
this.$Message.success(this.$t('learnActivity.score.saveScoreOk'))
|
|
|
+ this.isUpd = false
|
|
|
+ this.$emit('updScore', this.studentAnswer)
|
|
|
if (!this.studentAnswer.scores.includes(-1)) {
|
|
|
this.isComplete = true
|
|
|
}
|
|
@@ -714,10 +724,12 @@ export default {
|
|
|
},
|
|
|
deep: true
|
|
|
},
|
|
|
- studentAnswer: {
|
|
|
+ pStudentAnswer: {
|
|
|
async handler(newValue, oldValue) {
|
|
|
- if (!this.studentAnswer.status) {
|
|
|
- if (newValue.answers.length) {
|
|
|
+ this.studentAnswer = this._.cloneDeep(newValue || {})
|
|
|
+ console.log(this.studentAnswer)
|
|
|
+ if (!this.studentAnswer.status && this.studentAnswer.answers && this.studentAnswer.scores) {
|
|
|
+ if (this.studentAnswer.answers.length) {
|
|
|
try {
|
|
|
let sas = this.examScope == 'school' ? this.$store.state.user.schoolProfile.blob_sas : this.$store.state.user.userProfile.blob_sas
|
|
|
let blobUrl = this.examScope == 'school' ? JSON.parse(decodeURIComponent(localStorage.school_profile, "utf-8")).blob_uri : JSON.parse(decodeURIComponent(localStorage.user_profile, "utf-8")).blob_uri
|
|
@@ -727,7 +739,7 @@ export default {
|
|
|
* 2、这里就直接读取原始作答数据;
|
|
|
* 3、在渲染的时候再判断当前题目是否有批注数据。
|
|
|
*/
|
|
|
- a = await this.$tools.getFile(`${blobUrl}/exam/${newValue.answers[0]}?${sas}`)
|
|
|
+ a = await this.$tools.getFile(`${blobUrl}/exam/${this.studentAnswer.answers[0]}?${sas}`)
|
|
|
|
|
|
if (a) {
|
|
|
let ans = JSON.parse(a)
|
|
@@ -742,7 +754,7 @@ export default {
|
|
|
console.log('error', e)
|
|
|
}
|
|
|
} else {
|
|
|
- let a = newValue.scores.map(item => {
|
|
|
+ let a = this.studentAnswer.scores.map(item => {
|
|
|
return [this.$t('learnActivity.score.noStuAns1')]
|
|
|
})
|
|
|
this.$set(this.studentAnswer, 'answers', a)
|
|
@@ -754,7 +766,8 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
- deep: true
|
|
|
+ deep: true,
|
|
|
+ immediate: true
|
|
|
}
|
|
|
},
|
|
|
computed: {
|