|
|
|
@ -1,8 +1,15 @@
|
|
|
|
|
// 考试相关的接口,包括考试、问题、选项和评分等接口
|
|
|
|
|
/**
|
|
|
|
|
* @description: 考试模块接口,包括考试、问题、选项和评分等接口
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import api from './index'
|
|
|
|
|
import { axios } from '../utils/request'
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @description: 根据传入的参数获取问题列表
|
|
|
|
|
* @param {Object} parameter - 查询参数
|
|
|
|
|
* @returns {Promise} - 返回问题列表的Promise对象
|
|
|
|
|
*/
|
|
|
|
|
export function getQuestionList (parameter) {
|
|
|
|
|
return axios({
|
|
|
|
|
url: api.ExamQuestionList,
|
|
|
|
@ -11,6 +18,10 @@ export function getQuestionList (parameter) {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @description: 获取所有问题
|
|
|
|
|
* @returns {Promise} - 返回所有问题的Promise对象
|
|
|
|
|
*/
|
|
|
|
|
export function getQuestionAll () {
|
|
|
|
|
return axios({
|
|
|
|
|
url: api.ExamQuestionAll,
|
|
|
|
@ -18,6 +29,11 @@ export function getQuestionAll () {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @description: 更新问题信息
|
|
|
|
|
* @param {Object} parameter - 问题更新参数
|
|
|
|
|
* @returns {Promise} - 返回更新操作的Promise对象
|
|
|
|
|
*/
|
|
|
|
|
export function questionUpdate (parameter) {
|
|
|
|
|
console.log(parameter)
|
|
|
|
|
return axios({
|
|
|
|
@ -27,6 +43,10 @@ export function questionUpdate (parameter) {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @description: 获取问题的选项
|
|
|
|
|
* @returns {Promise} - 返回问题选项的Promise对象
|
|
|
|
|
*/
|
|
|
|
|
export function getQuestionSelection () {
|
|
|
|
|
return axios({
|
|
|
|
|
url: api.ExamQuestionSelection,
|
|
|
|
@ -37,6 +57,11 @@ export function getQuestionSelection () {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @description: 创建新问题
|
|
|
|
|
* @param {Object} parameter - 问题创建参数
|
|
|
|
|
* @returns {Promise} - 返回创建操作的Promise对象
|
|
|
|
|
*/
|
|
|
|
|
export function questionCreate (parameter) {
|
|
|
|
|
console.log(parameter)
|
|
|
|
|
return axios({
|
|
|
|
@ -46,6 +71,11 @@ export function questionCreate (parameter) {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @description: 根据传入的参数获取考试列表
|
|
|
|
|
* @param {Object} parameter - 查询参数
|
|
|
|
|
* @returns {Promise} - 返回考试列表的Promise对象
|
|
|
|
|
*/
|
|
|
|
|
export function getExamList (parameter) {
|
|
|
|
|
return axios({
|
|
|
|
|
url: api.ExamList,
|
|
|
|
@ -54,6 +84,10 @@ export function getExamList (parameter) {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @description: 获取所有考试
|
|
|
|
|
* @returns {Promise} - 返回所有考试的Promise对象
|
|
|
|
|
*/
|
|
|
|
|
export function getExamAll () {
|
|
|
|
|
return axios({
|
|
|
|
|
url: api.ExamAll,
|
|
|
|
@ -61,7 +95,10 @@ export function getExamAll () {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 获取所有问题,按照单选、多选和判断进行分类
|
|
|
|
|
/**
|
|
|
|
|
* @description: 获取所有问题,并按单选、多选和判断进行分类
|
|
|
|
|
* @returns {Promise} - 返回分类问题列表的Promise对象
|
|
|
|
|
*/
|
|
|
|
|
export function getExamQuestionTypeList () {
|
|
|
|
|
return axios({
|
|
|
|
|
url: api.ExamQuestionTypeList,
|
|
|
|
@ -72,6 +109,10 @@ export function getExamQuestionTypeList () {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @description: 获取考试卡片列表
|
|
|
|
|
* @returns {Promise} - 返回考试卡片列表的Promise对象
|
|
|
|
|
*/
|
|
|
|
|
export function getExamCardList () {
|
|
|
|
|
return axios({
|
|
|
|
|
url: api.ExamCardList,
|
|
|
|
@ -82,6 +123,11 @@ export function getExamCardList () {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @description: 创建新考试
|
|
|
|
|
* @param {Object} parameter - 考试创建参数
|
|
|
|
|
* @returns {Promise} - 返回创建操作的Promise对象
|
|
|
|
|
*/
|
|
|
|
|
export function examCreate (parameter) {
|
|
|
|
|
console.log(parameter)
|
|
|
|
|
return axios({
|
|
|
|
@ -91,6 +137,11 @@ export function examCreate (parameter) {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @description: 更新考试信息
|
|
|
|
|
* @param {Object} parameter - 考试更新参数
|
|
|
|
|
* @returns {Promise} - 返回更新操作的Promise对象
|
|
|
|
|
*/
|
|
|
|
|
export function examUpdate (parameter) {
|
|
|
|
|
console.log(parameter)
|
|
|
|
|
return axios({
|
|
|
|
@ -100,6 +151,11 @@ export function examUpdate (parameter) {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @description: 根据考试ID获取考试详情
|
|
|
|
|
* @param {String} examId - 考试ID
|
|
|
|
|
* @returns {Promise} - 返回考试详情的Promise对象
|
|
|
|
|
*/
|
|
|
|
|
export function getExamDetail (examId) {
|
|
|
|
|
return axios({
|
|
|
|
|
url: api.ExamDetail + examId,
|
|
|
|
@ -110,6 +166,11 @@ export function getExamDetail (examId) {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @description: 根据记录ID获取考试记录详情
|
|
|
|
|
* @param {String} recordId - 记录ID
|
|
|
|
|
* @returns {Promise} - 返回考试记录详情的Promise对象
|
|
|
|
|
*/
|
|
|
|
|
export function getExamRecordDetail (recordId) {
|
|
|
|
|
return axios({
|
|
|
|
|
url: api.recordDetail + recordId,
|
|
|
|
@ -120,6 +181,11 @@ export function getExamRecordDetail (recordId) {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @description: 根据问题ID获取问题详情
|
|
|
|
|
* @param {String} questionId - 问题ID
|
|
|
|
|
* @returns {Promise} - 返回问题详情的Promise对象
|
|
|
|
|
*/
|
|
|
|
|
export function getQuestionDetail (questionId) {
|
|
|
|
|
return axios({
|
|
|
|
|
url: api.QuestionDetail + questionId,
|
|
|
|
@ -130,6 +196,12 @@ export function getQuestionDetail (questionId) {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @description: 提交考试答案,完成考试
|
|
|
|
|
* @param {String} examId - 考试ID
|
|
|
|
|
* @param {Object} answersMap - 答案映射
|
|
|
|
|
* @returns {Promise} - 返回完成考试的Promise对象
|
|
|
|
|
*/
|
|
|
|
|
export function finishExam (examId, answersMap) {
|
|
|
|
|
console.log(answersMap)
|
|
|
|
|
return axios({
|
|
|
|
@ -142,6 +214,10 @@ export function finishExam (examId, answersMap) {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @description: 获取所有考试记录
|
|
|
|
|
* @returns {Promise} - 返回所有考试记录的Promise对象
|
|
|
|
|
*/
|
|
|
|
|
export function getExamRecordList () {
|
|
|
|
|
return axios({
|
|
|
|
|
url: api.ExamRecordList,
|
|
|
|
|