Merge branch 'refs/heads/bugfix/20240621'

This commit is contained in:
钱冠学
2024-07-05 13:27:42 +08:00
2 changed files with 10 additions and 2 deletions

View File

@@ -102,8 +102,13 @@ export default function answerMock(questionsData, page) {
// 自动填写逻辑
autoFill(data.answer_info_autofill, logic);
} else if (logic.skip_type === 4) {
// 选项隐藏逻辑
updateOptionHidden(data.hide_options, logic);
// 只计算跳转后所在页面的隐藏逻辑,否则会出现只返回最后一道隐藏选项题目的情况,导致失效
const toPage = page + 1
const hasHiddenLogicQuizPage = data.pages.findIndex((page) => page.includes(logic.question_index)) + 1
if (hasHiddenLogicQuizPage === toPage) {
// 选项隐藏逻辑
updateOptionHidden(data.hide_options, logic);
}
}
});
// 更新问卷状态

View File

@@ -122,6 +122,9 @@ export default defineComponent({
error = "";
}
}
if (Object.keys(answer || {}).every((key) => !answer[key])) {
answer = null
}
context.emit("update:error", error);
context.emit("update:answer", answer);
}