Spinner, Attendance bug fix, Marks

This commit is contained in:
rotimi-best
2021-09-11 19:27:11 +03:00
parent cc1cd9d48b
commit 8c107b0c40
10 changed files with 284 additions and 57 deletions
+4
View File
@@ -165,6 +165,10 @@ export function createExercise(exercise) {
return supabase.from('exercise').insert(exercise);
}
export function fetchExercises(courseId) {
return supabase.rpc('get_exercises').eq('course_id', courseId);
}
function isNew(item) {
return isNaN(item);
}
+7
View File
@@ -0,0 +1,7 @@
import { supabase } from '../../functions/supabase';
export async function fetchMarks(courseId) {
const { data } = await supabase.rpc('get_marks').eq('course_id', courseId);
return { data };
}
+2 -2
View File
@@ -49,7 +49,7 @@ export async function fetchSubmission({ courseId, exerciseId, submittedBy }) {
});
}
export async function updateSubmission({ id, status_id, total }) {
export async function updateSubmission({ id, status_id, total }, otherArgs) {
const toUpdate = {
status_id,
};
@@ -58,7 +58,7 @@ export async function updateSubmission({ id, status_id, total }) {
toUpdate.total = total;
}
return supabase.from('submission').update(toUpdate).match({ id });
return supabase.from('submission').update(toUpdate, otherArgs).match({ id });
}
export async function updateQuestionAnswer(update, match) {