import request from '@/utils/request'

export function getSubjectAll() {
  return request({
    url: '/question/subject/',
    method: 'get',
  })
}

export function createSubject(data) {
  return request({
    url: '/question/subject/',
    method: 'post',
    data
  })
}
export function updateSubject(id, data) {
  return request({
    url: `/question/subject/${id}/`,
    method: 'put',
    data
  })
}
export function deleteSubject(id) {
  return request({
    url: `/question/subject/${id}/`,
    method: 'delete',
  })
}

export function getQuestioncatAll(query) {
  return request({
    url: '/question/questioncat/all/',
    method: 'get',
    params: query
  })
}

export function getQuestioncatList(query) {
  return request({
    url: '/question/questioncat/',
    method: 'get',
    params: query
  })
}

export function createQuestioncat(data) {
  return request({
    url: '/question/questioncat/',
    method: 'post',
    data
  })
}
export function updateQuestioncat(id, data) {
  return request({
    url: `/question/questioncat/${id}/`,
    method: 'put',
    data
  })
}
export function deleteQuestioncat(id) {
  return request({
    url: `/question/questioncat/${id}/`,
    method: 'delete',
  })
}

export function getQuestionList(query) {
  return request({
    url: '/question/question/',
    method: 'get',
    params: query
  })
}

export function getQuestionCount(data) {
  return request({
    url: '/question/question/count/',
    method: 'post',
    data
  })
}

export function createQuestion(data) {
  return request({
    url: '/question/question/',
    method: 'post',
    data
  })
}
export function getQuestion(id) {
  return request({
    url: `/question/question/${id}/`,
    method: 'get',
  })
}

export function updateQuestion(id, data) {
  return request({
    url: `/question/question/${id}/`,
    method: 'put',
    data
  })
}
export function deleteQuestion(id) {
  return request({
    url: `/question/question/${id}/`,
    method: 'delete',
  })
}
export function deleteQuestions(data) {
  return request({
    url: `/question/question/deletes/`,
    method: 'post',
    data
  })
}
export function importQuestion(data) {
  return request({
    url: `/question/question/import/`,
    method: 'post',
    data
  })
}
export function exportQuestion(query) {
  return request({
    url: '/question/question/export/',
    method: 'get',
    params: query
  })
}

export function enableQuestions(data) {
  return request({
    url: '/question/question/enable/',
    method: 'post',
    data
  })
}