Commit c0679509 authored by 黄奎's avatar 黄奎

新增插件

parent ed023699
...@@ -76,12 +76,39 @@ export function CreateQuestion(questionKey) { ...@@ -76,12 +76,39 @@ export function CreateQuestion(questionKey) {
break; break;
//连线题 //连线题
case "matching": case "matching":
var array1=[{Name:"1",Content:""}]; var array1 = [{
var array2=[{Name:"A",Content:""}]; Name: "1",
var array3=[{Name:"1",Content:"A"}]; Content: ""
AnswerList.push(array1); }];
AnswerList.push(array2); var array2 = [{
AnswerList.push(array3); Name: "A",
Content: ""
}];
var array3 = [{
Name: "1",
Content: "A"
}];
AnswerList.push(array1);
AnswerList.push(array2);
AnswerList.push(array3);
break;
//排序题
case "sorting-problem":
var tempArray = [{
Name: "A",
Content: ""
}, {
Name: "B",
Content: ""
}, {
Name: "C",
Content: ""
}, {
Name: "D",
Content: ""
}];
AnswerList.push(tempArray);
break; break;
} }
return AnswerList; return AnswerList;
......
...@@ -51,6 +51,9 @@ ...@@ -51,6 +51,9 @@
</entry-problem> </entry-problem>
<!--连线题--> <!--连线题-->
<matching v-if="questionObj.Key=='matching'" :questionData="AnswerList" @getChild="getChildData"></matching> <matching v-if="questionObj.Key=='matching'" :questionData="AnswerList" @getChild="getChildData"></matching>
<!--排序题-->
<sorting-problem v-if="questionObj.Key=='sorting-problem '" :questionData="AnswerList"
@getChild="getChildData"></sorting-problem>
<br /> <br />
<div class="col-12"> <div class="col-12">
答案解析<UeEditor v-model="objOption.AnswerParse" :config="config" ref="AnswerParse"></UeEditor> 答案解析<UeEditor v-model="objOption.AnswerParse" :config="config" ref="AnswerParse"></UeEditor>
...@@ -107,6 +110,7 @@ ...@@ -107,6 +110,7 @@
import shortAnswer from '../questiontype/short-answer' import shortAnswer from '../questiontype/short-answer'
import entryProblem from '../questiontype/entry-problem' import entryProblem from '../questiontype/entry-problem'
import matching from '../questiontype/matching' import matching from '../questiontype/matching'
import sortingProblem from '../questiontype/sorting-problem'
export default { export default {
components: { components: {
UeEditor, UeEditor,
...@@ -118,6 +122,7 @@ ...@@ -118,6 +122,7 @@
shortAnswer, //简答题 shortAnswer, //简答题
entryProblem, //分录题 entryProblem, //分录题
matching, //连线题 matching, //连线题
sortingProblem, //排序题
}, },
props: { props: {
setingObj: { setingObj: {
......
...@@ -56,11 +56,12 @@ ...@@ -56,11 +56,12 @@
----- -----
</td> </td>
<td> <td>
{{data[1]}} <select v-model="item.Content">
<el-select v-model="item.Content"> <template v-for="(cItem,cIndex) in data[1]">
<el-option v-for="(cItem,cIndex) in data[1]" :key="cIndex" :label="cItem.Name" :value="cItem.Name"> <option :key="cIndex" :label="cItem.Name" :value="cItem.Name">
</el-option> </option>
</el-select> </template>
</select>
</td> </td>
</tr> </tr>
</table> </table>
...@@ -89,6 +90,9 @@ ...@@ -89,6 +90,9 @@
}, },
optionTitleList: [], optionTitleList: [],
}; };
},
computed: {
}, },
created() { created() {
this.initConfig(); this.initConfig();
......
<!--排序题-->
<style>
</style>
<template>
<div class="sortingProblemQuestion">
<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