|
@@ -27,17 +27,22 @@
|
|
|
<Icon :type="showQu ? 'md-eye-off':'md-eye'" />
|
|
|
{{ showQu ? $t('learnActivity.score.hideQu') : $t('learnActivity.score.showQu')}}
|
|
|
</span>
|
|
|
+ <!-- <span class="base-info-btn" @click="isDefOrder = !isDefOrder">
|
|
|
+ <Icon :type="isDefOrder ? 'md-reorder':'ios-keypad'" />
|
|
|
+ {{isDefOrder ? '默认顺序' : '题型排序'}}
|
|
|
+ </span> -->
|
|
|
</div>
|
|
|
+ <!-- 题号 -->
|
|
|
<div class="question-index-box" v-if="studentAnswer.scores">
|
|
|
<div class="base-info-item" style="white-space: nowrap;">{{$t('learnActivity.score.quIndex')}}</div>
|
|
|
<div>
|
|
|
<span v-for="(typeItem,typeIndex) in groupList" :key="typeIndex">
|
|
|
<span v-for="(item,index) in typeItem.list" :key="index">
|
|
|
- <span @click="goToQuestion(getScoreIndex(typeIndex,index))" :class="studentAnswer.scores[getScoreIndex(typeIndex,index)] >= 0 ? 'qu-order-tag':'qu-order-tag-def'" v-if="typeItem.type !== 'compose'">
|
|
|
+ <span @click="goToQuestion(getScoreIndex(typeIndex,index))" :class="studentAnswer.scores[item.index] >= 0 ? 'qu-order-tag':'qu-order-tag-def'" v-if="typeItem.type !== 'compose'">
|
|
|
{{getQuIndex(typeIndex,index)}}
|
|
|
</span>
|
|
|
<span v-else>
|
|
|
- <span @click="goToQuestion(getScoreIndex(typeIndex,index,childIndex))" v-for="(childItem,childIndex) in item.children" :key="childIndex" :class="studentAnswer.scores[getScoreIndex(typeIndex,index,childIndex)] >= 0 ? 'qu-order-tag':'qu-order-tag-def'">
|
|
|
+ <span @click="goToQuestion(getScoreIndex(typeIndex,index,childIndex))" v-for="(childItem,childIndex) in item.children" :key="childIndex" :class="studentAnswer.scores[childItem.index] >= 0 ? 'qu-order-tag':'qu-order-tag-def'">
|
|
|
{{getQuIndex(typeIndex,index) + '-' + (childIndex + 1)}}
|
|
|
</span>
|
|
|
</span>
|
|
@@ -58,7 +63,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[getScoreIndex(typeIndex,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 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((getScoreIndex(typeIndex,index)),item.score)">
|
|
@@ -89,7 +94,7 @@
|
|
|
</div>
|
|
|
<div class="qu-info-box">
|
|
|
<!-- 题干部分 -->
|
|
|
- <div class="item-question" v-show="showQu">
|
|
|
+ <div class="item-question item-question-flex" v-show="showQu">
|
|
|
<div class="item-question-order">{{ getQuIndex(typeIndex,index) }} .</div>
|
|
|
<div class="item-question-text" v-html="item.question"></div>
|
|
|
</div>
|
|
@@ -111,19 +116,21 @@
|
|
|
<!--学生作答答案显示区域-->
|
|
|
<div class="stu-answer-box item-explain-details" v-if="studentAnswer.answers && studentAnswer.answers.length">
|
|
|
<!-- 批注 主观题才会有批注功能 -->
|
|
|
- <div class="mark-btn-box" @click="markStuAnswer(getScoreIndex(typeIndex,index))" v-if="item.type !== 'single' && item.type !== 'multiple' && item.type !== 'judge'">
|
|
|
+ <div class="mark-btn-box" @click="markStuAnswer(item.index)" v-if="item.type !== 'single' && item.type !== 'multiple' && item.type !== 'judge'">
|
|
|
<Icon type="md-create" />
|
|
|
<span style="margin-left:5px;">{{$t('learnActivity.score.mark')}}</span>
|
|
|
</div>
|
|
|
<!--多选题答案-->
|
|
|
<div v-if="item.type === 'multiple'" :id="'answer'+ getScoreIndex(typeIndex,index)">
|
|
|
- <span v-for="(answerItem,answerIndex) in studentAnswer.answers[getScoreIndex(typeIndex,index)]" :key="'an'+ (answerIndex+index)" v-html="answerItem" style="display:inline;">
|
|
|
+ <!-- <span v-for="(answerItem,answerIndex) in studentAnswer.answers[getScoreIndex(typeIndex,index)]" :key="'an'+ (answerIndex+index)" v-html="answerItem" style="display:inline;">
|
|
|
+ </span> -->
|
|
|
+ <span v-for="(answerItem,answerIndex) in studentAnswer.answers[item.index]" :key="'an'+ (answerIndex+index)" v-html="answerItem" style="display:inline;">
|
|
|
</span>
|
|
|
</div>
|
|
|
<!--其余题型答案-->
|
|
|
- <div v-else-if="studentAnswer.answers[getScoreIndex(typeIndex,index)]" :id="'answer'+ getScoreIndex(typeIndex,index)">
|
|
|
+ <div v-else-if="studentAnswer.answers[item.index]" :id="'answer'+ getScoreIndex(typeIndex,index)">
|
|
|
<div>
|
|
|
- <span v-html="studentAnswer.answers[getScoreIndex(typeIndex,index)].toString()"></span>
|
|
|
+ <span v-html="studentAnswer.answers[item.index].toString()"></span>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -176,13 +183,13 @@
|
|
|
</div>
|
|
|
<!-- 综合题 -->
|
|
|
<div v-else style="width:100%;" class="compose-box">
|
|
|
- <div class="item-question" style="margin-left:90px; margin-bottom:10px;" v-show="showQu">
|
|
|
- <div class="item-question-order">{{ getQuIndex(typeIndex,index)}} .</div>
|
|
|
+ <div class="item-question item-question-flex" style="margin-left:90px; margin-top:20px;" v-show="showQu">
|
|
|
+ <div class="item-question-order">{{ getQuIndex(typeIndex,index)}}.</div>
|
|
|
<div class="item-question-text" v-html="item.question"></div>
|
|
|
</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[getScoreIndex(typeIndex,index,childIndex)]" 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 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((getScoreIndex(typeIndex,index,childIndex)),childItem.score)">
|
|
@@ -212,7 +219,7 @@
|
|
|
</div> -->
|
|
|
</div>
|
|
|
<div class="qu-info-box">
|
|
|
- <div class="child-item-question" v-show="showQu">
|
|
|
+ <div class="child-item-question child-item-question-flex" v-show="showQu">
|
|
|
<span class="child-item-question-order">{{$t('learnActivity.score.sQuLabel1')}}{{ childIndex + 1 }}{{$t('learnActivity.score.sQuLabel2')}}</span>
|
|
|
<p class="child-item-question-content" v-html="childItem.question"></p>
|
|
|
</div>
|
|
@@ -234,18 +241,18 @@
|
|
|
<!--学生作答答案显示区域-->
|
|
|
<div class="stu-answer-box item-explain-details" v-if="studentAnswer.answers && studentAnswer.answers.length">
|
|
|
<!-- 批注 主观题才会有批注功能 -->
|
|
|
- <div class="mark-btn-box" @click="markStuAnswer(getScoreIndex(typeIndex,index,childIndex))" v-if="childItem.type !== 'single' && childItem.type !== 'multiple' && childItem.type !== 'judge'">
|
|
|
+ <div class="mark-btn-box" @click="markStuAnswer(childItem.index)" v-if="childItem.type !== 'single' && childItem.type !== 'multiple' && childItem.type !== 'judge'">
|
|
|
<Icon type="md-create" />
|
|
|
<span style="margin-left:5px;">{{$t('learnActivity.score.mark')}}</span>
|
|
|
</div>
|
|
|
<!--多选题答案-->
|
|
|
<div v-if="childItem.type === 'multiple'" :id="'answer'+ getScoreIndex(typeIndex,index,childIndex)">
|
|
|
- <span v-for="(answerItem,answerIndex) in studentAnswer.answers[getScoreIndex(typeIndex,index,childIndex)]" :key="'an'+ (index+answerIndex+childIndex)" v-html="answerItem" style="display:inline-block;"></span>
|
|
|
+ <span v-for="(answerItem,answerIndex) in studentAnswer.answers[childItem.index]" :key="'an'+ (index+answerIndex+childIndex)" v-html="answerItem" style="display:inline-block;"></span>
|
|
|
</div>
|
|
|
<!--其余题型答案-->
|
|
|
- <div v-else-if="studentAnswer.answers[getScoreIndex(typeIndex,index,childIndex)]" :id="'answer'+ getScoreIndex(typeIndex,index,childIndex)">
|
|
|
+ <div v-else-if="studentAnswer.answers[childItem.index]" :id="'answer'+ getScoreIndex(typeIndex,index,childIndex)">
|
|
|
<div>
|
|
|
- <span v-html="studentAnswer.answers[getScoreIndex(typeIndex,index,childIndex)].toString()"></span><br />
|
|
|
+ <span v-html="studentAnswer.answers[childItem.index].toString()"></span><br />
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -343,6 +350,7 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ isDefOrder:false, //是否默认排序 默认/题型
|
|
|
activeIndex: 0,
|
|
|
curAnIndex: -1,
|
|
|
markStatus: false,
|
|
@@ -584,13 +592,25 @@ export default {
|
|
|
},
|
|
|
paperInfo: {
|
|
|
handler(newPaper) {
|
|
|
+ console.log('试卷数据',newPaper)
|
|
|
if (newPaper && newPaper.item) {
|
|
|
this.dataLoading = true
|
|
|
let that = this
|
|
|
this.groupList = []
|
|
|
this.exerciseList = []
|
|
|
if (newPaper.item.length) {
|
|
|
- newPaper.item.forEach(i => {
|
|
|
+ let index = 0
|
|
|
+ newPaper.item.forEach((i) => {
|
|
|
+ //记录题目原始位置
|
|
|
+ if(i.type == 'compose'){
|
|
|
+ i.children.forEach((cItem)=>{
|
|
|
+ cItem.index = index
|
|
|
+ index++
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ i.index = index
|
|
|
+ index++
|
|
|
+ }
|
|
|
if (!i.score) i.score = 0
|
|
|
})
|
|
|
/* 处理试卷内题目按照题型排序 */
|
|
@@ -605,7 +625,8 @@ export default {
|
|
|
that.exerciseList = that.exerciseList.concat(value)
|
|
|
}
|
|
|
})
|
|
|
- });
|
|
|
+ })
|
|
|
+ console.log('题型顺序',this.groupList)
|
|
|
}
|
|
|
this.dataLoading = false
|
|
|
}
|