import { requestClient } from '#/api/request';

enum Api {
  base = '/examAnswerResult/result',
  list = '/examAnswerResult/result/list',
}

function addAnswerResult(params: any) {
  return requestClient.post(Api.base, params, {
    successMessageMode: 'none',
  });
}

async function getAnswerResult(examId: number) {
  return requestClient.get(`${Api.base}/${examId}`);
}

async function getAnswerResultList(params: any) {
  return requestClient.get(`${Api.list}`, { params });
}

async function gradeExam(params: any) {
  return requestClient.post(`${Api.base}/grade`, params, {
    successMessageMode: 'message',
  });
}

export { addAnswerResult, getAnswerResult, getAnswerResultList, gradeExam };
