Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
L
learn-online-pc
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
learn-online-pc
Commits
8601259f
提交
8601259f
authored
6月 03, 2020
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: viewer 模块课后作业增加驳回功能
上级
e05c31be
显示空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
115 行增加
和
20 行删除
+115
-20
editor.vue
client/src/components/editor.vue
+2
-2
api.js
client/src/modules/viewer/api.js
+15
-3
editor.vue
client/src/modules/viewer/components/common/editor.vue
+2
-3
fileList.vue
client/src/modules/viewer/components/read/fileList.vue
+1
-1
chapterTest.vue
client/src/modules/viewer/components/work/chapterTest.vue
+2
-2
chapterWork.vue
client/src/modules/viewer/components/work/chapterWork.vue
+92
-8
examItem.vue
client/src/modules/viewer/components/work/examItem.vue
+1
-1
没有找到文件。
client/src/components/editor.vue
浏览文件 @
8601259f
...
...
@@ -85,8 +85,8 @@ export default {
]
}
if
(
this
.
readOnly
!==
null
)
{
config
.
readOnly
=
this
.
readOnly
if
(
this
.
disabled
!==
null
)
{
config
.
readOnly
=
this
.
disabled
}
const
editor
=
(
this
.
ckEditor
=
CKEDITOR
.
replace
(
...
...
client/src/modules/viewer/api.js
浏览文件 @
8601259f
...
...
@@ -57,21 +57,33 @@ export function updateChapterVideoProgress(params) {
}
/**
* 获取
答题信息
* 获取
章节作业
* @param {string} semesterId 学期ID
* @param {string} courseId 课程ID
* @param {string} resourseId 章节的资源ID
*/
export
function
getChapter
Exam
(
semesterId
,
courseId
,
resourseId
)
{
export
function
getChapter
Homework
(
semesterId
,
courseId
,
resourseId
)
{
return
httpRequest
.
get
(
`/v2/education/homeworks/
${
semesterId
}
/
${
courseId
}
/
${
resourseId
}
`
)
}
/**
* 获取提交作业截止时间
* @param {string} semesterId 学期ID
* @param {string} courseId 课程ID
* @param {string} chapterId 章节ID
*/
export
function
getChapterHomeworkDeadline
(
semesterId
,
courseId
,
chapterId
)
{
return
httpRequest
.
get
(
`/v2/education/homeworks/
${
semesterId
}
/
${
courseId
}
/
${
chapterId
}
/deadline`
)
}
/**
* 提交考试
*/
export
function
sbumitChapter
Exam
(
params
)
{
export
function
sbumitChapter
Homework
(
params
)
{
return
httpRequest
.
post
(
'/v2/education/homeworks'
,
params
,
{
headers
:
{
'Content-Type'
:
'application/json'
}
})
...
...
client/src/modules/viewer/components/common/editor.vue
浏览文件 @
8601259f
...
...
@@ -84,9 +84,8 @@ export default {
{
name
:
'insert'
,
items
:
[
'Image'
,
'Table'
,
'HorizontalRule'
]
}
]
}
if
(
this
.
readOnly
!==
null
)
{
config
.
readOnly
=
this
.
readOnly
if
(
this
.
disabled
!==
null
)
{
config
.
readOnly
=
this
.
disabled
}
const
editor
=
(
this
.
ckEditor
=
CKEDITOR
.
replace
(
...
...
client/src/modules/viewer/components/read/fileList.vue
浏览文件 @
8601259f
...
...
@@ -6,7 +6,7 @@
<i
class=
"el-icon-document"
></i>
<div
v-html=
"file.file_name"
></div>
</a>
<
span
v-if=
"file.file_size"
>
{{
file
.
file_size
}}
</span
>
<
!--
<span
v-if=
"file.file_size"
>
{{
file
.
file_size
}}
</span>
--
>
<a
:href=
"file.file_url"
:download=
"file.file_name"
target=
"_blank"
>
<el-tooltip
effect=
"dark"
content=
"下载"
>
<i
class=
"el-icon-download"
></i>
...
...
client/src/modules/viewer/components/work/chapterTest.vue
浏览文件 @
8601259f
...
...
@@ -102,7 +102,7 @@ export default {
getDetail
()
{
this
.
loading
=
true
api
.
getChapter
Exam
(
this
.
sid
,
this
.
cid
,
this
.
resourceId
)
.
getChapter
Homework
(
this
.
sid
,
this
.
cid
,
this
.
resourceId
)
.
then
(
response
=>
{
this
.
detail
=
Array
.
isArray
(
response
)
?
null
:
response
if
(
this
.
detail
)
{
...
...
@@ -248,7 +248,7 @@ export default {
// 请求提交接口
handleSubmitRequest
(
params
)
{
api
.
sbumitChapter
Exam
(
params
)
.
sbumitChapter
Homework
(
params
)
.
then
(
response
=>
{
if
(
response
.
status
)
{
this
.
getDetail
()
...
...
client/src/modules/viewer/components/work/chapterWork.vue
浏览文件 @
8601259f
...
...
@@ -2,23 +2,47 @@
<
template
>
<container
:title=
"chapter.name"
v-loading=
"loading"
>
<div
class=
"exam-form"
>
<el-form
:disabled=
"
isRevised
"
>
<el-form
:disabled=
"
disabled || !isWorkTime
"
>
<exam-item
v-for=
"(item, index) in questions"
:index=
"index"
:type=
"item.question_type"
:data=
"item"
:value=
"item.formModel"
:disabled=
"
isRevised
"
:disabled=
"
disabled || !isWorkTime
"
:key=
"item.id"
></exam-item>
</el-form>
</div>
<p
style=
"color:red;"
v-if=
"deadline"
>
请于截止日期
{{
deadline
}}
前提交
</p>
<!-- 驳回状态 -->
<template
v-if=
"detail && detail.status === 1"
>
<div
class=
"work-bottom"
>
<div
class=
"info"
>
<div
class=
"paper-check"
>
<h4>
作业被驳回,点击“重新编辑”按钮重新编辑内容再次提交
</h4>
<div
class=
"paper-check-item"
>
<b>
驳回时间:
</b>
{{
detail
.
checker_time
}}
</div>
<div
class=
"paper-check-item"
>
<b>
驳回说明:
</b>
<div
class=
"edit_html"
v-html=
"detail.check_comments"
></div>
</div>
</div>
</div>
</div>
<div
class=
"buttons"
>
<el-button
type=
"primary"
@
click=
"onReEdit"
:disabled=
"!isWorkTime"
>
重新编辑
</el-button>
</div>
</
template
>
<!-- 正常状态 -->
<
template
v-else
>
<div
class=
"work-bottom"
v-if=
"detail"
>
<div
class=
"info"
>
<template
v-if=
"isRevised"
>
<div
class=
"paper-check"
>
<p>
批改时间:
{{
detail
.
check_dat
e
}}
</p>
<p>
批改时间:
{{
detail
.
checker_tim
e
}}
</p>
<div
class=
"paper-check-item"
>
<b>
评分:
</b>
{{
detail
.
score
}}
...
...
@@ -39,9 +63,14 @@
</div>
<div
class=
"buttons"
>
<el-tooltip
content=
"在获老师批改之前,可以多次提交,将以最后一次提交为准"
placement=
"right"
>
<el-button
type=
"primary"
@
click=
"onSubmit"
:disabled=
"isRevised"
>
{{submitText}}
</el-button>
<el-button
type=
"primary"
@
click=
"onSubmit"
:disabled=
"disabled || !isWorkTime"
>
{{submitText}}
</el-button>
</el-tooltip>
</div>
</template>
</container>
</template>
...
...
@@ -80,7 +109,9 @@ export default {
detail
:
null
,
questions
:
[],
// 问题列表
startTime
:
new
Date
().
getTime
(),
// 进入时间
messageInstance
:
null
messageInstance
:
null
,
deadline
:
''
,
// 截止时间
disabled
:
false
}
},
watch
:
{
...
...
@@ -112,22 +143,42 @@ export default {
},
// 是否批改
isRevised
()
{
return
this
.
detail
?
!!
this
.
detail
.
check_date
:
false
return
this
.
detail
?
this
.
detail
.
status
===
0
:
false
},
// 提交按钮文本
submitText
()
{
return
this
.
isRevised
?
'已批改'
:
'提交'
},
// 是否是提交作业时间
isWorkTime
()
{
if
(
!
this
.
deadline
)
{
return
true
}
// 大于开始时间,小于结束时间
const
endTime
=
+
new
Date
(
this
.
deadline
)
const
currentTime
=
new
Date
().
getTime
()
return
currentTime
<
endTime
}
},
methods
:
{
// 获取作业截止时间
getDeadline
()
{
api
.
getChapterHomeworkDeadline
(
this
.
sid
,
this
.
cid
,
this
.
pid
)
.
then
(
response
=>
{
this
.
deadline
=
response
.
dead_line
})
},
// 获取详情
getDetail
()
{
this
.
loading
=
true
api
.
getChapter
Exam
(
this
.
sid
,
this
.
cid
,
this
.
resourceId
)
.
getChapter
Homework
(
this
.
sid
,
this
.
cid
,
this
.
resourceId
)
.
then
(
response
=>
{
this
.
detail
=
Array
.
isArray
(
response
)
?
null
:
response
if
(
this
.
detail
)
{
// -1未处理 0已处理 1驳回
this
.
disabled
=
[
0
,
1
].
includes
(
this
.
detail
.
status
)
const
parseAnswers
=
JSON
.
parse
(
this
.
detail
.
work_contents
)
// 设置答案
this
.
questions
=
this
.
questions
.
map
(
item
=>
{
...
...
@@ -239,7 +290,7 @@ export default {
// 请求提交接口
handleSubmitRequest
(
params
)
{
api
.
sbumitChapter
Exam
(
params
)
.
sbumitChapter
Homework
(
params
)
.
then
(
response
=>
{
if
(
response
.
status
)
{
this
.
$message
.
success
(
'提交成功,等待批改'
)
...
...
@@ -251,10 +302,43 @@ export default {
.
catch
(
error
=>
{
this
.
$message
.
error
(
error
.
message
)
})
},
// 重新编辑
onReEdit
()
{
this
.
disabled
=
false
this
.
detail
.
status
=
-
1
}
},
beforeMount
()
{
this
.
getDetail
()
this
.
getDeadline
()
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.work-bottom
{
margin-top
:
20px
;
.info
{
color
:
#999
;
line-height
:
28px
;
}
}
.buttons
{
padding
:
20px
0
;
::v-deep
.el-button
{
width
:
120px
;
}
}
.paper-check
{
padding
:
10px
;
color
:
#000
;
border
:
1px
solid
#dedede
;
h4
{
margin
:
0
0
10px
;
}
}
.paper-check-item
{
display
:
flex
;
}
</
style
>
client/src/modules/viewer/components/work/examItem.vue
浏览文件 @
8601259f
...
...
@@ -29,7 +29,7 @@
</div>
<div
class=
"q-item-ft"
v-if=
"disabled"
>
<
template
v-if=
"type === 3"
>
<p>
<p
v-if=
"data.check_comment"
>
<span>
评语:
</span>
<span>
{{
data
.
check_comment
}}
</span>
</p>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论