|
@@ -94,13 +94,13 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <!-- <div class="section__footer">
|
|
|
|
- <el-button type="primary" class="btn">返回列表</el-button>
|
|
|
|
- <el-button type="primary" class="btn">练习下一节</el-button>
|
|
|
|
- <el-button type="primary" class="btn">重新做题</el-button>
|
|
|
|
- <el-button type="primary" class="btn">错题解析</el-button>
|
|
|
|
- <el-button type="primary" class="btn">全部解析</el-button>
|
|
|
|
- </div> -->
|
|
|
|
|
|
+ <div class="section__footer">
|
|
|
|
+ <el-button type="primary" class="btn" @click="backList()">返回列表</el-button>
|
|
|
|
+ <!-- <el-button type="primary" class="btn">练习下一节</el-button> -->
|
|
|
|
+ <el-button type="primary" class="btn" @click="doRepeat(reportdata)">重新做题</el-button>
|
|
|
|
+ <el-button type="primary" class="btn" @click="wrongExplain(reportdata)">错题解析</el-button>
|
|
|
|
+ <el-button type="primary" class="btn" @click="allExplain(reportdata)">全部解析</el-button>
|
|
|
|
+ </div>
|
|
|
|
|
|
<div v-if="courseList.length" class="course_list">
|
|
<div v-if="courseList.length" class="course_list">
|
|
<div class="course__header">
|
|
<div class="course__header">
|
|
@@ -163,19 +163,26 @@ export default {
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
pageSize: 10,
|
|
pageSize: 10,
|
|
total: 0,
|
|
total: 0,
|
|
|
|
+ recordId: '',
|
|
|
|
+ type: 0, //type:1章卷,2节卷,3模考卷
|
|
};
|
|
};
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
...mapGetters(["examResult"]),
|
|
...mapGetters(["examResult"]),
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
- this.examId = this.$route.query.examId
|
|
|
|
|
|
+ const { examId, recordId, type } = this.$route.query
|
|
|
|
+ this.examId = examId
|
|
|
|
+ this.recordId = recordId
|
|
|
|
+ this.type = type
|
|
this.getcourList()
|
|
this.getcourList()
|
|
|
|
+ this.bankReport()
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
if (JSON.stringify(this.examResult) == "{}") {
|
|
if (JSON.stringify(this.examResult) == "{}") {
|
|
this.$router.back(-1);
|
|
this.$router.back(-1);
|
|
}
|
|
}
|
|
|
|
+ console.log('examResult:', this.examResult)
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
getcourList() {
|
|
getcourList() {
|
|
@@ -195,10 +202,129 @@ export default {
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ bankReport() {
|
|
|
|
+ this.$request.bankReportData(this.recordId).then((res) => {
|
|
|
|
+ this.reportdata = res.data
|
|
|
|
+ console.log('reportdata:', this.reportdata)
|
|
|
|
+ });
|
|
|
|
+ },
|
|
currentChangeCou(val) {
|
|
currentChangeCou(val) {
|
|
this.pageNum = val
|
|
this.pageNum = val
|
|
this.getcourList()
|
|
this.getcourList()
|
|
},
|
|
},
|
|
|
|
+ backList() {
|
|
|
|
+ this.$router.go(-1)
|
|
|
|
+ },
|
|
|
|
+ /**
|
|
|
|
+ * 去做题
|
|
|
|
+ */
|
|
|
|
+ async doRepeat(reportdata) {
|
|
|
|
+ // /bank/record/doNum
|
|
|
|
+ let count = await this.bankRecordDoNum()
|
|
|
|
+ console.log('已做的次数', count)
|
|
|
|
+ let answerNum = await this.getExamDetail(this.reportdata.examId)
|
|
|
|
+ console.log('全部的次数', answerNum)
|
|
|
|
+ //超过答题次数
|
|
|
|
+ if (answerNum > 0 && count >= answerNum) {
|
|
|
|
+ this.$message({
|
|
|
|
+ type: "warning",
|
|
|
|
+ message: "该试卷只能答题" + answerNum + "次!",
|
|
|
|
+ });
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ // answerNum==0没有答题次数限制
|
|
|
|
+ if (answerNum == 0 || (answerNum - count > 0 && answerNum > 0)) {
|
|
|
|
+ this.$router.push({
|
|
|
|
+ path: "/course-exam/" + this.reportdata.goodsId,
|
|
|
|
+ query: {
|
|
|
|
+ courseId: this.reportdata.courseId,
|
|
|
|
+ gradeId: this.reportdata.gradeId || 0,
|
|
|
|
+ moduleId: this.reportdata.moduleId || 0,
|
|
|
|
+ sectionId: this.reportdata.sectionId || 0,
|
|
|
|
+ examId: this.reportdata.examId,
|
|
|
|
+ type: this.type,
|
|
|
|
+ chapterId: this.reportdata.chapterId || 0,
|
|
|
|
+ orderGoodsId: this.reportdata.orderGoodsId,
|
|
|
|
+ },
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // this.studyLog()
|
|
|
|
+ },
|
|
|
|
+ /**
|
|
|
|
+ * 获取试卷已做的次数
|
|
|
|
+ */
|
|
|
|
+ bankRecordDoNum() {
|
|
|
|
+ return new Promise((resolve) => {
|
|
|
|
+ this.$request
|
|
|
|
+ .bankRecordDoNum({
|
|
|
|
+ goodsId: this.reportdata.goodsId,
|
|
|
|
+ gradeId: this.reportdata.gradeId,
|
|
|
|
+ chapterId: this.reportdata.chapterId || 0,
|
|
|
|
+ courseId: this.reportdata.courseId,
|
|
|
|
+ moduleId: this.reportdata.moduleId || 0,
|
|
|
|
+ examId: this.reportdata.examId,
|
|
|
|
+ })
|
|
|
|
+ .then((res) => {
|
|
|
|
+ resolve(res.data);
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ /**
|
|
|
|
+ * @param {Object} exam_id
|
|
|
|
+ * 获取试卷可以做的次数
|
|
|
|
+ */
|
|
|
|
+ getExamDetail(exam_id) {
|
|
|
|
+ return new Promise((resolve) => {
|
|
|
|
+ this.$request.getExamDetail(exam_id).then((res) => {
|
|
|
|
+ resolve(res.data.answerNum);
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ // 新增用户视频学习日志
|
|
|
|
+ studyLog() {
|
|
|
|
+ this.$axios({
|
|
|
|
+ url: "/user/study/log",
|
|
|
|
+ method: "post",
|
|
|
|
+ data: {
|
|
|
|
+ goodsId: this.reportdata.goodsId,
|
|
|
|
+ courseId: this.reportdata.courseId,
|
|
|
|
+ moduleId: this.reportdata.moduleId || 0,
|
|
|
|
+ chapterId: this.reportdata.chapterId || 0,
|
|
|
|
+ sectionId: this.reportdata.sectionId || 0,
|
|
|
|
+ fromPlat: 2, //来源平台 1小程序 2PC网站
|
|
|
|
+ goodsType: 1, // 商品类型 1视频2题库 3补考 4前培 5虚拟赠送题库 6直播
|
|
|
|
+ orderGoodsId: this.reportdata.orderGoodsId,
|
|
|
|
+ },
|
|
|
|
+ }).then((res) => {
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ wrongExplain(reportdata) {
|
|
|
|
+ this.$router.push({
|
|
|
|
+ path: "/bank-exam-wrong-explain/" + reportdata.recordId,
|
|
|
|
+ query: {
|
|
|
|
+ examId: reportdata.examId,
|
|
|
|
+ moduleId: reportdata.moduleId || 0,
|
|
|
|
+ chapterId: reportdata.chapterId || 0,
|
|
|
|
+ goodsId: reportdata.goodsId,
|
|
|
|
+ orderGoodsId: reportdata.orderGoodsId,
|
|
|
|
+ courseType: 2,
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ allExplain(reportdata) {
|
|
|
|
+ this.$router.push({
|
|
|
|
+ path: "/bank-exam-all-explain/" + reportdata.recordId,
|
|
|
|
+ query: {
|
|
|
|
+ examId: reportdata.examId,
|
|
|
|
+ moduleId: reportdata.moduleId || 0,
|
|
|
|
+ chapterId: reportdata.chapterId || 0,
|
|
|
|
+ goodsId: reportdata.goodsId,
|
|
|
|
+ courseType: 2,
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+ },
|
|
},
|
|
},
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|