Added Speaking to level, fixed a bug where it was causing level to crash if the listening was already created and the section was switched, added true false exercises to listening

This commit is contained in:
Carlos-Mesquita
2024-11-13 20:32:59 +00:00
parent 153d7f5448
commit 8cb09e349f
23 changed files with 1122 additions and 292 deletions

View File

@@ -35,7 +35,7 @@ export const listeningSection = (task: number) => {
};
export const speakingTask = (task: number) => {
if (task === 3) {
if ([1,3].includes(task)) {
return {
id: v4(),
type: "interactiveSpeaking",

View File

@@ -72,6 +72,8 @@ export interface LevelSectionSettings extends SectionSettings {
speakingSecondTopic?: string;
isSpeakingTopicOpen: boolean;
isGenerateVideoOpen: boolean;
isSpeakingExercisesOpen: boolean;
isConfigureExercisesOpen: boolean;
// section picker
isReadingPickerOpen: boolean;
@@ -80,6 +82,7 @@ export interface LevelSectionSettings extends SectionSettings {
export type Context = "passage" | "video" | "audio" | "listeningScript" | "speakingScript" | "writing";
export type Generating = Context | "exercises" | string | undefined;
export type LevelGenResults = {generating: string, result: Record<string, any>[], module: Module};
export type Section = LevelPart | ReadingPart | ListeningPart | WritingExercise | SpeakingExercise | InteractiveSpeakingExercise;
export type ExamPart = ListeningPart | ReadingPart | LevelPart;
@@ -91,7 +94,7 @@ export interface SectionState {
generating: Generating;
genResult: {generating: string, result: Record<string, any>[], module: Module} | undefined;
levelGenerating: Generating[];
levelGenResults: {generating: string, result: Record<string, any>[], module: Module}[];
levelGenResults: LevelGenResults[];
focusedExercise?: {questionId: number; id: string} | undefined;
writingSection?: number;
speakingSection?: number;