/*
 * @Author: zjq
 * @description 考试管理
 */
import request from '@/utils/request';

/**
 * @description 新增考试
 * @param {object} data
 */
export const addExamManage = (data: object) => {
    return request({
        url: '/api/v1/ExamManage/Add',
        method: 'post',
        data,
    });
};
/**
 * @description 编辑考试
 * @param {object} data
 */
export const editExamManage = (data: object) => {
    return request({
        url: '/api/v1/ExamManage/Update',
        method: 'put',
        data,
    });
};
/**
 * @description 删除考试
 * @param {object} data
 */
export const deleteExamManage = (data: object) => {
    return request({
        url: '/api/v1/ExamManage/Delete',
        method: 'delete',
        data,
    });
};
/**
 * @description 获取考试列表
 * @param {object} params
 */
export const getExamManageData = (params?: object) => {
    return request({
        url: '/api/v1/ExamManage/GetPagedList',
        method: 'post',
        data: params,
    });
};
/**
 * @description 查询考试详情
 * @param {any} Id
 */
export const getExamManageDetail = (Id: any) => {
    return request({
        url: `/api/v1/ExamManage/Get?id=${Id}`,
        method: 'get',
    });
};
/**
 * @description 根据选择的试卷id或者抽题规则id返回试题类型及数量
 * @param {any} testPaperId
 * @param {any} extractRuleId
 */
export const getTestPaperQuestionCount = (testPaperId: any, extractRuleId: any) => {
    return request({
        url: `/api/v1/TestPaper/GetTestPaperQuestionCount?testPaperId=${testPaperId}&extractRuleId=${extractRuleId}`,
        method: 'get',
    });
};
