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

课后作业接口调整

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