提交 6de4c428 authored 作者: 王鹏飞's avatar 王鹏飞

课后作业接口调整

上级 ad729691
......@@ -8,9 +8,7 @@ const httpRequest = new BaseAPI(webConf)
* @param {string} courseId 课程ID
*/
export function getCourse(semesterId, courseId) {
return httpRequest.get(
`/api/lms/v2/education/courses/${courseId}`
)
return httpRequest.get(`/api/lms/v2/education/courses/${courseId}`)
}
/**
......@@ -44,10 +42,7 @@ export function getChapterVideoAliyun(vid) {
* @param {Object} params
*/
export function getChapterVideoProgress(semesterId, resourseId, params) {
return httpRequest.get(
`/api/lms/v2/education/video/${resourseId}/device`,
params
)
return httpRequest.get(`/api/lms/v2/education/video/${resourseId}/device`, params)
}
/**
......@@ -64,10 +59,8 @@ export function updateChapterVideoProgress(params) {
* @param {string} courseId 课程ID
* @param {string} resourseId 章节的资源ID
*/
export function getChapterHomework(courseId, resourseId) {
return httpRequest.get(
`/api/lms/v2/education/homeworks/${courseId}/${resourseId}`
)
export function getChapterHomework(courseId, chapterId, resourseId) {
return httpRequest.get(`/api/lms/v2/education/homeworks/${courseId}/${chapterId}/${resourseId}`)
}
/**
......@@ -77,9 +70,7 @@ export function getChapterHomework(courseId, resourseId) {
* @param {string} chapterId 章节ID
*/
export function getChapterHomeworkDeadline(semesterId, courseId, chapterId) {
return httpRequest.get(
`/api/lms/v2/education/homeworks/${courseId}/${chapterId}/deadline`
)
return httpRequest.get(`/api/lms/v2/education/homeworks/${courseId}/${chapterId}/deadline`)
}
/**
......@@ -106,9 +97,7 @@ export function uploadFile(data) {
* @param {string} courseId 课程ID
*/
export function getCourseWork(semesterId, courseId) {
return httpRequest.get(
`/api/lms/v2/education/courses/${courseId}/essay`
)
return httpRequest.get(`/api/lms/v2/education/courses/${courseId}/essay`)
}
/**
......@@ -117,11 +106,9 @@ export function getCourseWork(semesterId, courseId) {
* @param {string} courseId 课程ID
*/
export function updateCourseWork(semesterId, courseId, data) {
return httpRequest.post(
`/api/lms/v2/education/courses/${courseId}/essay`,
data,
{ headers: { 'Content-Type': 'multipart/form-data' } }
)
return httpRequest.post(`/api/lms/v2/education/courses/${courseId}/essay`, data, {
headers: { 'Content-Type': 'multipart/form-data' }
})
}
/**
......@@ -130,9 +117,7 @@ export function updateCourseWork(semesterId, courseId, data) {
* @param {string} courseId 课程ID
*/
export function getCourseExam(semesterId, courseId) {
return httpRequest.get(
`/api/lms/v2/education/${courseId}/examination`
)
return httpRequest.get(`/api/lms/v2/education/${courseId}/examination`)
}
/**
......@@ -142,9 +127,7 @@ export function getCourseExam(semesterId, courseId) {
* @param {string} examId 试题ID
*/
export function getCourseExamStatus(semesterId, courseId, examId) {
return httpRequest.get(
`/api/lms/v2/education/${courseId}/examination/${examId}/status`
)
return httpRequest.get(`/api/lms/v2/education/${courseId}/examination/${examId}/status`)
}
/**
......@@ -154,11 +137,9 @@ export function getCourseExamStatus(semesterId, courseId, examId) {
* @param {string} examId 试题ID
*/
export function submitCourseExam(semesterId, courseId, examId, data) {
return httpRequest.post(
`/api/lms/v2/education/${courseId}/examination/${examId}/sheet`,
data,
{ headers: { 'Content-Type': 'application/x-www-form-urlencoded' } }
)
return httpRequest.post(`/api/lms/v2/education/${courseId}/examination/${examId}/sheet`, data, {
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
})
}
/**
......@@ -168,8 +149,5 @@ export function submitCourseExam(semesterId, courseId, examId, data) {
* @param {string} examId 试题ID
*/
export function getCourseExamResult(semesterId, courseId, examId, params) {
return httpRequest.get(
`/api/lms/v2/education/${courseId}/examination/${examId}/sheet`,
params
)
return httpRequest.get(`/api/lms/v2/education/${courseId}/examination/${examId}/sheet`, params)
}
......@@ -101,7 +101,7 @@ export default {
getDetail() {
this.loading = true
api
.getChapterHomework(this.cid, this.resourceId)
.getChapterHomework(this.cid, this.pid, this.resourceId)
.then(response => {
this.detail = Array.isArray(response) ? null : response
if (this.detail) {
......
......@@ -167,7 +167,7 @@ export default {
getDetail() {
this.loading = true
api
.getChapterHomework(this.cid, this.resourceId)
.getChapterHomework(this.cid, this.pid, this.resourceId)
.then(response => {
this.detail = Array.isArray(response) ? null : response
if (this.detail) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论