import { $post, $get } from "@/plugins/axios";

export const uploadFormalImage = (options, datas, config) => {
  const pathInfo = options.imageEnc ? "image/uploadsheet" : "ms-sheet";
  return $post(
    `/api/file/${pathInfo}/${options.examId}/${options.subjectId}/${options.examNumber}`,
    datas,
    config
  );
};
export const uploadSliceImage = (options, datas, config) => {
  const pathInfo = options.imageEnc ? "image/upload" : "ms-slice";
  return $post(
    `/api/file/${pathInfo}/${options.examId}/${options.subjectId}/${options.examNumber}`,
    datas,
    config
  );
};
export const getStudentGroupByExamNumber = examNumber => {
  return $get(`/api/exam/listStudents/${examNumber}`);
};
export const getStudentByExamNumber = examNumber => {
  return $get(`/api/exam/getStudent/${examNumber}`);
};
export const uploadStudent = datas => {
  return $post(`/api/upload/student/${datas.subjectId}`, datas);
};
export const saveCollectLog = datas => {
  return $post(`/api/marklog/saveCollectLog`, {
    ...datas,
    workId: datas.examId
  });
};
export const getLevelList = examId => {
  return $get(`/api/exam/getLevel/${examId}`);
};
