Ver Fonte

修复多选题的问题1

zhangyujun há 3 anos atrás
pai
commit
f6f4d6db1d

+ 1 - 0
src/api/request.ts

@@ -22,6 +22,7 @@ request.interceptors.response.use((res) => {
 	if (res && res.data) {
 		switch (res.data.code) {
 			case 401:
+				
 				// Toast("登录失败,需要再次登录")
 				window.setTimeout(() => {
 

+ 8 - 2
src/hooks/exercise/wrong.ts

@@ -71,6 +71,8 @@ export const useSubjectCheck = (currentSubject: ComputedRef<any>, nextSubject: (
 
 				}
 				else {
+					//状态2是错误的
+					isAllTrue = false
 					status = 2
 				}
 
@@ -81,12 +83,16 @@ export const useSubjectCheck = (currentSubject: ComputedRef<any>, nextSubject: (
 					status = 0;
 				}
 				if (currentSubject.value.userAnswer === val) {
+					//状态2是错误的
+					isAllTrue = false
 					status += 2;
 				}
 			}
-
+			
 			return { opt: val, status };
 		});
+		isAllTrue?trueNum.value++:falseNum.value++;
+		
 
 		if (JSON.stringify(currentSubject.value.answer) == JSON.stringify(currentSubject.value.userAnswer)) {
 			//答案正确
@@ -115,7 +121,7 @@ export const useSubjectCheck = (currentSubject: ComputedRef<any>, nextSubject: (
 				skillsShow.value = true;
 			}
 
-			falseNum.value++;
+			
 		}
 	};
 

+ 1 - 1
src/views/mockTest/components/mockTestEnd.vue

@@ -23,7 +23,7 @@
 		<span class="evaluation">学车之路,任重而道远!路漫漫其修远兮,吾将上下而求索。</span>
 	</div>
 	<div class="btn-box">
-		<m-button @click="goWrongPreview" class="btn1" text="错题重做" />
+		<m-button @click="goWrongPreview"  class="btn1" text="错题重做" />
 		<m-button @click="againTest" class="btn2" text="重新测试" />
 	</div>
 </template>