Commit 47a4312a authored by 黄奎's avatar 黄奎

页面修改

parent c0b66be5
......@@ -159,15 +159,15 @@
:questionData="AnswerList" :setOption="objOption" @getChild="getChildData">
</entry-problem>
<!--连线题-->
<matching v-if="questionObj.Key=='matching'" :questionData="AnswerList" @getChild="getChildData"></matching>
<matching v-if="questionObj.Key=='matching'" :questionData="AnswerList" :setOption="objOption" @getChild="getChildData"></matching>
<!--排序题-->
<sorting-problem v-if="questionObj.Key=='sorting-problem'" :questionData="AnswerList"
<sorting-problem v-if="questionObj.Key=='sorting-problem'" :questionData="AnswerList" :setOption="objOption"
@getChild="getChildData"></sorting-problem>
<!--完型填空-->
<cloze v-if="questionObj.Key=='cloze'" :questionData="AnswerList" @getChild="getChildData"></cloze>
<cloze v-if="questionObj.Key=='cloze'" :questionData="AnswerList" :setOption="objOption" @getChild="getChildData"></cloze>
<!--阅读理解、听力题-->
<reading-comprehensio v-if="questionObj.Key=='reading-comprehensio'||questionObj.Key=='listening'"
:questionData="AnswerList" @getChild="getChildData"></reading-comprehensio>
:questionData="AnswerList" :setOption="objOption" @getChild="getChildData"></reading-comprehensio>
<!--共用选择题-->
<sharing-choose v-if="questionObj.Key=='sharing-choose'" :questionData="AnswerList" @getChild="getChildData"
:setOption="objOption">
......@@ -187,9 +187,6 @@
</option>
</template>
</select>
<!-- <q-select filled stack-label option-value="Id" option-label="Name" v-model="objOption.DifficultyType"
ref="DifficultyType" :options="questionDifficultyTypeList" label="难易程度" :dense="false"
class="col-6 q-pr-lg q-pb-lg" emit-value map-options /> -->
</div>
<div class="col-12" style="margin-top:16px;">
<span class="difficulty_Degree">知识点: </span>
......@@ -200,10 +197,6 @@
{{x.PointName}}
<i class="iconfont icon-shanchu1" @click="removePointTag(i)"></i>
</span>
<!-- <div class="col">
<q-chip v-for="(x, i) in choosePointArray" @remove="removePointTag(i)" :key="i" square color="red"
class="q-ma-none q-mr-md" icon="bookmark" text-color="white" :label="x.PointName" removable />
</div> -->
</div>
</div>
</q-card-section>
......@@ -219,7 +212,6 @@
:multiple="true" @selected="getPointList">
</questionpoint>
</q-dialog>
</template>
<script>
......@@ -362,6 +354,7 @@
this.objOption.QuestionTypeKey = item.Key;
var obj = CreateQuestion(item.Key);
this.AnswerList = obj;
this.objOption.QuestionContent = JSON.stringify(obj);
},
//获取题型列表
getQuestionType() {
......
......@@ -111,6 +111,9 @@
props: {
questionData: {
type: Array,
},
setOption: {
type: Object,
}
},
components: {
......@@ -174,7 +177,7 @@
}
}).onOk(() => {
item.splice(index, 1);
this.childIndex=-1;
this.childIndex = -1;
this.calcOptionTitle();
});
},
......@@ -213,8 +216,27 @@
},
//返回数据到父组件
returnDataToParent() {
this.getAnswer();
this.$emit('getChild', this.data);
},
//获取答案
getAnswer() {
this.setOption.Answer = "";
if (this.data && this.data.length > 0) {
var answer = "";
this.data.forEach((item) => {
item.forEach((subItem) => {
if (subItem.IsAnswer) {
answer += "," + subItem.Name;
}
})
})
if (answer != "") {
answer = answer.substring(1);
}
this.setOption.Answer = answer;
}
},
ChangeItem(item, subItem) {
if (item && item.length > 0) {
item.forEach(childItem => {
......
<!--排序题-->
<style>
.sortingProblemQuestion{
width:100%
.sortingProblemQuestion {
width: 100%
}
.team_tit{
.team_tit {
font-size: 14px;
color: #A8A8B3;
padding-bottom: 20px;
}
.selectBox{
.selectBox {
display: inline-block;
vertical-align: top;
text-align: left;
......@@ -24,10 +26,12 @@
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">
......@@ -44,22 +48,19 @@
<i class="iconfont icon-guanbi Tiku_DelIcon" @click="deleteOpion(index)"></i>
</td>
</tr>
<tfoot>
<tr>
<td colspan="3">
</table>
<br />
<a class="addTiMuList" @click="addOption()">
<i class="iconfont icon-add"></i>添加选项
<i class="iconfont icon-add"></i>添加更多
</a>
</td>
</tr>
</tfoot>
</table>
<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">
<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>
......@@ -81,6 +82,9 @@
questionData: {
type: Array,
},
setOption: {
type: Object,
}
},
components: {
UeEditor
......@@ -93,8 +97,8 @@
initialFrameHeight: 80,
},
optionTitleList: [],
commonIndex:-1,
clickIndex:-1,
commonIndex: -1,
clickIndex: -1,
};
},
created() {
......@@ -122,7 +126,7 @@
}).onOk(() => {
this.data[0].splice(index, 1);
this.data[1].splice(index, 1);
this.commonIndex=-1;
this.commonIndex = -1;
this.calcOptionTitle();
});
},
......@@ -158,11 +162,26 @@
},
//返回数据到父组件
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;
changeEdit(index) {
this.commonIndex = index;
},
},
mounted() {
......
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