import request from '@/utils/request'

// 查询学习资源列表
export function listEl_course(query) {
  return request({
    url: '/exam/el_course/list',
    method: 'get',
    params: query
  })
}

// 查询学习资源下拉列表
export function option_course(data) {
  return request({
    url: '/exam/el_course/queryOption',
    method: 'post',
    data: data
  })
}

// 查询学习资源详细
export function getEl_course(id) {
  return request({
    url: '/exam/el_course/' + id,
    method: 'get'
  })
}

// 新增学习资源
export function addEl_course(data) {
  return request({
    url: '/exam/el_course',
    method: 'post',
    data: data
  })
}

// 修改学习资源
export function updateEl_course(data) {
  return request({
    url: '/exam/el_course',
    method: 'put',
    data: data
  })
}

// 删除学习资源
export function delEl_course(id) {
  return request({
    url: '/exam/el_course/' + id,
    method: 'delete'
  })
}

// 新增章节
export function add_el_chapter(data) {
  return request({
    url: '/exam/el_chapter',
    method: 'post',
    data: data
  })
}

// 修改章节
export function edit_el_chapter(data) {
  return request({
    url:  '/exam/el_chapter',
    method: 'put',
    data: data
  })
}

// 删除章节
export function del_el_chapter(id) {
  return request({
    url: '/exam/el_chapter/' + id,
    method: 'delete'
  })
}

//根据课程查询学习人员列表
export function getLearnList(query) {
  return request({
    url: '/exam/el_course/learnList',
    method: 'get',
    params: query
  })
}
//根据人员课程学习状况
export function getEl_courseInfo(query) {
  return request({
    url: '/exam/el_course/'+query.userId+'/'+query.id,
    method: 'get',
  })
}

//获取章节题目信息
export function queryChapterQu(id) {
  return request({
    url: '/exam/el_chapter/queryChapterQu/' + id,
    method: 'post',
  })
}

//考核记录列表
export function assessList(id,pageNum,pageSize) {
  return request({
    url: '/exam/el_chapter/assessList/' + id+'?pageNum='+pageNum+'&pageSize='+pageSize,
    method: 'post',
  })
}

//考核记录列表
export function assessDetail(id) {
  return request({
    url: '/exam/el_chapter/assessDetail/' + id,
    method: 'post',
  })
}
