/*
 * @Author: zjq
 * @description 自我练习列表
 */
import request from '@/utils/request';

/**
 * @description 获取自我练习列表
 * @param {object} params
 */
export const getPracticeData = (params?: object) => {
    return request({
        url: '/api/v1/Practice/GetPagedList',
        method: 'post',
        data: params,
    });
};

/**
 * @description 新增练习-生成练习ID
 * @param {object} data
 */
export const addPractice = (data: object) => {
    return request({
        url: '/api/v1/Practice/Add',
        method: 'post',
        data,
    });
};

/**
 * @description 获取练习试题类型分组数据
 * @param {any} Id
 */
export const getPracticeQuestionGroup = (Id: any) => {
    return request({
        url: `/api/v1/Practice/GetPracticeQuestionViewResponses?PracticeId=${Id}`,
        method: 'get',
    });
};
/**
 * @description 获取练习试题详情
 * @param {any} Id
 */
export const getPracticeQuestion = (Id: any,) => {
    return request({
        url: `/api/v1/Practice/GetPracticeQuestionDto?PracticeQuestionId=${Id}`,
        method: 'get',
    });
};
/**
 * @description 提交练习答案
 * @param {object} params
 */
export const answerUserPractice = (params?: object) => {
    return request({
        url: '/api/v1/Practice/Practice',
        method: 'post',
        data: params,
    });
};

/**
 * @description 完成练习
 * @param {object} params
 */
export const submitUserPractice = (params?: object) => {
    return request({
        url: '/api/v1/Practice/Complete',
        method: 'post',
        data: params,
    });
};

/**
 * @description 满足条件试题数量
 * @param {object} params
 */
export const getTagQuestionCount = (params: object) => {
    return request({
        url: `/api/v1/Practice/GetTagQuestionCount`,
        method: 'post',
        data: params,
    });
};

/**
 * @description 获取练习试题类型分组数据-查看
 * @param {any} Id
 */
export const getViewPracticeQuestions = (Id: any) => {
    return request({
        url: `/api/v1/Practice/GetViewPracticeQuestions?PracticeId=${Id}`,
        method: 'get',
    });
};
/**
 * @description 获取练习试题详情-查看
 * @param {any} Id
 */
export const getPracticeView = (Id: any,) => {
    return request({
        url: `/api/v1/Practice/View?PracticeQuestionId=${Id}`,
        method: 'get',
    });
};