fix(api): throw during exam generation if empty config (#62044)

This commit is contained in:
Shaun Hamilton
2025-09-04 12:49:07 +02:00
committed by GitHub
parent 00cc06f49c
commit ebd17c473b
@@ -303,6 +303,10 @@ export function generateExam(
};
});
if (examCopy.config.questionSets.length === 0) {
throw `${examCopy.id}: Invalid exam config - no question sets config.`;
}
// Convert question set config by type: [[all question sets of type], [another type], ...]
const typeConvertedQuestionSetsConfig = examCopy.config.questionSets.reduce(
(acc, curr) => {