Created the first exercise of the listening demo

This commit is contained in:
Tiago Ribeiro
2023-03-24 18:09:05 +00:00
parent 3d74bf9bf1
commit 2b38f9df9b
8 changed files with 473 additions and 84 deletions

View File

@@ -1,5 +1,3 @@
export type Type = "fillBlanks" | "matchingSentences";
export interface ReadingExam {
text: {
title: string;
@@ -8,7 +6,17 @@ export interface ReadingExam {
exercises: Exercise[];
}
type Exercise = FillBlanksExercise | MatchSentencesExercise;
export interface ListeningExam {
audio: {
title: string;
source: string;
transcript: string;
repeatableTimes: number; // *The amount of times the user is allowed to repeat the audio, 0 for unlimited
};
exercises: Exercise[];
}
export type Exercise = FillBlanksExercise | MatchSentencesExercise | MultipleChoiceExercise;
export interface FillBlanksExercise {
prompt: string; // *EXAMPLE: "Complete the summary below. Click a blank to select the corresponding word for it."
@@ -23,7 +31,7 @@ export interface FillBlanksExercise {
}
export interface MatchSentencesExercise {
type: string;
type: "matchSentences";
prompt: string;
sentences: {
id: string;
@@ -37,3 +45,21 @@ export interface MatchSentencesExercise {
sentence: string;
}[];
}
export interface MultipleChoiceExercise {
type: "multipleChoice";
prompt: string; // *EXAMPLE: "Select the appropriate option."
questions: MultipleChoiceQuestion[];
}
export interface MultipleChoiceQuestion {
variant: "image" | "text";
id: string; // *EXAMPLE: "1"
prompt: string; // *EXAMPLE: "What does her briefcase look like?"
solution: string; // *EXAMPLE: "A"
options: {
id: string; // *EXAMPLE: "A"
src?: string; // *EXAMPLE: "https://i.imgur.com/rEbrSqA.png" (only used if the variant is "image")
text?: string; // *EXAMPLE: "wallet, pens and novel" (only used if the variant is "text")
}[];
}