import request from '@/utils/request'

/// 科目列表
export function getPaperSubjects(query) {
    return request({
        url: '/learn/teaching/subjects',
        method: 'get',
        params: query
    })
}

/// 科目列表
export function getPaperKnowledges(query) {
    return request({
        url: '/learn/teaching/knowledges',
        method: 'get',
        params: query
    })
}

/// 省份列表
export function getPaperProvinces(query) {
    return request({
        url: '/learn/teaching/provinces',
        method: 'get',
        params: query
    })
}

/// 考生类型
export function getPaperExamTypes(query) {
    // query: {location}
    return request({
        url: '/learn/teaching/examTypes',
        method: 'get',
        params: query
    })
}

/// 院校
export function getPaperUniversities(query) {
    // query: {batchId}
    return request({
        url: '/learn/teaching/universities',
        method: 'get',
        params: query
    })
}

/// 专业组
export function getPaperMajors(query) {
    // query: {location, examType, batchId, universityId}
    return request({
        url: '/learn/teaching/majors',
        method: 'get',
        params: query
    })
}

/// 试卷批次
export function getPaperBatches() {
    return request({
        url: '/learn/test/list',
        method: 'get'
    })
}

/// 试卷题型
export function getPaperQuestionTypes(query) {
    // query: {subjectId, majorPlanId}
    return request({
        url: '/learn/teaching/questionTypes',
        method: 'get',
        params: query
    })
}

// 试卷试题
export function getPaperQuestions(query) {
    // query: {...}
    return request({
        url: '/learn/questions/list',
        method: 'get',
        params: query
    })
}

// 班级
export function getPaperClasses(query) {
    return request({
        url: '/learn/teaching/classes',
        method: 'get',
        params: query
    })
}

// 学生
export function getPaperStudents(query) {
    return request({
        url: '/learn/teaching/students',
        method: 'get',
        params: query
    })
}

// 自动组卷
export function buildPaperAuto(data) {
    return request({
        url: '/learn/teaching/build/auto',
        method: 'post',
        data
    })
}

// 手工组卷
export function buildPaperManual(data) {
    return request({
        url: '/learn/teaching/build/manual',
        method: 'post',
        data
    })
}

// 发布试卷
export function publishPaper(data) {
    return request({
        url: '/learn/teaching/publish/paper',
        method: 'post',
        data
    })
}

// 批量发布试卷
export function publishPapers(data) {
    return request({
        url: '/learn/teaching/publish/papers',
        method: 'post',
        data
    })
}

