Solved a bug where the speaking and interactive speaking were not being correctly evaluated

This commit is contained in:
Tiago Ribeiro
2024-03-23 15:43:25 +00:00
parent 38c0c823e1
commit 13ebb9bbd8
9 changed files with 23 additions and 8 deletions

View File

@@ -28,6 +28,7 @@ export const evaluateWritingAnswer = async (exercise: WritingExercise, solution:
total: 100,
},
solutions: [{id: exercise.id, solution: solution.solutions[0].solution, evaluation: response.data}],
isDisabled: true,
};
}
@@ -77,12 +78,14 @@ const evaluateSpeakingExercise = async (exercise: SpeakingExercise, exerciseId:
if (response.status === 200) {
return {
...solution,
id,
score: {
correct: response.data ? speakingReverseMarking[response.data.overall] : 0,
correct: 0,
missing: 0,
total: 100,
},
solutions: [{id: exerciseId, solution: response.data ? response.data.fullPath : null, evaluation: response.data}],
isDisabled: true,
};
}
@@ -119,18 +122,19 @@ const evaluateInteractiveSpeakingExercise = async (exerciseId: string, solution:
};
const response = await axios.post("/api/evaluate/interactiveSpeaking", formData, config);
console.log({data: response.data, status: response.status});
if (response.status === 200) {
return {
...solution,
id,
score: {
correct: response.data ? speakingReverseMarking[response.data.overall] : 0,
correct: 0,
missing: 0,
total: 100,
},
module: "speaking",
solutions: [{id: exerciseId, solution: response.data ? response.data.answer : null, evaluation: response.data}],
isDisabled: true,
};
}