Commit a7d2bfc1 authored by 黄奎's avatar 黄奎

页面修改

parent 53cdc553
......@@ -47,9 +47,17 @@
<tbody class="contant">
<tr v-for="(subItem,subIndex) in item">
<td style="width:40px;text-align:center;">
<div class="Answer_List2">
{{subItem.Name}}
</div>
<template v-if="isOperate">
<div class="Answer_List" @click="ChangeItem(item,subItem)" :class="{'Is_Answer':subItem.IsAnswer}">
{{subItem.Name}}
</div>
</template>
<template v-else>
<div class="Answer_List2">
{{subItem.Name}}
</div>
</template>
</td>
<td>
<div class="InpDIV" style="border:0;margin-top:-2px;" v-html="subItem.Content">
......@@ -81,7 +89,12 @@
isShowAnswer: {
type: Boolean,
default: false,
}
},
//是否可操作(PC端考试使用【可以点击选中】)
isOperate: {
type: Boolean,
default: false,
},
},
data() {
return {
......@@ -89,7 +102,33 @@
};
},
methods: {
//获取答案
getAnswer() {
this.data.Answer = "";
if (this.data && this.data.QuestionContentObj && this.data.QuestionContentObj.length > 0) {
var answer = "";
this.data.QuestionContentObj.forEach((item) => {
item.forEach((subItem) => {
if (subItem.IsAnswer) {
answer += "," + subItem.Name;
}
})
})
if (answer != "") {
answer = answer.substring(1);
}
this.data.Answer = answer;
}
},
ChangeItem(item, subItem) {
if (item && item.length > 0) {
item.forEach(childItem => {
childItem.IsAnswer = false;
})
}
subItem.IsAnswer = true;
this.getAnswer();
},
},
mounted() {
......
......@@ -3,6 +3,7 @@
.v_entryProblemQuestion {
width: 100%;
}
</style>
<template>
<div class="v_entryProblemQuestion">
......@@ -17,6 +18,16 @@
</td>
</tr>
</tbody>
<tbody v-if="isOperate" v-for="(item,index) in data.QuestionContentObj" :key="index">
<tr>
<td style="width:50px;text-align:center;padding-top:8px;">
{{index+1}}</el-checkbox>
</td>
<td>
<el-input v-model="item.Content" :placeholder="'请填写第 '+(index+1)+' 空答案'"> </el-input>
</td>
</tr>
</tbody>
<tbody>
<tr>
<td colspan="2"><span v-if="data&&data.IsMutex==1" style="font-size:13px;">答案顺序打乱也判正确</span></td>
......@@ -46,9 +57,13 @@
isShowAnswer: {
type: Boolean,
default: false,
}
},
//是否可操作(PC端考试使用【可以填写答案】)
isOperate: {
type: Boolean,
default: false,
},
},
data() {
return {
data: this.questionObj,
......
......@@ -24,7 +24,7 @@
{{index+1}}</el-checkbox>
</td>
<td>
<el-input v-model="item.Content" > </el-input>
<el-input v-model="item.Content" :placeholder="'请填写第 '+(index+1)+' 空答案'"> </el-input>
</td>
</tr>
</tbody>
......
......@@ -45,6 +45,24 @@
</td>
</tr>
</table>
<table v-if="isOperate&&data&&data.QuestionContentObj&&data.QuestionContentObj.length>2" style="padding-left:13px;">
<tr v-for="(item,index) in data.QuestionContentObj[0]">
<td style="width:30px;">
{{item.Name}}
</td>
<td>
<span class="line_center"></span>
</td>
<td>
<select v-model="data.QuestionContentObj[2][index].Content" class="selectBox2">
<template v-for="(cItem,cIndex) in data.QuestionContentObj[1]">
<option :key="cIndex" :label="cItem.Name" :value="cItem.Name">
</option>
</template>
</select>
</td>
</tr>
</table>
<span class="team_tit" v-if="isShowAnswer">答案</span>
<table v-if="isShowAnswer&&data&&data.QuestionContentObj&&data.QuestionContentObj.length>2"
style="padding-left:13px;">
......@@ -79,7 +97,12 @@
isShowAnswer: {
type: Boolean,
default: false,
}
},
//是否可操作(PC端考试使用【可以点击选中】)
isOperate: {
type: Boolean,
default: false,
},
},
data() {
return {
......
......@@ -4,7 +4,7 @@
width: 100%;
}
.v_readingComprehensioQuestion .clozeTest_question_tit {
width: 100%;
height: 40px;
......@@ -16,7 +16,7 @@
display: flex;
justify-content: space-between;
align-items: center;
margin-top:10px;
margin-top: 10px;
}
.v_readingComprehensioQuestion .clozeTest_question_tit i {
......@@ -28,10 +28,10 @@
<template>
<div class="v_readingComprehensioQuestion">
<template v-if="data&&data.QuestionContentObj&&data.QuestionContentObj.length>0">
<table class="common_TiTable" v-for="(item,index) in data.QuestionContentObj" :key="index">
<table class="common_TiTable" v-for="(item,index) in data.QuestionContentObj" :key="index">
<thead>
<tr>
<th colspan="3" style="text-align:left;">
<th colspan="2" style="text-align:left;">
<div class="clozeTest_question_tit" @click="showNav(index)">
<div>
{{index+1}}小题<span style="color:#A8A8B3;">({{item.QuestionName}})</span>
......@@ -44,7 +44,7 @@
</thead>
<tbody>
<tr>
<td colspan="3">
<td colspan="2">
<div style="margin:16px 0;" v-html="item.SubTitle"></div>
</td>
</tr>
......@@ -53,61 +53,116 @@
v-if="item.QuestionKey=='single' ||item.QuestionKey=='multiple'|| item.QuestionKey=='single-number'">
<tr v-for="(subItem,subIndex) in item.SubAnwser" :key="subIndex">
<td style="width:40px;text-align:center;">
<template
v-if="item.QuestionKey=='single'||item.QuestionKey=='multiple'|| item.QuestionKey=='single-number'">
<div class="Answer_List2" :class="{'Is_Answer':subItem.IsAnswer&&isShowAnswer}">
{{subItem.Name}}
</div>
<template v-if="item.QuestionKey=='single'|| item.QuestionKey=='single-number'">
<template v-if="isShowAnswer">
<div class="Answer_List2" :class="{'Is_Answer':subItem.IsAnswer }">
{{subItem.Name}}
</div>
</template>
<template v-else-if="isOperate">
<div class="Answer_List2" @click="ChangeItem(item,subItem)"
:class="{'Is_Answer':subItem.IsAnswer }">
{{subItem.Name}}
</div>
</template>
<template v-else>
<div class="Answer_List2">
{{subItem.Name}}
</div>
</template>
</template>
<template v-else-if="item.QuestionKey=='multiple'">
<div class="Answer_List" :class="{'Is_Answer':subItem.IsAnswer&&isShowAnswer}">
{{subItem.Name}}
</div>
<template v-if="isShowAnswer">
<div class="Answer_List" :class="{'Is_Answer':subItem.IsAnswer}">
{{subItem.Name}}
</div>
</template>
<template v-else-if="isOperate">
<div class="Answer_List" @click="changeMutile(subItem)" :class="{'Is_Answer':subItem.IsAnswer}">
{{subItem.Name}}
</div>
</template>
<template v-else>
<div class="Answer_List2">
{{subItem.Name}}
</div>
</template>
</template>
</td>
<td>
<div class="InpDIV" style="border:0;margin-top:-2px;" v-html="subItem.Content">
</div>
</td>
<td style="width:40px;text-align:center;">
</td>
</tr>
</template>
<!--填空题-->
<template v-if="item.QuestionKey=='fill-in'">
<tr v-for="(subItem,subIndex) in item.SubAnwser">
<td style="width:50px;text-align:center;padding-top:8px;">
{{subIndex+1}}
</td>
<td>
<div class="InpDIV" v-html="subItem.Content" style="border:0;margin-top:-2px;"
@click="changeEdit(subIndex)">
</div>
</td>
<td style="width:30px;text-align:center;">
</td>
</tr>
<template v-if="isShowAnswer">
<tr v-for="(subItem,subIndex) in item.SubAnwser" :key="subIndex">
<td style="width:50px;text-align:center;padding-top:8px;">
{{subIndex+1}}
</td>
<td>
<div class="InpDIV" v-html="subItem.Content" style="border:0;margin-top:-2px;">
</div>
</td>
</tr>
</template>
<template v-if="isOperate">
<tr v-for="(subItem,subIndex) in item.SubAnwser" :key="subIndex">
<td style="width:50px;text-align:center;padding-top:8px;">
{{subIndex+1}}
</td>
<td>
<el-input v-model="subItem.Content" :placeholder="'请填写第 '+(subIndex+1)+' 空答案'"> </el-input>
</td>
</tr>
</template>
</template>
<!--判断题-->
<template v-if="item.QuestionKey=='judge'">
<tr v-for="(subItem,subIndex) in item.SubAnwser">
<td style="width:50px;">
<div class="Answer_List2" @click="ChangeItem(item,subItem)" :class="{'Is_Answer':subItem.IsAnswer&&isShowAnswer}">
{{subItem.Name}}
</div>
</td>
<td colspan="2" style="text-align:left;vertical-align:middle;">
{{subItem.Content}}
</td>
</tr>
<template v-if="isShowAnswer">
<tr v-for="(subItem,subIndex) in item.SubAnwser" :key="subIndex">
<td style="width:50px;">
<div class="Answer_List2" :class="{'Is_Answer':subItem.IsAnswer&&isShowAnswer}">
{{subItem.Name}}
</div>
</td>
<td style="text-align:left;vertical-align:middle;">
{{subItem.Content}}
</td>
</tr>
</template>
<template v-if="isOperate">
<tr v-for="(subItem,subIndex) in item.SubAnwser" :key="subIndex">
<td style="width:50px;">
<div class="Answer_List" @click="ChangeItem(item,subItem)" :class="{'Is_Answer':subItem.IsAnswer}">
{{subItem.Name}}
</div>
</td>
<td colspan="2" style="text-align:left;vertical-align:middle;">
{{subItem.Content}}
</td>
</tr>
</template>
</template>
<!--简答题-->
<template v-if="item.QuestionKey=='short-answer'">
<tr v-for="(subItem,subIndex) in item.SubAnwser">
<td colspan="3">
答案: <div v-html="subItem.Content"></div>
</td>
</tr>
<template v-if="isShowAnswer">
<tr v-for="(subItem,subIndex) in item.SubAnwser" :key="subIndex">
<td colspan="2">
答案: <div v-html="subItem.Content"></div>
</td>
</tr>
</template>
<template v-if="isOperate">
<tr v-for="(subItem,subIndex) in item.SubAnwser" :key="subIndex">
<td colspan="2">
<el-input v-model="subItem.Content" :placeholder="'请填写第简答题答案'"> </el-input>
</td>
</tr>
</template>
</template>
</tbody>
</table>
......@@ -124,7 +179,12 @@
isShowAnswer: {
type: Boolean,
default: false,
}
},
//是否可操作(PC端考试使用【可以点击选中】)
isOperate: {
type: Boolean,
default: false,
},
},
data() {
return {
......@@ -133,7 +193,19 @@
},
methods: {
//单选和判断题
ChangeItem(item, subItem) {
if (item.SubAnwser && item.SubAnwser.length > 0) {
item.SubAnwser.forEach(childItem => {
childItem.IsAnswer = false;
})
}
subItem.IsAnswer = true;
},
//多选题
changeMutile(subItem) {
subItem.IsAnswer = !subItem.IsAnswer;
},
},
mounted() {
......
......@@ -7,11 +7,14 @@
</style>
<template>
<div class="v_shortAnswerQuestion" >
<div class="v_shortAnswerQuestion">
<div style="display:flex;" v-if="isShowAnswer">
<div style="font-weight:bold;">答案:</div>
<div v-html="data.Answer"></div>
</div>
<div style="display:flex;" v-if="isOperate">
<el-input v-model="data.Answer" placeholder="请填写问题答案"> </el-input>
</div>
<div style="display:flex;" v-if="isShowAnswer">
<div style="font-weight:bold;">解析:</div>
<div v-html="data.AnswerParse"></div>
......@@ -28,7 +31,12 @@
isShowAnswer: {
type: Boolean,
default: false,
}
},
//是否可操作(PC端考试使用【可以填写答案】)
isOperate: {
type: Boolean,
default: false,
},
},
data() {
return {
......
......@@ -48,12 +48,26 @@
</tr>
</table>
<br />
<table v-if="isShowAnswer&&data&&data.QuestionContentObj&&data.QuestionContentObj.length>0">
<table v-if="isOperate&&data.QuestionContentObj&&data.QuestionContentObj.length>0">
<tr>
<td>
<template v-for="(item,index) in data.QuestionContentObj[1]">
<select v-model="item.Name" class="selectBox" :key="index">
<template v-for="(cItem,cIndex) in data.QuestionContentObj[0]">
<option :key="cIndex" :label="cItem.Name" :value="cItem.Name">
</option>
</template>
</select>
</template>
</td>
</tr>
</table>
<table v-if="isShowAnswer">
<tr>
<td>
<span style="font-weight:bold;">答案:</span>
<span v-for="(cItem,cIndex) in data.QuestionContentObj[0]">
{{cItem.Name}}
<span>
{{data.Answer}}
</span>
</td>
</tr>
......@@ -75,7 +89,12 @@
isShowAnswer: {
type: Boolean,
default: false,
}
},
//是否可操作(PC端考试使用【可以点击选中】)
isOperate: {
type: Boolean,
default: false,
},
},
data() {
return {
......
......@@ -284,26 +284,26 @@
<!--简答题、名词解释、论述题、计算题、口语题、其它-->
<v-shortanswer v-if="dItem.QuestionTypeKey=='short-answer'||dItem.QuestionTypeKey=='noun-explanation'||dItem.QuestionTypeKey=='essay-question'
||dItem.QuestionTypeKey=='calculation' || dItem.QuestionTypeKey=='spoken'|| dItem.QuestionTypeKey=='other'
" :questionObj="dItem" :isShowAnswer="isShowAnswer"> </v-shortanswer>
" :questionObj="dItem" :isShowAnswer="isShowAnswer" :isOperate="isOperate"> </v-shortanswer>
<!--分录题、资料题-->
<v-entryproblem v-if="dItem.QuestionTypeKey=='entry-problem'|| dItem.QuestionTypeKey=='data-question'"
:questionObj="dItem" :isShowAnswer="isShowAnswer">
:questionObj="dItem" :isShowAnswer="isShowAnswer" :isOperate="isOperate">
</v-entryproblem>
<!--连线题-->
<v-matching v-if="dItem.QuestionTypeKey=='matching'" :questionObj="dItem" :isShowAnswer="isShowAnswer">
<v-matching v-if="dItem.QuestionTypeKey=='matching'" :questionObj="dItem" :isShowAnswer="isShowAnswer" :isOperate="isOperate">
</v-matching>
<!--排序题-->
<v-sortingproblem v-if="dItem.QuestionTypeKey=='sorting-problem'" :questionObj="dItem"
:isShowAnswer="isShowAnswer"></v-sortingproblem>
:isShowAnswer="isShowAnswer" :isOperate="isOperate"></v-sortingproblem>
<!--完型填空-->
<v-cloze v-if="dItem.QuestionTypeKey=='cloze'" :questionObj="dItem" :isShowAnswer="isShowAnswer"></v-cloze>
<v-cloze v-if="dItem.QuestionTypeKey=='cloze'" :questionObj="dItem" :isShowAnswer="isShowAnswer" :isOperate="isOperate">></v-cloze>
<!--阅读理解、听力题-->
<v-readingcomprehensio
v-if="dItem.QuestionTypeKey=='reading-comprehensio'||dItem.QuestionTypeKey=='listening'"
:questionObj="dItem" :isShowAnswer="isShowAnswer"></v-readingcomprehensio>
:questionObj="dItem" :isShowAnswer="isShowAnswer" :isOperate="isOperate"></v-readingcomprehensio>
<!--共用选择题-->
<v-sharingchoose v-if="dItem.QuestionTypeKey=='sharing-choose'" :questionObj="dItem"
......
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