Updated the writing evaluation to use the different endpoints
This commit is contained in:
@@ -11,6 +11,7 @@ import {writingReverseMarking} from "@/utils/score";
|
||||
interface Body {
|
||||
question: string;
|
||||
answer: string;
|
||||
task: 1 | 2;
|
||||
id: string;
|
||||
}
|
||||
|
||||
@@ -62,7 +63,7 @@ async function getCorrespondingStat(id: string, index: number): Promise<Stat> {
|
||||
}
|
||||
|
||||
async function evaluate(body: Body): Promise<AxiosResponse> {
|
||||
const backendRequest = await axios.post(`${process.env.BACKEND_URL}/writing_task2`, body as Body, {
|
||||
const backendRequest = await axios.post(`${process.env.BACKEND_URL}/writing_task${body.task.toString() || "1"}`, body as Body, {
|
||||
headers: {
|
||||
Authorization: `Bearer ${process.env.BACKEND_JWT}`,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user