import request from '@/utils/request'
import { parseStrEmpty } from "@/utils/ruoyi";


// 老师考试相关 start
// 查询老师考试集合列表
export function examTearcherList(query) {
    return request({
      url: '/sim/real-exam-collection/teacher/exam/list',
      method: 'get',
      params: query
    })
}
// 查询老师考试集合详细信息
export function examTearcherGet(examCollectionId) {
    return request({
      url: '/sim/real-exam-collection/' + parseStrEmpty(examCollectionId),
      method: 'get'
    })
}
// 新增老师考试集合
export function examTearcheradd(data) {
    return request({
      url: '/sim/real-exam-collection',
      method: 'post',
      data: data
    })
}
// 修改老师考试集合
export function examTearcherupdate(data) {
    return request({
      url: '/sim/real-exam-collection',
      method: 'put',
      data: data
    })
}
// 删除考试集合老师考试集合列表
export function examTearcherdel(examCollectionIds) {
    return request({
        url: '/sim/real-exam-collection/' + examCollectionIds,
        method: 'delete'
    })
}

// 打开考试集合
export function examTearcheropen(examCollectionId,examCollectionState) {
  const data = {
    examCollectionState
  }
  return request({
    url: '/sim/real-exam-collection/teacher/exam/open/' + examCollectionId,
    method: 'put',
    data: data
  })
}
// 关闭考试集合
export function examTearcherclose(examCollectionId,examCollectionState) {
  const data = {
    examCollectionState
  }
  return request({
    url: '/sim/real-exam-collection/teacher/exam/close/' + examCollectionId,
    method: 'put',
    data: data
  })
}
// 老师考试相关 end


// 老师练习相关 start
// 练习集合列表
export function exerciseTearcherList(query) {
  return request({
    url: '/sim/real-exam-collection/teacher/exercise/list',
    method: 'get',
    params: query
  })
}

// 老师练习相关 end



// 学生考试相关 start
// 查询学生考试集合列表
export function examStudentList() {
    return request({
        url: '/sim/real-exam/student/exam/listByUserId/',
        method: 'get'
    })
}

// 学生进入考试
export function examStudentEnter(examId) {
  return request({
      url: '/sim/real-exam/student/exam/enter/' + parseStrEmpty(examId),
      method: 'get'
  })
}

// 学生开始考试
export function examStudentStart(examId) {
  return request({
      url: '/sim/real-exam/student/exam/start/' + parseStrEmpty(examId),
      method: 'get'
  })
}


// 准备考试界面
export function examStudentPrepare(examId) {
  return request({
      url: '/sim/real-exam/student/exam/prepare/' + parseStrEmpty(examId),
      method: 'get'
  })
}

// 正在考试界面
export function examStudentAnswering(examId) {
  return request({
      url: '/sim/real-exam/student/exam/answering/' + parseStrEmpty(examId),
      method: 'get'
  })
}

//考试交卷界面
export function examStudentSubmit(examId) {
  return request({
      url: '/sim/real-exam/student/exam/submit/' + parseStrEmpty(examId),
      method: 'get'
  })
}


//结束考试界面
export function examStudentReport(examId) {
  return request({
      url: '/sim/real-exam/student/exam/report/' + parseStrEmpty(examId),
      method: 'get'
  })
}


// 学生获取考试详细信息
export function examStudentGet(userId) {
  return request({
      url: '/sim/real-exam/student/' + parseStrEmpty(userId),
      method: 'get'
  })
}

// 学生考试相关 end
