|
@@ -92,6 +92,13 @@
|
|
|
}"
|
|
|
v-for="(item, index) in question.jsonStr"
|
|
|
:key="index"
|
|
|
+ @click="
|
|
|
+ radioSelect(
|
|
|
+ question,
|
|
|
+ questionIndex,
|
|
|
+ item.optionsId
|
|
|
+ )
|
|
|
+ "
|
|
|
>
|
|
|
<div>
|
|
|
{{ ast[index] }}. {{ item.content }}
|
|
@@ -136,6 +143,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+
|
|
|
<div
|
|
|
class="question"
|
|
|
v-if="question.type == 2 && current == questionIndex"
|
|
@@ -170,7 +178,7 @@
|
|
|
</div>
|
|
|
<div class="question-list" v-if="question.ques">
|
|
|
<el-checkbox
|
|
|
- disabled
|
|
|
+ :disabled='bankType == 2 ? false : true'
|
|
|
class="checkbox"
|
|
|
:class="{
|
|
|
right:
|
|
@@ -221,7 +229,7 @@
|
|
|
</div>
|
|
|
<div class="question__btns">
|
|
|
<div
|
|
|
- v-if="!question.ques"
|
|
|
+ v-if="bankType == 2 || (bankType == 1 && !question.ques)"
|
|
|
class="submit"
|
|
|
@click="checkboxSubmit(question, questionIndex)"
|
|
|
>
|
|
@@ -242,6 +250,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+
|
|
|
<div
|
|
|
class="question"
|
|
|
v-if="question.type == 3 && current == questionIndex"
|
|
@@ -287,6 +296,7 @@
|
|
|
}"
|
|
|
v-for="(item, index) in judge"
|
|
|
:key="index"
|
|
|
+ @click="judgeSelect(question, questionIndex, index)"
|
|
|
>
|
|
|
<div>
|
|
|
{{ ast[index] }}. {{ item }}
|
|
@@ -332,6 +342,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+
|
|
|
<div
|
|
|
class="question"
|
|
|
v-if="question.type == 4 && current == questionIndex"
|
|
@@ -412,6 +423,13 @@
|
|
|
}"
|
|
|
v-for="(item, index) in json.optionsList"
|
|
|
:key="index"
|
|
|
+ @click="
|
|
|
+ radioSelectChild(
|
|
|
+ questionIndex,
|
|
|
+ jsonIndex,
|
|
|
+ item.optionsId
|
|
|
+ )
|
|
|
+ "
|
|
|
>
|
|
|
<div>
|
|
|
{{ ast[index] }}. {{ item.content }}
|
|
@@ -457,6 +475,7 @@
|
|
|
</div>
|
|
|
<div class="question__btns"></div>
|
|
|
</div>
|
|
|
+
|
|
|
<div
|
|
|
class="question"
|
|
|
v-if="json.type == 2"
|
|
@@ -500,7 +519,7 @@
|
|
|
v-if="question.ques[jsonIndex]"
|
|
|
>
|
|
|
<el-checkbox
|
|
|
- disabled
|
|
|
+ :disabled="bankType == 2 ? false : true"
|
|
|
class="checkbox"
|
|
|
:class="{
|
|
|
right:
|
|
@@ -574,7 +593,7 @@
|
|
|
</div>
|
|
|
<div class="question__btns">
|
|
|
<div
|
|
|
- v-if="!question.ques[jsonIndex]"
|
|
|
+ v-if="bankType == 2 || (bankType == 1 && !question.ques[jsonIndex])"
|
|
|
class="submit"
|
|
|
@click="
|
|
|
checkboxSubmitChild(
|
|
@@ -587,6 +606,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+
|
|
|
<div
|
|
|
class="question"
|
|
|
v-if="json.type == 3"
|
|
@@ -648,6 +668,13 @@
|
|
|
}"
|
|
|
v-for="(item, index) in judge"
|
|
|
:key="index"
|
|
|
+ @click="
|
|
|
+ judgeSelectChild(
|
|
|
+ questionIndex,
|
|
|
+ jsonIndex,
|
|
|
+ index
|
|
|
+ )
|
|
|
+ "
|
|
|
>
|
|
|
<div>
|
|
|
{{ ast[index] }}. {{ item }}
|
|
@@ -708,12 +735,12 @@
|
|
|
<div
|
|
|
class="question-list textarea"
|
|
|
v-if="
|
|
|
- !(
|
|
|
+ bankType == 2 || ( bankType == 1 && !(
|
|
|
question.ques[jsonIndex] &&
|
|
|
(question.ques[jsonIndex].imageList
|
|
|
.length ||
|
|
|
question.ques[jsonIndex].text)
|
|
|
- )
|
|
|
+ ))
|
|
|
"
|
|
|
>
|
|
|
<el-input
|
|
@@ -793,12 +820,12 @@
|
|
|
<div class="question__btns">
|
|
|
<div
|
|
|
v-if="
|
|
|
- !(
|
|
|
+ bankType == 2 || ( bankType == 1 && !(
|
|
|
question.ques[jsonIndex] &&
|
|
|
(question.ques[jsonIndex].imageList
|
|
|
.length ||
|
|
|
question.ques[jsonIndex].text)
|
|
|
- )
|
|
|
+ ))
|
|
|
"
|
|
|
class="submit"
|
|
|
@click="
|
|
@@ -832,6 +859,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+
|
|
|
<div
|
|
|
class="question"
|
|
|
v-if="question.type == 5 && current == questionIndex"
|
|
@@ -848,8 +876,8 @@
|
|
|
<div
|
|
|
class="question-list textarea"
|
|
|
v-if="
|
|
|
- !question.ques.imageList.length &&
|
|
|
- !question.ques.text
|
|
|
+ bankType == 2 || ( bankType == 1 && !question.ques.imageList.length &&
|
|
|
+ !question.ques.text)
|
|
|
"
|
|
|
>
|
|
|
<el-input
|
|
@@ -915,8 +943,8 @@
|
|
|
<div class="question__btns">
|
|
|
<div
|
|
|
v-if="
|
|
|
- !question.ques.imageList.length &&
|
|
|
- !question.ques.text
|
|
|
+ bankType == 2 || ( bankType == 1 && !question.ques.imageList.length &&
|
|
|
+ !question.ques.text)
|
|
|
"
|
|
|
class="submit"
|
|
|
@click="ansSubmit(question, questionIndex)"
|
|
@@ -1001,10 +1029,11 @@
|
|
|
v-for="(item, index) in questionList"
|
|
|
:key="index"
|
|
|
:class="{
|
|
|
- green: isRight(item, index),
|
|
|
- red: isWrong(item, index),
|
|
|
- yellow: isPart(item, index),
|
|
|
- blue: isOver(item, index),
|
|
|
+ green: bankType == 1 && isRight(item, index),
|
|
|
+ red: bankType == 1 && isWrong(item, index),
|
|
|
+ yellow: bankType == 1 && isPart(item, index),
|
|
|
+ blue: bankType == 1 && isOver(item, index),
|
|
|
+ check_ans: bankType == 2 && isCheck(item, index),
|
|
|
}"
|
|
|
@click="changeIndex(index)"
|
|
|
>
|
|
@@ -1627,26 +1656,29 @@ export default {
|
|
|
* 单选点击确认
|
|
|
*/
|
|
|
radioSelect(question, questionIndex, optionsId) {
|
|
|
- if (this.questionList[questionIndex].ques) return;
|
|
|
+ // if (this.questionList[questionIndex].ques) return;
|
|
|
+ if (this.questionList[questionIndex].ques && this.bankType == 1) {
|
|
|
+ return
|
|
|
+ }
|
|
|
this.$set(this.questionList[questionIndex], "ques", optionsId);
|
|
|
this.isDoOver();
|
|
|
|
|
|
- if (
|
|
|
- this.questionList[questionIndex].ques !=
|
|
|
- this.questionList[questionIndex].ans
|
|
|
- ) {
|
|
|
- this.$request
|
|
|
- .examWrongRecord({
|
|
|
- orderGoodsId: this.orderGoodsId,
|
|
|
- examId: this.examId,
|
|
|
- goodsId: this.goodsId,
|
|
|
- moduleExamId: this.moduleId || 0,
|
|
|
- chapterExamId: this.chapterId || 0,
|
|
|
- questionIds: [this.questionList[questionIndex].questionId],
|
|
|
- recordId: this.recordId,
|
|
|
- })
|
|
|
- .then((res) => {});
|
|
|
- }
|
|
|
+ // if (
|
|
|
+ // this.questionList[questionIndex].ques !=
|
|
|
+ // this.questionList[questionIndex].ans
|
|
|
+ // ) {
|
|
|
+ // this.$request
|
|
|
+ // .examWrongRecord({
|
|
|
+ // orderGoodsId: this.orderGoodsId,
|
|
|
+ // examId: this.examId,
|
|
|
+ // goodsId: this.goodsId,
|
|
|
+ // moduleExamId: this.moduleId || 0,
|
|
|
+ // chapterExamId: this.chapterId || 0,
|
|
|
+ // questionIds: [this.questionList[questionIndex].questionId],
|
|
|
+ // recordId: this.recordId,
|
|
|
+ // })
|
|
|
+ // .then((res) => {});
|
|
|
+ // }
|
|
|
},
|
|
|
|
|
|
/**
|
|
@@ -1654,7 +1686,10 @@ export default {
|
|
|
* 案例单选点击
|
|
|
*/
|
|
|
radioSelectChild(questionIndex, jsonIndex, optionsId) {
|
|
|
- if (this.questionList[questionIndex].ques[jsonIndex]) return;
|
|
|
+ // if (this.questionList[questionIndex].ques[jsonIndex]) return;
|
|
|
+ if (this.questionList[questionIndex].ques[jsonIndex] && this.bankType == 1) {
|
|
|
+ return
|
|
|
+ }
|
|
|
this.$set(this.questionList[questionIndex].ques, jsonIndex, optionsId);
|
|
|
this.isDoOver();
|
|
|
},
|
|
@@ -1662,7 +1697,10 @@ export default {
|
|
|
* 多选点击确认
|
|
|
*/
|
|
|
checkboxSubmit(question, questionIndex) {
|
|
|
- if (this.questionList[questionIndex].ques) return;
|
|
|
+ // if (this.questionList[questionIndex].ques) return;
|
|
|
+ if (this.questionList[questionIndex].ques && this.bankType == 1) {
|
|
|
+ return
|
|
|
+ }
|
|
|
let arr = [];
|
|
|
this.questionList[questionIndex].jsonStr.forEach((item) => {
|
|
|
if (item.checked) {
|
|
@@ -1670,6 +1708,7 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
if (!arr.length) {
|
|
|
+ delete this.questionList[questionIndex].ques
|
|
|
this.$message({
|
|
|
type: "warning",
|
|
|
message: "请选择答案",
|
|
@@ -1679,38 +1718,34 @@ export default {
|
|
|
this.$set(this.questionList[questionIndex], "ques", arr);
|
|
|
this.isDoOver();
|
|
|
|
|
|
- // let isWrong = this.questionList[questionIndex].ques.some(
|
|
|
- // (quesItem, quesIndex) => {
|
|
|
- // return (
|
|
|
- // this.questionList[questionIndex].ques[quesIndex] !=
|
|
|
- // this.questionList[questionIndex].ans[quesIndex]
|
|
|
- // );
|
|
|
- // }
|
|
|
- // );
|
|
|
- let isWrong = this.questionList[questionIndex].ques.some((item, i) => {
|
|
|
- return this.questionList[questionIndex].ans.indexOf(item) == -1;
|
|
|
- })
|
|
|
- // 回答错误
|
|
|
- if (isWrong) {
|
|
|
- this.$request
|
|
|
- .examWrongRecord({
|
|
|
- orderGoodsId: this.orderGoodsId,
|
|
|
- examId: this.examId,
|
|
|
- goodsId: this.goodsId,
|
|
|
- moduleExamId: this.moduleId || 0,
|
|
|
- chapterExamId: this.chapterId || 0,
|
|
|
- questionIds: [this.questionList[questionIndex].questionId],
|
|
|
- recordId: this.recordId,
|
|
|
- })
|
|
|
- .then((res) => {});
|
|
|
- }
|
|
|
+
|
|
|
+ // let isWrong = this.questionList[questionIndex].ques.some((item, i) => {
|
|
|
+ // return this.questionList[questionIndex].ans.indexOf(item) == -1;
|
|
|
+ // })
|
|
|
+ // // 回答错误
|
|
|
+ // if (isWrong) {
|
|
|
+ // this.$request
|
|
|
+ // .examWrongRecord({
|
|
|
+ // orderGoodsId: this.orderGoodsId,
|
|
|
+ // examId: this.examId,
|
|
|
+ // goodsId: this.goodsId,
|
|
|
+ // moduleExamId: this.moduleId || 0,
|
|
|
+ // chapterExamId: this.chapterId || 0,
|
|
|
+ // questionIds: [this.questionList[questionIndex].questionId],
|
|
|
+ // recordId: this.recordId,
|
|
|
+ // })
|
|
|
+ // .then((res) => {});
|
|
|
+ // }
|
|
|
},
|
|
|
/**
|
|
|
* @param {Object}
|
|
|
* 案例多选确认
|
|
|
*/
|
|
|
checkboxSubmitChild(questionIndex, ansIndex) {
|
|
|
- if (this.questionList[questionIndex].ques[ansIndex]) return;
|
|
|
+ // if (this.questionList[questionIndex].ques[ansIndex]) return;
|
|
|
+ if (this.questionList[questionIndex].ques[ansIndex] && this.bankType == 1) {
|
|
|
+ return
|
|
|
+ }
|
|
|
let arr = [];
|
|
|
this.questionList[questionIndex].jsonStr[ansIndex].optionsList.forEach(
|
|
|
(item) => {
|
|
@@ -1721,6 +1756,7 @@ export default {
|
|
|
);
|
|
|
|
|
|
if (!arr.length) {
|
|
|
+ delete this.questionList[questionIndex].ques[ansIndex]
|
|
|
this.$message({
|
|
|
type: "warning",
|
|
|
message: "请选择答案",
|
|
@@ -1735,30 +1771,36 @@ export default {
|
|
|
* 判断点击确认
|
|
|
*/
|
|
|
judgeSelect(question, questionIndex, index) {
|
|
|
- if (question.ques) return;
|
|
|
+ // if (question.ques) return;
|
|
|
+ if (question.ques && this.bankType == 1) {
|
|
|
+ return
|
|
|
+ }
|
|
|
this.$set(this.questionList[questionIndex], "ques", index + "");
|
|
|
this.isDoOver();
|
|
|
|
|
|
- if (
|
|
|
- this.questionList[questionIndex].ques !=
|
|
|
- this.questionList[questionIndex].ans
|
|
|
- ) {
|
|
|
- this.$request
|
|
|
- .examWrongRecord({
|
|
|
- orderGoodsId: this.orderGoodsId,
|
|
|
- examId: this.examId,
|
|
|
- goodsId: this.goodsId,
|
|
|
- moduleExamId: this.moduleId || 0,
|
|
|
- chapterExamId: this.chapterId || 0,
|
|
|
- questionIds: [this.questionList[questionIndex].questionId],
|
|
|
- recordId: this.recordId,
|
|
|
- })
|
|
|
- .then((res) => {});
|
|
|
- }
|
|
|
+ // if (
|
|
|
+ // this.questionList[questionIndex].ques !=
|
|
|
+ // this.questionList[questionIndex].ans
|
|
|
+ // ) {
|
|
|
+ // this.$request
|
|
|
+ // .examWrongRecord({
|
|
|
+ // orderGoodsId: this.orderGoodsId,
|
|
|
+ // examId: this.examId,
|
|
|
+ // goodsId: this.goodsId,
|
|
|
+ // moduleExamId: this.moduleId || 0,
|
|
|
+ // chapterExamId: this.chapterId || 0,
|
|
|
+ // questionIds: [this.questionList[questionIndex].questionId],
|
|
|
+ // recordId: this.recordId,
|
|
|
+ // })
|
|
|
+ // .then((res) => {});
|
|
|
+ // }
|
|
|
},
|
|
|
judgeSelectChild(questionIndex, jsonIndex, index) {
|
|
|
console.log(this.questionList[questionIndex].ques[jsonIndex]);
|
|
|
- if (this.questionList[questionIndex].ques[jsonIndex]) return;
|
|
|
+ // if (this.questionList[questionIndex].ques[jsonIndex]) return;
|
|
|
+ if (this.questionList[questionIndex].ques[jsonIndex] && this.bankType == 1) {
|
|
|
+ return
|
|
|
+ }
|
|
|
this.$set(this.questionList[questionIndex].ques, jsonIndex, index + "");
|
|
|
this.isDoOver();
|
|
|
},
|
|
@@ -1931,6 +1973,11 @@ export default {
|
|
|
this.getCollectInfo(this.current);
|
|
|
}
|
|
|
},
|
|
|
+ isCheck(item, index) {
|
|
|
+ if (this.questionList[index].ques) {
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ },
|
|
|
isRight(item, index) {
|
|
|
//单选
|
|
|
if (this.questionList[index].ques) {
|
|
@@ -2703,12 +2750,15 @@ export default {
|
|
|
border-radius: 8px;
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
- &.right, &.user_choose {
|
|
|
+ &.right {
|
|
|
background: #37c65b;
|
|
|
}
|
|
|
&.wrong {
|
|
|
background: #ff3a30;
|
|
|
}
|
|
|
+ &.user_choose {
|
|
|
+ background: #007aff;
|
|
|
+ }
|
|
|
}
|
|
|
&.textarea {
|
|
|
margin-right: 12px;
|
|
@@ -2982,7 +3032,7 @@ export default {
|
|
|
&.yellow {
|
|
|
background: #ffc53d;
|
|
|
}
|
|
|
- &.blue {
|
|
|
+ &.blue, &.check_ans {
|
|
|
background: #3f8dfd;
|
|
|
}
|
|
|
}
|
|
@@ -3039,8 +3089,7 @@ export default {
|
|
|
background: #ff3a30;
|
|
|
}
|
|
|
|
|
|
- &.blue {
|
|
|
- border: 1rpx solid #eeeeee;
|
|
|
+ &.blue, &.check_ans {
|
|
|
color: #fff;
|
|
|
background: #3f8dfd;
|
|
|
}
|