|
@@ -5,22 +5,22 @@
|
|
<img src="../../../assets/icon/no_data.svg" width="120" />
|
|
<img src="../../../assets/icon/no_data.svg" width="120" />
|
|
<span style="margin-top:15px;color:#808080">暂无数据</span>
|
|
<span style="margin-top:15px;color:#808080">暂无数据</span>
|
|
</div>
|
|
</div>
|
|
- <div class="content-wrap" v-else>
|
|
|
|
|
|
+ <div class="content-wrap" ref="mathJaxContainer" v-else>
|
|
<Loading :top="200" v-show="dataLoading" type="1"></Loading>
|
|
<Loading :top="200" v-show="dataLoading" type="1"></Loading>
|
|
<div class="list-view" :key="typeIndex" v-for="(typeItem,typeIndex) in listData">
|
|
<div class="list-view" :key="typeIndex" v-for="(typeItem,typeIndex) in listData">
|
|
<p v-show="viewModel === 'type' && typeItem.list.length" class="type-name">{{ numberConvertToUppercase(getLatestTypeIndex(typeItem.type) + 1) }}
|
|
<p v-show="viewModel === 'type' && typeItem.list.length" class="type-name">{{ numberConvertToUppercase(getLatestTypeIndex(typeItem.type) + 1) }}
|
|
: {{ exersicesType[typeItem.type] }}
|
|
: {{ exersicesType[typeItem.type] }}
|
|
- ({{ typeItem.score }} 分) </p>
|
|
|
|
|
|
+ ({{ typeItem.score || 0 }} 分) </p>
|
|
|
|
|
|
- <div class="exercise-item" v-for="(item,index) of typeItem.list" :key="index" @click="onQuestionToggle(exerciseList.indexOf(item),item.id,$event,typeItem.list)"
|
|
|
|
|
|
+ <div class="exercise-item" v-for="(item,index) of typeItem.list" :key="index"
|
|
@mouseenter="exerciseMouseover($event)" @mouseleave="exerciseMouseleave($event)">
|
|
@mouseenter="exerciseMouseover($event)" @mouseleave="exerciseMouseleave($event)">
|
|
|
|
|
|
<!-- 工具栏部分 -->
|
|
<!-- 工具栏部分 -->
|
|
<div class="item-tools-wrap">
|
|
<div class="item-tools-wrap">
|
|
- <div class="item-tools-t flex-row-center" v-show="isShowTools" @click.stop="handleSetScore(item,exerciseList.indexOf(item),typeItem.list,index)">
|
|
|
|
- <Icon type="ios-list-box-outline" />配分</div>
|
|
|
|
- <div class="item-tools-t flex-row-center" v-show="isShowTools" @click.stop="handleToolEdit(typeItem.list,item,index)">
|
|
|
|
- <Icon type="ios-brush-outline" />编辑</div>
|
|
|
|
|
|
+ <!-- <div class="item-tools-t flex-row-center" v-show="isShowTools" @click.stop="handleSetScore(item,exerciseList.indexOf(item),typeItem.list,index)">
|
|
|
|
+ <Icon type="ios-list-box-outline" />配分</div> -->
|
|
|
|
+ <!-- <div class="item-tools-t flex-row-center" v-show="isShowTools" @click.stop="handleToolEdit(typeItem.list,item,index)">
|
|
|
|
+ <Icon type="ios-brush-outline" />编辑</div> -->
|
|
<div class="item-tools-t flex-row-center" v-show="isShowTools" @click.stop="handleDelete(typeItem.list,item,index)">
|
|
<div class="item-tools-t flex-row-center" v-show="isShowTools" @click.stop="handleDelete(typeItem.list,item,index)">
|
|
<Icon type="ios-archive-outline" />删除</div>
|
|
<Icon type="ios-archive-outline" />删除</div>
|
|
<div class="item-tools-t flex-row-center" v-show="index != 0 && isShowTools" @click.stop="handleMoveUp(typeItem.list,index)">
|
|
<div class="item-tools-t flex-row-center" v-show="index != 0 && isShowTools" @click.stop="handleMoveUp(typeItem.list,index)">
|
|
@@ -29,49 +29,56 @@
|
|
@click.stop="handleMoveDown(typeItem.list,index)">
|
|
@click.stop="handleMoveDown(typeItem.list,index)">
|
|
<Icon type="md-arrow-down" />下移</div>
|
|
<Icon type="md-arrow-down" />下移</div>
|
|
</div>
|
|
</div>
|
|
- <!-- 题干部分 -->
|
|
|
|
- <div class="item-question">
|
|
|
|
- <div v-if="viewModel === 'list'">
|
|
|
|
- <div class="item-question-order">{{ index + 1 }} : </div>
|
|
|
|
- <div class="item-question-text" v-html="item.question"></div>
|
|
|
|
|
|
+ <div @click="onQuestionToggle(exerciseList.indexOf(item),item.id,$event,typeItem.list)">
|
|
|
|
+ <!-- 题干部分 -->
|
|
|
|
+ <div class="item-question">
|
|
|
|
+ <div v-if="viewModel === 'list'">
|
|
|
|
+ <div class="item-question-order">{{ index + 1 }} : </div>
|
|
|
|
+ <div class="item-question-text" v-html="item.question"></div>
|
|
|
|
+ </div>
|
|
|
|
+ <div v-else>
|
|
|
|
+ <div class="item-question-order">{{ pageSize * (pageNum - 1) + index + 1 }} : </div>
|
|
|
|
+ <div class="item-question-text" v-html="item.question" @click="onRichTextClick($event)"></div>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
- <div v-else>
|
|
|
|
- <div class="item-question-order">{{ pageSize * (pageNum - 1) + index + 1 }} : </div>
|
|
|
|
- <div class="item-question-text" v-html="item.question" @click="onRichTextClick($event)"></div>
|
|
|
|
|
|
+ <!-- 选项部分 -->
|
|
|
|
+ <div v-for="(option,optionIndex) in item.option" :key="optionIndex" class="item-options">
|
|
|
|
+ <div class="item-option-content">
|
|
|
|
+ <div class="item-option-order">{{String.fromCharCode(64 + parseInt(optionIndex+1))}} :</div>
|
|
|
|
+ <div class="item-option-text" v-html="option.value" @click="onRichTextClick($event)"></div>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
- <span class="item-btn-toggle">
|
|
|
|
- <span class="item-score">{{ item.score }} 分</span>
|
|
|
|
- <Icon :type="collapseList.indexOf(index) > -1 ? 'ios-arrow-dropup' : 'ios-arrow-dropdown'" />
|
|
|
|
- </span>
|
|
|
|
</div>
|
|
</div>
|
|
- <!-- 选项部分 -->
|
|
|
|
- <div v-for="(option,optionIndex) in item.option" :key="optionIndex" class="item-options">
|
|
|
|
- <div class="item-option-content">
|
|
|
|
- <div class="item-option-order">{{String.fromCharCode(64 + parseInt(optionIndex+1))}} :</div>
|
|
|
|
- <div class="item-option-text" v-html="option.value" @click="onRichTextClick($event)"></div>
|
|
|
|
- </div>
|
|
|
|
|
|
+ <div class="item-btn-toggle" @click.stop>
|
|
|
|
+ <template>
|
|
|
|
+ <InputNumber :max="item.score + surPlusScore" :min="0" v-model="item.score" style="display: inline-block ;width: 60px;margin-right: 10px;height: 30px;"
|
|
|
|
+ @click.stop></InputNumber>
|
|
|
|
+ <span style="margin-right: 20px;">分</span>
|
|
|
|
+ <!-- <span class="item-score" title="设置题目分数" @click.stop="onSetSingleItem(item,index)" v-else>{{ item.score }} 分</span> -->
|
|
|
|
+ </template>
|
|
|
|
+ <Icon :type="collapseList.indexOf(index) > -1 ? 'ios-arrow-dropup' : 'ios-arrow-dropdown'" />
|
|
</div>
|
|
</div>
|
|
<!-- 答案以及解析 -->
|
|
<!-- 答案以及解析 -->
|
|
<transition name="slide">
|
|
<transition name="slide">
|
|
<!-- <div v-show="collapseList.indexOf(exerciseList.indexOf(item)) > -1" class="toggle-area"> -->
|
|
<!-- <div v-show="collapseList.indexOf(exerciseList.indexOf(item)) > -1" class="toggle-area"> -->
|
|
<div v-show="collapseList.indexOf(exerciseList.indexOf(item)) > -1" class="toggle-area">
|
|
<div v-show="collapseList.indexOf(exerciseList.indexOf(item)) > -1" class="toggle-area">
|
|
- <div v-if="item.type !== 'Compose'">
|
|
|
|
|
|
+ <div v-if="item.type !== 'compose'">
|
|
<!-- 答案展示部分 -->
|
|
<!-- 答案展示部分 -->
|
|
<div class="item-explain" v-show="isShowAnswer">
|
|
<div class="item-explain" v-show="isShowAnswer">
|
|
<span class="explain-title">【答ㅤ案】</span>
|
|
<span class="explain-title">【答ㅤ案】</span>
|
|
<div class="item-explain-details" @click="onRichTextClick($event)">
|
|
<div class="item-explain-details" @click="onRichTextClick($event)">
|
|
<!-- 问答题答案 -->
|
|
<!-- 问答题答案 -->
|
|
- <div v-if="item.type === 'Subjective'">
|
|
|
|
|
|
+ <div v-if="item.type === 'subjective'">
|
|
<span v-for="(answer,index) in item.answer" :key="index" v-html="item.answer.length ? answer : '未设置答案'"></span>
|
|
<span v-for="(answer,index) in item.answer" :key="index" v-html="item.answer.length ? answer : '未设置答案'"></span>
|
|
</div>
|
|
</div>
|
|
<!-- 填空题答案 -->
|
|
<!-- 填空题答案 -->
|
|
- <div v-else-if="item.type === 'Complete'">
|
|
|
|
- <span :class="[ item.type === 'Complete' ? 'item-answer-item':'']" v-for="(answer,index) in item.answer"
|
|
|
|
|
|
+ <div v-else-if="item.type === 'complete'">
|
|
|
|
+ <span :class="[ item.type === 'complete' ? 'item-answer-item':'']" v-for="(answer,index) in item.answer"
|
|
:key="index" v-html="answer"></span>
|
|
:key="index" v-html="answer"></span>
|
|
</div>
|
|
</div>
|
|
<!-- 其余题型答案 -->
|
|
<!-- 其余题型答案 -->
|
|
<div v-else>
|
|
<div v-else>
|
|
- <span :class="[ item.type === 'Complete' ? 'item-answer-item':'']" v-for="(answer,index) in item.answer"
|
|
|
|
|
|
+ <span :class="[ item.type === 'complete' ? 'item-answer-item':'']" v-for="(answer,index) in item.answer"
|
|
:key="index">{{answer}}</span>
|
|
:key="index">{{answer}}</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -90,7 +97,7 @@
|
|
<span v-if="! (_.compact(item.points).length)">暂未绑定知识点</span>
|
|
<span v-if="! (_.compact(item.points).length)">暂未绑定知识点</span>
|
|
<div v-else>
|
|
<div v-else>
|
|
<span v-for="(point,index) in item.points" :key="index" class="item-point-tag">
|
|
<span v-for="(point,index) in item.points" :key="index" class="item-point-tag">
|
|
- <span v-if="allPointList.length && allPointList.filter(i => i.id === point).length">{{ allPointList.filter(i => i.id === point)[0].name }}</span>
|
|
|
|
|
|
+ {{ point }}
|
|
</span>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -106,35 +113,60 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
-
|
|
|
|
- <Modal v-model="scoreModal" title="题目配分" @on-ok="onConfirmScore">
|
|
|
|
|
|
+
|
|
|
|
+ <!-- 单个试题配分弹框 -->
|
|
|
|
+<!-- <Modal v-model="scoreModal" title="题目配分" @on-ok="onConfirmScore">
|
|
<InputNumber :max="curItemScore + surPlusScore" :min="0" :step="scoreStep" v-model="curItemScore" @on-change="onScoreChange"></InputNumber>
|
|
<InputNumber :max="curItemScore + surPlusScore" :min="0" :step="scoreStep" v-model="curItemScore" @on-change="onScoreChange"></InputNumber>
|
|
<p>剩余可分配分数:{{ surPlusScore }}</p>
|
|
<p>剩余可分配分数:{{ surPlusScore }}</p>
|
|
- </Modal>
|
|
|
|
-
|
|
|
|
|
|
+ </Modal> -->
|
|
|
|
+
|
|
|
|
+ <!-- 题型配分弹窗 -->
|
|
<Modal v-model="typeScoreModel" title="题型配分" footer-hide>
|
|
<Modal v-model="typeScoreModel" title="题型配分" footer-hide>
|
|
|
|
+ <span class="type-score-item">试卷总分 : {{ paperInfo.score }}</span>
|
|
<span class="type-score-item">已分配总分 : {{ getTotalScore(groupTypeList) }}</span>
|
|
<span class="type-score-item">已分配总分 : {{ getTotalScore(groupTypeList) }}</span>
|
|
- <div v-for="(item,index) in groupTypeList" :key="index" class="type-score-item">
|
|
|
|
- <div v-if="item.list.length">
|
|
|
|
- <span>{{ exersicesType[item.type] }} </span>
|
|
|
|
- <span>共 {{ item.list.length }} 道题,总分配:</span>
|
|
|
|
- <InputNumber :max="paper.score" :min="0" :step="scoreStep" v-model="item.score"></InputNumber>
|
|
|
|
|
|
+ <div v-for="(modalItem,modalIndex) in groupTypeList" :key="modalIndex" class="type-score-item">
|
|
|
|
+ <div v-if="modalItem.list.length">
|
|
|
|
+ <span>{{ exersicesType[modalItem.type] }} </span>
|
|
|
|
+ <span>共 {{ modalItem.list.length }} 道题,总分配:</span>
|
|
|
|
+ <InputNumber :max="paperInfo.score" :min="0" :step="scoreStep" v-model="modalItem.score"></InputNumber>
|
|
<span> 分</span>
|
|
<span> 分</span>
|
|
|
|
+ <div v-show="modalItem.type === 'multiple'" style="margin-top: 10px;">
|
|
|
|
+ <div class="rule-item">
|
|
|
|
+ <RadioGroup v-model="multipleRule" vertical>
|
|
|
|
+ <Radio :label="1">
|
|
|
|
+ <Icon type="social-android"></Icon>
|
|
|
|
+ <span>默认全对得满分</span>
|
|
|
|
+ </Radio>
|
|
|
|
+ <Radio :label="2">
|
|
|
|
+ <Icon type="social-windows"></Icon>
|
|
|
|
+ <span>少选得一半分数,错选或者不选不得分</span>
|
|
|
|
+ </Radio>
|
|
|
|
+ <Radio :label="3">
|
|
|
|
+ <Icon type="social-windows"></Icon>
|
|
|
|
+ <span>少选按个数得分,错选或者不选不得分</span>
|
|
|
|
+ </Radio>
|
|
|
|
+ <Radio :label="4">
|
|
|
|
+ <Icon type="social-windows"></Icon>
|
|
|
|
+ <span>依照(选项数 - 2 * 错选数)/ 选项数,负分则不得分</span>
|
|
|
|
+ </Radio>
|
|
|
|
+ </RadioGroup>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <Button class="type-score-btn" @click="onConfirmTypeScore" type="info" :disabled="getTotalScore(groupTypeList) > paper.score">确认</Button>
|
|
|
|
- <p style="color:red;text-align:center;font-weight:bold;margin-top:10px" v-show="getTotalScore(groupTypeList) > paper.score">配分已超试卷总分,请重新分配!</p>
|
|
|
|
|
|
+ <Button class="type-score-btn" @click="onConfirmTypeScore" type="info" :disabled="getTotalScore(groupTypeList) > paperInfo.score">确认</Button>
|
|
|
|
+ <p style="color:red;text-align:center;font-weight:bold;margin-top:10px" v-show="getTotalScore(groupTypeList) > paperInfo.score">配分已超试卷总分,请重新分配!</p>
|
|
|
|
|
|
</Modal>
|
|
</Modal>
|
|
-
|
|
|
|
- <Modal v-model="editExerciseModal" class-name="edit-exercise-modal" width="1200px" footer-hide title="编辑习题">
|
|
|
|
|
|
+
|
|
|
|
+ <!-- 编辑试题弹窗 -->
|
|
|
|
+<!-- <Modal v-model="editExerciseModal" class-name="edit-exercise-modal" width="1200px" footer-hide title="编辑习题">
|
|
<BaseEditExercise :exerciseItem="currentExercise" @onEditSuccess="onEditSuccess" refId="paperEdit" ref="paperEdit"></BaseEditExercise>
|
|
<BaseEditExercise :exerciseItem="currentExercise" @onEditSuccess="onEditSuccess" refId="paperEdit" ref="paperEdit"></BaseEditExercise>
|
|
<div slot="footer">
|
|
<div slot="footer">
|
|
<Button type="success">确认</Button>
|
|
<Button type="success">确认</Button>
|
|
</div>
|
|
</div>
|
|
-
|
|
|
|
- </Modal>
|
|
|
|
|
|
+ </Modal> -->
|
|
|
|
|
|
<!-- 音频播放弹窗 -->
|
|
<!-- 音频播放弹窗 -->
|
|
<Modal v-model="playAudioModal" width="400" footer-hide @on-visible-change="onAudioModalChange">
|
|
<Modal v-model="playAudioModal" width="400" footer-hide @on-visible-change="onAudioModalChange">
|
|
@@ -175,19 +207,21 @@
|
|
return {
|
|
return {
|
|
schoolCode: '',
|
|
schoolCode: '',
|
|
dataLoading: false,
|
|
dataLoading: false,
|
|
|
|
+ curEditItemId:null,
|
|
exerciseList: [],
|
|
exerciseList: [],
|
|
schoolInfo: {},
|
|
schoolInfo: {},
|
|
isShowUploadList: false,
|
|
isShowUploadList: false,
|
|
|
|
+ multipleRule:1,
|
|
typeScoreModel: false,
|
|
typeScoreModel: false,
|
|
setPaperInfoModal: false,
|
|
setPaperInfoModal: false,
|
|
editExerciseModal: false,
|
|
editExerciseModal: false,
|
|
exersicesType: {
|
|
exersicesType: {
|
|
- Single: '单选题',
|
|
|
|
- Multiple: '多选题',
|
|
|
|
- Judge: '判断题',
|
|
|
|
- Complete: '填空题',
|
|
|
|
- Subjective: '问答题',
|
|
|
|
- Compose: '综合题'
|
|
|
|
|
|
+ single: '单选题',
|
|
|
|
+ multiple: '多选题',
|
|
|
|
+ judge: '判断题',
|
|
|
|
+ complete: '填空题',
|
|
|
|
+ subjective: '问答题',
|
|
|
|
+ compose: '综合题'
|
|
},
|
|
},
|
|
exersicesDiff: ['容易', '较易', '一般', '较难', '困难'],
|
|
exersicesDiff: ['容易', '较易', '一般', '较难', '困难'],
|
|
diffColors: ['#32CF74', '#E8BE15', '#F19300', '#EB5E00', '#D30000'],
|
|
diffColors: ['#32CF74', '#E8BE15', '#F19300', '#EB5E00', '#D30000'],
|
|
@@ -206,7 +240,7 @@
|
|
groupList: [],
|
|
groupList: [],
|
|
groupTypeList: [],
|
|
groupTypeList: [],
|
|
orderList:[],
|
|
orderList:[],
|
|
- typeList: ['Single', 'Multiple', 'Judge', 'Complete', 'Subjective', 'Compose'],
|
|
|
|
|
|
+ typeList: ['single', 'multiple', 'judge', 'complete', 'subjective', 'compose'],
|
|
viewModel: 'type',
|
|
viewModel: 'type',
|
|
filterParams: {},
|
|
filterParams: {},
|
|
surPlusScore: 0,
|
|
surPlusScore: 0,
|
|
@@ -223,7 +257,11 @@
|
|
curAudioSrc: "",
|
|
curAudioSrc: "",
|
|
curAudioName: "",
|
|
curAudioName: "",
|
|
curVideoSrc: "",
|
|
curVideoSrc: "",
|
|
- curVideoName: ""
|
|
|
|
|
|
+ curVideoName: "",
|
|
|
|
+ modifyItems:[],
|
|
|
|
+ paperInfo:{
|
|
|
|
+ score:0
|
|
|
|
+ }
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
@@ -248,8 +286,6 @@
|
|
|
|
|
|
/* 音频点击播放事件 */
|
|
/* 音频点击播放事件 */
|
|
onRichTextClick(e) {
|
|
onRichTextClick(e) {
|
|
- console.log(e)
|
|
|
|
- // e.stopPropagation()
|
|
|
|
if (e.srcElement.classList[0] === 'richText-audio') {
|
|
if (e.srcElement.classList[0] === 'richText-audio') {
|
|
this.playAudioModal = true
|
|
this.playAudioModal = true
|
|
this.curAudioSrc = e.srcElement.dataset.url
|
|
this.curAudioSrc = e.srcElement.dataset.url
|
|
@@ -267,6 +303,7 @@
|
|
*/
|
|
*/
|
|
onQuestionToggle(index, id, e) {
|
|
onQuestionToggle(index, id, e) {
|
|
e.stopPropagation()
|
|
e.stopPropagation()
|
|
|
|
+ this.curEditItemId = null
|
|
let listIndex = this.collapseList.indexOf(index)
|
|
let listIndex = this.collapseList.indexOf(index)
|
|
if (listIndex > -1) {
|
|
if (listIndex > -1) {
|
|
this.collapseList.splice(listIndex, 1)
|
|
this.collapseList.splice(listIndex, 1)
|
|
@@ -285,34 +322,14 @@
|
|
this.$emit('toggleChange', this.collapseList)
|
|
this.$emit('toggleChange', this.collapseList)
|
|
},
|
|
},
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 根据知识点id集合换取知识点对象集合
|
|
|
|
- * @param ids
|
|
|
|
- */
|
|
|
|
- getPointsByIds(ids) {
|
|
|
|
- // 去除空值后
|
|
|
|
- let idsArr = this._.compact(ids)
|
|
|
|
- return new Promise((r, j) => {
|
|
|
|
- if (idsArr.length) {
|
|
|
|
- this.$api.knowledge.FindKnowledgebyId(idsArr).then(res => {
|
|
|
|
- if (!res.error && res.result.data.length) {
|
|
|
|
- r(res.result.data)
|
|
|
|
- } else {
|
|
|
|
- r([])
|
|
|
|
- }
|
|
|
|
- }).catch(err => {
|
|
|
|
- j(err)
|
|
|
|
- })
|
|
|
|
- } else {
|
|
|
|
- r([])
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
-
|
|
|
|
|
|
+ onSetSingleItem(item,index){
|
|
|
|
+ this.curItemScore = item.score
|
|
|
|
+ this.curEditItemId = item.id
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ onItemScoreChange(val){
|
|
|
|
+ console.log(val)
|
|
},
|
|
},
|
|
-
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -406,10 +423,11 @@
|
|
onOk: () => {
|
|
onOk: () => {
|
|
this.$Message.success('删除成功')
|
|
this.$Message.success('删除成功')
|
|
this.surPlusScore += item.score
|
|
this.surPlusScore += item.score
|
|
- console.log(this.surPlusScore)
|
|
|
|
|
|
+ this.$emit('scoreUpdate',this.surPlusScore)
|
|
arr.splice(index, 1)
|
|
arr.splice(index, 1)
|
|
this.exerciseList.splice(this.exerciseList.indexOf(item), 1)
|
|
this.exerciseList.splice(this.exerciseList.indexOf(item), 1)
|
|
this.$emit('dataUpdate', this.exerciseList)
|
|
this.$emit('dataUpdate', this.exerciseList)
|
|
|
|
+ this.$EventBus.$emit('onPaperItemChange',this.exerciseList)
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
@@ -419,17 +437,12 @@
|
|
* @param item
|
|
* @param item
|
|
*/
|
|
*/
|
|
handleToolEdit(arr, item, index) {
|
|
handleToolEdit(arr, item, index) {
|
|
|
|
+ console.log('试卷当前编辑的题目')
|
|
console.log(item)
|
|
console.log(item)
|
|
- let isSchoolItem = item.code === this.$store.state.userInfo.schoolCode
|
|
|
|
- if (isSchoolItem) {
|
|
|
|
- this.$Message.warning('无校本资源编辑权限!')
|
|
|
|
- } else {
|
|
|
|
- this.curIndex = index // 题型分组下的index
|
|
|
|
- this.currentExerciseIndex = this.exerciseList.indexOf(item) // 清单列表下的index
|
|
|
|
- this.curTypeItems = arr
|
|
|
|
- this.currentExercise = item
|
|
|
|
- this.editExerciseModal = true
|
|
|
|
- }
|
|
|
|
|
|
+ this.currentExerciseIndex = this.exerciseList.indexOf(item) // 清单列表下的index
|
|
|
|
+ this.curTypeItems = arr
|
|
|
|
+ this.currentExercise = item
|
|
|
|
+ this.editExerciseModal = true
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|
|
@@ -454,6 +467,7 @@
|
|
onScoreChange(val) {
|
|
onScoreChange(val) {
|
|
this.surPlusScore = this.surPlusScore + this.lastScore - val
|
|
this.surPlusScore = this.surPlusScore + this.lastScore - val
|
|
this.lastScore = val
|
|
this.lastScore = val
|
|
|
|
+ this.$emit('scoreUpdate',this.surPlusScore)
|
|
|
|
|
|
},
|
|
},
|
|
|
|
|
|
@@ -466,31 +480,44 @@
|
|
/** 按照题型配分 */
|
|
/** 按照题型配分 */
|
|
onConfirmTypeScore() {
|
|
onConfirmTypeScore() {
|
|
/** 重新计算剩余分配分数 */
|
|
/** 重新计算剩余分配分数 */
|
|
- this.surPlusScore = this.paper.score - this.groupTypeList.reduce((p, e) => p + e.score, 0)
|
|
|
|
|
|
+ this.surPlusScore = this.paperInfo.score - this.groupTypeList.reduce((p, e) => parseInt(p) + parseInt(e.score), 0)
|
|
if (this.surPlusScore < 0) {
|
|
if (this.surPlusScore < 0) {
|
|
this.$Message.warning("当前配分超过试卷总分,请重新分配!")
|
|
this.$Message.warning("当前配分超过试卷总分,请重新分配!")
|
|
} else {
|
|
} else {
|
|
/* 按照题型配分后平均分配给每个子题 */
|
|
/* 按照题型配分后平均分配给每个子题 */
|
|
this.groupTypeList.forEach(item => {
|
|
this.groupTypeList.forEach(item => {
|
|
- item.list.forEach(exercise => {
|
|
|
|
- exercise.score = item.score / item.list.length
|
|
|
|
- if (item.id) {
|
|
|
|
- this.exerciseList.filter(item => item.id === exercise.id)[0].score = item.score / item.list.length
|
|
|
|
- } else {
|
|
|
|
- this.exerciseList.filter(item => item.shaCode === exercise.shaCode)[0].score = item.score / item.list.length
|
|
|
|
|
|
+ item.list.forEach((exercise,exerciseIndex) => {
|
|
|
|
+ // 先找到原始列表里面的当前题目
|
|
|
|
+ let listItem = this.exerciseList.filter(item => item.id === exercise.id)[0]
|
|
|
|
+ // 先判断是否总分除以题目数量能否除尽
|
|
|
|
+ let remainder = item.score % item.list.length
|
|
|
|
+ // 如果可以整除 则直接计算
|
|
|
|
+ if(remainder === 0){
|
|
|
|
+ exercise.score = item.score / item.list.length
|
|
|
|
+ }else{
|
|
|
|
+ // 如果不能整除 则前面所有取整 最后一题加上余数 即可完成配分
|
|
|
|
+ let integerScore = parseInt(item.score / item.list.length)
|
|
|
|
+ let lastItem = exerciseIndex === item.list.length - 1
|
|
|
|
+ exercise.score = lastItem ? integerScore + remainder : integerScore
|
|
}
|
|
}
|
|
|
|
+ listItem.score = exercise.score
|
|
})
|
|
})
|
|
})
|
|
})
|
|
|
|
+
|
|
/** 回到题型视图 */
|
|
/** 回到题型视图 */
|
|
this.groupList = this.groupTypeList
|
|
this.groupList = this.groupTypeList
|
|
this.$parent.viewModel = 'type'
|
|
this.$parent.viewModel = 'type'
|
|
|
|
+ this.$parent.paperInfo.multipleRule = this.multipleRule
|
|
this.typeScoreModel = false
|
|
this.typeScoreModel = false
|
|
|
|
+ this.$emit('scoreUpdate',this.surPlusScore)
|
|
}
|
|
}
|
|
|
|
|
|
},
|
|
},
|
|
|
|
|
|
/** 编辑成功 */
|
|
/** 编辑成功 */
|
|
onEditSuccess(item) {
|
|
onEditSuccess(item) {
|
|
|
|
+
|
|
|
|
+
|
|
if (item.id) {
|
|
if (item.id) {
|
|
this.$refs.paperEdit.isLoading = false
|
|
this.$refs.paperEdit.isLoading = false
|
|
this.editExerciseModal = false
|
|
this.editExerciseModal = false
|
|
@@ -498,6 +525,14 @@
|
|
this.exerciseList.splice(this.currentExerciseIndex, 1, item)
|
|
this.exerciseList.splice(this.currentExerciseIndex, 1, item)
|
|
this.curTypeItems.splice(this.curIndex, 1, item)
|
|
this.curTypeItems.splice(this.curIndex, 1, item)
|
|
this.$emit('dataUpdate', this.exerciseList)
|
|
this.$emit('dataUpdate', this.exerciseList)
|
|
|
|
+
|
|
|
|
+ let existIndex = this.modifyItems.map(i => i.id).indexOf(item.id)
|
|
|
|
+ if( existIndex < 0){
|
|
|
|
+ this.modifyItems.push(item)
|
|
|
|
+ }else{
|
|
|
|
+ this.modifyItems[existIndex] = item
|
|
|
|
+ }
|
|
|
|
+
|
|
} else {
|
|
} else {
|
|
this.editExerciseModal = false
|
|
this.editExerciseModal = false
|
|
this.exerciseList.splice(this.currentExerciseIndex, 1, item)
|
|
this.exerciseList.splice(this.currentExerciseIndex, 1, item)
|
|
@@ -507,7 +542,6 @@
|
|
this.collapseList.splice(listIndex, 1)
|
|
this.collapseList.splice(listIndex, 1)
|
|
}
|
|
}
|
|
this.$Message.success("修改成功!")
|
|
this.$Message.success("修改成功!")
|
|
-
|
|
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
@@ -541,7 +575,7 @@
|
|
i.score = 0
|
|
i.score = 0
|
|
}
|
|
}
|
|
})
|
|
})
|
|
- return arr.reduce((p, e) => p + e.score, 0)
|
|
|
|
|
|
+ return arr.reduce((p, e) => p + parseInt(e.score), 0)
|
|
},
|
|
},
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -581,9 +615,11 @@
|
|
this.groupList = []
|
|
this.groupList = []
|
|
this.exerciseList = []
|
|
this.exerciseList = []
|
|
this.orderList = []
|
|
this.orderList = []
|
|
- console.log('list组件接收的数据')
|
|
|
|
- console.log(newPaper)
|
|
|
|
|
|
+ this.paperInfo = newPaper
|
|
if (newPaper.item.length) {
|
|
if (newPaper.item.length) {
|
|
|
|
+ newPaper.item.forEach(i => {
|
|
|
|
+ if(!i.score) i.score = 0
|
|
|
|
+ })
|
|
this.orderList.push({ list:newPaper.item })
|
|
this.orderList.push({ list:newPaper.item })
|
|
/* 处理试卷内题目按照题型排序 */
|
|
/* 处理试卷内题目按照题型排序 */
|
|
this.typeList.forEach(item => {
|
|
this.typeList.forEach(item => {
|
|
@@ -592,27 +628,23 @@
|
|
that.groupList.push({
|
|
that.groupList.push({
|
|
type: key,
|
|
type: key,
|
|
list: value,
|
|
list: value,
|
|
- score: value.reduce((p, e) => p + e.score, 0)
|
|
|
|
|
|
+ score: value.reduce((p, e) => parseInt(p) + parseInt(e.score), 0)
|
|
})
|
|
})
|
|
that.exerciseList = that.exerciseList.concat(value)
|
|
that.exerciseList = that.exerciseList.concat(value)
|
|
}
|
|
}
|
|
})
|
|
})
|
|
});
|
|
});
|
|
-
|
|
|
|
- /* 查找当前页面所有知识点ID换名称 */
|
|
|
|
- this.getPointsByIds(this.getPointIds(this.exerciseList)).then(res => {
|
|
|
|
- this.allPointList = res
|
|
|
|
- })
|
|
|
|
}
|
|
}
|
|
|
|
|
|
this.originData = this.exerciseList
|
|
this.originData = this.exerciseList
|
|
this.groupTypeList = this.groupList
|
|
this.groupTypeList = this.groupList
|
|
this.totalNum = newPaper.item.length
|
|
this.totalNum = newPaper.item.length
|
|
- this.surPlusScore = newPaper.score - newPaper.item.reduce((p, e) => p + e.score, 0);
|
|
|
|
|
|
+ this.surPlusScore = newPaper.score - newPaper.item.reduce((p, e) => parseInt(p) + parseInt(e.score), 0);
|
|
|
|
+ this.$emit('scoreUpdate',this.surPlusScore)
|
|
this.pageScrollTo(0)
|
|
this.pageScrollTo(0)
|
|
this.pageChange(1)
|
|
this.pageChange(1)
|
|
this.$nextTick(()=>{
|
|
this.$nextTick(()=>{
|
|
- window.MathJax.Hub.Queue(["Typeset", MathJax.Hub]);
|
|
|
|
|
|
+ window.MathJax.Hub.Queue(["Typeset", MathJax.Hub,this.$refs.mathJaxContainer]);
|
|
})
|
|
})
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -650,14 +682,24 @@
|
|
justify-content: center;
|
|
justify-content: center;
|
|
margin: 20px 0;
|
|
margin: 20px 0;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
.components-el-container .type-name {
|
|
.components-el-container .type-name {
|
|
font-size: 18px;
|
|
font-size: 18px;
|
|
font-weight: bold;
|
|
font-weight: bold;
|
|
margin-top: 20px;
|
|
margin-top: 20px;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ .components-el-container /deep/ .ivu-input-number-handler-down-inner,
|
|
|
|
+ .components-el-container /deep/ .ivu-input-number-handler-up-inner{
|
|
|
|
+ right: 8px;
|
|
|
|
+ font-size: 16px;
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
|
|
+ .components-el-container .exercise-item:hover {
|
|
|
|
+ border: 1px solid #01b4ef;
|
|
|
|
+ }
|
|
|
|
+
|
|
.components-el-container .exercise-item {
|
|
.components-el-container .exercise-item {
|
|
position: relative;
|
|
position: relative;
|
|
margin-top: 30px;
|
|
margin-top: 30px;
|