Merge branch 'develop' into ENCOA-83_MasterStatistical
This commit is contained in:
@@ -33,6 +33,11 @@ export const updateExpiryDateOnGroup = async (participantID: string, corporateID
|
||||
return;
|
||||
};
|
||||
|
||||
export const getGroups = async () => {
|
||||
const groupDocs = await getDocs(collection(db, "groups"));
|
||||
return groupDocs.docs.map((x) => ({...x.data(), id: x.id})) as Group[];
|
||||
};
|
||||
|
||||
export const getUserGroups = async (id: string): Promise<Group[]> => {
|
||||
const groupDocs = await getDocs(query(collection(db, "groups"), where("admin", "==", id)));
|
||||
return groupDocs.docs.map((x) => ({...x.data(), id})) as Group[];
|
||||
|
||||
@@ -26,6 +26,7 @@ export const countExercises = (exercises: Exercise[]) => {
|
||||
const lengthMap = exercises.map((e) => {
|
||||
if (e.type === "multipleChoice") return e.questions.length;
|
||||
if (e.type === "interactiveSpeaking") return e.prompts.length;
|
||||
if (e.type === "fillBlanks") return e.words.length;
|
||||
|
||||
return 1;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user