import fetch from '@/utils/fetch'

/**
 * 【查】分页查询错题巩固列表
 * {currentPage,pageSize,title}
 */
export const pagingMistakeListApi = (params) =>
  fetch({ url: '/assessmentEvaluation/mistake/paging', method: 'get', params })

/**
 * 【查】根据试题分类查询所有错退
 * {currentPage,pageSize,title}
 */
export const getMistakesByclassifyId = (classifyId, showUserAnswer = 1) =>
  fetch({ url: '/assessmentEvaluation/mistake/questions/' + classifyId, method: 'get', params: { showUserAnswer } })
/**
 * 【改】上传错题答题模式的答案
 * {currentPage,pageSize,title}
 */
export const patchMistakes = (classifyId, mistakes) =>
  fetch({ url: '/assessmentEvaluation/mistake/submitMistakes/' + classifyId, method: 'patch', data: mistakes })
/**
 * 【查】根据试题分类查最后一次考试ID
 * {currentPage,pageSize,title}
 */
export const getLastExamHistoryId = (classifyId) =>
  fetch({ url: '/assessmentEvaluation/mistake/lastExamHistory/' + classifyId, method: 'get' })
