作答矩阵非必选题,未作答时提交时报错

This commit is contained in:
钱冠学
2025-01-26 13:50:35 +08:00
parent 78d663a596
commit ccc5ef412b

View File

@@ -271,7 +271,7 @@ export default defineComponent({
return isError; return isError;
}); });
} }
} else if (questionType === 10) { } else if (answer && questionType === 10) {
// 矩阵多选题,列分组时,校验选项数量 // 矩阵多选题,列分组时,校验选项数量
const cellGroups = (config?.cell_option_groups?.option_group || []).filter((i) => i.groups?.length); const cellGroups = (config?.cell_option_groups?.option_group || []).filter((i) => i.groups?.length);
if (cellGroups.length) { if (cellGroups.length) {
@@ -338,7 +338,7 @@ export default defineComponent({
isError = true; isError = true;
} }
console.log('===', minSelect, Object.keys(answer), answer, perLineSelectedCount); console.log('===', minSelect, Object.keys(answer), answer, perLineSelectedCount);
} else if (questionType === 12) { } else if (answer && questionType === 12) {
question.error = ''; question.error = '';
} else if (answer && questionType === 14 && Object.keys(answer).length < config.min_select) { } else if (answer && questionType === 14 && Object.keys(answer).length < config.min_select) {
// 图片多选题 // 图片多选题