提交 2b9dc081 authored 作者: hexi's avatar hexi

路由homeworks增加courseid

上级 0be24b43
......@@ -186,9 +186,9 @@ const getCourseAssess = (cid, sid, callback) => {
})
}
/* 获取试题信息 */
const getExamDetail = (eid, sid, callback) => {
const getExamDetail = (eid, sid, courseid, callback) => {
util.requestApi({
url: util.config.URL_PATH1 + '/v2/education/homeworks/' + sid + '/' + eid,
url: util.config.URL_PATH1 + '/v2/education/homeworks/' + sid + '/' + courseid + '/' + eid,
callback: function (res) {
callback(res)
}
......
......@@ -131,7 +131,7 @@ Page({
if (wx.getStorageSync('_homework')) {
this.setData({ 'exam': this.updateData(wx.getStorageSync('_homework')) })
}
CourseApi.getExamDetail(this.data.exam.id, this.data.exam.semester_id, (res) => {
CourseApi.getExamDetail(this.data.exam.id, this.data.exam.semester_id, this.param.course_id, (res) => {
let _data = res.data
let json = _data.homework
if (json) {
......@@ -214,11 +214,11 @@ Page({
}
this.unArrRandomSort(arr)
this.param.work_contents = JSON.stringify(arr)
this.param.score = (score/total*100).toFixed(1)
this.param.score = (score/total*100).toFixed(1);
wx.showLoading({ title: '提交中...', mask: true })
CourseApi.submitExamDetail(this.param, (res) => {
if (res.data.status) {
CourseApi.getExamDetail(this.data.exam.id, this.data.exam.semester_id, (res) => {
CourseApi.getExamDetail(this.data.exam.id, this.data.exam.semester_id, this.param.course_id, (res) => {
let _data = res.data
let json = _data.homework
if (json) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论