Commit fbbbeb65 authored by 黄奎's avatar 黄奎

页面修改

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