提交 75a627a4 authored 作者: lihuihui's avatar lihuihui

update

上级 f3de1688
module.exports = { module.exports = {
domain: 'dev.ezijing.com', domain: 'dev.ezijing.com',
url: 'https://x-exam.ezijing.com/api', url: 'https://x-exam2.ezijing.com/api',
isEnableToIphoneDebugger: true, isEnableToIphoneDebugger: true,
// apiBaseURL: '//demo-login.ezijing.com/', // apiBaseURL: '//demo-login.ezijing.com/',
webpack: { webpack: {
......
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
: 'stu2' : 'stu2'
: questionParams.answerRecord[item.question_item_id] : questionParams.answerRecord[item.question_item_id]
? questionParams.answerRecord[item.question_item_id][lItem.id] ? questionParams.answerRecord[item.question_item_id][lItem.id]
? questionParams.answerRecord[item.question_item_id][lItem.id].answer.length !== 0 ? questionParams.answerRecord[item.question_item_id][lItem.id].answer[0]
? questionParams.answerRecord[item.question_item_id][lItem.id].sign ? questionParams.answerRecord[item.question_item_id][lItem.id].sign
? 'stu1 stu3' ? 'stu1 stu3'
: 'stu1' : 'stu1'
......
...@@ -56,9 +56,10 @@ ...@@ -56,9 +56,10 @@
<div :class="item.q_order === questionParams.questionIndex + 1 ? 'active title' : 'title'"> <div :class="item.q_order === questionParams.questionIndex + 1 ? 'active title' : 'title'">
<div class="num">{{ item.q_order }}.</div><div class="des" v-html="item.content"></div> <div class="num">{{ item.q_order }}.</div><div class="des" v-html="item.content"></div>
</div> </div>
<!-- <template v-if="item.type == 3"> <div v-if="item.type == 3" @click="changeIndex(item.q_order)">
<el-input @input="QAChange(questionData.question_item_id, item.id)" type="textarea" placeholder="请输入内容" v-model="questionData.textContent"></el-input> <el-input @input="QAChildChange(questionData.question_item_id, item)" type="textarea" placeholder="请输入内容" v-model="item.answer"></el-input>
</template> --> </div>
<!-- <el-input @input="QAChange(questionData.question_item_id, questionData.id)" type="textarea" placeholder="请输入内容" v-model="questionData.textContent"></el-input> -->
<ul :class="item.type == 2 ? 'check-option' : 'radio-option'"><!-- radio-option check-option --> <ul :class="item.type == 2 ? 'check-option' : 'radio-option'"><!-- radio-option check-option -->
<template v-if="item.options"> <template v-if="item.options">
<template v-for="(items, cIndex) in item.options"> <template v-for="(items, cIndex) in item.options">
...@@ -134,20 +135,29 @@ export default { ...@@ -134,20 +135,29 @@ export default {
this.questionData.q_order = k.q_order this.questionData.q_order = k.q_order
typeof k.options === 'string' && (k.options = JSON.parse(k.options)) typeof k.options === 'string' && (k.options = JSON.parse(k.options))
return k return k
// if (k.q_order === this.questionParams.questionIndex + 1) {
// } else {
// return {
// content: k.content,
// q_order: k.q_order
// }
// }
}) })
const key = ['question_item_id', 'question_item_title', 'question_item_type'] const key = ['question_item_id', 'question_item_title', 'question_item_type']
key.map(k => { key.map(k => {
this.questionData[k] = item[k] this.questionData[k] = item[k]
}) })
// 案例题里面的问答题答案回显
const pId = this.questionData.question_item_id
setTimeout(() => {
this.questionData.list.map(el => {
if (el.type === 3) {
if (this.questionParams.answerRecord[pId]) {
this.questionParams.answerRecord[pId][el.id] ? el.answer = this.questionParams.answerRecord[pId][el.id].answer[0] : el.answer = ''
} else {
el.answer = ''
}
return el
}
})
this.$forceUpdate()
}, 300)
} }
}) })
this.$forceUpdate()
} else { } else {
const currentItem = item.question_list.find(items => { return items.q_order === this.questionParams.questionIndex + 1 }) const currentItem = item.question_list.find(items => { return items.q_order === this.questionParams.questionIndex + 1 })
if (currentItem) { if (currentItem) {
...@@ -171,6 +181,27 @@ export default { ...@@ -171,6 +181,27 @@ export default {
} }
}) })
}, },
// 案例题下面的问答题
QAChildChange(pId, item) {
if (this.questionParams.answerRecord[pId]) {
if (this.questionParams.answerRecord[pId][item.id]) {
this.questionParams.answerRecord[pId][item.id].answer = [item.answer]
} else {
this.questionParams.answerRecord[pId][item.id] = {
answer: [item.answer],
sign: false
}
}
} else {
this.questionParams.answerRecord[pId] = {
[item.id]: {
answer: [item.answer],
sign: false
}
}
}
this.$forceUpdate()
},
// 问答题回答 // 问答题回答
QAChange(pId, cId) { QAChange(pId, cId) {
this.questionParams.answerRecord[pId] this.questionParams.answerRecord[pId]
...@@ -188,6 +219,10 @@ export default { ...@@ -188,6 +219,10 @@ export default {
} }
this.$forceUpdate() this.$forceUpdate()
}, },
changeIndex(order) {
this.questionParams.questionIndex = order - 1
this.$forceUpdate()
},
// 选项选择 // 选项选择
changeOptions: _.debounce(function(type, pId, cId, optId, order) { changeOptions: _.debounce(function(type, pId, cId, optId, order) {
if (order) { if (order) {
...@@ -270,7 +305,6 @@ export default { ...@@ -270,7 +305,6 @@ export default {
} else { } else {
this.questionParams.answerRecord[pId][item.id].sign = true this.questionParams.answerRecord[pId][item.id].sign = true
} }
console.log(this.questionParams.answerRecord[pId][item.id], '=123')
} else { } else {
this.questionParams.answerRecord[pId][cId] = { sign: true, answer: [] } this.questionParams.answerRecord[pId][cId] = { sign: true, answer: [] }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论