Tang преди 3 години
родител
ревизия
2a9a512f44
променени са 4 файла, в които са добавени 16 реда и са изтрити 15 реда
  1. 4 4
      pages2/bank/questionBank.vue
  2. 2 1
      pages2/bank/questionBankExplain.vue
  3. 7 8
      pages2/bank/question_record.vue
  4. 3 2
      pages2/bank/question_report.vue

+ 4 - 4
pages2/bank/questionBank.vue

@@ -555,14 +555,15 @@ export default {
 					}
 				} else if (item.type == 4) {
 					//案例题
-					let isOver = item.jsonStr.every(jsonItem => {
+					let isOver = item.jsonStr.every((jsonItem,indexs) => {
 						if (jsonItem.type == 1 || jsonItem.type == 2 || jsonItem.type == 3) {
-							if (jsonItem.ques) {
+							if (item.ques[indexs]) {
 								return true;
 							} else {
 								return false;
 							}
 						} else if (jsonItem.type == 5) {
+							console.log(jsonItem,111)
 							if (jsonItem.ansText.text.length || jsonItem.ansText.imageList.length) {
 								return true;
 							} else {
@@ -576,7 +577,6 @@ export default {
 						console.log(item,444)
 					}
 				} else if (item.type == 5) {
-					console.log(item,5)
 					//简答题
 					if (item.ansText.text.length || item.ansText.imageList.length) {
 						count++;
@@ -1136,7 +1136,7 @@ export default {
 				rightQuestionNum:number,
 				status:1,
 				doQuestionNum:doQuestionNum,
-				score:score,
+				performance:score,
 				historyExamJson:JSON.stringify(this.questionList)
 			}).then(res => {
 				this.isSubmit = true;

+ 2 - 1
pages2/bank/questionBankExplain.vue

@@ -366,6 +366,7 @@ export default {
 		goodsQuestionList() {
 			//继续答题
 			if(this.isContinue) {
+				console.log(this.isContinue,"历史做题")
 				this.$api.examReport(this.recordId).then(res => {
 					let json = JSON.parse(res.data.data.historyExamJson)
 					
@@ -583,7 +584,7 @@ export default {
 				recordId: this.recordId,
 				rightQuestionNum:number,
 				status:1,
-				score:score,
+				performance:score,
 				historyExamJson:JSON.stringify(this.questionList)
 			}).then(res => {
 				this.isSubmit = true;

+ 7 - 8
pages2/bank/question_record.vue

@@ -137,8 +137,8 @@ export default {
 		 * 去做题
 		 */
 		async doRepeat(id, goodsId, moduleId = 0, chapterId = 0) {
-			await this.getDetail();
-			let count = await this.examRecordCount(id);
+			await this.getDetail(goodsId);
+			let count = await this.examRecordCount(id,goodsId);
 			let answerNum = await this.getExamDetail(id);
 			//超过答题次数
 			if (answerNum > 0 && count >= answerNum) {
@@ -147,7 +147,7 @@ export default {
 			}
 
 			uni.navigateTo({
-				url: '/pages2/bank/questionBankExplain?id=' + id + '&goodsid=' + goodsId + '&moduleId=' + moduleId + '&chapterId=' + chapterId + ''
+				url: '/pages2/bank/questionBank?id=' + id + '&goodsid=' + goodsId + '&moduleId=' + moduleId + '&chapterId=' + chapterId + ''
 			});
 		},
 		/**
@@ -164,12 +164,12 @@ export default {
 		/**
 		 * 查询试卷历史做题次数
 		 */
-		examRecordCount(examId) {
+		examRecordCount(examId,goodsId) {
 			return new Promise(resolve => {
 				this.$api
 					.examRecordCount({
 						examId: examId,
-						goodsId: this.id
+						goodsId: goodsId
 					})
 					.then(res => {
 						resolve(res.data.data);
@@ -177,11 +177,10 @@ export default {
 			});
 		},
 
-		getDetail() {
+		getDetail(id) {
 			return new Promise(resolve => {
-				this.$api.goodsDetail(this.id).then(res => {
+				this.$api.goodsDetail(id).then(res => {
 					this.goodsData = res.data.data;
-
 					resolve();
 				});
 			});

+ 3 - 2
pages2/bank/question_report.vue

@@ -84,6 +84,7 @@ export default {
 					  context1.setStrokeStyle("#EEEEEE")
 					  context1.setLineWidth(caculateX * 20)
 					  context1.arc(caculateX * 90, caculateX * 90, caculateX * 80, 0, 2 * Math.PI, true)
+					  // context1.arc(caculateX * 90, caculateX * 90, caculateX * 80, 0, (this.reportdata.performance / this.reportdata.goodsId) * 2 * Math.PI, false);
 					  context1.stroke()
 					  context1.beginPath()
 					  context1.setStrokeStyle("#32D74B")
@@ -92,11 +93,11 @@ export default {
 					  context1.setTextBaseline('middle')
 					  context1.setLineCap('round')
 					  context1.setFontSize(caculateX * 64)
-					  context1.fillText('60', caculateX * 90, caculateX * 90, caculateX * 180)
+					  context1.fillText(this.reportdata.performance, caculateX * 90, caculateX * 90, caculateX * 180)
 					  context1.setFillStyle('#999999')
 					  context1.setFontSize(caculateX * 20)
 					  context1.fillText('满分100', caculateX * 90, caculateX * 130, caculateX * 180)
-					  context1.arc(caculateX * 90, caculateX * 90, caculateX * 80, 0,  Math.PI, true)
+					  context1.arc(caculateX * 90, caculateX * 90, caculateX * 80, 0, (this.reportdata.performance / 100) * 2 * Math.PI, false)
 					  context1.stroke()
 					  context1.draw()