Commit 913727d8 authored by 黄奎's avatar 黄奎

页面修改

parent 507a9a96
......@@ -3,6 +3,7 @@
.v_fillInQuestion {
width: 100%;
}
</style>
<template>
<div class="v_fillInQuestion">
......@@ -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" > </el-input>
</td>
</tr>
</tbody>
<tbody>
<tr>
<td colspan="2"><span v-if="data&&data.IsMutex==1" style="font-size:13px;">答案顺序打乱也判正确</span></td>
......@@ -46,7 +57,11 @@
isShowAnswer: {
type: Boolean,
default: false,
}
}, //是否可操作(PC端考试使用【可以点击选中】)
isOperate: {
type: Boolean,
default: false,
},
},
data() {
return {
......
......@@ -11,9 +11,17 @@
<tbody v-for="(item,index) in data.QuestionContentObj" :key="index">
<tr>
<td style="width:50px;text-align:center;">
<div class="Answer_List2">
{{item.Name}}
</div>
<template v-if="isOperate">
<div class="Answer_List" style="cursor:pointer;" @click="ChangeItem(item)"
:class="{'Is_Answer':item.IsAnswer}">
{{item.Name}}
</div>
</template>
<template v-else>
<div class="Answer_List2">
{{item.Name}}
</div>
</template>
</td>
<td style="vertical-align:middle;">
<span v-if="index==0"></span>
......@@ -42,9 +50,13 @@
isShowAnswer: {
type: Boolean,
default: false,
}
},
//是否可操作(PC端考试使用【可以点击选中】)
isOperate: {
type: Boolean,
default: false,
},
},
data() {
return {
data: this.questionObj,
......@@ -52,7 +64,15 @@
},
created() {},
methods: {
ChangeItem(item) {
if (this.data && this.data.QuestionContentObj && this.data.QuestionContentObj.length > 0) {
this.data.QuestionContentObj.forEach(item => {
item.IsAnswer = false;
})
}
item.IsAnswer = true;
this.data.Answer = item.Name;
},
},
mounted() {
......
......@@ -10,9 +10,17 @@
<tbody v-for="(item,index) in data.QuestionContentObj" :key="index">
<tr>
<td style="width:40px;text-align:center;">
<div class="num_option_dx2">
{{item.Name}}
</div>
<template v-if="isOperate">
<div class="num_option_dx" style="cursor:pointer;" @click="ChangeItem(item)"
:class="{'Is_Answer':item.IsAnswer}">
{{item.ShowName}}
</div>
</template>
<template v-else>
<div class="num_option_dx2">
{{item.Name}}
</div>
</template>
</td>
<td>
<div class="InpDIV" style="border:0;" v-html="item.Content"></div>
......@@ -40,7 +48,12 @@
isShowAnswer: {
type: Boolean,
default: false,
}
},
//是否可操作(PC端考试使用【可以点击选中】)
isOperate: {
type: Boolean,
default: false,
},
},
data() {
return {
......@@ -48,7 +61,26 @@
};
},
methods: {
//获取选项答案
getAnswer() {
if (this.data && this.data.QuestionContentObj && this.data.QuestionContentObj.length > 0) {
var answer = "";
this.data.QuestionContentObj.forEach(item => {
if (item.IsAnswer) {
answer += "," + item.Name;
}
})
if (answer != "") {
answer = answer.substring(1);
}
this.data.Answer = answer;
}
},
//点击设为答案
ChangeItem(item) {
item.IsAnswer = !item.IsAnswer;
this.getAnswer();
},
},
mounted() {
......
......@@ -14,7 +14,7 @@
<template v-if="isOperate">
<div class="Answer_List2" style="cursor:pointer;" @click="ChangeItem(item)"
:class="{'Is_Answer':item.IsAnswer}">
{{item.Name}}
{{item.ShowName}}
</div>
</template>
<template v-else>
......@@ -50,7 +50,7 @@
type: Boolean,
default: false,
},
//是否可操作(PC端考试使用)
//是否可操作(PC端考试使用【可以点击选中】)
isOperate: {
type: Boolean,
default: false,
......@@ -61,11 +61,9 @@
data: this.questionObj,
};
},
mounted() {},
methods: {
ChangeItem(item) {
if (this.data.QuestionContentObj && this.data.QuestionContentObj.length > 0) {
this.data.QuestionContentObj.forEach(item => {
item.IsAnswer = false;
......@@ -73,7 +71,6 @@
}
item.IsAnswer = true;
this.data.Answer = item.Name;
console.log("this.data",this.data);
},
},
watch: {
......
......@@ -273,13 +273,13 @@
:questionObj="dItem" :isShowAnswer="isShowAnswer" :isOperate="isOperate">
</v-single>
<!--多选题-->
<v-multiple v-if="dItem.QuestionTypeKey=='multiple'" :questionObj="dItem" :isShowAnswer="isShowAnswer">
<v-multiple v-if="dItem.QuestionTypeKey=='multiple'" :questionObj="dItem" :isShowAnswer="isShowAnswer" :isOperate="isOperate">
</v-multiple>
<!--填空题-->
<v-fillin v-if="dItem.QuestionTypeKey=='fill-in'" :questionObj="dItem" :isShowAnswer="isShowAnswer">
<v-fillin v-if="dItem.QuestionTypeKey=='fill-in'" :questionObj="dItem" :isShowAnswer="isShowAnswer" :isOperate="isOperate">
</v-fillin>
<!--判断题-->
<v-judge v-if="dItem.QuestionTypeKey=='judge'" :questionObj="dItem" :isShowAnswer="isShowAnswer"></v-judge>
<v-judge v-if="dItem.QuestionTypeKey=='judge'" :questionObj="dItem" :isShowAnswer="isShowAnswer" :isOperate="isOperate"></v-judge>
<!--简答题、名词解释、论述题、计算题、口语题、其它-->
<v-shortanswer v-if="dItem.QuestionTypeKey=='short-answer'||dItem.QuestionTypeKey=='noun-explanation'||dItem.QuestionTypeKey=='essay-question'
......
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