Commit fbbbeb65 authored by 黄奎's avatar 黄奎

页面修改

parent 2d2f1725
<!--填空题-->
<style>
.fillInQuestion{
width:100%;
.fillInQuestion {
width: 100%;
}
.tk_info {
color: #A8A8B3;
font-size: 12px;
line-height: 24px;
cursor: default;
margin-top:20px;
margin-top: 20px;
}
</style>
<template>
<div class="fillInQuestion">
......@@ -36,7 +38,8 @@
</tr>
<tr>
<td colspan="3">
<el-checkbox v-model="setOption.IsMutex" :true-label="1" :false-label="0"><span style="font-size:12px;">答案顺序打乱也判正确</span></el-checkbox>
<el-checkbox v-model="setOption.IsMutex" :true-label="1" :false-label="0"><span
style="font-size:12px;">答案顺序打乱也判正确</span></el-checkbox>
<div class="tk_info">
1. 一个空有多种答案时请用";"隔开。如:水;H2O
</br>
......@@ -69,7 +72,7 @@
initialFrameWidth: null,
initialFrameHeight: 80,
},
commonIndex:-1,
commonIndex: -1,
};
},
created() {},
......@@ -97,11 +100,21 @@
},
//返回数据到父组件
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;
changeEdit(index) {
this.commonIndex = index;
}
},
mounted() {
......
<!--多选题-->
<style>
.multipleQuestion{
width:100%;
.multipleQuestion {
width: 100%;
}
</style>
<template>
<div class="multipleQuestion">
......@@ -12,7 +13,6 @@
<div class="num_option_dx" @click="ChangeItem(item)" :class="{'Is_Answer':item.IsAnswer}">
{{item.Name}}
</div>
<!-- <el-checkbox v-model="item.IsAnswer">{{item.Name}}</el-checkbox> -->
</td>
<td>
<div class="InpDIV" v-html="item.Content" v-if="commonIndex!=index" @click="changeEdit(index)"></div>
......@@ -20,19 +20,12 @@
</td>
<td style="width:40px;text-align:center;">
<i class="iconfont icon-guanbi Tiku_DelIcon" @click="deleteOpion(index)"></i>
<!-- <a style="cursor:pointer;" @click="deleteOpion(index)">删除</a> -->
</td>
</tr>
<tfoot>
<tr>
<td colspan="3">
<a class="addTiMuList" @click="addOption()">
<i class="iconfont icon-add"></i>添加选项
</a>
</td>
</tr>
</tfoot>
</table>
<a class="addTiMuList" @click="addOption()">
<i class="iconfont icon-add"></i>添加选项
</a>
</div>
</template>
<script>
......@@ -60,7 +53,7 @@
initialFrameHeight: 80,
},
optionTitleList: [],
commonIndex:-1,
commonIndex: -1,
};
},
created() {
......@@ -81,7 +74,7 @@
cancel: "取消",
}).onOk(() => {
this.data.splice(index, 1);
this.commonIndex=-1;
this.commonIndex = -1;
this.calcOptionTitle();
}).onCancel(() => {
......@@ -131,12 +124,12 @@
this.$emit('getChild', this.data);
},
//点击设为答案
ChangeItem(item){
ChangeItem(item) {
item.IsAnswer = !item.IsAnswer;
},
//点击切换输入
changeEdit(index){
this.commonIndex=index;
changeEdit(index) {
this.commonIndex = index;
}
},
mounted() {
......
......@@ -22,16 +22,10 @@
<i class="iconfont icon-guanbi Tiku_DelIcon" @click="deleteOpion(index)"></i>
</td>
</tr>
<tfoot>
<tr>
<td colspan="3">
<a class="addTiMuList" @click="addOption()">
<i class="iconfont icon-add"></i>添加选项
</a>
</td>
</tr>
</tfoot>
</table>
<a class="addTiMuList" @click="addOption()">
<i class="iconfont icon-add"></i>添加选项
</a>
</div>
</template>
<script>
......@@ -83,6 +77,7 @@
this.data.splice(index, 1);
this.commonIndex = -1;
this.calcOptionTitle();
this.getAnswer();
}).onCancel(() => {
});
......@@ -96,6 +91,7 @@
IsAnswer: false
});
this.calcOptionTitle()
this.getAnswer();
} else {
this.$q.notify({
type: 'warning',
......@@ -129,7 +125,18 @@
})
}
item.IsAnswer = true;
this.setOption.Answer = item.Name;
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;
}
})
}
},
//点击切换输入
changeEdit(index) {
......
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