|
@@ -91,6 +91,11 @@
|
|
|
<div class="question-part" :class="{'halfScreen':paper.sections[currentSection - 1].hasMaterial}">
|
|
|
<textarea v-model="paper.questions[currentQuestion].content"></textarea>
|
|
|
<textarea v-for="answer in paper.questions[currentQuestion].options" :key="answer.id" v-model="answer.content"></textarea>
|
|
|
+ <br/><br/>
|
|
|
+ <div>
|
|
|
+ 答案:<el-checkbox v-for="(answer,index) in paper.questions[currentQuestion].options" :key="index" v-model="answer.correct">{{allOptionList[answer.oindex]}}</el-checkbox>
|
|
|
+ </div>
|
|
|
+ <br/><br/>
|
|
|
<el-button @click="drawer = true" type="primary">查看</el-button>
|
|
|
<el-button @click="updateQuestion" type="danger">保存</el-button>
|
|
|
</div>
|
|
@@ -211,6 +216,15 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
updateQuestion(){
|
|
|
+ let answer = this.paper.questions[this.currentQuestion].options.filter(option => {
|
|
|
+ return option.correct
|
|
|
+ }).map((option) => {
|
|
|
+ return this.allOptionList[option.oindex]
|
|
|
+ }).join(',');
|
|
|
+ this.paper.questions[this.currentQuestion].answer = answer;
|
|
|
+
|
|
|
+ console.log(this.paper.questions[this.currentQuestion]);
|
|
|
+
|
|
|
updateQuestion(this.paper.questions[this.currentQuestion]).then((result) => {
|
|
|
alert(result.result?'修改成功':'修改失败');
|
|
|
this.getQuestion(this.$route.params.pid,this.currentQuestion);
|