Spinner, Attendance bug fix, Marks
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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 };
|
||||
}
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user