/** 与 Web 端 subject/doWork/index.ts 保持一致 */
export const resource_type_free = '0';
export const resource_type_ai = '1';
export const resource_type_wrong_book = '2';
export const resource_type_analogy = '3';
export const resource_type_paper = '7';
export const resource_type_homework = '8';
export const resource_type_wrong_retry = '10';
export const resource_type_similar_recommend = '11';

/** 兼容历史错误传参 */
export const normalizeResourceType = (type?: string) => {
    if (!type || type === 'homework') return resource_type_homework;
    return type;
};

/** 需要走作业保存/提交接口的资源类型 */
export const isHomeworkExamResourceType = (type: string) =>
    type === resource_type_homework ||
    type === resource_type_wrong_retry ||
    type === resource_type_similar_recommend;
