- Added the ability for a student/developer to choose a gender for a speaking instructor;
- Made it so, if chosen, the user will only get speaking exams with their chosen gender; - Added the ability for speaking exams to select a gender when generating;
This commit is contained in:
@@ -1,11 +1,29 @@
|
||||
import {Module} from "@/interfaces";
|
||||
import {Exam, ReadingExam, ListeningExam, WritingExam, SpeakingExam, Exercise, UserSolution, LevelExam, Variant} from "@/interfaces/exam";
|
||||
import {
|
||||
Exam,
|
||||
ReadingExam,
|
||||
ListeningExam,
|
||||
WritingExam,
|
||||
SpeakingExam,
|
||||
Exercise,
|
||||
UserSolution,
|
||||
LevelExam,
|
||||
Variant,
|
||||
InstructorGender,
|
||||
} from "@/interfaces/exam";
|
||||
import axios from "axios";
|
||||
|
||||
export const getExam = async (module: Module, avoidRepeated: boolean, variant?: Variant): Promise<Exam | undefined> => {
|
||||
export const getExam = async (
|
||||
module: Module,
|
||||
avoidRepeated: boolean,
|
||||
variant?: Variant,
|
||||
instructorGender?: InstructorGender,
|
||||
): Promise<Exam | undefined> => {
|
||||
const url = new URLSearchParams();
|
||||
url.append("avoidRepeated", avoidRepeated.toString());
|
||||
|
||||
if (variant) url.append("variant", variant);
|
||||
if (module === "speaking" && instructorGender) url.append("instructorGender", instructorGender);
|
||||
|
||||
const examRequest = await axios<Exam[]>(`/api/exam/${module}?${url.toString()}`);
|
||||
if (examRequest.status !== 200) {
|
||||
|
||||
Reference in New Issue
Block a user