import request from '@/config/axios'

// 课程-试题-选项 VO
export interface CourseQuestOptionVO {
  id: number // 课程试题选项id
  cqoQuestId: number // 试题id
  cqoQuestion: string // 问题内容
  cqoValue: string // 选项
  cqoOption: string // 选项内容
  cqoSocre: number // 选项分值
  cqoIsAnswer: string // 答案
  tenantId: Number // 租户id
}

// 课程-试题-选项 API
export const CourseQuestOptionApi = {
  // 查询课程-试题-选项分页
  getCourseQuestOptionPage: async (params: any) => {
    return await request.get({ url: `/bjdx/course-quest-option/page`, params })
  },

  // 查询课程-试题-选项详情
  getCourseQuestOption: async (id: number) => {
    return await request.get({ url: `/bjdx/course-quest-option/get?id=` + id })
  },

  // 新增课程-试题-选项
  createCourseQuestOption: async (data: CourseQuestOptionVO) => {
    return await request.post({ url: `/bjdx/course-quest-option/create`, data })
  },

  // 修改课程-试题-选项
  updateCourseQuestOption: async (data: CourseQuestOptionVO) => {
    return await request.put({ url: `/bjdx/course-quest-option/update`, data })
  },

  // 删除课程-试题-选项
  deleteCourseQuestOption: async (id: number) => {
    return await request.delete({ url: `/bjdx/course-quest-option/delete?id=` + id })
  },

  // 导出课程-试题-选项 Excel
  exportCourseQuestOption: async (params) => {
    return await request.download({ url: `/bjdx/course-quest-option/export-excel`, params })
  }
}
