/*
 * @Description: 
 * @Author: Aimee·Zhang
 * @Date: 2022-01-13 13:17:14
 * @LastEditors: Aimee·Zhang
 * @LastEditTime: 2022-01-14 08:38:02
 */
/**
 * @description:健康测评模块接口
 * @params {*}
 * @return {*}
 * @Date: 2022-01-13 13:17:33
 */
import { request } from '../index'
/**
 * @description:健康测评接口
 */
const evaluations = () => {
	return request({
		url: 'evaluations'
	})
}
/**
 * @description:测试介绍页面
 * @Date: 2022-01-13 15:04:47
 */
const evaluationsInfo = (evaluation_id) => {
	return request({
		url: `evaluations/${evaluation_id}`
	})
}

/**
 * @description:试题列表
 * @Date: 2022-01-13 15:12:31
 */

const evaluationsQuestion = (evaluation_id, page) => {
	return request({
		url: `evaluations/${evaluation_id}/questions`,
		data: {
			page: page
		}
	})
}
/**
 * @description:提交答案
 * @Date: 2022-01-13 16:06:26
 */
const evaluationsAnswers = (data) => {
	return request({
		url: `evaluations/${data.id}/answers`,
		data: data,
		method: 'POST'
	})
}
/**
 * @description:获取测评结果
 * @Date: 2022-01-13 16:28:02
 */
const evaluationsAnswersInfo = (id) => {
	return request({
		url: `evaluations/${id}/result`,
	})
}

export {
	evaluations,
	evaluationsInfo,
	evaluationsQuestion,
	evaluationsAnswers,
	evaluationsAnswersInfo
}
