import { InteractiveSpeakingExercise, LevelPart, ListeningPart, ReadingPart, SpeakingExercise, WritingExercise } from "@/interfaces/exam";
import { v4 } from "uuid";

export const writingTask = (task: number) => ({
    id: v4(),
    type: "writing",
    prefix: `You should spend about ${task == 1 ? "20" : "40"} minutes on this task.`,
    prompt: "",
    userSolutions: [],
    suffix: `You should write at least ${task == 1 ? "150" : "250"} words.`,
    wordCounter: {
        limit: task == 1 ? 150 : 250,
        type: "min",
    },
    order: 1
} as WritingExercise);

export const readingPart = (task: number) => {
    return {
        text: {
            title: "",
            content: ""
        },
        exercises: []
    } as ReadingPart;
};


export const listeningSection = (task: number) => {
    return {
        audio: undefined,
        script: undefined,
        exercises: [],
    } as ListeningPart;
};

export const speakingTask = (task: number) => {
    if ([1,3].includes(task)) {
        return {
            id: v4(),
            type: "interactiveSpeaking",
            title: "",
            text: "",
            prompts: [],
            userSolutions: []
        } as InteractiveSpeakingExercise;
    }
    return {
        id: v4(),
        type: "speaking",
        title: "",
        text: "",
        prompts: [],
        video_url: "",
        userSolutions: [],
    } as SpeakingExercise;
}

export const levelPart = (task : number) => {
    return {
        exercises: []
    } as LevelPart;
} 