/**
 * 授权 API
 */
import {
	http
} from '../request/main.js'
/**
 * 开始答题
 * 
 * @returns {Promise}
 */
export function startChallenge() {
	return http.post('/examine/startChallenge')}

/**
 * 获取新题
 * 
 * @returns {Promise}
 */
export function getNew(session_id) {
	return http.post('/examine/getNew', {
		session_id
	})}

/**
 * 提交答案
 * 
 * @returns {Promise}
 */
export function submitAnswer(id, answer) {
	return http.post('/examine/submitAnswer', {
		id,
		answer
	})
}

/**
 * 获取考核结果
 * 
 * @returns {Promise}
 */
export function getSummary(session_id) {
	return http.post('/examine/getSummary', {
		session_id
	})
}

/**
 * 获取考核历史
 * 
 * @returns {Promise}
 */
export function getHistory(session_id, page, page_size) {
	return http.post('/examine/getHistory', {
		session_id,
		page,
		page_size
	})
}

/**
 * 获取答题结果
 * 
 * @returns {Promise}
 */
export function getResult(id) {
	return http.post('/examine/getResult', {
		id
	})
}

/**
 * 获取排行数据
 * 
 * @returns {Promise}
 */
export function getTopList(group, page, page_size) {
	return http.post('/examine/getTopList', {
		group,
		page,
		page_size
	})
}

/**
 * 获取我的排行
 * 
 * @returns {Promise}
 */
export function getMineTop(group) {
	return http.post('/examine/getMineTop', {
		group
	})
}

/**
 * 获取全部排行和个人排行
 * 比赛专用
 * 
 * @returns {Promise}
 */
export function getRankingList() {
	return http.post('/examine/getRankingList', {
	})
}
