forgot useMemo usage for AssetPickerSheet

Signed-off-by: Kenneth Obsequio <k80308392@gmail.com>
This commit is contained in:
2026-08-15 11:09:09 +08:00
parent 1029177a91
commit 0013c22523
2 changed files with 62 additions and 2 deletions
@@ -195,6 +195,15 @@ const DEFAULT_HANDLERS = {
*/
async function evaluateEntity({ entityType, entityId, userId, courseId = null, transaction = null }) {
const t = transaction;
// Units always complete by passing their own quiz — overrides whatever
// completion_requirement type (if any) is configured on the unit. A unit
// with no quiz attached never completes (isUnitQuizPassed returns false).
if (entityType === 'unit') {
const completed = await isUnitQuizPassed({ unitId: entityId, userId, t });
return { status: completed ? 'completed' : 'in_progress', evaluated_via: 'quiz_required', satisfied: [] };
}
const rows = await CompletionRequirement.findAll({
where: { entity_type: entityType, entity_id: entityId },
order: [['order', 'ASC']],