|
|
|
@ -65,9 +65,10 @@ |
|
|
|
|
<el-table-column prop="courses" label="对应课程" width="140" align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="knowledgePoints" label="对应知识点" width="140" align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="wrongNum" label="错题次数" width="100" align="center"></el-table-column> |
|
|
|
|
<el-table-column label="操作" width="100" align="center"> |
|
|
|
|
<el-table-column label="操作" width="140" align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-button type="text" @click="show(scope.row)">查看</el-button> |
|
|
|
|
<!-- <el-button type="text" @click="correct(scope.row)" v-if="scope.row.typeId != 4">去纠错</el-button> --> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
</el-table> |
|
|
|
@ -96,16 +97,46 @@ |
|
|
|
|
<p v-for="(option,i) in quesInfo.options" :key="i">{{i}}.{{quesInfo.options[i]}}</p> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<div class="meta ans"> |
|
|
|
|
<!-- <div class="meta ans"> |
|
|
|
|
<div class="info"> |
|
|
|
|
<p class="key">正确答案:</p> |
|
|
|
|
<p class="val">{{quesInfo.answer}}</p> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<div class="meta"> |
|
|
|
|
</div> --> |
|
|
|
|
<!-- <div class="meta"> |
|
|
|
|
<p class="key">答案解析:</p> |
|
|
|
|
<p class="val" v-html="quesInfo.answerAnalysis"></p> |
|
|
|
|
</div> --> |
|
|
|
|
</div> |
|
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
<el-dialog title="纠错" :visible.sync="correctVisible" width="40%"> |
|
|
|
|
<div class="ques"> |
|
|
|
|
<div class="name-wrap"> |
|
|
|
|
<div class="name" v-html="quesInfo.questionStem"></div> |
|
|
|
|
</div> |
|
|
|
|
<div class="options"> |
|
|
|
|
<template v-if="quesInfo.typeId == 1 || quesInfo.typeId == 3"> |
|
|
|
|
<div class="option"> |
|
|
|
|
<el-radio-group v-model="quesInfo.val"> |
|
|
|
|
<el-radio v-for="(option,i) in quesInfo.options" :key="i" :label="i"> |
|
|
|
|
{{i}}.{{quesInfo.options[i]}} |
|
|
|
|
</el-radio> |
|
|
|
|
</el-radio-group> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
<template v-if="quesInfo.typeId == 2"> |
|
|
|
|
<el-checkbox-group v-model="quesInfo.val"> |
|
|
|
|
<el-checkbox class="option-check" :label="i" v-for="(option,i) in quesInfo.options" :key="i"> |
|
|
|
|
{{i}}.{{quesInfo.options[i]}} |
|
|
|
|
</el-checkbox> |
|
|
|
|
</el-checkbox-group> |
|
|
|
|
</template> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
|
|
<el-button v-throttle @click="correctVisible = false">取消</el-button> |
|
|
|
|
<el-button type="primary" @click="toCorrect" v-throttle>确定</el-button> |
|
|
|
|
</div> |
|
|
|
|
</el-dialog> |
|
|
|
|
</div> |
|
|
|
@ -143,7 +174,8 @@ export default { |
|
|
|
|
pageSizeNum: 10, |
|
|
|
|
totalNum: 0, |
|
|
|
|
detailVisible: false, |
|
|
|
|
quesInfo: {} |
|
|
|
|
quesInfo: {}, |
|
|
|
|
correctVisible: false |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
computed: { |
|
|
|
@ -152,6 +184,7 @@ export default { |
|
|
|
|
]), |
|
|
|
|
}, |
|
|
|
|
mounted() { |
|
|
|
|
console.log(process.env.NODE_ENV) |
|
|
|
|
this.getType() |
|
|
|
|
this.getName() |
|
|
|
|
}, |
|
|
|
@ -202,8 +235,7 @@ export default { |
|
|
|
|
}, |
|
|
|
|
show(row){ |
|
|
|
|
this.detailVisible = true |
|
|
|
|
this.$post(`${this.api.questionInfo}?qid=${row.questionId}`) |
|
|
|
|
.then(res => { |
|
|
|
|
this.$post(`${this.api.questionInfo}?qid=${row.questionId}`).then(res => { |
|
|
|
|
let info = res.data.list |
|
|
|
|
let options = {} |
|
|
|
|
for(let i in info){ |
|
|
|
@ -215,10 +247,67 @@ export default { |
|
|
|
|
this.quesInfo = info |
|
|
|
|
}).catch(err => {}) |
|
|
|
|
}, |
|
|
|
|
correct(row){ |
|
|
|
|
this.correctVisible = true |
|
|
|
|
this.$post(`${this.api.questionInfo}?qid=${row.questionId}`).then(res => { |
|
|
|
|
let info = res.data.list |
|
|
|
|
let options = {} |
|
|
|
|
for(let i in info){ |
|
|
|
|
if(i.includes('option') && info[i]){ |
|
|
|
|
options[i.replace('option','')] = info[i] |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
info.options = options |
|
|
|
|
if(info.typeId == 2){ |
|
|
|
|
this.$set(info,'val',[]) |
|
|
|
|
}else if(info.typeId == 5){ |
|
|
|
|
info.questionStem = info.questionStem.replace(/\(\)\(\)\(\)/g,`<input class="input"></input>`) |
|
|
|
|
}else{ |
|
|
|
|
this.$set(info,'val','') |
|
|
|
|
} |
|
|
|
|
this.quesInfo = info |
|
|
|
|
}).catch(err => {}) |
|
|
|
|
}, |
|
|
|
|
toCorrect(){ |
|
|
|
|
let right = true |
|
|
|
|
let quesInfo = this.quesInfo |
|
|
|
|
let type = quesInfo.typeId |
|
|
|
|
if(type == 1 || type == 3){ |
|
|
|
|
if(quesInfo.val != quesInfo.answer) right = false |
|
|
|
|
}else if(type == 2){ |
|
|
|
|
let val = quesInfo.val.sort().join('') |
|
|
|
|
if(val != quesInfo.answer) right = false |
|
|
|
|
}else if(type == 5){ |
|
|
|
|
let options = [...document.querySelectorAll(`.ques input`)].map(n => n.value) |
|
|
|
|
let answers = [] |
|
|
|
|
for(let i in quesInfo.options){ |
|
|
|
|
answers.push(quesInfo.options[i]) |
|
|
|
|
} |
|
|
|
|
answers.map((n,i) => { |
|
|
|
|
if(n != options[i]) right = false |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
if(right){ |
|
|
|
|
this.$post(`${this.api.removes}?qid=${quesInfo.id}&userId=${this.userId}&type=${this.type}`).then(res => { |
|
|
|
|
this.$message.success('纠错成功') |
|
|
|
|
this.correctVisible = false |
|
|
|
|
this.getData() |
|
|
|
|
}).catch(err => {}) |
|
|
|
|
}else{ |
|
|
|
|
this.$message.error('回答错误') |
|
|
|
|
this.correctVisible = false |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
practice(){ |
|
|
|
|
let qid = this.listData.map(n => n.questionId).join() |
|
|
|
|
if(!this.listData.length) return this.$message.warning('错题列表为空,无法练习') |
|
|
|
|
let qid = [] |
|
|
|
|
this.listData.map(n => { |
|
|
|
|
n.typeName != '简答题' && qid.push(n.questionId) |
|
|
|
|
}) |
|
|
|
|
if(!qid.length) return this.$message.warning('未查询到客观题,无法练习') |
|
|
|
|
this.setInfo({ |
|
|
|
|
qid |
|
|
|
|
qid: qid.join(), |
|
|
|
|
type: this.type |
|
|
|
|
}) |
|
|
|
|
this.$router.push('do') |
|
|
|
|
} |
|
|
|
@ -230,7 +319,7 @@ export default { |
|
|
|
|
/deep/.no-mb.el-form-item{ |
|
|
|
|
margin-bottom: 0; |
|
|
|
|
} |
|
|
|
|
.ques{ |
|
|
|
|
/deep/.ques{ |
|
|
|
|
.key{ |
|
|
|
|
font-weight: bold; |
|
|
|
|
color: #333; |
|
|
|
@ -255,6 +344,23 @@ export default { |
|
|
|
|
margin-right: 30px; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.input{ |
|
|
|
|
width: 100px; |
|
|
|
|
height: 28px; |
|
|
|
|
padding: 0 5px; |
|
|
|
|
margin: 0 5px 5px; |
|
|
|
|
color: #444; |
|
|
|
|
background-color: #fff; |
|
|
|
|
border: 1px solid #ebebeb; |
|
|
|
|
box-sizing: border-box; |
|
|
|
|
&:focus{ |
|
|
|
|
outline: none; |
|
|
|
|
} |
|
|
|
|
&:disabled{ |
|
|
|
|
background-color: #e8e8e8; |
|
|
|
|
cursor: not-allowed; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.meta{ |
|
|
|
|
padding-left: 10px; |
|
|
|
|
margin: 20px 0; |
|
|
|
@ -273,5 +379,34 @@ export default { |
|
|
|
|
margin-top: 10px; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.options{ |
|
|
|
|
margin-top: 10px; |
|
|
|
|
font-size: 14px; |
|
|
|
|
color: #8b8b8b; |
|
|
|
|
.option{ |
|
|
|
|
margin: 5px 0; |
|
|
|
|
&.selected{ |
|
|
|
|
font-weight: bold; |
|
|
|
|
color: #555; |
|
|
|
|
} |
|
|
|
|
.el-radio-group{ |
|
|
|
|
display: flex; |
|
|
|
|
flex-direction: column; |
|
|
|
|
.el-radio{ |
|
|
|
|
margin: 3px 0; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.option-check{ |
|
|
|
|
display: block; |
|
|
|
|
margin-right: 6px; |
|
|
|
|
} |
|
|
|
|
/deep/.el-radio__label{ |
|
|
|
|
padding-left: 6px; |
|
|
|
|
} |
|
|
|
|
.upload{ |
|
|
|
|
margin: 20px 0 10px; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
</style> |