chore: disable mark as complete if all exercises are not complete #513

This commit is contained in:
Rotimi Best
2024-12-23 02:31:53 +01:00
parent 39665fb65d
commit b3ca8b00a6
12 changed files with 76 additions and 34 deletions
@@ -61,6 +61,18 @@ export async function fetchProfileCourseProgress(
return { data, error };
}
export async function checkExercisesComplete(
lessonId: Lesson['id'],
groupMemberId: Groupmember['id']
) {
const { data, error } = await supabase.rpc('check_if_student_completed_exercises', {
lesson_id_arg: lessonId,
groupmember_id_arg: groupMemberId
});
return { data, error };
}
const SLUG_QUERY = `
id,
title,