import axiosInstance from "@/apis/axios.config";

const EVALUATION_PREFIX = "/api/evaluation"

const evaluationApis = {
    overAllEvaluation(assignmentId: number, studentId: number){
        return axiosInstance.post(`${EVALUATION_PREFIX}/overall`, {}, {
            params: {
                assignmentId,
                studentId
            },
            timeout: 40000 // 设置超时时间为 40 秒
        })
    },
    sentenceEvaluation(assignmentId: number, studentId: number){
        return axiosInstance.post(`${EVALUATION_PREFIX}/sentence`, {}, {
            params: {
                assignmentId,
                studentId
            },
            timeout: 40000 // 设置超时时间为 40 秒
        })
    },
    getOverall(assignmentId: number, studentId: number, version: number){
        return axiosInstance.get(`${EVALUATION_PREFIX}/select/overall`, {
            params: {
                assignmentId,
                studentId,
                version
            }
        })
    },
    getSentence(assignmentId: number, studentId: number, version: number){
        return axiosInstance.get(`${EVALUATION_PREFIX}/select/sentence`, {
            params: {
                assignmentId,
                studentId,
                version
            }
        })
    },
    getEvaluationVersionList(assignmentId: number, studentId: number){
        return axiosInstance.get(`${EVALUATION_PREFIX}/record/list`, {
            params: {
                assignmentId,
                studentId
            }
        })
    },
}

export default evaluationApis