From ebe4c41f76dd61cb355cfea2c1feb95b597db588 Mon Sep 17 00:00:00 2001 From: Tiago Ribeiro Date: Sat, 7 Oct 2023 10:18:51 +0100 Subject: [PATCH] Updated a bit more of the evaluation --- src/utils/evaluation.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/utils/evaluation.ts b/src/utils/evaluation.ts index 5a1c1507..b64b96ec 100644 --- a/src/utils/evaluation.ts +++ b/src/utils/evaluation.ts @@ -51,7 +51,10 @@ const evaluateSpeakingExercise = async (exercise: SpeakingExercise, exerciseId: const formData = new FormData(); formData.append("audio", audioFile, "audio.wav"); - formData.append("question", `${exercise.text.replaceAll("\n", "")} You should talk about: ${exercise.prompts.join(", ")}`); + + const evaluationQuestion = + `${exercise.text.replaceAll("\n", "")}` + (exercise.prompts.length > 0 ? `You should talk about: ${exercise.prompts.join(", ")}` : ""); + formData.append("question", evaluationQuestion); const config = { headers: {