|
|
@@ -482,7 +482,7 @@ export const useExam = () => {
|
|
|
answer1 = answer1 || '';
|
|
|
answer2 = answer2 || '';
|
|
|
if ([EnumQuestionType.SINGLE_CHOICE, EnumQuestionType.JUDGMENT].includes(typeId)) {
|
|
|
- return answer1?.trim() === answers[0];
|
|
|
+ return answer1.trim() === answers[0];
|
|
|
} else if ([EnumQuestionType.MULTIPLE_CHOICE].includes(typeId)) {
|
|
|
return answers.length === answer1.length && answers.every(item => answer1.includes(item));
|
|
|
} else {
|
|
|
@@ -528,7 +528,9 @@ export const useExam = () => {
|
|
|
if (currentQuestion.value.activeSubIndex < currentQuestion.value.subQuestions.length - 1) {
|
|
|
currentQuestion.value.activeSubIndex++;
|
|
|
} else {
|
|
|
- currentIndex.value++;
|
|
|
+ const lastIndex = currentIndex.value + 1;
|
|
|
+ questionList.value[lastIndex].activeSubIndex = 0;
|
|
|
+ currentIndex.value = lastIndex;
|
|
|
}
|
|
|
}
|
|
|
// 上一题
|
|
|
@@ -540,7 +542,9 @@ export const useExam = () => {
|
|
|
if (currentQuestion.value.activeSubIndex > 0) {
|
|
|
currentQuestion.value.activeSubIndex--;
|
|
|
} else {
|
|
|
- currentIndex.value--;
|
|
|
+ const prevIndex = currentIndex.value - 1;
|
|
|
+ questionList.value[prevIndex].activeSubIndex = questionList.value[prevIndex].subQuestions.length - 1;
|
|
|
+ currentIndex.value = prevIndex;
|
|
|
}
|
|
|
} else {
|
|
|
if (currentIndex.value > 0) {
|
|
|
@@ -746,7 +750,7 @@ export const useExam = () => {
|
|
|
virtualIndex: 0,
|
|
|
duration: 0,
|
|
|
activeSubIndex: 0,
|
|
|
- hasSubQuestions: item.subQuestions?.length > 0,
|
|
|
+ hasSubQuestions: item.subQuestions && item.subQuestions?.length > 0,
|
|
|
typeTitle: item.typeTitle
|
|
|
} as Study.Question
|
|
|
}
|