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

// data-init-manage
export const dataInitList = datas => {
  return $postParam("/api/admin/grade/paper/initialize", datas);
};
// dimension
export const paperDimensionList = datas => {
  return $postParam("/api/admin/grade/paper/dimension/list", datas);
};
export const updatePaperDimension = datas => {
  return $post("/api/admin/grade/paper/dimension/save", datas);
};
export const paperDimensionExport = datas => {
  return $postParam("/api/admin/grade/paper/dimension/export", datas, {
    responseType: "blob"
  });
};
export const syncPaperStruct = datas => {
  return $postParam(
    "/api/admin/grade/paper/struct/change_paper_structure",
    datas
  );
};
export const paperStructList = datas => {
  return $postParam("/api/admin/grade/paper/struct/list", datas);
};
export const updatePaperStruct = datas => {
  return $post("/api/admin/grade/paper/struct/save", datas);
};
export const paperStructExport = datas => {
  return $postParam("/api/admin/grade/paper/struct/export", datas, {
    responseType: "blob"
  });
};
export const paperDefineList = datas => {
  return $postParam("/api/admin/grade/paper/paper_define", datas);
};
export const updatePaperDefine = datas => {
  return $post("/api/admin/grade/paper/save_define", datas);
};
export const moduleEvaluationList = datas => {
  return $postParam("/api/admin/grade/module/evaluation/list", datas);
};
export const updateModuleEvaluation = datas => {
  return $post("/api/admin/grade/module/evaluation/save", datas);
};

// analysis-course-manage
export const analysisBatchList = datas => {
  return $postParam("/api/admin/grade/batch/page", datas);
};
export const updateAnalysisBatch = datas => {
  return $post("/api/admin/grade/batch/save", datas);
};
export const deleteAnalysisBatch = id => {
  return $postParam("/api/admin/grade/batch/delete", { id });
};
export const analysisBatchPaperList = datas => {
  return $postParam("/api/admin/grade/batch/paper/page", datas);
};
export const addAnalysisBatchPaper = datas => {
  return $post("/api/admin/grade/batch/paper/save", datas);
};
export const deleteAnalysisBatchPaper = (batchId, idList) => {
  return $postParam("/api/admin/grade/batch/paper/delete", { batchId, idList });
};
export const analysisBatchPaperPublish = (batchId, gradeBatchPaperId) => {
  return $postParam("/api/admin/grade/batch/paper/publish", {
    batchId,
    gradeBatchPaperId
  });
};
export const analysisPaperList = datas => {
  return $postParam("/api/admin/grade/batch/paper/able", datas);
};
export const analysisBatchTemplateExport = datas => {
  return $postParam("/api/admin/grade/batch/download", datas, {
    responseType: "blob"
  });
};
export const analysisDataImport = datas => {
  return $postParam("/api/admin/grade/batch/push", datas);
};
export const analysisBatchCalc = datas => {
  return $postParam("/api/admin/grade/batch/start_calc", datas);
};

// analysis-report-view
export const ssoAnalysisLogin = datas => {
  return $postParam("/api/admin/exam/sso/analysis_login", datas);
};
