Commit e08906d4 authored by 黄奎's avatar 黄奎

页面修改

parent 534f7a8c
......@@ -90,7 +90,7 @@
</div>
</template>
<template v-slot:body-cell-Title="props">
<td style="width:400px;">
<td style="width:400px;cursor:pointer;">
<div @click="goDetail(props.row)" v-html="props.row.Title" class="quetion_Title">
</div>
</td>
......
<!--分录题-->
<style>
.entryProblemQuestion {
width: 100%;
}
.entrytk_info {
color: #A8A8B3;
font-size: 12px;
line-height: 24px;
cursor: default;
}
</style>
<template>
<div class="entryProblemQuestion">
<table v-if="data&&data.length>0" class="common_TiTable">
<tr v-for="(item,index) in data">
<td style="width:40px;text-align:center;padding-top:8px;">
{{index+1}}</el-checkbox>
</td>
<td>
<div class="InpDIV" v-html="item.Content" v-if="commonIndex!=index" @click="changeEdit(index)"></div>
<UeEditor v-model="item.Content" :config="config" v-else></UeEditor>
</td>
<td style="width:40px;text-align:center;">
<i class="iconfont icon-guanbi Tiku_DelIcon" @click="deleteOpion(index)"></i>
</td>
</tr>
</table>
<br />
<a class="addTiMuList" @click="addOption()">
<i class="iconfont icon-add"></i>添加更多
</a>
<br />
<br />
<el-checkbox v-model="setOption.IsMutex" :true-label="1" :false-label="0"><span
style="font-size:12px;">答案顺序打乱也判正确</span></el-checkbox>
<br />
<br />
<div class="entrytk_info">
1. 一个空有多种答案时请用";"隔开。如:水;H2O
<br />
2. 若试题答案是数字,可设置范围,两个数字之间用"-"。如:1-9,学生填写1到9之间的数字都算正确(包括1和9)
</div>
</div>
</template>
<script>
import UeEditor from '../editor/UeEditor'
export default {
props: {
questionData: {
type: Array,
},
setOption: {
type: Object,
}
},
components: {
UeEditor
},
data() {
return {
data: this.questionData,
config: {
initialFrameWidth: null,
initialFrameHeight: 80,
},
commonIndex: -1,
};
},
created() {},
methods: {
//删除选项
deleteOpion(index) {
this.$q.dialog({
title: "删除小题",
message: "确实要删除该选项吗?",
persistent: true,
cancel: {
label: "取消",
flat: true
},
ok: {
label: "确认",
flat: true,
focus: true
}
}).onOk(() => {
this.data.splice(index, 1);
this.commonIndex = -1;
});
},
//新增选项
addOption() {
this.data.push({
Content: "",
});
},
//获取答案
getAnswer() {
if (this.data && this.data.length > 0) {
var answer = "";
this.data.forEach(item => {
answer += "★" + item.Content;
})
if (answer != "") {
answer = answer.substring(1);
}
this.setOption.Answer = answer;
}
},
//返回数据到父组件
returnDataToParent() {
this.getAnswer();
this.$emit('getChild', this.data);
},
changeEdit(index) {
this.commonIndex = index;
}
},
mounted() {
},
watch: {
data: {
handler(newValue) {
this.returnDataToParent();
},
deep: true
},
}
};
</script>
<!--填空题-->
<style>
.fillInQuestion {
width: 100%;
}
.tk_info {
color: #A8A8B3;
font-size: 12px;
line-height: 24px;
cursor: default;
margin-top: 20px;
}
</style>
<template>
<div class="fillInQuestion">
<table v-if="data&&data.length>0" class="common_TiTable">
<tr v-for="(item,index) in data">
<td style="width:50px;text-align:center;padding-top:8px;">
{{index+1}}</el-checkbox>
</td>
<td>
<div class="InpDIV" v-html="item.Content" v-if="commonIndex!=index" @click="changeEdit(index)"></div>
<UeEditor v-model="item.Content" :config="config" v-else></UeEditor>
</td>
<td style="width:30px;text-align:center;">
<i class="iconfont icon-guanbi Tiku_DelIcon" @click="deleteOpion(index)"></i>
</td>
</tr>
</table>
<a class="addTiMuList" @click="addOption()">
<i class="iconfont icon-add"></i>添加更多
</a>
<br />
<br />
<el-checkbox v-model="setOption.IsMutex" :true-label="1" :false-label="0"><span
style="font-size:12px;">答案顺序打乱也判正确</span></el-checkbox>
<br />
<div class="tk_info">
1. 一个空有多种答案时请用";"隔开。如:水;H2O
</br>
2. 若试题答案是数字,可设置范围,两个数字之间用"-"。如:1-9,学生填写1到9之间的数字都算正确(包括1和9)
</div>
</div>
</template>
<script>
import UeEditor from '../editor/UeEditor'
export default {
props: {
questionData: {
type: Array,
},
setOption: {
type: Object,
}
},
components: {
UeEditor
},
data() {
return {
data: this.questionData,
config: {
initialFrameWidth: null,
initialFrameHeight: 80,
},
commonIndex: -1,
};
},
created() {},
methods: {
//删除选项
deleteOpion(index) {
this.$q.dialog({
title: '提示信息',
message: '是否确定删除?',
cancel: true,
persistent: true,
ok: "确定",
cancel: "取消",
}).onOk(() => {
this.data.splice(index, 1);
}).onCancel(() => {
});
},
//新增选项
addOption() {
this.data.push({
Content: "",
});
},
//返回数据到父组件
returnDataToParent() {
if (this.data && this.data.length > 0) {
var answer = "";
this.data.forEach(item => {
answer += "★" + item.Content;
})
if (answer != "") {
answer = answer.substring(1);
}
this.setOption.Answer = answer;
}
this.$emit('getChild', this.data);
},
//点击切换输入
changeEdit(index) {
this.commonIndex = index;
}
},
mounted() {
},
watch: {
data: {
handler(newValue) {
this.returnDataToParent();
},
deep: true
},
}
};
</script>
<!--判断题-->
<style>
.judgeQuestion {
width: 100%;
}
</style>
<template>
<div class="judgeQuestion">
<table v-if="data&&data.length>0" class="common_TiTable">
<tr v-for="(item,index) in data">
<td style="width:50px;text-align:center;">
<div class="Answer_List" @click="ChangeItem(item)" :class="{'Is_Answer':item.IsAnswer}">
{{item.Name}}
</div>
</td>
<td style="vertical-align:middle;">
<span v-if="index==0"></span>
<span v-if="index==1"></span>
</td>
</tr>
</table>
</div>
</template>
<script>
import UeEditor from '../editor/UeEditor'
export default {
props: {
questionData: {
type: Array,
},
setOption: {
type: Object,
}
},
components: {
UeEditor
},
data() {
return {
data: this.questionData,
config: {
initialFrameWidth: null,
initialFrameHeight: 80,
},
};
},
created() {},
methods: {
//返回数据到父组件
returnDataToParent() {
this.getAnswer();
this.$emit('getChild', this.data);
},
ChangeItem(item) {
if (this.data && this.data.length > 0) {
this.data.forEach(item => {
item.IsAnswer = false;
})
}
item.IsAnswer = true;
this.getAnswer();
},
//获取正确答案
getAnswer() {
this.setOption.Answer = "";
if (this.data && this.data.length > 0) {
this.data.forEach(item => {
if (item.IsAnswer) {
this.setOption.Answer = item.Name;
}
})
}
},
},
mounted() {
},
watch: {
data: {
handler(newValue) {
this.returnDataToParent();
},
deep: true
},
}
};
</script>
<!--连线题-->
<style>
.matchingQuestion {
width: 100%;
}
.team_tit {
display: inline-block;
font-size: 14px;
color: #A8A8B3;
padding-bottom: 20px;
margin-left: 13px;
}
.line_center {
display: inline-block;
width: 28px;
height: 10px;
border-top: 1px solid #E1E1E5;
margin: 13px 12px 0 0;
}
.selectBox2 {
display: inline-block;
vertical-align: top;
text-align: left;
position: relative;
cursor: pointer;
width: 58px;
line-height: 24px;
height: 24px;
background: #FFFFFF;
border: 1px solid #E1E1E5;
border-radius: 4px;
font-size: 12px;
color: #181E33;
outline: none;
}
</style>
<template>
<div class="matchingQuestion">
<span class="team_tit" style="margin-top:20px;padding-bottom:0;">第1组:</span>
<table v-if="data&&data.length>0" class="common_TiTable">
<tr v-for="(item,index) in data[0]">
<td style="width:40px;text-align:center;padding-top:10px;">
{{item.Name}}
</td>
<td>
<div class="InpDIV" v-html="item.Content" v-if="commonIndex!=index" @click="changeEdit(index)"></div>
<UeEditor v-model="item.Content" :config="config" v-else></UeEditor>
</td>
<td style="width:40px;text-align:center;">
<i class="iconfont icon-guanbi Tiku_DelIcon" @click="deleteOpion(0,index)"></i>
</td>
</tr>
<tfoot>
<tr>
<td colspan="3">
<a class="addTiMuList" style="margin-left:13px;" @click="addOption(0)">
<i class="iconfont icon-add"></i>添加更多
</a>
</td>
</tr>
</tfoot>
</table>
<span class="team_tit">第2组:</span>
<table v-if="data&&data.length>1" class="common_TiTable">
<tr v-for="(item,index) in data[1]">
<td style="width:40px;text-align:center;padding-top:10px;">
{{item.Name}}
</td>
<td>
<div class="InpDIV" v-html="item.Content" v-if="commonIndex2!=index" @click="changeEdit2(index)"></div>
<UeEditor v-model="item.Content" :config="config" v-else></UeEditor>
</td>
<td style="width:40px;text-align:center;">
<i class="iconfont icon-guanbi Tiku_DelIcon" @click="deleteOpion(1,index)"></i>
</td>
</tr>
<tfoot>
<tr>
<td colspan="3">
<a class="addTiMuList" style="margin-left:13px;" @click="addOption(1)">
<i class="iconfont icon-add"></i>添加更多
</a>
</td>
</tr>
</tfoot>
</table>
<span class="team_tit">答案</span>
<table v-if="data&&data.length>2" style="padding-left:13px;">
<tr v-for="(item,index) in data[0]">
<td style="width:30px;">
{{item.Name}}
</td>
<td>
<span class="line_center"></span>
</td>
<td>
<select v-model="data[2][index].Content" class="selectBox2">
<template v-for="(cItem,cIndex) in data[1]">
<option :key="cIndex" :label="cItem.Name" :value="cItem.Name">
</option>
</template>
</select>
</td>
</tr>
</table>
</div>
</template>
<script>
import {
getOptionList, //获取选择标签【A,B,C,D....】
} from '../../api/question/questionconfig'
import UeEditor from '../editor/UeEditor'
export default {
props: {
questionData: {
type: Array,
},
setOption: {
type: Object,
}
},
components: {
UeEditor
},
data() {
return {
data: this.questionData,
config: {
initialFrameWidth: null,
initialFrameHeight: 80,
},
optionTitleList: [],
commonIndex: -1,
commonIndex2: -1
};
},
computed: {
},
created() {
this.initConfig();
},
methods: {
initConfig() {
this.optionTitleList = getOptionList();
},
//删除选项
deleteOpion(index, subIndex) {
this.$q.dialog({
title: '提示信息',
message: '是否确定删除?',
cancel: true,
persistent: true,
ok: "确定",
cancel: "取消",
}).onOk(() => {
//删除第一组是,也删除答案里面的
if (index == 0) {
this.data[2].splice(subIndex, 1);
}
this.data[index].splice(subIndex, 1);
//删除的第二组
if (index == 1) {
var temp1 = this.data[1];
this.data[2].forEach(item => {
var isExists = false;
if (temp1 && temp1.length > 0) {
temp1.forEach(subItem => {
if (subItem.Name == item.Content) {
isExists = true;
}
})
}
if (!isExists) {
item.Content = "";
}
})
}
this.commonIndex = -1;
this.commonIndex2 = -1;
this.calcOptionTitle();
}).onCancel(() => {
});
},
//新增选项
addOption(index) {
if (index == 0) {
this.data[2].push({
Name: "",
Content: "A",
});
}
this.data[index].push({
Name: "",
Content: "",
});
this.calcOptionTitle();
},
//重新计算选择Title[A,B,C,D....]
calcOptionTitle() {
if (this.data && this.data.length > 0) {
this.data.forEach((item, index) => {
item.forEach((subItem, subIndex) => {
if (index == 0 || index == 2) {
subItem.Name = subIndex + 1;
} else if (index == 1) {
subItem.Name = this.optionTitleList[subIndex];
}
})
})
}
},
//返回数据到父组件
returnDataToParent() {
this.getAnswer();
this.$emit('getChild', this.data);
},
//获取正确答案
getAnswer() {
this.setOption.Answer = "";
if (this.data && this.data.length > 0) {
var answer = "";
this.data[2].forEach(item => {
answer += "," + item.Content;
})
if (answer != "") {
answer = answer.substring(1);
}
this.setOption.Answer = answer;
}
},
//点击切换输入
changeEdit(index) {
this.commonIndex = index;
this.commonIndex2 = -1;
},
changeEdit2(index) {
this.commonIndex2 = index;
this.commonIndex = -1;
}
},
mounted() {},
watch: {
data: {
handler(newValue) {
this.returnDataToParent();
},
deep: true
},
}
};
</script>
<!--多选题-->
<style>
.multipleQuestion {
width: 100%;
}
</style>
<template>
<div class="multipleQuestion">
<table v-if="data&&data.length>0" class="common_TiTable">
<tr v-for="(item,index) in data">
<td style="width:40px;text-align:center;">
<div class="num_option_dx" @click="ChangeItem(item)" :class="{'Is_Answer':item.IsAnswer}">
{{item.Name}}
</div>
</td>
<td>
<div class="InpDIV" v-html="item.Content" v-if="commonIndex!=index" @click="changeEdit(index)"></div>
<UeEditor v-model="item.Content" :config="config" v-else></UeEditor>
</td>
<td style="width:40px;text-align:center;">
<i class="iconfont icon-guanbi Tiku_DelIcon" @click="deleteOpion(index)"></i>
</td>
</tr>
</table>
<a class="addTiMuList" @click="addOption()">
<i class="iconfont icon-add"></i>添加选项
</a>
</div>
</template>
<script>
import {
getOptionList, //获取选择标签【A,B,C,D....】
} from '../../api/question/questionconfig'
import UeEditor from '../editor/UeEditor'
export default {
props: {
questionData: {
type: Array,
},
setOption: {
type: Object,
}
},
components: {
UeEditor
},
data() {
return {
data: this.questionData,
config: {
initialFrameWidth: null,
initialFrameHeight: 80,
},
optionTitleList: [],
commonIndex: -1,
};
},
created() {
this.initConfig();
},
methods: {
initConfig() {
this.optionTitleList = getOptionList();
},
//删除选项
deleteOpion(index) {
this.$q.dialog({
title: '提示信息',
message: '是否确定删除?',
cancel: true,
persistent: true,
ok: "确定",
cancel: "取消",
}).onOk(() => {
this.data.splice(index, 1);
this.commonIndex = -1;
this.calcOptionTitle();
}).onCancel(() => {
});
},
//新增选项
addOption() {
if (this.data.length < 7) {
this.data.push({
Name: "",
Content: "",
IsAnswer: false
});
this.calcOptionTitle()
} else {
this.$q.notify({
type: 'warning',
position: 'center',
timeout: 1500,
message: `最多只能添加7个选项`
})
return
}
},
//重新计算选择Title[A,B,C,D....]
calcOptionTitle() {
if (this.data && this.data.length > 0) {
this.data.forEach((item, index) => {
item.Name = this.optionTitleList[index];
})
}
},
//返回数据到父组件
returnDataToParent() {
if (this.data && this.data.length > 0) {
var answer = "";
this.data.forEach(item => {
if (item.IsAnswer) {
answer += "," + item.Name;
}
})
if (answer != "") {
answer = answer.substring(1);
}
this.setOption.Answer = answer;
}
this.$emit('getChild', this.data);
},
//点击设为答案
ChangeItem(item) {
item.IsAnswer = !item.IsAnswer;
},
//点击切换输入
changeEdit(index) {
this.commonIndex = index;
}
},
mounted() {
},
watch: {
data: {
handler(newValue) {
this.returnDataToParent();
},
deep: true
},
}
};
</script>
This diff is collapsed.
<!--共用选择题-->
<style>
.sharingChooseQuestion {
width: 100%;
}
.B-info {
font-size: 14PX;
color: #A8A8B3;
padding-bottom: 10px;
margin-left: 13px;
}
</style>
<template>
<div class="sharingChooseQuestion">
<table v-if="data&&data.length>0" class="common_TiTable">
<tr v-for="(item,index) in data[0]">
<td style="width:40px;text-align:center;padding-top:8px;">
{{item.Name}}
</td>
<td>
<div class="InpDIV" v-html="item.Content" v-if="commonIndex!=index" @click="changeEdit(index)"></div>
<UeEditor v-model="item.Content" :config="config" v-else></UeEditor>
</td>
<td style="width:40px;text-align:center;">
<i v-if="index>0" class="iconfont icon-guanbi Tiku_DelIcon" @click="deleteOpion(index)"></i>
</td>
</tr>
<tfoot>
<tr>
<td colspan="3">
<a class="addTiMuList" style="margin-left:13px;" @click="addOption()">
<i class="iconfont icon-add"></i>添加选项
</a>
</td>
</tr>
</tfoot>
</table>
<table v-if="data&&data.length>0" class="common_TiTable">
<tr v-for="(item,index) in data[1]">
<td style="width:40px;text-align:center;padding-top:8px;">
{{index+1}}
</td>
<td>
<div class="InpDIV" v-html="item.Content" v-if="commonIndex2!=index" @click="changeEdit2(index)"></div>
<UeEditor v-model="item.Content" :config="config" v-else></UeEditor>
</td>
<td style="width:40px;text-align:center;">
<i v-if="index>0" class="iconfont icon-guanbi Tiku_DelIcon" @click="deleteQuestion(index)"></i>
</td>
</tr>
<tfoot>
<tr>
<td colspan="3">
<a class="addTiMuList" style="margin-left:13px;" @click="addQuestion()">
<i class="iconfont icon-add"></i>添加题干
</a>
</td>
</tr>
</tfoot>
</table>
<div class="B-info">答案:</div>
<table v-if="data&&data.length>0" style="margin-bottom:20px;">
<tr v-for="(item,index) in data[1]">
<td style="padding:12px 0 0 13px;">
{{index+1}}
</td>
<td>
<select v-model="item.Name" class="selectBox" style="margin:10px 0 0 0;outline:none;">
<template v-for="(cItem,cIndex) in data[0]">
<option :key="cIndex" :label="cItem.Name" :value="cItem.Name">
</option>
</template>
</select>
</td>
</tr>
</table>
</div>
</template>
<script>
import {
getOptionList, //获取选择标签【A,B,C,D....】
} from '../../api/question/questionconfig'
import UeEditor from '../editor/UeEditor'
export default {
props: {
questionData: {
type: Array,
},
setOption: {
type: Object
}
},
components: {
UeEditor
},
data() {
return {
data: this.questionData,
config: {
initialFrameWidth: null,
initialFrameHeight: 80,
},
optionTitleList: [],
commonIndex: -1,
commonIndex2: -2
};
},
created() {
this.initConfig();
},
methods: {
initConfig() {
this.optionTitleList = getOptionList();
},
//删除选项
deleteOpion(index) {
this.$q.dialog({
title: '提示信息',
message: '是否确定删除?',
cancel: true,
persistent: true,
ok: "确定",
cancel: "取消",
}).onOk(() => {
this.data[0].splice(index, 1);
this.commonIndex = -1;
this.calcOptionTitle();
}).onCancel(() => {
});
},
//新增选项
addOption() {
if (this.data.length < 26) {
this.data[0].push({
Name: "",
Content: "",
});
this.calcOptionTitle();
} else {
this.$q.notify({
type: 'warning',
position: 'center',
timeout: 1500,
message: `最多只能添加26个选项`
})
return
}
},
//删除题干
deleteQuestion(index) {
this.$q.dialog({
title: '提示信息',
message: '是否确定删除?',
cancel: true,
persistent: true,
ok: "确定",
cancel: "取消",
}).onOk(() => {
this.data[1].splice(index, 1);
this.commonIndex2 = -1;
this.calcOptionTitle();
}).onCancel(() => {
});
},
//添加题干
addQuestion() {
this.data[1].push({
Name: "",
Content: "",
});
this.calcOptionTitle();
},
//重新计算选择Title[A,B,C,D....]
calcOptionTitle() {
if (this.data && this.data.length > 0) {
this.data[0].forEach((item, index) => {
item.Name = this.optionTitleList[index];
})
}
},
//返回数据到父组件
returnDataToParent() {
this.$emit('getChild', this.data);
},
getAnswer() {
this.setOption.Answer = "";
if (this.data && this.data.length > 1) {
var answer = "";
this.data[1].forEach(item => {
answer += "," + item.Name;
})
if (answer != "") {
answer = answer.substring(1);
}
this.setOption.Answer = answer;
}
},
changeEdit(index) {
this.commonIndex = index;
this.commonIndex2 = -1;
},
changeEdit2(index) {
this.commonIndex = -1;
this.commonIndex2 = index;
}
},
mounted() {
},
watch: {
data: {
handler(newValue) {
this.setOption.Title = this.data[1][0].Content;
this.returnDataToParent();
},
deep: true
},
}
};
</script>
<!--简答题-->
<style>
.shortAnswerQuestion {
width: 100%;
margin-bottom: 20px;
}
</style>
<template>
<div class="shortAnswerQuestion">
<br />
答案
<br />
<UeEditor v-model="setOption.Answer" :config="config"></UeEditor>
</div>
</template>
<script>
import UeEditor from '../editor/UeEditor'
export default {
props: {
setOption: {
type: Object,
}
},
components: {
UeEditor
},
data() {
return {
config: {
initialFrameWidth: null,
initialFrameHeight: 80,
},
};
},
created() {},
methods: {
},
mounted() {
},
};
</script>
<!--排序题-->
<style>
.sortingProblemQuestion {
width: 100%
}
.team_tit {
font-size: 14px;
color: #A8A8B3;
padding-bottom: 20px;
}
.selectBox {
display: inline-block;
vertical-align: top;
text-align: left;
position: relative;
cursor: pointer;
width: 58px;
line-height: 24px;
height: 24px;
background: #FFFFFF;
border: 1px solid #E1E1E5;
border-radius: 4px;
font-size: 12px;
color: #181E33;
margin: 0 20px 14px 0;
}
.blue-border {
border: 1px solid #FFFFFF;
box-shadow: 0 0 7px 1px #75BAFF;
}
</style>
<template>
<div class="sortingProblemQuestion">
<table v-if="data&&data.length>0" class="common_TiTable">
<tr v-for="(item,index) in data[0]">
<td style="width:40px;text-align:center;">
{{item.Name}}
</td>
<td>
<div class="InpDIV" v-html="item.Content" v-if="commonIndex!=index" @click="changeEdit(index)"></div>
<UeEditor v-model="item.Content" :config="config" v-else></UeEditor>
</td>
<td style="width:40px;text-align:center;">
<i class="iconfont icon-guanbi Tiku_DelIcon" @click="deleteOpion(index)"></i>
</td>
</tr>
</table>
<br />
<a class="addTiMuList" @click="addOption()">
<i class="iconfont icon-add"></i>添加更多
</a>
<br />
<div class="team_tit">答案:请在下方下拉框中对选项进行排序(顺序从左到右)</div>
<table v-if="data&&data.length>0">
<tr>
<td>
<template v-for="(item,index) in data[1]">
<select v-model="item.Name" class="selectBox" :class="{'blue-border':index==clickIndex}"
@click="clickIndex=index">
<template v-for="(cItem,cIndex) in data[0]">
<option :key="cIndex" :label="cItem.Name" :value="cItem.Name">
</option>
</template>
</select>
</template>
</td>
</tr>
</table>
</div>
</template>
<script>
import {
getOptionList, //获取选择标签【A,B,C,D....】
} from '../../api/question/questionconfig'
import UeEditor from '../editor/UeEditor'
export default {
props: {
questionData: {
type: Array,
},
setOption: {
type: Object,
}
},
components: {
UeEditor
},
data() {
return {
data: this.questionData,
config: {
initialFrameWidth: null,
initialFrameHeight: 80,
},
optionTitleList: [],
commonIndex: -1,
clickIndex: -1,
};
},
created() {
this.initConfig();
},
methods: {
initConfig() {
this.optionTitleList = getOptionList();
},
//删除选项
deleteOpion(index) {
this.$q.dialog({
title: "删除小题",
message: "确实要删除该选项吗?",
persistent: true,
cancel: {
label: "取消",
flat: true
},
ok: {
label: "确认",
flat: true,
focus: true
}
}).onOk(() => {
this.data[0].splice(index, 1);
this.data[1].splice(index, 1);
this.commonIndex = -1;
this.calcOptionTitle();
});
},
//新增选项
addOption() {
if (this.data.length < 26) {
this.data[0].push({
Name: "",
Content: "",
});
this.data[1].push({
Name: "A",
Content: "",
});
this.calcOptionTitle();
} else {
this.$q.notify({
type: 'warning',
position: 'center',
timeout: 1500,
message: `最多只能添加26个选项`
})
return
}
},
//重新计算选择Title[A,B,C,D....]
calcOptionTitle() {
if (this.data && this.data.length > 0) {
this.data[0].forEach((item, index) => {
item.Name = this.optionTitleList[index];
})
}
},
//返回数据到父组件
returnDataToParent() {
this.getAnswer();
this.$emit('getChild', this.data);
},
//获取正确答案
getAnswer() {
this.setOption.Answer = "";
if (this.data && this.data.length > 0) {
var answer = "";
this.data[1].forEach(item => {
answer += "," + item.Name;
})
if (answer != "") {
answer = answer.substring(1);
}
this.setOption.Answer = answer;
}
},
//点击切换输入
changeEdit(index) {
this.commonIndex = index;
},
},
mounted() {
},
watch: {
data: {
handler(newValue) {
this.returnDataToParent();
},
deep: true
},
}
};
</script>
......@@ -131,46 +131,45 @@
<span class="question_number">选项处用##题号##替换,如##1##</span>
</template>
<div v-html="objOption.Title" @click="clickQuestion($event)"></div>
<!-- <UeEditor v-if="questionObj.Key!='sharing-choose'" v-model="objOption.Title" :config="config"
ref="UE_Title"></UeEditor> -->
</div>
<br />
<!--单选题-->
<v-single v-if="questionObj.Key=='single'||questionObj.Key=='single-number'" :questionData="AnswerList"
@getChild="getChildData" :setOption="objOption"></v-single>
<!--多选题-->
<multiple v-if="questionObj.Key=='multiple'" :questionData="AnswerList" @getChild="getChildData"
:setOption="objOption"></multiple>
<v-multiple v-if="questionObj.Key=='multiple'" :questionData="AnswerList" @getChild="getChildData"
:setOption="objOption"></v-multiple>
<!--填空题-->
<fill-in v-if="questionObj.Key=='fill-in'" :questionData="AnswerList" @getChild="getChildData"
:setOption="objOption"></fill-in>
<v-fillin v-if="questionObj.Key=='fill-in'" :questionData="AnswerList" @getChild="getChildData"
:setOption="objOption"></v-fillin>
<!--判断题-->
<judge v-if="questionObj.Key=='judge'" :questionData="AnswerList" @getChild="getChildData"
:setOption="objOption"></judge>
<v-judge v-if="questionObj.Key=='judge'" :questionData="AnswerList" @getChild="getChildData"
:setOption="objOption"></v-judge>
<!--简答题、名词解释、论述题、计算题、口语题、其它-->
<short-answer v-if="questionObj.Key=='short-answer'||questionObj.Key=='noun-explanation'||questionObj.Key=='essay-question'
<v-shortanswer v-if="questionObj.Key=='short-answer'||questionObj.Key=='noun-explanation'||questionObj.Key=='essay-question'
||questionObj.Key=='calculation' || questionObj.Key=='spoken'|| questionObj.Key=='other'
" :setOption="objOption"> </short-answer>
" :setOption="objOption"> </v-shortanswer>
<!--分录题、资料题-->
<entry-problem v-if="questionObj.Key=='entry-problem'|| questionObj.Key=='data-question'"
<v-entryproblem v-if="questionObj.Key=='entry-problem'|| questionObj.Key=='data-question'"
:questionData="AnswerList" :setOption="objOption" @getChild="getChildData">
</entry-problem>
</v-entryproblem>
<!--连线题-->
<matching v-if="questionObj.Key=='matching'" :questionData="AnswerList" :setOption="objOption"
@getChild="getChildData"></matching>
<v-matching v-if="questionObj.Key=='matching'" :questionData="AnswerList" :setOption="objOption"
@getChild="getChildData"></v-matching>
<!--排序题-->
<sorting-problem v-if="questionObj.Key=='sorting-problem'" :questionData="AnswerList" :setOption="objOption"
@getChild="getChildData"></sorting-problem>
<v-sortingproblem v-if="questionObj.Key=='sorting-problem'" :questionData="AnswerList" :setOption="objOption"
@getChild="getChildData"></v-sortingproblem>
<!--完型填空-->
<cloze v-if="questionObj.Key=='cloze'" :questionData="AnswerList" :setOption="objOption"
@getChild="getChildData"></cloze>
<v-cloze v-if="questionObj.Key=='cloze'" :questionData="AnswerList" :setOption="objOption"
@getChild="getChildData"></v-cloze>
<!--阅读理解、听力题-->
<reading-comprehensio v-if="questionObj.Key=='reading-comprehensio'||questionObj.Key=='listening'"
:questionData="AnswerList" :setOption="objOption" @getChild="getChildData"></reading-comprehensio>
<v-readingcomprehensio v-if="questionObj.Key=='reading-comprehensio'||questionObj.Key=='listening'"
:questionData="AnswerList" :setOption="objOption" @getChild="getChildData"></v-readingcomprehensio>
<!--共用选择题-->
<sharing-choose v-if="questionObj.Key=='sharing-choose'" :questionData="AnswerList" @getChild="getChildData"
<v-sharingchoose v-if="questionObj.Key=='sharing-choose'" :questionData="AnswerList" @getChild="getChildData"
:setOption="objOption">
</sharing-choose>
</v-sharingchoose>
<br />
<div class="col-12">
<div style="margin:20px 0;">答案解析</div>
......@@ -181,12 +180,7 @@
<br />
<span class="difficulty_Degree">难度</span>
<span>{{objOption.DifficultyTypeStr}}</span>
<!-- <select v-model="objOption.DifficultyType" class="selectBox blue-border">
<template v-for="(cItem,cIndex) in questionDifficultyTypeList">
<option :key="cIndex" :label="cItem.Name" :value="cItem.Id">
</option>
</template>
</select> -->
</div>
<div class="col-12">
<br />
......@@ -249,31 +243,31 @@
import questionpoint from '../../components/question/questionpoint'
import vSingle from '../../components/questiontype/v-single'
import multiple from '../../components/questiontype/multiple'
import fillIn from '../../components/questiontype/fill-in'
import judge from '../../components/questiontype/judge'
import shortAnswer from '../../components/questiontype/short-answer'
import entryProblem from '../../components/questiontype/entry-problem'
import matching from '../../components/questiontype/matching'
import sortingProblem from '../../components/questiontype/sorting-problem'
import cloze from '../../components/questiontype/cloze'
import readingComprehensio from '../../components/questiontype/reading-comprehensio'
import sharingChoose from '../../components/questiontype/sharing-choose'
import vMultiple from '../../components/questiontype/v-multiple'
import vFillIn from '../../components/questiontype/v-fillin'
import vJudge from '../../components/questiontype/v-judge'
import vShortAnswer from '../../components/questiontype/v-shortanswer'
import vEntryProblem from '../../components/questiontype/v-entryproblem'
import vMatching from '../../components/questiontype/v-matching'
import vSortingProblem from '../../components/questiontype/v-sortingproblem'
import vCloze from '../../components/questiontype/v-cloze'
import vReadingComprehensio from '../../components/questiontype/v-readingcomprehensio'
import vSharingChoose from '../../components/questiontype/v-sharingchoose'
export default {
components: {
UeEditor,
questionpoint, //知识点
vSingle, //单选题
multiple, //多选题
fillIn, //填空题
judge, //判断题
shortAnswer, //简答题
entryProblem, //分录题
matching, //连线题
sortingProblem, //排序题
cloze, //完型填空
readingComprehensio, //阅读理解
sharingChoose, //共用选择题
vMultiple, //多选题
vFillIn, //填空题
vJudge, //判断题
vShortAnswer, //简答题
vEntryProblem, //分录题
vMatching, //连线题
vSortingProblem, //排序题
vCloze, //完型填空
vReadingComprehensio, //阅读理解
vSharingChoose, //共用选择题
},
props: {
setingObj: {
......
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