/* eslint-disable */
// @ts-ignore
import request from '@/http/vue-query';
import { CustomRequestOptions } from '@/http/types';

import * as API from './types';

/** 获取老师阅卷任务列表 获取指定老师的阅卷任务列表，包含当前任务和历次任务，支持分页和学年筛选 GET /marking-tasks */
export async function markingTasksUsingGet({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.markingTasksUsingGetParams;
  options?: CustomRequestOptions;
}) {
  return request<
    API.Response & {
      data?: API.TeacherMarkingTasksResponse;
    }
  >('/marking-tasks', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 获取阅卷任务历史记录 根据任务ID获取该老师在这个任务下阅过的试卷历史记录，按创建时间从小到大排序 GET /marking-tasks/${param0}/history */
export async function markingTasksTaskIdHistoryUsingGet({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.markingTasksTaskIdHistoryUsingGetParams;
  options?: CustomRequestOptions;
}) {
  const { task_id: param0, ...queryParams } = params;

  return request<
    API.Response & {
      data?: API.MarkingTaskHistoryResponse;
    }
  >(`/marking-tasks/${param0}/history`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 获取学生阅卷题目 获取指定任务的学生阅卷题目 GET /marking-tasks/${param0}/question */
export async function markingTasksTaskIdQuestionUsingGet({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.markingTasksTaskIdQuestionUsingGetParams;
  options?: CustomRequestOptions;
}) {
  const { task_id: param0, ...queryParams } = params;

  return request<
    API.Response & {
      data?: API.StudentMarkingQuestionResponse;
    }
  >(`/marking-tasks/${param0}/question`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 获取考生的阅卷题目列表 从教师的缓存队列中取出多条数据，获取题目信息和图片路径 GET /marking-tasks/${param0}/questions */
export async function markingTasksTaskIdQuestionsUsingGet({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.markingTasksTaskIdQuestionsUsingGetParams;
  options?: CustomRequestOptions;
}) {
  const { task_id: param0, ...queryParams } = params;

  return request<
    API.Response & {
      data?: API.StudentMarkingQuestionsResponse;
    }
  >(`/marking-tasks/${param0}/questions`, {
    method: 'GET',
    params: {
      ...queryParams,
    },
    ...(options || {}),
  });
}

/** 回评任务 根据任务ID删除所有相关的阅卷任务记录，并将任务状态重置为准备中 POST /marking-tasks/${param0}/remark */
export async function markingTasksTaskIdRemarkUsingPost({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.markingTasksTaskIdRemarkUsingPostParams;
  options?: CustomRequestOptions;
}) {
  const { task_id: param0, ...queryParams } = params;

  return request<
    API.Response & {
      message?: string;
    }
  >(`/marking-tasks/${param0}/remark`, {
    method: 'POST',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 开始阅卷任务 开始指定的阅卷任务 POST /marking-tasks/${param0}/start */
export async function markingTasksTaskIdStartUsingPost({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.markingTasksTaskIdStartUsingPostParams;
  options?: CustomRequestOptions;
}) {
  const { task_id: param0, ...queryParams } = params;

  return request<
    API.Response & {
      message?: string;
    }
  >(`/marking-tasks/${param0}/start`, {
    method: 'POST',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 获取考试科目下所有题目及其任务列表 根据考试ID和科目ID获取所有题目及其任务列表，如果题目下面没有任务，则不用返回 GET /marking-tasks/by-question */
export async function markingTasksByQuestionUsingGet({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.markingTasksByQuestionUsingGetParams;
  options?: CustomRequestOptions;
}) {
  return request<
    API.Response & {
      data?: API.MarkingTasksByQuestionResponse;
    }
  >('/marking-tasks/by-question', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 获取历史评分 根据question_id获取当前登录老师历史打过的分，去重并从小到大排序 GET /marking-tasks/history-scores */
export async function markingTasksHistoryScoresUsingGet({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.markingTasksHistoryScoresUsingGetParams;
  options?: CustomRequestOptions;
}) {
  return request<
    API.Response & {
      data?: API.GetHistoryScoresResponse;
    }
  >('/marking-tasks/history-scores', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 设置问题卷记录 设置指定题目的问题卷记录 POST /marking-tasks/problem-record */
export async function markingTasksProblemRecordUsingPost({
  body,
  options,
}: {
  body: API.SetProblemRecordRequest;
  options?: CustomRequestOptions;
}) {
  return request<
    API.Response & {
      data?: API.SetProblemRecordResponse;
    }
  >('/marking-tasks/problem-record', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 获取题目平均分对比 根据题目ID和任务ID计算所有老师和特定老师的平均分对比 GET /marking-tasks/question/${param0}/task/${param1}/average-score-comparison */
export async function markingTasksQuestionQuestionIdTaskTaskIdAverageScoreComparisonUsingGet({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.markingTasksQuestionQuestionIdTaskTaskIdAverageScoreComparisonUsingGetParams;
  options?: CustomRequestOptions;
}) {
  const { question_id: param0, task_id: param1, ...queryParams } = params;

  return request<
    API.Response & {
      data?: API.QuestionAverageScoreComparisonResponse;
    }
  >(
    `/marking-tasks/question/${param0}/task/${param1}/average-score-comparison`,
    {
      method: 'GET',
      params: { ...queryParams },
      ...(options || {}),
    }
  );
}
