/*
 * @Author: zjq
 * @description 我的考试
 */
import request from '@/utils/request';

/**
 * @description 开始考试
 * @param {object} params
 */
export const startUserExam = (params?: object) => {
    return request({
        url: '/api/v1/UserExam/Start',
        method: 'post',
        data: params,
    });
};

/**
 * @description 获取考试列表
 * @param {object} params
 */
export const getUserExamData = (params?: object) => {
    return request({
        url: '/api/v1/UserExam/GetPagedList',
        method: 'post',
        data: params,
    });
};
/**
 * @description 获取试题类型分组数据
 * @param {any} Id
 */
export const getExamQuestionGroup = (Id: any) => {
    return request({
        url: `/api/v1/UserExam/GetExamQuestionGroup?ExamId=${Id}`,
        method: 'get',
    });
};
/**
 * @description 获取试题详情
 * @param {any} QuestionId
 * @param {any} ExamId
 */
export const getExamQuestion = (QuestionId: any, ExamId: any) => {
    return request({
        url: `/api/v1/UserExam/GetExamQuestion?QuestionId=${QuestionId}&ExamId=${ExamId}`,
        method: 'get',
    });
};
/**
 * @description 提交考试答案
 * @param {object} params
 */
export const answerUserExam = (params?: object) => {
    return request({
        url: '/api/v1/UserExam/Exam',
        method: 'post',
        data: params,
    });
};

/**
 * @description 交卷
 * @param {object} params
 */
export const submitUserExam = (params?: object) => {
    return request({
        url: '/api/v1/UserExam/Submit',
        method: 'post',
        data: params,
    });
};
