diff --git a/app/helpers/homework_commons_helper.rb b/app/helpers/homework_commons_helper.rb index 858754012..5fa8e6757 100644 --- a/app/helpers/homework_commons_helper.rb +++ b/app/helpers/homework_commons_helper.rb @@ -223,13 +223,20 @@ module HomeworkCommonsHelper end # 作品状态 - def homework_status homework, member + def practice_homework_status homework, member [{id: 3, name: "未通关", count: homework.un_complete_count(member)}, {id: 4, name: "已通关", count: homework.complete_count(member)}, {id: 1, name: "按时提交", count: homework.finished_count(member)}, {id: 2, name: "延时提交", count: homework.delay_finished_count(member)}] end + # 作品状态 + def homework_status homework, member + [{id: 0, name: "未提交", count: homework.unfinished_count(member)}, + {id: 1, name: "按时提交", count: homework.finished_count(member)}, + {id: 2, name: "延时提交", count: homework.delay_finished_count(member)}] + end + # 作品分数的显示 def work_score_format score, current_user, score_open score.nil? ? "--" : (current_user || score_open) ? number_with_precision(score, precision: 1) : "**" diff --git a/app/views/homework_commons/works_list.json.jbuilder b/app/views/homework_commons/works_list.json.jbuilder index e567ea79a..839b40bfd 100644 --- a/app/views/homework_commons/works_list.json.jbuilder +++ b/app/views/homework_commons/works_list.json.jbuilder @@ -23,7 +23,7 @@ if @user_course_identity < Course::STUDENT if @homework.homework_type != "practice" json.teacher_comment teacher_comment @homework, @current_user.id end - json.task_status homework_status @homework, @member + json.task_status @homework.homework_type != "practice" ? homework_status(@homework, @member) : practice_homework_status(@homework, @member) json.course_group_info course_group_info @course, @current_user.id elsif @user_course_identity == Course::STUDENT