Updated the speaking and interactive speaking to the new format
This commit is contained in:
@@ -51,7 +51,7 @@ export const evaluateSpeakingAnswer = async (
|
||||
case "speaking":
|
||||
return {...(await evaluateSpeakingExercise(exercise, exercise.id, solution, id, task)), id} as UserSolution;
|
||||
case "interactiveSpeaking":
|
||||
return {...(await evaluateInteractiveSpeakingExercise(exercise.id, solution, id)), id} as UserSolution;
|
||||
return {...(await evaluateInteractiveSpeakingExercise(exercise.id, solution, id, exercise.variant)), id} as UserSolution;
|
||||
default:
|
||||
return undefined;
|
||||
}
|
||||
@@ -110,7 +110,12 @@ const evaluateSpeakingExercise = async (
|
||||
return undefined;
|
||||
};
|
||||
|
||||
const evaluateInteractiveSpeakingExercise = async (exerciseId: string, solution: UserSolution, id: string): Promise<UserSolution | undefined> => {
|
||||
const evaluateInteractiveSpeakingExercise = async (
|
||||
exerciseId: string,
|
||||
solution: UserSolution,
|
||||
id: string,
|
||||
variant?: "initial" | "final",
|
||||
): Promise<UserSolution | undefined> => {
|
||||
const promiseParts = solution.solutions.map(async (x: {prompt: string; blob: string}) => {
|
||||
const blob = await downloadBlob(x.blob);
|
||||
if (!x.blob.startsWith("blob")) await axios.post("/api/storage/delete", {path: x.blob});
|
||||
@@ -132,6 +137,7 @@ const evaluateInteractiveSpeakingExercise = async (exerciseId: string, solution:
|
||||
formData.append(`answer_${seed}`, audioFile, `${seed}.wav`);
|
||||
});
|
||||
formData.append("id", id);
|
||||
formData.append("variant", variant || "final");
|
||||
|
||||
const config = {
|
||||
headers: {
|
||||
|
||||
Reference in New Issue
Block a user