import{ myRequest} from './api.js'

// 考试信息
export const getExam= (id) => myRequest('/education/app/exam/'+id, '', "GET");

//考试登录
export const phoneLogin= (params) => myRequest('/auth/app/phoneLogin', params, "POST");

//考试注册
export const register= (params) => myRequest('/education/app/student/register', params, "POST");

//开始考试获取题的数据
export const startExam= (examId,loginName,loginPassword) => myRequest('/education/app/exam/startExam/'+examId +'/'+loginName+'/'+loginPassword, '', "GET");

//是否已经登录       如果有openId的话会直接反考试数据
export const checkOpenId= (examId,openId) => myRequest('/education/app/exam/checkOpenId/'+examId +'/'+openId, '', "GET");

//提交答案
export const answerSheet= (params) => myRequest('/education/app/answerSheet/add', params, "POST",{'content-type': 'application/json'});

//获取openId
export const getStuOpenId= (params) => myRequest('/auth/app/student/getStuOpenId', params, "POST");
//解除绑定
export const unbindMiniOpenid= (params) => myRequest('/education/app/student/unbindMiniOpenid', params, "POST");
//获取答题历史列表
export const getExamHistory= (examId,loginName) => myRequest('/education/eStudentTestPaper/getExamHistory/'+examId+'/'+loginName, '', "GET");

//获取答题历史详细信息
export const getExamHistoryView= (answerSheetId) => myRequest('/education/eStudentTestPaper/getExamHistoryView/'+answerSheetId,'', "GET");

 //获取APPID
export const getAppID = (params) => myRequest('/auth/app/getAppId', params, 'GET');

 //排行榜
export const getExamRanking = (examId) => myRequest('/education/app/answerSheet/getExamRanking/'+examId, '', 'GET');

 //我的排名信息
export const getExamRankingForStu = (examId,loginName) => myRequest('/education/app/answerSheet/getExamRankingForStu/'+examId+'/'+loginName, '', 'GET');