import request from '@/utils/request'

// 查询在线考试列表
export function listPaper(query) {
  return request({
    url: '/elearn/paper/list',
    method: 'get',
    params: query
  })
}

// 查询试卷
export function paperDetail(query) {
  return request({
    url: '/elearn/paper/paperDetail',
    method: 'get',
    params: query
  })
}

// 查询题目
export function quDetail(query) {
  return request({
    url: '/elearn/paper/quDetail',
    method: 'get',
    params: query
  })
}

// 交卷
export function handExam(query) {
  return request({
    url: '/elearn/paper/handExam',
    method: 'get',
    params: query
  })
}
// 试卷详情
export function paperResult(query) {
  return request({
    url: '/elearn/paper/paperResult',
    method: 'get',
    params: query
  })
}



// 填充答案
export function fillAnswer(data) {
  return request({
    url: '/elearn/paper/fillAnswer',
    method: 'post',
    data: data
  })
}


// 查询在线考试详细
export function getPaper(paperId) {
  return request({
    url: '/elearn/paper/' + paperId,
    method: 'get'
  })
}

// 新增在线考试
export function addPaper(data) {
  return request({
    url: '/elearn/paper',
    method: 'post',
    data: data
  })
}

// 修改在线考试
export function updatePaper(data) {
  return request({
    url: '/elearn/paper',
    method: 'put',
    data: data
  })
}

// 创建考试
export function createPaper(data) {
  return request({
    url: '/elearn/paper/createPaper',
    method: 'post',
    data: data
  })
}


// 删除在线考试
export function delPaper(paperId) {
  return request({
    url: '/elearn/paper/' + paperId,
    method: 'delete'
  })
}

// 导出在线考试
export function exportPaper(query) {
  return request({
    url: '/elearn/paper/export',
    method: 'get',
    params: query
  })
}
