提交 f99803b3 authored 作者: haodaking's avatar haodaking

课程作业提交提示语修改

上级 d3b27796
......@@ -27,12 +27,7 @@
<em class="player-button player-button-download" v-if="chapter.pdf">
<a :href="chapter.pdf" download target="_blank">下载PPT</a>
</em>
<em
:class="pptClass"
@click="togglePPTVisible"
v-if="chatperResources.ppts.length"
>同步显示PPT</em
>
<em :class="pptClass" @click="togglePPTVisible" v-if="chatperResources.ppts.length">同步显示PPT</em>
<em :class="skipClass" @click="toggleSkip">始终跳过片头</em>
</div>
</div>
......@@ -159,7 +154,7 @@ export default {
this.isPlaying = true
const ppts = this.chatperResources.ppts || []
let index = this.chatperResources.ppts.findIndex(
(item) => item.ppt_point > time
item => item.ppt_point > time
)
index = index !== -1 ? index - 1 : ppts.length - 1
this.$emit('change-ppt', index)
......@@ -191,12 +186,12 @@ export default {
getChapterVideo() {
// 视频播放类型 1是CC加密; 2是非加密; 3是阿里云
if (this.videoProvider === 3) {
api.getChapterVideoAliyun(this.resourceId).then((response) => {
api.getChapterVideoAliyun(this.resourceId).then(response => {
this.chatperResources = response
Array.isArray(response.ppts) && this.$emit('pptupdate', response.ppts)
})
} else {
api.getChapterVideo(this.resourceId).then((response) => {
api.getChapterVideo(this.resourceId).then(response => {
let { video, audio, ppts } = response
video = video.reduce(
(result, item) => {
......@@ -221,7 +216,7 @@ export default {
.getChapterVideoProgress(this.sid, this.resourceId, {
device_id: Cookies.get('_idt')
})
.then((response) => {
.then(response => {
this.progress = response
// 跳转播放进度
if (this.player && response.cpt) {
......
......@@ -32,9 +32,7 @@
</div>
</div>
<div class="buttons">
<el-button type="primary" @click="onReEdit" :disabled="!isWorkTime"
>重新编辑</el-button
>
<el-button type="primary" @click="onReEdit" :disabled="!isWorkTime">重新编辑</el-button>
</div>
</template>
<!-- 正常状态 -->
......@@ -55,9 +53,7 @@
</div>
</template>
<template v-else-if="detail.created_time">
<p class="help">
已于 {{ detail.created_time }} 提交,等待老师批改中。
</p>
<p class="help">已于 {{ detail.created_time }} 提交,等待老师批改中。</p>
<template
v-if="
detail.updated_time &&
......@@ -70,16 +66,12 @@
</div>
</div>
<div class="buttons">
<el-tooltip
content="在获老师批改之前,可以多次提交,将以最后一次提交为准"
placement="right"
>
<el-tooltip content="在获老师批改之前,可以多次提交,将以最后一次提交为准" placement="right">
<el-button
type="primary"
@click="onSubmit"
:disabled="disabled || !isWorkTime"
>{{ submitText }}</el-button
>
>{{ submitText }}</el-button>
</el-tooltip>
</div>
</template>
......@@ -177,7 +169,7 @@ export default {
getDeadline() {
api
.getChapterHomeworkDeadline(this.sid, this.cid, this.pid)
.then((response) => {
.then(response => {
this.deadline = response.dead_line
})
},
......@@ -186,16 +178,16 @@ export default {
this.loading = true
api
.getChapterHomework(this.sid, this.cid, this.resourceId)
.then((response) => {
.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) => {
this.questions = this.questions.map(item => {
const found = parseAnswers.find(
(answer) => answer.question_id === item.id
answer => answer.question_id === item.id
)
if (found) {
item.user_answer = found.descreption
......@@ -215,7 +207,7 @@ export default {
if (!list) {
return []
}
return list.map((item) => {
return list.map(item => {
let temp = null
if (item.question_type === 1) {
// 单选
......@@ -268,7 +260,9 @@ export default {
// 校验
if (!this.checkSubmit()) {
this.messageInstance && this.messageInstance.close()
this.messageInstance = this.$message.error('还有题目未做,不能提交')
this.messageInstance = this.$message.error(
'答题内容不能为空,请检查并输入内容'
)
return
}
// 计算答题时间
......@@ -276,7 +270,7 @@ export default {
(new Date().getTime() - this.startTime) / 1000
)
// 提交的答案数据
const answers = this.questions.map((item) => {
const answers = this.questions.map(item => {
return {
question_id: item.id,
descreption:
......@@ -303,7 +297,7 @@ export default {
handleSubmitRequest(params) {
api
.sbumitChapterHomework(params)
.then((response) => {
.then(response => {
if (response.status) {
this.$message.success('提交成功,等待批改')
this.getDetail()
......@@ -311,7 +305,7 @@ export default {
this.$message.error(response.data.error)
}
})
.catch((error) => {
.catch(error => {
this.$message.error(error.message)
})
},
......
......@@ -19,7 +19,7 @@
ref="ruleForm"
>
<el-form-item label="主题" prop="essay_name">
<el-input v-model="ruleForm.essay_name" placeholder="主题"></el-input>
<el-input v-model="ruleForm.essay_name" placeholder="主题" maxlength="50"></el-input>
</el-form-item>
<el-form-item label="正文" prop="essay_description">
<!-- 编辑器 -->
......@@ -108,11 +108,10 @@ export default {
},
rules: {
essay_name: [
{ required: true, message: '请输入主题', trigger: 'blur' },
{ max: 50, message: '最多输入 50 个字符', trigger: 'blur' }
{ required: true, message: '请输入主题', trigger: 'blur' }
],
essay_description: [
{ required: true, message: '请输入正文', trigger: 'blur' }
{ required: true, message: '请输入正文', trigger: 'change' }
],
url: [{ required: true, message: '请上传附件', trigger: 'change' }]
},
......@@ -159,19 +158,24 @@ export default {
},
// 提交
onSubmit() {
this.$refs.ruleForm
.validate()
.then(response => {
const params = Object.assign(this.ruleForm, {
semester_id: this.sid,
course_id: this.cid
})
this.handleSubmitRequest(params)
})
.catch(() => {
this.messageInstance && this.messageInstance.close()
this.messageInstance = this.$message.error('还有题目未做,不能提交')
})
this.messageInstance && this.messageInstance.close()
if (!this.ruleForm.essay_name) {
this.messageInstance = this.$message.error('请输入主题')
return
}
if (!this.ruleForm.essay_description) {
this.messageInstance = this.$message.error('请输入正文')
return
}
if (!this.ruleForm.url) {
this.messageInstance = this.$message.error('请上传附件')
return
}
const params = Object.assign(this.ruleForm, {
semester_id: this.sid,
course_id: this.cid
})
this.handleSubmitRequest(params)
},
// 请求提交接口
handleSubmitRequest(params) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论