import { http } from '@/utils/http';

/**
 * 分页查询练习题列表
 */
export function PageQueryExerciseList(data) {
  return http.post(`/TeachingServer/ExerciseManager/PageQueryExerciseList`, data);
}

/**
 * 新建练习题
 */
export function CreateExercise(data) {
  return http.post(`/TeachingServer/ExerciseManager/CreateExercise`, data);
}

/**
 * 得到练习题信息
 * @param {object} data
 * @param {string} data.exercise_id 练习题id
 * @returns {object} data
 * @returns {string} data.exercise 练习题信息
 */
export function GetExerciseInfo(data) {
  return http.post(`/TeachingServer/ExerciseManager/GetExerciseInfo`, data);
}

/**
 * 更新练习题
 */
export function UpdateExercise(data) {
  return http.post(`/TeachingServer/ExerciseManager/UpdateExercise`, data);
}

/**
 * 删除练习题
 * @param {object} data
 * @param {string} data.exercise_id 练习题id
 */
export function DeleteExercise(data) {
  return http.post(`/TeachingServer/ExerciseManager/DeleteExercise`, data);
}

/**
 * 得到标签列表
 * @param {object} data
 * @param {string} data.store_type 标签名称
 */
export function GetLabelList(data) {
  return http.post(`/TeachingServer/ExerciseManager/GetLabelList`, data);
}

/**
 * 添加题目到练习
 */
export function AddQuestionToExercise(data) {
  return http.post(`/TeachingServer/ExerciseManager/AddQuestionToExercise`, data);
}

/**
 * 保存题目
 */
export function SaveQuestion(data) {
  return http.post(`/TeachingServer/ExerciseManager/SaveQuestion`, data);
}

/**
 * 得到练习的题目索引列表
 */
export function GetExerciseQuestionIndexList(data) {
  return http.post(`/TeachingServer/ExerciseManager/GetExerciseQuestionIndexList`, data);
}

/**
 * 得到题目
 * @param {object} data
 * @param {string} data.question_id 题目id
 */
export function GetQuestionInfo(data) {
  return http.post(`/TeachingServer/ExerciseManager/GetQuestionInfo`, data);
}

/**
 * 删除题目
 * @param {object} data
 * @param {string} data.question_id 题目id
 */
export function DeleteQuestion(data) {
  return http.post(`/TeachingServer/ExerciseManager/DeleteQuestion`, data);
}

/**
 * 创建分享记录
 */
export function CreateShareRecord(data) {
  return http.post(`/TeachingServer/ExerciseManager/CreateShareRecord`, data);
}

/**
 * 复制练习题到公共库
 */
export function CopyExerciseToPublicStore(data) {
  return http.post(`/TeachingServer/ExerciseManager/CopyExerciseToPublicStore`, data);
}

/**
 * 复制练习题到个人库
 */
export function CopyExerciseToPersonalStore(data) {
  return http.post(`/TeachingServer/ExerciseManager/CopyExerciseToPersonalStore`, data);
}

/**
 * 分页查询练习题分享记录列表
 */
export function PageQueryExerciseShareRecordList(data) {
  return http.post(`/TeachingServer/ExerciseManager/PageQueryExerciseShareRecordList`, data);
}

/**
 * 分页查询练习题用户答题记录列表
 */
export function PageQueryExerciseUserAnswerRecordList(data) {
  return http.post(`/TeachingServer/ExerciseManager/PageQueryExerciseUserAnswerRecordList`, data);
}

/**
 * 得到练习题题目用户答题统计表
 * @param {object} data
 * @param {string} data.share_record_id 分享记录id
 */
export function GetExerciseQuestionUserAnswerStatList(data) {
  return http.post(`/TeachingServer/ExerciseComInfoQuery/GetExerciseQuestionUserAnswerStatList`, data);
}

/**
 * 得到练习题题目答题用户列表
 * @param {object} data
 * @param {string} data.share_record_id 分享记录id
 * @param {string} data.question_id 题目id
 */
export function GetExerciseQuestionAnswerUserList(data) {
  return http.post(`/TeachingServer/ExerciseComInfoQuery/GetExerciseQuestionAnswerUserList`, data);
}

/**
 * 得到我的课程列表（教师）
 */
export function GetMyCourseList_Teacher(data) {
  return http.post(
    `${process.env.VUE_APP_LearnWebSI}?MethodName=teaching-course_manager-GetMyCourseList_Teacher`,
    data,
  );
}

/**
 * 得到课程学员列表
 */
export function GetCourseStudentList(data) {
  return http.post(`${process.env.VUE_APP_LearnWebSI}?MethodName=teaching-course_manager-GetCourseStudentList`, data);
}

/**
 * 得到分享记录信息
 * @param {object} data
 * @param {string} data.share_record_id 分享记录id
 */
export function GetShareRecordInfo(data) {
  return http.post(`/TeachingServer/ExerciseManager/GetShareRecordInfo`, data);
}

/**
 * 开始答题
 * @param {object} data
 * @param {string} data.exercise_id 练习题id
 * @param {string} data.share_record_id 分享记录id
 */
export function StartAnswer(data) {
  return http.post(`/TeachingServer/ExerciseManager/StartAnswer`, data);
}

/**
 * 填写题目答案
 */
export function FillQuestionAnswer(data) {
  return http.post(`/TeachingServer/ExerciseManager/FillQuestionAnswer`, data);
}

/**
 * 得到答题记录题目信息
 */
export function GetQuestionInfo_AnswerRecord(data) {
  return http.post(`/TeachingServer/ExerciseManager/GetQuestionInfo_AnswerRecord`, data);
}

/**
 * 提交答题
 */
export function SubmitAnswer(data) {
  return http.post(`/TeachingServer/ExerciseManager/SubmitAnswer`, data);
}

/**
 * 得到答题记录信息
 */
export function GetAnswerRecordInfo(data) {
  return http.post(`/TeachingServer/AnswerManger/GetAnswerRecordInfo`, data);
}

/**
 * 得到答题记录报告
 */
export function GetAnswerRecordReport(data) {
  return http.post(`/TeachingServer/ExerciseManager/GetAnswerRecordReport`, data);
}

/**
 * 填写题目答题批注
 */
export function FillQuestionAnswerRemark(data) {
  return http.post(`/TeachingServer/ExerciseAnswerManager/FillQuestionAnswerRemark`, data);
}

/**
 * 完成答题批注
 */
export function FinishAnswerRemark(data) {
  return http.post(`/TeachingServer/ExerciseAnswerManager/FinishAnswerRemark`, data);
}

/**
 * 得用户答题记录列表
 */
export function GetUserAnswerRecordList(data) {
  return http.post(`/TeachingServer/ExerciseManager/GetUserAnswerRecordList`, data);
}

/**
 * 得到分享配置
 * @param {object} data
 * @returns {object} {exercise_share_url_path 练习题分享链接的路径}
 */
export function GetShareConfig(data) {
  return http.post(`${process.env.VUE_APP_FileServer}?MethodName=sys_config_manager-GetShareConfig`, data);
}

/**
 * 结束答题
 * @param {object} data
 * @param {string} data.answer_record_id 答题记录id
 */
export function EndAnswer(data) {
  return http.post(`/TeachingServer/ExerciseAnswerManager/EndAnswer`, data);
}

/**
 * 开始编辑
 * @param {object} data
 * @param {string} data.share_record_id 分享记录id
 */
export function StartEdit(data) {
  return http.post(`/TeachingServer/ExerciseManager/StartEdit`, data);
}

/**
 * 删除我的分享编辑练习题
 * @param {object} data
 * @param {string} data.exercise_id 练习题id
 */
export function DeleteMyShareEditExercise(data) {
  return http.post(`/TeachingServer/ExerciseManager/DeleteMyShareEditExercise`, data);
}

/**
 * 停止分享记录
 * @param {object} data
 * @param {string} data.share_record_id 分享记录id
 */
export function StopShareRecord(data) {
  return http.post(`/TeachingServer/ExerciseManager/StopShareRecord`, data);
}

/**
 * 移动题目
 */
export function MoveQuestion(data) {
  return http.post(`/TeachingServer/ExerciseManager/MoveQuestion`, data);
}
