|
@@ -2,6 +2,7 @@ import { ref, watch, onBeforeMount, Ref, computed, nextTick, ComputedRef } from
|
|
|
import { CollectionModel } from "@/model/collection";
|
|
|
import { RouterBus } from "@/hooks";
|
|
|
import { Notify } from "vant";
|
|
|
+import { isArrSubset } from "@/utils/utils";
|
|
|
|
|
|
/**错题与收藏 */
|
|
|
export const useSubjectCheck = (currentSubject: ComputedRef<any>, nextSubject: () => Promise<void>) => {
|
|
@@ -58,11 +59,19 @@ export const useSubjectCheck = (currentSubject: ComputedRef<any>, nextSubject: (
|
|
|
} else {
|
|
|
status = 0;
|
|
|
}
|
|
|
- if (currentSubject.value.userAnswer.includes(val)) {
|
|
|
- status += 2;
|
|
|
+ if (currentSubject.value.userAnswer instanceof Array) {
|
|
|
+ if (currentSubject.value.userAnswer.includes(val)) {
|
|
|
+ status += 2;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (currentSubject.value.userAnswer === val) {
|
|
|
+ status += 2;
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
return { opt: val, status };
|
|
|
});
|
|
|
+
|
|
|
if (JSON.stringify(currentSubject.value.answer) == JSON.stringify(currentSubject.value.userAnswer)) {
|
|
|
//答案正确
|
|
|
currentSubject.value.isTrue = true;
|