Added the ability for some exams to be private and not chosen randomly
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import {collection, getDocs, query, where, setDoc, doc, Firestore, getDoc} from "firebase/firestore";
|
||||
import {collection, getDocs, query, where, setDoc, doc, Firestore, getDoc, and} from "firebase/firestore";
|
||||
import {shuffle} from "lodash";
|
||||
import {Difficulty, Exam, InstructorGender, SpeakingExam, Variant, WritingExam} from "@/interfaces/exam";
|
||||
import {DeveloperUser, Stat, StudentUser, User} from "@/interfaces/user";
|
||||
@@ -17,7 +17,7 @@ export const getExams = async (
|
||||
): Promise<Exam[]> => {
|
||||
const moduleRef = collection(db, module);
|
||||
|
||||
const q = query(moduleRef, where("isDiagnostic", "==", false));
|
||||
const q = query(moduleRef, and(where("isDiagnostic", "==", false), where("private", "!=", true)));
|
||||
const snapshot = await getDocs(q);
|
||||
|
||||
const allExams = shuffle(
|
||||
|
||||
Reference in New Issue
Block a user