|
@@ -59,25 +59,33 @@
|
|
|
<div v-if="item.type != 'compose'" style="display:flex;width:100%;" class="not-compose-box" :id="'qustion'+ getScoreIndex(typeIndex,index)">
|
|
|
<div class="scoring-input-box" @click.stop v-if="studentAnswer.scores && studentAnswer.scores.length">
|
|
|
<InputNumber v-model="studentAnswer.scores[getScoreIndex(typeIndex,index)]" size="small" :formatter="value => value < 0 ? '' : `${value}分`" :parser="value => value.replace('分', '')" :min="0" :max="item.score" placeholder="0分" class="score-input" />
|
|
|
+ <!-- 快速打分 满分 零分 -->
|
|
|
<div style="display:flex;justify-content: space-evenly;margin-top:5px;">
|
|
|
<span class="fast-score-tag" title="满分" @click="fastSetScore((typeIndex + index),item.score)">
|
|
|
<!-- 题目分数 -->{{item.score}}
|
|
|
</span>
|
|
|
- <span class="fast-score-tag" title="零分" @click="fastSetScore((typeIndex + index),0)">
|
|
|
+ <span class="fast-score-tag" title="零分" @click="fastSetScore((typeIndex + index),0)" style="background:#ed4014">
|
|
|
0
|
|
|
</span>
|
|
|
</div>
|
|
|
- <div style="display:flex;justify-content: space-evenly;margin-top:5px;" v-show="showQu">
|
|
|
+ <!-- 加分 减分 -->
|
|
|
+ <div style="display:flex;justify-content: space-evenly;margin-top:5px;">
|
|
|
+ <span class="fast-score-tag" @click="scoreUp((typeIndex + index),item.score)">
|
|
|
+ <Icon type="md-add" />
|
|
|
+ </span>
|
|
|
+ <span class="fast-score-tag" @click="scoreDown(typeIndex + index)" style="background:#ed4014">
|
|
|
+ <Icon type="md-remove" />
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ <!-- 滚动上下题目去掉 -->
|
|
|
+ <!-- <div style="display:flex;justify-content: space-evenly;margin-top:5px;display:none;" v-show="showQu">
|
|
|
<span class="fast-score-tag" title="上一题" :style="{'background':'#aeaeae','cursor':(typeIndex + index) == 0 ? 'not-allowed':''}" @click="goToQuestion(getQuIndex(typeIndex,index) - 1)">
|
|
|
- <!-- 上一题-->
|
|
|
<Icon type="md-arrow-round-back" />
|
|
|
</span>
|
|
|
<span class="fast-score-tag" title="下一题" :style="{'background':'#aeaeae','cursor':(typeIndex + index + 1) == studentAnswer.scores.legnth ? 'not-allowed':''}" @click="goToQuestion(getQuIndex(typeIndex,index) + 1)">
|
|
|
- <!-- 下一题 -->
|
|
|
<Icon type="md-arrow-round-forward" />
|
|
|
</span>
|
|
|
- </div>
|
|
|
- <!-- <p>{{getScoreIndex(typeIndex,index)}}</p> -->
|
|
|
+ </div> -->
|
|
|
</div>
|
|
|
<div class="qu-info-box">
|
|
|
<!-- 题干部分 -->
|
|
@@ -184,6 +192,7 @@
|
|
|
<div class="child-item" v-for="(childItem,childIndex) in item.children" :key="childIndex" :id="'qustion'+getScoreIndex(typeIndex,index,childIndex)">
|
|
|
<div class="scoring-input-box" @click.stop v-if="item.type == 'compose' && studentAnswer.scores && studentAnswer.scores.length">
|
|
|
<InputNumber v-model="studentAnswer.scores[getScoreIndex(typeIndex,index,childIndex)]" size="small" :formatter="value => value < 0 ? '' : `${value}分`" :parser="value => value.replace('分', '')" :min="0" :max="childItem.score" placeholder="0分" class="score-input" />
|
|
|
+ <!-- 快速打分 满分 零分 -->
|
|
|
<div style="display:flex;justify-content: space-evenly;margin-top:5px;">
|
|
|
<span class="fast-score-tag" title="满分" @click="fastSetScore((typeIndex + index + childIndex),childItem.score)">
|
|
|
<!-- 题目分数 -->{{childItem.score}}
|
|
@@ -192,17 +201,24 @@
|
|
|
0
|
|
|
</span>
|
|
|
</div>
|
|
|
- <div style="display:flex;justify-content: space-evenly;margin-top:5px;" v-show="showQu">
|
|
|
+ <!-- 加分 减分 -->
|
|
|
+ <div style="display:flex;justify-content: space-evenly;margin-top:5px;">
|
|
|
+ <span class="fast-score-tag" @click="scoreUp((typeIndex + index + childIndex),item.score)">
|
|
|
+ <Icon type="md-add" />
|
|
|
+ </span>
|
|
|
+ <span class="fast-score-tag" @click="scoreDown(typeIndex + index + childIndex)" style="background:#ed4014">
|
|
|
+ <Icon type="md-remove" />
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ <!-- 滚动上下题目去掉 -->
|
|
|
+ <!-- <div style="display:flex;justify-content: space-evenly;margin-top:5px;display:none;" v-show="showQu">
|
|
|
<span class="fast-score-tag" title="上一题" :style="{'background':'#aeaeae','cursor':(typeIndex + index + childIndex) == 0 ? 'not-allowed':''}" @click="goToQuestion((getQuIndex(typeIndex,index) + childIndex) - 1)">
|
|
|
- <!-- 上一题-->
|
|
|
<Icon type="md-arrow-round-back" />
|
|
|
</span>
|
|
|
<span class="fast-score-tag" title="下一题" :style="{'background':'#aeaeae','cursor':(typeIndex + index + childIndex + 1) == studentAnswer.scores.length ? 'not-allowed':''}" @click="goToQuestion((getQuIndex(typeIndex,index) + childIndex) + 1)">
|
|
|
- <!-- 下一题 -->
|
|
|
<Icon type="md-arrow-round-forward" />
|
|
|
</span>
|
|
|
- </div>
|
|
|
- <!-- <p>{{getScoreIndex(typeIndex,index,childIndex)}}</p> -->
|
|
|
+ </div> -->
|
|
|
</div>
|
|
|
<div class="qu-info-box">
|
|
|
<div class="child-item-question" v-show="showQu">
|
|
@@ -316,6 +332,11 @@ export default {
|
|
|
default: '',
|
|
|
required: true
|
|
|
},
|
|
|
+ subjectId: {
|
|
|
+ type: String,
|
|
|
+ default: '',
|
|
|
+ required: true
|
|
|
+ },
|
|
|
paper: {
|
|
|
type: Object,
|
|
|
default: () => { }
|
|
@@ -343,16 +364,16 @@ export default {
|
|
|
complete: '填空题',
|
|
|
subjective: '问答题',
|
|
|
compose: '综合题',
|
|
|
- correct:'改错题',
|
|
|
- connector:'连线题'
|
|
|
+ correct: '改错题',
|
|
|
+ connector: '连线题'
|
|
|
},
|
|
|
collapseList: [],
|
|
|
groupList: [],
|
|
|
- typeList: ['single', 'multiple', 'judge', 'complete', 'subjective', 'connector', 'correct','compose'],
|
|
|
+ typeList: ['single', 'multiple', 'judge', 'complete', 'subjective', 'connector', 'correct', 'compose'],
|
|
|
showAnswer: false,
|
|
|
showQu: false,
|
|
|
- showOption: false
|
|
|
-
|
|
|
+ showOption: false,
|
|
|
+ scope: ''
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -406,6 +427,22 @@ export default {
|
|
|
fastSetScore(index, score) {
|
|
|
this.$set(this.studentAnswer.scores, index, score)
|
|
|
},
|
|
|
+ // 加分
|
|
|
+ scoreUp(index, totalScore) {
|
|
|
+ if (this.studentAnswer.scores[index] < totalScore) {
|
|
|
+ this.$set(this.studentAnswer.scores, index, ++this.studentAnswer.scores[index])
|
|
|
+ } else {
|
|
|
+ this.$Message.warning('已经是小题满分了')
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 减分
|
|
|
+ scoreDown(index) {
|
|
|
+ if (this.studentAnswer.scores[index] > 0) {
|
|
|
+ this.$set(this.studentAnswer.scores, index, --this.studentAnswer.scores[index])
|
|
|
+ } else {
|
|
|
+ this.$Message.warning('已经是零分了')
|
|
|
+ }
|
|
|
+ },
|
|
|
// 批注学生作答数据
|
|
|
markStuAnswer(index) {
|
|
|
this.$Message.warning('暂未处理批注功能!')
|
|
@@ -430,7 +467,7 @@ export default {
|
|
|
context.lineTo(150, 150); //下一点坐标
|
|
|
context.stroke();
|
|
|
},
|
|
|
- //保存学生作答信息
|
|
|
+ //保存学生分数
|
|
|
saveScore() {
|
|
|
let requestData = {
|
|
|
"id": this.examId,
|
|
@@ -439,7 +476,7 @@ export default {
|
|
|
"studentId": this.studentAnswer.id,
|
|
|
"classId": this.studentAnswer.classId,
|
|
|
"school": this.paperInfo.code,
|
|
|
- "subjectId": this.paperInfo.subjectId
|
|
|
+ "subjectId": this.subjectId
|
|
|
}
|
|
|
this.$api.learnActivity.UpsertAllRecord(requestData).then(res => {
|
|
|
if (res.error == null) {
|
|
@@ -499,6 +536,7 @@ export default {
|
|
|
watch: {
|
|
|
paper: {
|
|
|
handler(newValue, oldValue) {
|
|
|
+ console.log('newValue', newValue)
|
|
|
this.paperInfo = newValue
|
|
|
},
|
|
|
deep: true
|
|
@@ -544,7 +582,9 @@ export default {
|
|
|
if (!this.studentAnswer.status) {
|
|
|
if (newValue.answers.length) {
|
|
|
try {
|
|
|
- let a = await this.$tools.getFile(newValue.answers[0] + this.$store.state.schoolSas.sas)
|
|
|
+ console.log(this.scope)
|
|
|
+ let sas = this.scope == 'school' ? this.$store.state.user.schoolProfile.blob_sas : this.$store.state.user.userProfile.blob_sas
|
|
|
+ let a = await this.$tools.getFile(newValue.answers[0] + '?' + sas)
|
|
|
console.log('a', JSON.parse(a))
|
|
|
if (a) {
|
|
|
this.$set(this.studentAnswer, 'answers', JSON.parse(a))
|
|
@@ -583,6 +623,14 @@ export default {
|
|
|
return 0
|
|
|
}
|
|
|
},
|
|
|
+ created() {
|
|
|
+ console.log('router', this.$route)
|
|
|
+ if (this.$route.name == 'privateEvaluation') {
|
|
|
+ this.scope = 'private'
|
|
|
+ } else {
|
|
|
+ this.scope = 'school'
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
</script>
|
|
|
|