|
@@ -96,7 +96,13 @@
|
|
|
}"
|
|
|
v-for="(item, index) in question.jsonStr"
|
|
|
:key="index"
|
|
|
- @click="radioSelect(question, questionIndex, item.optionsId)"
|
|
|
+ @click="
|
|
|
+ radioSelect(
|
|
|
+ question,
|
|
|
+ questionIndex,
|
|
|
+ item.optionsId
|
|
|
+ )
|
|
|
+ "
|
|
|
>
|
|
|
<div>
|
|
|
{{ ast[index] }}. {{ item.content }}
|
|
@@ -133,7 +139,7 @@
|
|
|
</div>
|
|
|
<div class="question__btns"></div>
|
|
|
</div>
|
|
|
-
|
|
|
+
|
|
|
<div
|
|
|
class="question"
|
|
|
v-if="question.type == 2 && current == questionIndex"
|
|
@@ -168,7 +174,7 @@
|
|
|
</div>
|
|
|
<div class="question-list" v-if="question.ques">
|
|
|
<el-checkbox
|
|
|
- :disabled='bankType == 2 ? false : true'
|
|
|
+ :disabled="bankType == 2 ? false : true"
|
|
|
class="checkbox"
|
|
|
:class="{
|
|
|
right:
|
|
@@ -229,7 +235,9 @@
|
|
|
</div>
|
|
|
<div class="question__btns">
|
|
|
<div
|
|
|
- v-if="bankType == 2 || (bankType == 1 && !question.ques)"
|
|
|
+ v-if="
|
|
|
+ bankType == 2 || (bankType == 1 && !question.ques)
|
|
|
+ "
|
|
|
class="submit"
|
|
|
@click="checkboxSubmit(question, questionIndex)"
|
|
|
>
|
|
@@ -273,13 +281,18 @@
|
|
|
<div class="question-list" v-if="question.ques">
|
|
|
<div
|
|
|
class="radio"
|
|
|
- :class="{
|
|
|
+ :class="{
|
|
|
right:
|
|
|
- bankType == 1 && (index == (question.ques == 1 ? 0 : 1) || index != question.ans),
|
|
|
+ bankType == 1 &&
|
|
|
+ (index == (question.ques == 1 ? 0 : 1) ||
|
|
|
+ index != question.ans),
|
|
|
wrong:
|
|
|
- bankType == 1 && (index == (question.ques == 1 ? 0 : 1) &&
|
|
|
- question.ques != question.ans),
|
|
|
- user_choose: bankType == 2 && (index == (question.ques == 1 ? 0 : 1)),
|
|
|
+ bankType == 1 &&
|
|
|
+ index == (question.ques == 1 ? 0 : 1) &&
|
|
|
+ question.ques != question.ans,
|
|
|
+ user_choose:
|
|
|
+ bankType == 2 &&
|
|
|
+ index == (question.ques == 1 ? 0 : 1),
|
|
|
}"
|
|
|
v-for="(item, index) in judge"
|
|
|
:key="index"
|
|
@@ -411,7 +424,13 @@
|
|
|
}"
|
|
|
v-for="(item, index) in json.optionsList"
|
|
|
:key="index"
|
|
|
- @click="radioSelectChild( questionIndex, jsonIndex, item.optionsId)"
|
|
|
+ @click="
|
|
|
+ radioSelectChild(
|
|
|
+ questionIndex,
|
|
|
+ jsonIndex,
|
|
|
+ item.optionsId
|
|
|
+ )
|
|
|
+ "
|
|
|
>
|
|
|
<div>
|
|
|
{{ ast[index] }}. {{ item.content }}
|
|
@@ -589,7 +608,10 @@
|
|
|
</div>
|
|
|
<div class="question__btns">
|
|
|
<div
|
|
|
- v-if="bankType == 2 || (bankType == 1 && !question.ques[jsonIndex])"
|
|
|
+ v-if="
|
|
|
+ bankType == 2 ||
|
|
|
+ (bankType == 1 && !question.ques[jsonIndex])
|
|
|
+ "
|
|
|
class="submit"
|
|
|
@click="
|
|
|
checkboxSubmitChild(
|
|
@@ -654,12 +676,26 @@
|
|
|
class="radio"
|
|
|
:class="{
|
|
|
right:
|
|
|
- bankType == 1 && (index == (question.ques[jsonIndex] == 1 ? 0 : 1) ||
|
|
|
- index != question.ans[jsonIndex]),
|
|
|
+ bankType == 1 &&
|
|
|
+ (index ==
|
|
|
+ (question.ques[jsonIndex] == 1
|
|
|
+ ? 0
|
|
|
+ : 1) ||
|
|
|
+ index != question.ans[jsonIndex]),
|
|
|
wrong:
|
|
|
- bankType == 1 && (index == (question.ques[jsonIndex] == 1 ? 0 : 1) &&
|
|
|
- question.ques[jsonIndex] != question.ans[jsonIndex]),
|
|
|
- user_choose: bankType == 2 && (index == (question.ques[jsonIndex] == 1 ? 0 : 1)),
|
|
|
+ bankType == 1 &&
|
|
|
+ index ==
|
|
|
+ (question.ques[jsonIndex] == 1
|
|
|
+ ? 0
|
|
|
+ : 1) &&
|
|
|
+ question.ques[jsonIndex] !=
|
|
|
+ question.ans[jsonIndex],
|
|
|
+ user_choose:
|
|
|
+ bankType == 2 &&
|
|
|
+ index ==
|
|
|
+ (question.ques[jsonIndex] == 1
|
|
|
+ ? 0
|
|
|
+ : 1),
|
|
|
}"
|
|
|
v-for="(item, index) in judge"
|
|
|
:key="index"
|
|
@@ -692,7 +728,9 @@
|
|
|
"
|
|
|
>
|
|
|
<div class="answer-list__left">
|
|
|
- 正确答案:{{ ast[question.ans[jsonIndex] == 1 ? 0 : 1] }}
|
|
|
+ 正确答案:{{
|
|
|
+ ast[question.ans[jsonIndex] == 1 ? 0 : 1]
|
|
|
+ }}
|
|
|
</div>
|
|
|
<div class="answer-list__left">
|
|
|
我的答案:{{
|
|
@@ -734,12 +772,14 @@
|
|
|
<div
|
|
|
class="question-list textarea"
|
|
|
v-if="
|
|
|
- bankType == 2 || ( bankType == 1 && !(
|
|
|
- question.ques[jsonIndex] &&
|
|
|
- (question.ques[jsonIndex].imageList
|
|
|
- .length ||
|
|
|
- question.ques[jsonIndex].text)
|
|
|
- ))
|
|
|
+ bankType == 2 ||
|
|
|
+ (bankType == 1 &&
|
|
|
+ !(
|
|
|
+ question.ques[jsonIndex] &&
|
|
|
+ (question.ques[jsonIndex].imageList
|
|
|
+ .length ||
|
|
|
+ question.ques[jsonIndex].text)
|
|
|
+ ))
|
|
|
"
|
|
|
>
|
|
|
<el-input
|
|
@@ -820,12 +860,14 @@
|
|
|
<div class="question__btns">
|
|
|
<div
|
|
|
v-if="
|
|
|
- bankType == 2 || ( bankType == 1 && !(
|
|
|
- question.ques[jsonIndex] &&
|
|
|
- (question.ques[jsonIndex].imageList
|
|
|
- .length ||
|
|
|
- question.ques[jsonIndex].text)
|
|
|
- ))
|
|
|
+ bankType == 2 ||
|
|
|
+ (bankType == 1 &&
|
|
|
+ !(
|
|
|
+ question.ques[jsonIndex] &&
|
|
|
+ (question.ques[jsonIndex].imageList
|
|
|
+ .length ||
|
|
|
+ question.ques[jsonIndex].text)
|
|
|
+ ))
|
|
|
"
|
|
|
class="submit"
|
|
|
@click="
|
|
@@ -862,8 +904,10 @@
|
|
|
<div
|
|
|
class="question-list textarea"
|
|
|
v-if="
|
|
|
- bankType == 2 || ( bankType == 1 && !question.ques.imageList.length &&
|
|
|
- !question.ques.text)
|
|
|
+ bankType == 2 ||
|
|
|
+ (bankType == 1 &&
|
|
|
+ !question.ques.imageList.length &&
|
|
|
+ !question.ques.text)
|
|
|
"
|
|
|
>
|
|
|
<el-input
|
|
@@ -931,8 +975,10 @@
|
|
|
<div class="question__btns">
|
|
|
<div
|
|
|
v-if="
|
|
|
- bankType == 2 || (bankType == 1 && !question.ques.imageList.length &&
|
|
|
- !question.ques.text)
|
|
|
+ bankType == 2 ||
|
|
|
+ (bankType == 1 &&
|
|
|
+ !question.ques.imageList.length &&
|
|
|
+ !question.ques.text)
|
|
|
"
|
|
|
class="submit"
|
|
|
@click="ansSubmit(question, questionIndex)"
|
|
@@ -1639,7 +1685,7 @@ export default {
|
|
|
radioSelect(question, questionIndex, optionsId) {
|
|
|
// if (this.questionList[questionIndex].ques) return;
|
|
|
if (this.questionList[questionIndex].ques && this.bankType == 1) {
|
|
|
- return
|
|
|
+ return;
|
|
|
}
|
|
|
this.$set(this.questionList[questionIndex], "ques", optionsId);
|
|
|
this.isDoOver();
|
|
@@ -1651,8 +1697,11 @@ export default {
|
|
|
*/
|
|
|
radioSelectChild(questionIndex, jsonIndex, optionsId) {
|
|
|
// if (this.questionList[questionIndex].ques[jsonIndex]) return;
|
|
|
- if (this.questionList[questionIndex].ques[jsonIndex] && this.bankType == 1) {
|
|
|
- return
|
|
|
+ if (
|
|
|
+ this.questionList[questionIndex].ques[jsonIndex] &&
|
|
|
+ this.bankType == 1
|
|
|
+ ) {
|
|
|
+ return;
|
|
|
}
|
|
|
this.$set(this.questionList[questionIndex].ques, jsonIndex, optionsId);
|
|
|
this.isDoOver();
|
|
@@ -1663,7 +1712,7 @@ export default {
|
|
|
checkboxSubmit(question, questionIndex) {
|
|
|
// if (this.questionList[questionIndex].ques) return;
|
|
|
if (this.questionList[questionIndex].ques && this.bankType == 1) {
|
|
|
- return
|
|
|
+ return;
|
|
|
}
|
|
|
let arr = [];
|
|
|
this.questionList[questionIndex].jsonStr.forEach((item) => {
|
|
@@ -1672,7 +1721,7 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
if (!arr.length) {
|
|
|
- delete this.questionList[questionIndex].ques
|
|
|
+ delete this.questionList[questionIndex].ques;
|
|
|
this.$message({
|
|
|
type: "warning",
|
|
|
message: "请选择答案",
|
|
@@ -1688,8 +1737,11 @@ export default {
|
|
|
*/
|
|
|
checkboxSubmitChild(questionIndex, ansIndex) {
|
|
|
// if (this.questionList[questionIndex].ques[ansIndex]) return;
|
|
|
- if (this.questionList[questionIndex].ques[ansIndex] && this.bankType == 1) {
|
|
|
- return
|
|
|
+ if (
|
|
|
+ this.questionList[questionIndex].ques[ansIndex] &&
|
|
|
+ this.bankType == 1
|
|
|
+ ) {
|
|
|
+ return;
|
|
|
}
|
|
|
let arr = [];
|
|
|
this.questionList[questionIndex].jsonStr[ansIndex].optionsList.forEach(
|
|
@@ -1701,7 +1753,7 @@ export default {
|
|
|
);
|
|
|
|
|
|
if (!arr.length) {
|
|
|
- delete this.questionList[questionIndex].ques[ansIndex]
|
|
|
+ delete this.questionList[questionIndex].ques[ansIndex];
|
|
|
this.$message({
|
|
|
type: "warning",
|
|
|
message: "请选择答案",
|
|
@@ -1718,18 +1770,29 @@ export default {
|
|
|
judgeSelect(question, questionIndex, index) {
|
|
|
// if (question.ques) return;
|
|
|
if (question.ques && this.bankType == 1) {
|
|
|
- return
|
|
|
+ return;
|
|
|
}
|
|
|
- this.$set(this.questionList[questionIndex], "ques", index == 0 ? '1' : '0');
|
|
|
+ this.$set(
|
|
|
+ this.questionList[questionIndex],
|
|
|
+ "ques",
|
|
|
+ index == 0 ? "1" : "0"
|
|
|
+ );
|
|
|
this.isDoOver();
|
|
|
},
|
|
|
judgeSelectChild(questionIndex, jsonIndex, index) {
|
|
|
console.log(this.questionList[questionIndex].ques[jsonIndex]);
|
|
|
// if (this.questionList[questionIndex].ques[jsonIndex]) return;
|
|
|
- if (this.questionList[questionIndex].ques[jsonIndex] && this.bankType == 1) {
|
|
|
- return
|
|
|
+ if (
|
|
|
+ this.questionList[questionIndex].ques[jsonIndex] &&
|
|
|
+ this.bankType == 1
|
|
|
+ ) {
|
|
|
+ return;
|
|
|
}
|
|
|
- this.$set(this.questionList[questionIndex].ques, jsonIndex, index == 0 ? '1' : '0');
|
|
|
+ this.$set(
|
|
|
+ this.questionList[questionIndex].ques,
|
|
|
+ jsonIndex,
|
|
|
+ index == 0 ? "1" : "0"
|
|
|
+ );
|
|
|
this.isDoOver();
|
|
|
},
|
|
|
|
|
@@ -1903,7 +1966,7 @@ export default {
|
|
|
},
|
|
|
isCheck(item, index) {
|
|
|
if (this.questionList[index].ques) {
|
|
|
- return true
|
|
|
+ return true;
|
|
|
}
|
|
|
},
|
|
|
isRight(item, index) {
|
|
@@ -2750,6 +2813,11 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ /deep/
|
|
|
+ .el-checkbox__input.is-checked
|
|
|
+ + .el-checkbox__label {
|
|
|
+ color: #000 !important;
|
|
|
+ }
|
|
|
/deep/
|
|
|
.el-checkbox__input.is-disabled
|
|
|
+ span.el-checkbox__label {
|
|
@@ -2963,7 +3031,8 @@ export default {
|
|
|
&.yellow {
|
|
|
background: #ffc53d;
|
|
|
}
|
|
|
- &.blue, &.check_ans {
|
|
|
+ &.blue,
|
|
|
+ &.check_ans {
|
|
|
background: #3f8dfd;
|
|
|
}
|
|
|
}
|
|
@@ -3020,7 +3089,8 @@ export default {
|
|
|
background: #ff3a30;
|
|
|
}
|
|
|
|
|
|
- &.blue, &.check_ans {
|
|
|
+ &.blue,
|
|
|
+ &.check_ans {
|
|
|
color: #fff;
|
|
|
background: #3f8dfd;
|
|
|
}
|