提交 15e006dd authored 作者: haodaking's avatar haodaking

fix: 修改作业提交判断逻辑

上级 e59bb059
......@@ -8,14 +8,7 @@
<template v-for="(item, index) in questions">
<el-form :disabled="disabled" :key="item.id" ref="form" :model="item.formModel" :rules="rules">
<el-form-item prop="user_answer">
<exam-item
:index="index"
:type="item.question_type"
:data="item"
:value="item.formModel"
:disabled="disabled"
:hasUpload="hasUpload"
></exam-item>
<exam-item :index="index" :type="item.question_type" :data="item" :value="item.formModel" :disabled="disabled" :hasUpload="hasUpload"></exam-item>
</el-form-item>
</el-form>
</template>
......@@ -65,13 +58,7 @@
<!-- 我收到的作业评论 -->
<chapter-work-comment-to-me :id="detail.id" v-if="showComment"></chapter-work-comment-to-me>
<!-- 评论同学作业 -->
<chapter-work-comment
id="comment"
:endTime="commentEndTime"
:status="detail.status2"
@update="$emit('updateHomework')"
v-if="showComment"
>
<chapter-work-comment id="comment" :endTime="commentEndTime" :status="detail.status2" @update="$emit('updateHomework')" v-if="showComment">
<!-- 已批改 -->
<template v-if="isRevised">
<div class="work-bottom">
......@@ -168,10 +155,7 @@ export default {
const { questions = [], answer = {} } = data
this.questions = this.genQuestions(questions)
this.detail = Array.isArray(answer) ? {} : answer
if (
(this.detail.status === 1 || this.detail.status2 === 1) &&
!([-1, -2].includes(this.detail.status) || [-1, -2].includes(this.detail.status2))
) {
if ((this.detail.status === 1 || this.detail.status2 === 1) && !([-1, -2].includes(this.detail.status) || [-1, -2].includes(this.detail.status2))) {
this.dialogVisible = true
}
// 答案处理
......@@ -234,12 +218,11 @@ export default {
disabled() {
// 已提交
const isSubmit = !!this.detail.created_time
if (this.detail.status === 1) {
return false
}
// -1未处理 0已处理 1驳回
return this.detail.status === 0 || (isSubmit && !this.isWorkTime)
// if (this.detail.status === 1) {
// return false
// }
// // -1未处理 0已处理 1驳回
// return this.detail.status === 0 || !this.isWorkTime
},
dialogTitle() {
if (this.detail.status === 1 && this.detail.status2 === 1) {
......@@ -356,8 +339,7 @@ export default {
const answers = this.questions.map(item => {
return {
question_id: item.id,
descreption:
item.question_type === 3 ? Base64.encode(item.formModel.user_answer) : item.formModel.user_answer,
descreption: item.question_type === 3 ? Base64.encode(item.formModel.user_answer) : item.formModel.user_answer,
file_url: item.formModel.attachments,
is_encoded: 1
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论