Updated the writing evaluation to use the different endpoints
This commit is contained in:
@@ -11,10 +11,16 @@ import {
|
||||
import axios from "axios";
|
||||
import {speakingReverseMarking, writingReverseMarking} from "./score";
|
||||
|
||||
export const evaluateWritingAnswer = async (exercise: WritingExercise, solution: UserSolution, id: string): Promise<UserSolution | undefined> => {
|
||||
export const evaluateWritingAnswer = async (
|
||||
exercise: WritingExercise,
|
||||
task: number,
|
||||
solution: UserSolution,
|
||||
id: string,
|
||||
): Promise<UserSolution | undefined> => {
|
||||
const response = await axios.post<Evaluation>("/api/evaluate/writing", {
|
||||
question: `${exercise.prompt} ${exercise.attachment ? exercise.attachment.description : ""}`.replaceAll("\n", ""),
|
||||
answer: solution.solutions[0].solution.trim().replaceAll("\n", " "),
|
||||
task,
|
||||
id,
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user