Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
L
learn-online-pc
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
learn-online-pc
Commits
1eb19f81
提交
1eb19f81
authored
5月 25, 2020
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改课程考试模块
上级
7854fc18
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
101 行增加
和
81 行删除
+101
-81
PlayerAction.js
client/src/action/PlayerAction.js
+84
-79
player_api.js
client/src/api/player_api.js
+1
-1
courseDetail.vue
client/src/pages/learn/courseDetail.vue
+2
-0
chapterExam2.vue
client/src/pages/player/chapterExam/chapterExam2.vue
+0
-0
exam.vue
client/src/pages/player/exam/exam.vue
+0
-0
index.vue
client/src/pages/player/index.vue
+6
-1
sideChapterList.vue
client/src/pages/player/rightSide/sideChapterList.vue
+2
-0
routes.js
client/src/router/routes.js
+6
-0
没有找到文件。
client/src/action/PlayerAction.js
浏览文件 @
1eb19f81
...
@@ -164,7 +164,8 @@ export default class PlayerAction extends BaseACTION {
...
@@ -164,7 +164,8 @@ export default class PlayerAction extends BaseACTION {
json
:
json
,
json
:
json
,
courseInfo
:
_res
.
files
||
[],
courseInfo
:
_res
.
files
||
[],
courseWork
:
_res
.
curriculum
||
{},
courseWork
:
_res
.
curriculum
||
{},
curJson
:
curJson
curJson
:
curJson
,
rawResponse
:
_res
}
}
})
})
}
}
...
@@ -291,51 +292,51 @@ export default class PlayerAction extends BaseACTION {
...
@@ -291,51 +292,51 @@ export default class PlayerAction extends BaseACTION {
exam
.
id
=
_res
.
id
exam
.
id
=
_res
.
id
exam
.
title
=
_res
.
title
exam
.
title
=
_res
.
title
exam
.
score
=
{}
exam
.
score
=
{}
exam
.
radioList
=
_res
.
examination
.
radioList
exam
.
examination
=
_res
.
examination
.
map
(
exam
=>
{
for
(
let
i
=
0
;
i
<
exam
.
radioList
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
exam
.
radioList
.
length
;
i
++
)
{
exam
.
radioList
[
i
].
user_answer
=
''
exam
.
radioList
[
i
].
user_answer
=
''
exam
.
radioList
[
i
].
right_answer
=
''
exam
.
radioList
[
i
].
right_answer
=
''
exam
.
radioList
[
i
].
get_score
=
-
1
exam
.
radioList
[
i
].
get_score
=
-
1
}
exam
.
checkboxList
=
_res
.
examination
.
checkboxList
for
(
let
i
=
0
;
i
<
exam
.
checkboxList
.
length
;
i
++
)
{
exam
.
checkboxList
[
i
].
user_answer
=
[]
exam
.
checkboxList
[
i
].
right_answer
=
[]
exam
.
checkboxList
[
i
].
get_score
=
-
1
}
exam
.
shortAnswerList
=
_res
.
examination
.
shortAnswerList
for
(
let
i
=
0
;
i
<
exam
.
shortAnswerList
.
length
;
i
++
)
{
exam
.
shortAnswerList
[
i
].
user_answer
=
''
exam
.
shortAnswerList
[
i
].
get_score
=
-
1
exam
.
shortAnswerList
[
i
].
attachments
=
[]
exam
.
shortAnswerList
[
i
].
upload
=
{
type
:
'upload-form'
,
label
:
'附件上传:'
,
model
:
'attachments'
,
action
:
webConf
.
apiBaseURL
+
'/util/upload-file'
,
data
:
{
special
:
'exam'
},
attrs
:
{
multiple
:
true
,
headers
:
{
tenant
:
'sofia'
}
},
html
:
`
<div style="color: #72818c; font-size: 14px;">
<p style="margin: 0;">支持doc,docx,ppt,xls,txt,rar,zip,pdf,jpg,pic,png格式的文件,文件小于30M。</p>
</div>
`
}
}
}
for
(
let
i
=
0
;
i
<
exam
.
checkboxList
.
length
;
i
++
)
{
exam
.
checkboxList
[
i
].
user_answer
=
[]
exam
.
checkboxList
[
i
].
right_answer
=
[]
exam
.
checkboxList
[
i
].
get_score
=
-
1
}
for
(
let
i
=
0
;
i
<
exam
.
shortAnswerList
.
length
;
i
++
)
{
exam
.
shortAnswerList
[
i
].
user_answer
=
''
exam
.
shortAnswerList
[
i
].
get_score
=
-
1
exam
.
shortAnswerList
[
i
].
attachments
=
[]
exam
.
shortAnswerList
[
i
].
upload
=
{
type
:
'upload-form'
,
label
:
'附件上传:'
,
model
:
'attachments'
,
action
:
webConf
.
apiBaseURL
+
'/util/upload-file'
,
data
:
{
special
:
'exam'
},
attrs
:
{
multiple
:
true
,
headers
:
{
tenant
:
'sofia'
}
},
html
:
`
<div style="color: #72818c; font-size: 14px;">
<p style="margin: 0;">支持doc,docx,ppt,xls,txt,rar,zip,pdf,jpg,pic,png格式的文件,文件小于30M。</p>
</div>
`
}
}
return
exam
})
return
exam
return
exam
})
})
}
}
/* 获取考卷结果 */
/* 获取考卷结果 */
getExamAnswer
(
cid
,
sid
,
eid
)
{
getExamAnswer
(
cid
,
sid
,
eid
,
obj
)
{
return
Player
.
getExamAnswer
(
cid
,
sid
,
eid
).
then
(
_res
=>
{
return
Player
.
getExamAnswer
(
cid
,
sid
,
eid
,
obj
).
then
(
_res
=>
{
if
(
_res
.
code
)
{
return
_res
}
if
(
_res
.
code
)
{
return
_res
}
const
exam
=
{}
const
exam
=
{}
let
tmp
=
null
let
tmp
=
null
...
@@ -345,46 +346,50 @@ export default class PlayerAction extends BaseACTION {
...
@@ -345,46 +346,50 @@ export default class PlayerAction extends BaseACTION {
exam
.
score
=
_res
.
score
exam
.
score
=
_res
.
score
exam
.
isPublished
=
_res
.
is_published
||
''
exam
.
isPublished
=
_res
.
is_published
||
''
exam
.
submitted_time
=
_res
.
submitted_time
exam
.
submitted_time
=
_res
.
submitted_time
exam
.
radioList
=
_res
.
sheet
.
radioList
exam
.
examination
=
_res
.
sheet
.
map
(
exam
=>
{
for
(
let
i
=
0
;
i
<
exam
.
radioList
.
length
;
i
++
)
{
exam
.
radioList
=
exam
.
radioList
||
[]
tmp
=
exam
.
radioList
[
i
]
for
(
let
i
=
0
;
i
<
exam
.
radioList
.
length
;
i
++
)
{
if
(
!
tmp
.
user_answer
)
tmp
.
user_answer
=
''
tmp
=
exam
.
radioList
[
i
]
if
(
!
tmp
.
right_answer
)
tmp
.
right_answer
=
''
if
(
!
tmp
.
user_answer
)
tmp
.
user_answer
=
''
if
(
!
tmp
.
get_score
)
tmp
.
get_score
=
-
1
if
(
!
tmp
.
right_answer
)
tmp
.
right_answer
=
''
}
if
(
!
tmp
.
get_score
)
tmp
.
get_score
=
-
1
exam
.
checkboxList
=
_res
.
sheet
.
checkboxList
for
(
let
i
=
0
;
i
<
exam
.
checkboxList
.
length
;
i
++
)
{
tmp
=
exam
.
checkboxList
[
i
]
if
(
!
tmp
.
user_answer
||
!
tmp
.
user_answer
.
length
)
tmp
.
user_answer
=
[]
if
(
!
tmp
.
right_answer
||
!
tmp
.
right_answer
.
length
)
tmp
.
right_answer
=
[]
if
(
!
tmp
.
get_score
)
tmp
.
get_score
=
-
1
}
exam
.
shortAnswerList
=
_res
.
sheet
.
shortAnswerList
for
(
let
i
=
0
;
i
<
exam
.
shortAnswerList
.
length
;
i
++
)
{
tmp
=
exam
.
shortAnswerList
[
i
]
tmp
.
user_answer
=
Base64
.
decode
(
tmp
.
user_answer
.
replace
(
/ /gi
,
'+'
))
if
(
!
tmp
.
attachments
||
!
tmp
.
attachments
.
length
)
tmp
.
attachments
=
[]
tmp
.
upload
=
{
type
:
'upload-form'
,
label
:
'附件上传:'
,
model
:
'attachments'
,
action
:
webConf
.
apiBaseURL
+
'/util/upload-file'
,
data
:
{
special
:
'exam'
},
attrs
:
{
multiple
:
true
,
headers
:
{
tenant
:
'sofia'
}
},
html
:
`
<div style="color: #72818c; font-size: 14px;">
<p style="margin: 0;">支持doc,docx,ppt,xls,txt,rar,zip,pdf,jpg,pic,png格式的文件,文件小于30M。</p>
</div>
`
}
}
}
exam
.
checkboxList
=
exam
.
checkboxList
||
[]
for
(
let
i
=
0
;
i
<
exam
.
checkboxList
.
length
;
i
++
)
{
tmp
=
exam
.
checkboxList
[
i
]
if
(
!
tmp
.
user_answer
||
!
tmp
.
user_answer
.
length
)
tmp
.
user_answer
=
[]
// if (!tmp.right_answer || !tmp.right_answer.length) tmp.right_answer = []
tmp
.
right_answer
=
tmp
.
right_answer
||
[]
if
(
!
tmp
.
get_score
)
tmp
.
get_score
=
-
1
}
exam
.
shortAnswerList
=
exam
.
shortAnswerList
||
[]
for
(
let
i
=
0
;
i
<
exam
.
shortAnswerList
.
length
;
i
++
)
{
tmp
=
exam
.
shortAnswerList
[
i
]
tmp
.
user_answer
=
tmp
.
user_answer
?
Base64
.
decode
(
tmp
.
user_answer
.
replace
(
/ /gi
,
'+'
))
:
''
if
(
!
tmp
.
attachments
||
!
tmp
.
attachments
.
length
)
tmp
.
attachments
=
[]
tmp
.
upload
=
{
type
:
'upload-form'
,
label
:
'附件上传:'
,
model
:
'attachments'
,
action
:
webConf
.
apiBaseURL
+
'/util/upload-file'
,
data
:
{
special
:
'exam'
},
attrs
:
{
multiple
:
true
,
headers
:
{
tenant
:
'sofia'
}
},
html
:
`
<div style="color: #72818c; font-size: 14px;">
<p style="margin: 0;">支持doc,docx,ppt,xls,txt,rar,zip,pdf,jpg,pic,png格式的文件,文件小于30M。</p>
</div>
`
}
}
return
exam
})
return
exam
return
exam
})
})
}
}
...
...
client/src/api/player_api.js
浏览文件 @
1eb19f81
...
@@ -113,7 +113,7 @@ export default class PlayerAPI extends BaseAPI {
...
@@ -113,7 +113,7 @@ export default class PlayerAPI extends BaseAPI {
* @param {[string]} semester_id -> sid
* @param {[string]} semester_id -> sid
* @param {[string]} exam_id -> eid
* @param {[string]} exam_id -> eid
*/
*/
getExamAnswer
=
(
cid
,
sid
,
eid
)
=>
this
.
get
(
`/v2/education/
${
sid
}
/
${
cid
}
/examination/
${
eid
}
/sheet`
,
{}
)
getExamAnswer
=
(
cid
,
sid
,
eid
,
obj
=
{})
=>
this
.
get
(
`/v2/education/
${
sid
}
/
${
cid
}
/examination/
${
eid
}
/sheet`
,
obj
)
/**
/**
* 获取考试状态
* 获取考试状态
* @param {[string]} course_id -> cid
* @param {[string]} course_id -> cid
...
...
client/src/pages/learn/courseDetail.vue
浏览文件 @
1eb19f81
...
@@ -618,6 +618,8 @@ export default {
...
@@ -618,6 +618,8 @@ export default {
}
else
{
}
else
{
this
.
$router
.
push
({
path
:
`/player/
${
sid
}
/
${
cid
}
/live/
${
_id
}
`
})
this
.
$router
.
push
({
path
:
`/player/
${
sid
}
/
${
cid
}
/live/
${
_id
}
`
})
}
}
}
else
if
(
_course
.
chapters
[
i2
].
type
===
9
)
{
this
.
$router
.
push
({
path
:
`/player/
${
sid
}
/
${
cid
}
/chapter-exam2/
${
_course
.
chapters
[
i2
].
id
}
`
})
}
}
return
return
}
}
...
...
client/src/pages/player/chapterExam/chapterExam2.vue
0 → 100644
浏览文件 @
1eb19f81
差异被折叠。
点击展开。
client/src/pages/player/exam/exam.vue
浏览文件 @
1eb19f81
差异被折叠。
点击展开。
client/src/pages/player/index.vue
浏览文件 @
1eb19f81
...
@@ -18,6 +18,7 @@
...
@@ -18,6 +18,7 @@
<div
class=
"play-content"
>
<div
class=
"play-content"
>
<router-view
<router-view
ref=
"comTotalChapter"
ref=
"comTotalChapter"
:chapters=
"rawResponse.chapters"
:chapterName=
"curChapterName"
:chapterName=
"curChapterName"
:chapterId=
"chapterId"
:chapterId=
"chapterId"
:courseInfo=
"courseInfo"
:courseInfo=
"courseInfo"
...
@@ -33,6 +34,7 @@
...
@@ -33,6 +34,7 @@
@
updateProgress=
"updateProgress"
@
updateProgress=
"updateProgress"
@
changeSideBar=
"changeSideBar"
@
changeSideBar=
"changeSideBar"
:key=
"id"
:key=
"id"
v-if=
"rawResponse.chapters"
></router-view>
></router-view>
</div>
</div>
</div>
</div>
...
@@ -151,7 +153,8 @@ export default {
...
@@ -151,7 +153,8 @@ export default {
chapterExam
:
{},
chapterExam
:
{},
/* 章节视频 */
/* 章节视频 */
chapterVideo
:
{},
chapterVideo
:
{},
chapterPpts
:
[]
chapterPpts
:
[],
rawResponse
:
{}
// 接口返回的数据
}
}
},
},
beforeRouteUpdate
(
to
,
from
,
next
)
{
beforeRouteUpdate
(
to
,
from
,
next
)
{
...
@@ -178,6 +181,7 @@ export default {
...
@@ -178,6 +181,7 @@ export default {
return
return
}
}
cAction
.
Player
.
getChapterList
(
to
.
params
.
cid
,
to
.
params
.
sid
,
to
.
params
.
id
).
then
(
json
=>
{
cAction
.
Player
.
getChapterList
(
to
.
params
.
cid
,
to
.
params
.
sid
,
to
.
params
.
id
).
then
(
json
=>
{
this
.
rawResponse
=
json
.
rawResponse
this
.
chapterList
=
json
.
json
this
.
chapterList
=
json
.
json
this
.
courseInfo
=
json
.
courseInfo
this
.
courseInfo
=
json
.
courseInfo
this
.
courseWork
=
json
.
courseWork
this
.
courseWork
=
json
.
courseWork
...
@@ -219,6 +223,7 @@ export default {
...
@@ -219,6 +223,7 @@ export default {
return
return
}
}
cAction
.
Player
.
getChapterList
(
this
.
cid
,
this
.
sid
,
this
.
id
).
then
(
json
=>
{
cAction
.
Player
.
getChapterList
(
this
.
cid
,
this
.
sid
,
this
.
id
).
then
(
json
=>
{
this
.
rawResponse
=
json
.
rawResponse
this
.
chapterList
=
json
.
json
this
.
chapterList
=
json
.
json
this
.
courseInfo
=
json
.
courseInfo
this
.
courseInfo
=
json
.
courseInfo
this
.
courseWork
=
json
.
courseWork
this
.
courseWork
=
json
.
courseWork
...
...
client/src/pages/player/rightSide/sideChapterList.vue
浏览文件 @
1eb19f81
...
@@ -80,6 +80,8 @@ export default {
...
@@ -80,6 +80,8 @@ export default {
return
return
}
}
this
.
$router
.
push
({
path
:
`/player/
${
sid
}
/
${
cid
}
/live/
${
_id
}
`
})
this
.
$router
.
push
({
path
:
`/player/
${
sid
}
/
${
cid
}
/live/
${
_id
}
`
})
}
else
if
(
_course
.
chapters
[
i2
].
type
===
5
)
{
this
.
$router
.
push
({
path
:
`/player/
${
sid
}
/
${
cid
}
/chapter-exam2/
${
_course
.
chapters
[
i2
].
id
}
`
})
}
}
return
return
}
}
...
...
client/src/router/routes.js
浏览文件 @
1eb19f81
...
@@ -201,6 +201,12 @@ export default [
...
@@ -201,6 +201,12 @@ export default [
component
:
()
=>
import
(
'@/pages/player/chapterExam/chapterExam.vue'
),
component
:
()
=>
import
(
'@/pages/player/chapterExam/chapterExam.vue'
),
props
:
true
props
:
true
},
},
{
path
:
'chapter-exam2/:id'
,
name
:
'chapterExam2'
,
component
:
()
=>
import
(
'@/pages/player/chapterExam/chapterExam2.vue'
),
props
:
true
},
{
{
path
:
'chapter-read/:id'
,
path
:
'chapter-read/:id'
,
name
:
'chapterRead'
,
name
:
'chapterRead'
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论