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

页面修改

parent 507a9a96
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
.v_fillInQuestion { .v_fillInQuestion {
width: 100%; width: 100%;
} }
</style> </style>
<template> <template>
<div class="v_fillInQuestion"> <div class="v_fillInQuestion">
...@@ -17,6 +18,16 @@ ...@@ -17,6 +18,16 @@
</td> </td>
</tr> </tr>
</tbody> </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> <tbody>
<tr> <tr>
<td colspan="2"><span v-if="data&&data.IsMutex==1" style="font-size:13px;">答案顺序打乱也判正确</span></td> <td colspan="2"><span v-if="data&&data.IsMutex==1" style="font-size:13px;">答案顺序打乱也判正确</span></td>
...@@ -46,7 +57,11 @@ ...@@ -46,7 +57,11 @@
isShowAnswer: { isShowAnswer: {
type: Boolean, type: Boolean,
default: false, default: false,
} }, //是否可操作(PC端考试使用【可以点击选中】)
isOperate: {
type: Boolean,
default: false,
},
}, },
data() { data() {
return { return {
......
...@@ -11,9 +11,17 @@ ...@@ -11,9 +11,17 @@
<tbody v-for="(item,index) in data.QuestionContentObj" :key="index"> <tbody v-for="(item,index) in data.QuestionContentObj" :key="index">
<tr> <tr>
<td style="width:50px;text-align:center;"> <td style="width:50px;text-align:center;">
<div class="Answer_List2"> <template v-if="isOperate">
{{item.Name}} <div class="Answer_List" style="cursor:pointer;" @click="ChangeItem(item)"
</div> :class="{'Is_Answer':item.IsAnswer}">
{{item.Name}}
</div>
</template>
<template v-else>
<div class="Answer_List2">
{{item.Name}}
</div>
</template>
</td> </td>
<td style="vertical-align:middle;"> <td style="vertical-align:middle;">
<span v-if="index==0"></span> <span v-if="index==0"></span>
...@@ -42,9 +50,13 @@ ...@@ -42,9 +50,13 @@
isShowAnswer: { isShowAnswer: {
type: Boolean, type: Boolean,
default: false, default: false,
} },
//是否可操作(PC端考试使用【可以点击选中】)
isOperate: {
type: Boolean,
default: false,
},
}, },
data() { data() {
return { return {
data: this.questionObj, data: this.questionObj,
...@@ -52,7 +64,15 @@ ...@@ -52,7 +64,15 @@
}, },
created() {}, created() {},
methods: { 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() { mounted() {
......
...@@ -10,9 +10,17 @@ ...@@ -10,9 +10,17 @@
<tbody v-for="(item,index) in data.QuestionContentObj" :key="index"> <tbody v-for="(item,index) in data.QuestionContentObj" :key="index">
<tr> <tr>
<td style="width:40px;text-align:center;"> <td style="width:40px;text-align:center;">
<div class="num_option_dx2"> <template v-if="isOperate">
{{item.Name}} <div class="num_option_dx" style="cursor:pointer;" @click="ChangeItem(item)"
</div> :class="{'Is_Answer':item.IsAnswer}">
{{item.ShowName}}
</div>
</template>
<template v-else>
<div class="num_option_dx2">
{{item.Name}}
</div>
</template>
</td> </td>
<td> <td>
<div class="InpDIV" style="border:0;" v-html="item.Content"></div> <div class="InpDIV" style="border:0;" v-html="item.Content"></div>
...@@ -40,7 +48,12 @@ ...@@ -40,7 +48,12 @@
isShowAnswer: { isShowAnswer: {
type: Boolean, type: Boolean,
default: false, default: false,
} },
//是否可操作(PC端考试使用【可以点击选中】)
isOperate: {
type: Boolean,
default: false,
},
}, },
data() { data() {
return { return {
...@@ -48,7 +61,26 @@ ...@@ -48,7 +61,26 @@
}; };
}, },
methods: { 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() { mounted() {
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<template v-if="isOperate"> <template v-if="isOperate">
<div class="Answer_List2" style="cursor:pointer;" @click="ChangeItem(item)" <div class="Answer_List2" style="cursor:pointer;" @click="ChangeItem(item)"
:class="{'Is_Answer':item.IsAnswer}"> :class="{'Is_Answer':item.IsAnswer}">
{{item.Name}} {{item.ShowName}}
</div> </div>
</template> </template>
<template v-else> <template v-else>
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
type: Boolean, type: Boolean,
default: false, default: false,
}, },
//是否可操作(PC端考试使用) //是否可操作(PC端考试使用【可以点击选中】)
isOperate: { isOperate: {
type: Boolean, type: Boolean,
default: false, default: false,
...@@ -61,11 +61,9 @@ ...@@ -61,11 +61,9 @@
data: this.questionObj, data: this.questionObj,
}; };
}, },
mounted() {}, mounted() {},
methods: { methods: {
ChangeItem(item) { ChangeItem(item) {
if (this.data.QuestionContentObj && this.data.QuestionContentObj.length > 0) { if (this.data.QuestionContentObj && this.data.QuestionContentObj.length > 0) {
this.data.QuestionContentObj.forEach(item => { this.data.QuestionContentObj.forEach(item => {
item.IsAnswer = false; item.IsAnswer = false;
...@@ -73,7 +71,6 @@ ...@@ -73,7 +71,6 @@
} }
item.IsAnswer = true; item.IsAnswer = true;
this.data.Answer = item.Name; this.data.Answer = item.Name;
console.log("this.data",this.data);
}, },
}, },
watch: { watch: {
......
...@@ -273,13 +273,13 @@ ...@@ -273,13 +273,13 @@
:questionObj="dItem" :isShowAnswer="isShowAnswer" :isOperate="isOperate"> :questionObj="dItem" :isShowAnswer="isShowAnswer" :isOperate="isOperate">
</v-single> </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-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-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' <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