Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
L
learn-online-pc
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
learn-online-pc
Commits
e2ea4b12
提交
e2ea4b12
authored
5月 28, 2020
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: 修改课程考试相关内容
上级
3425b686
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
58 行增加
和
57 行删除
+58
-57
PlayerAction.js
client/src/action/PlayerAction.js
+1
-0
chapterExam.vue
client/src/pages/player/chapterExam/chapterExam.vue
+1
-1
chapterExam2.vue
client/src/pages/player/chapterExam/chapterExam2.vue
+43
-44
exam.vue
client/src/pages/player/exam/exam.vue
+11
-10
sideChapterList.vue
client/src/pages/player/rightSide/sideChapterList.vue
+2
-2
没有找到文件。
client/src/action/PlayerAction.js
浏览文件 @
e2ea4b12
...
...
@@ -122,6 +122,7 @@ export default class PlayerAction extends BaseACTION {
video_provider
:
(
__
.
video
&&
__
.
video
.
video_provider
)
||
''
,
time
:
(
__
.
video
&&
tools
.
convertTime
.
durationToTimeString
(
__
.
video
.
video_length
))
||
''
,
name
:
__
.
name
,
chapterId
:
__
.
id
,
// 需要chapterId 用来 提交 作业或问题 , 这个 chapterId 是 每个章节下 对应课程的 id,不是 章节id
type
:
__
.
type
,
work_type
:
(
__
.
homework
&&
__
.
homework
.
work_type
)
||
''
,
homework
:
_homework
,
...
...
client/src/pages/player/chapterExam/chapterExam.vue
浏览文件 @
e2ea4b12
...
...
@@ -158,7 +158,7 @@ export default {
let
str
=
''
let
stuAnswer
=
''
// 学生答案
let
stuIsCorrect
=
0
// 学生是否答对
let
_json
=
JSON
.
parse
(
_
.
question_options
)
let
_json
=
_
.
question_options
?
JSON
.
parse
(
_
.
question_options
)
:
[]
_json
.
forEach
(
function
(
__
,
j
)
{
if
(
__
.
checked
)
{
switch
(
j
)
{
...
...
client/src/pages/player/chapterExam/chapterExam2.vue
浏览文件 @
e2ea4b12
...
...
@@ -6,7 +6,7 @@
<h3>
{{
exam
.
title
}}
</h3>
</div>
</div>
<template
v-if=
"exam.type !== 3"
>
<template
v-if=
"
status.isStart &&
exam.type !== 3"
>
<div
class=
"play-paper-content play-chapter-exam"
>
<template
v-if=
"exam.id"
>
<div
class=
"exam"
>
...
...
@@ -15,7 +15,7 @@
<!--
<div
class=
'tit'
>
{{
exam
.
title
}}
</div>
-->
<template
v-if=
"exam.type === 2"
>
<template
v-if=
"exam.score"
>
<div
style=
"font-size: 18px;"
>
总分
:
{{
exam
.
score
.
total
}}
分
</div>
<div
style=
"font-size: 18px;"
>
分数
:
{{
exam
.
score
.
total
}}
分
</div>
</
template
>
</template>
<
template
v-else-if=
"exam.type === 1"
>
...
...
@@ -23,15 +23,15 @@
</
template
>
<!-- </div> -->
<!-- </div> -->
<
template
v-if=
"(exam.type !== 1
&& exam.type !== 2
)"
>
<
template
v-if=
"(exam.type !== 1)"
>
<div
style=
"text-align: center;"
v-if=
"exam.paper_deadline"
>
考试截止时间为:
{{
exam
.
paper_deadline
}}
</div>
<template
v-for=
"
exam
in exam.examination"
>
<template
v-for=
"
question
in exam.examination"
>
<!-- 单选题 -->
<template
v-if=
"
exam
.radioList.length"
>
<template
v-for=
"(item, index) in
exam
.radioList"
>
<template
v-if=
"
question
.radioList.length"
>
<template
v-for=
"(item, index) in
question
.radioList"
>
<div
v-bind:key=
"item.id"
class=
"q-group"
:data-index=
"index"
>
<div
class=
"q-num"
>
{{
index
+
1
}}
.
</div>
<div
class=
"q-title"
v-html=
"item.content"
></div>
...
...
@@ -59,10 +59,10 @@
</template>
</template>
<!-- 多选题 -->
<
template
v-if=
"
exam
.checkboxList.length"
>
<template
v-for=
"(item, index) in
exam
.checkboxList"
>
<
template
v-if=
"
question
.checkboxList.length"
>
<template
v-for=
"(item, index) in
question
.checkboxList"
>
<div
v-bind:key=
"item.id"
class=
"q-group"
:data-index=
"index"
>
<div
class=
"q-num"
>
{{
exam
.
radioList
.
length
+
index
+
1
}}
.
</div>
<div
class=
"q-num"
>
{{
question
.
radioList
.
length
+
index
+
1
}}
.
</div>
<div
class=
"q-title"
v-html=
"item.content"
></div>
<div
class=
"q-type"
>
(多选题)
</div>
<el-checkbox-group
class=
"checkbox-group"
v-model=
"item.user_answer"
>
...
...
@@ -88,12 +88,12 @@
</template>
</template>
<!-- 简答题 -->
<
template
v-if=
"
exam
.shortAnswerList.length"
>
<template
v-for=
"(item, index) in
exam
.shortAnswerList"
>
<
template
v-if=
"
question
.shortAnswerList.length"
>
<template
v-for=
"(item, index) in
question
.shortAnswerList"
>
<div
class=
"q-group"
:key=
"index"
>
<div
class=
"q-sa-title"
>
{{
exam
.
radioList
.
length
+
exam
.
checkboxList
.
length
+
index
+
1
}}
.
简答题
</div>
>
{{
question
.
radioList
.
length
+
question
.
checkboxList
.
length
+
index
+
1
}}
.
简答题
</div>
<div
class=
"edit_html"
v-html=
"item.content || ''"
></div>
<v-editor
v-model=
"item.user_answer"
></v-editor>
<div
style=
"height: 10px;"
></div>
...
...
@@ -105,6 +105,7 @@
:formData=
"item"
:isUpload=
"!exam.type"
></component>
<div
class=
"result"
>
评语:
{{
item
.
check_comment
}}
</div>
</div>
</
template
>
</template>
...
...
@@ -309,11 +310,11 @@ export default {
},
init
()
{
const
data
=
this
.
activeChatper
.
paper
this
.
exam
=
data
this
.
exam
.
id
=
data
.
id
this
.
exam
.
title
=
data
.
paper_title
this
.
exam
.
score
=
{}
this
.
exam
.
examination
=
data
.
examination
.
map
(
exam
=>
{
const
exam
=
{}
exam
.
id
=
data
.
id
exam
.
title
=
data
.
paper_title
exam
.
score
=
{}
exam
.
examination
=
data
.
examination
.
map
(
exam
=>
{
for
(
let
i
=
0
;
i
<
exam
.
radioList
.
length
;
i
++
)
{
exam
.
radioList
[
i
].
user_answer
=
''
exam
.
radioList
[
i
].
right_answer
=
''
...
...
@@ -351,31 +352,32 @@ export default {
}
return
exam
})
this
.
exam
.
paper_deadline
=
data
.
paper_deadline
exam
.
paper_deadline
=
data
.
paper_deadline
this
.
exam
=
JSON
.
parse
(
JSON
.
stringify
(
exam
))
// this.loadExamStatus()
// this.loadExamInfo()
this
.
loadAjax
()
//
if (this._time) {
//
clearInterval(this._time)
//
this._time = null
//
}
//
this._time = setInterval(() => {
//
// this.loadExamStatus()
//
if (!this.exam.type && this.status.isStart) {
//
// console.log(11, '暂存')
//
this.submitExam({ submitType: true }) // 暂存, submitType: true 暂存;其他或不填为提交
//
}
//
/* 到时间 自动提交 */
//
if (
//
!this.exam.type &&
//
this.status.isStart &&
//
new Date(this.status.terminateTime).getTime() -
//
new Date(this.status.serverTime).getTime()
<=
//
5000
//
) {
//
this.submitExam({ submitType: false, currentTarget: { dataset: {} } })
//
}
//
}, 3000)
if
(
this
.
_time
)
{
clearInterval
(
this
.
_time
)
this
.
_time
=
null
}
this
.
_time
=
setInterval
(()
=>
{
// this.loadExamStatus()
if
(
!
this
.
exam
.
type
&&
this
.
status
.
isStart
)
{
// console.log(11, '暂存')
this
.
submitExam
({
submitType
:
true
})
// 暂存, submitType: true 暂存;其他或不填为提交
}
/* 到时间 自动提交 */
if
(
!
this
.
exam
.
type
&&
this
.
status
.
isStart
&&
new
Date
(
this
.
status
.
terminateTime
).
getTime
()
-
new
Date
(
this
.
status
.
serverTime
).
getTime
()
<=
5000
)
{
this
.
submitExam
({
submitType
:
false
,
currentTarget
:
{
dataset
:
{}
}
})
}
},
3000
)
},
/* 定时调用 - 考试状态 */
loadExamStatus
()
{
...
...
@@ -445,11 +447,8 @@ export default {
console
.
log
(
'没有考试内容,认为是第一次答题,并且在答题期间,所以显示考试开始页面'
)
if
(
!
flag
)
{
this
.
status
.
isStart
=
false
}
}
else
{
// this.exam.id = _data.id
this
.
status
.
isStart
=
true
this
.
exam
.
title
=
_data
.
title
this
.
exam
.
type
=
_data
.
type
this
.
exam
.
score
=
_data
.
score
...
...
@@ -565,7 +564,7 @@ export default {
background
:
'rgba(255, 255, 255, 0.9)'
})
}
cAction
.
Player
.
submitExam
(
this
.
cid
,
this
.
sid
,
this
.
exam
.
id
,
body
)
cAction
.
Player
.
submitExam
(
this
.
cid
,
this
.
sid
,
this
.
id
,
body
)
.
then
(
_res
=>
{
if
(
e
.
submitType
)
{
// this.$message.success('暂存成功')
...
...
client/src/pages/player/exam/exam.vue
浏览文件 @
e2ea4b12
...
...
@@ -46,12 +46,12 @@
</
template
>
<!-- </div> -->
<!-- </div> -->
<
template
v-if=
"(exam.type !== 1
&& exam.type !== 2
)"
>
<
template
v-if=
"(exam.type !== 1)"
>
<div
style=
"text-align: center;"
>
考试截止时间为:
{{
status
.
terminateTime
}}
</div>
<template
v-for=
"
exam
in exam.examination"
>
<template
v-for=
"
question
in exam.examination"
>
<!-- 单选题 -->
<template
v-if=
"
exam
.radioList.length"
>
<template
v-for=
"(item, index) in
exam
.radioList"
>
<template
v-if=
"
question
.radioList.length"
>
<template
v-for=
"(item, index) in
question
.radioList"
>
<div
v-bind:key=
"item.id"
class=
"q-group"
:data-index=
"index"
>
<div
class=
"q-num"
>
{{
index
+
1
}}
.
</div>
<div
class=
"q-title"
v-html=
"item.content"
></div>
...
...
@@ -79,10 +79,10 @@
</template>
</template>
<!-- 多选题 -->
<
template
v-if=
"
exam
.checkboxList.length"
>
<template
v-for=
"(item, index) in
exam
.checkboxList"
>
<
template
v-if=
"
question
.checkboxList.length"
>
<template
v-for=
"(item, index) in
question
.checkboxList"
>
<div
v-bind:key=
"item.id"
class=
"q-group"
:data-index=
"index"
>
<div
class=
"q-num"
>
{{
exam
.
radioList
.
length
+
index
+
1
}}
.
</div>
<div
class=
"q-num"
>
{{
question
.
radioList
.
length
+
index
+
1
}}
.
</div>
<div
class=
"q-title"
v-html=
"item.content"
></div>
<div
class=
"q-type"
>
(多选题)
</div>
<el-checkbox-group
class=
"checkbox-group"
v-model=
"item.user_answer"
>
...
...
@@ -108,12 +108,12 @@
</template>
</template>
<!-- 简答题 -->
<
template
v-if=
"
exam
.shortAnswerList.length"
>
<template
v-for=
"(item, index) in
exam
.shortAnswerList"
>
<
template
v-if=
"
question
.shortAnswerList.length"
>
<template
v-for=
"(item, index) in
question
.shortAnswerList"
>
<div
class=
"q-group"
:key=
"index"
>
<div
class=
"q-sa-title"
>
{{
exam
.
radioList
.
length
+
exam
.
checkboxList
.
length
+
index
+
1
}}
.
简答题
</div>
>
{{
question
.
radioList
.
length
+
question
.
checkboxList
.
length
+
index
+
1
}}
.
简答题
</div>
<div
class=
"edit_html"
v-html=
"item.content || ''"
></div>
<v-editor
v-model=
"item.user_answer"
></v-editor>
<div
style=
"height: 10px;"
></div>
...
...
@@ -125,6 +125,7 @@
:formData=
"item"
:isUpload=
"!exam.type"
></component>
<div
class=
"result"
>
评语:
{{
item
.
check_comment
}}
</div>
</div>
</
template
>
</template>
...
...
client/src/pages/player/rightSide/sideChapterList.vue
浏览文件 @
e2ea4b12
...
...
@@ -80,8 +80,8 @@ export default {
return
}
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
].
i
d
}
`
})
}
else
if
(
_course
.
chapters
[
i2
].
type
===
9
)
{
this
.
$router
.
push
({
path
:
`/player/
${
sid
}
/
${
cid
}
/chapter-exam2/
${
_course
.
chapters
[
i2
].
chapterI
d
}
`
})
}
return
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论