Commit 0a000e69 authored by 黄奎's avatar 黄奎

页面修改

parent fabee4a5
......@@ -62,11 +62,11 @@ export function CreateQuestion(questionKey) {
IsAnswer: false
})
break;
//简答
case "short-answer":
// AnswerList.push({
// Content: ""
// })
//分录
case "entry-problem":
AnswerList.push({
Content: ""
})
break;
}
return AnswerList;
......
......@@ -41,10 +41,13 @@
:setOption="objOption"></fill-in>
<!--判断题-->
<judge v-if="questionObj.Key=='judge'" :questionData="AnswerList" @getChild="getChildData"></judge>
<!--简答题、名词解释、论述题-->
<short-answer
v-if="questionObj.Key=='short-answer'||questionObj.Key=='noun-explanation'||questionObj.Key=='essay-question'"
:setOption="objOption"> </short-answer>
<!--简答题、名词解释、论述题、计算题-->
<short-answer v-if="questionObj.Key=='short-answer'||questionObj.Key=='noun-explanation'||questionObj.Key=='essay-question'
||questionObj.Key=='calculation'
" :setOption="objOption"> </short-answer>
<!--分录题-->
<entry-problem v-if="questionObj.Key=='entry-problem'" :questionData="AnswerList" @getChild="getChildData">
</entry-problem>
<br />
<div class="col-12">
答案解析<UeEditor v-model="objOption.AnswerParse" :config="config" ref="AnswerParse"></UeEditor>
......@@ -99,6 +102,7 @@
import fillIn from '../questiontype/fill-in'
import judge from '../questiontype/judge'
import shortAnswer from '../questiontype/short-answer'
import entryProblem from '../questiontype/entry-problem'
export default {
components: {
UeEditor,
......@@ -108,6 +112,7 @@
fillIn, //填空题
judge, //判断题
shortAnswer, //简答题
entryProblem, //分录题
},
props: {
setingObj: {
......
<!--分录题-->
<style>
</style>
<template>
<div class="entryProblemQuestion">
<table v-if="data&&data.length>0">
<tr v-for="(item,index) in data">
<td>
{{index+1}}</el-checkbox>
</td>
<td>
<UeEditor v-model="item.Content" :config="config"></UeEditor>
</td>
<td>
<a style="cursor:pointer;" @click="deleteOpion(index)">删除</a>
</td>
</tr>
<tfoot>
<tr>
<td colspan="3">
<a style="cursor:pointer;" @click="addOption()">添加选项</a>
</td>
</tr>
<tr>
<td colspan="3">
1. 一个空有多种答案时请用";"隔开。如:水;H2O
<br />
2. 若试题答案是数字,可设置范围,两个数字之间用"-"。如:1-9,学生填写1到9之间的数字都算正确(包括1和9)
</td>
</tr>
</tfoot>
</table>
</div>
</template>
<script>
import UeEditor from '../editor/UeEditor'
export default {
props: {
questionData: {
type: Array,
},
},
components: {
UeEditor
},
data() {
return {
data: this.questionData,
config: {
initialFrameWidth: null,
initialFrameHeight: 80,
},
};
},
created() {},
methods: {
//删除选项
deleteOpion(index) {
this.data.splice(index, 1);
this.calcOptionTitle();
},
//新增选项
addOption() {
this.data.push({
Content: "",
});
},
//返回数据到父组件
returnDataToParent() {
this.$emit('getChild', this.data);
},
},
mounted() {
},
watch: {
data: {
handler(newValue) {
this.returnDataToParent();
},
deep: true
},
}
};
</script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment