实训作业的列表增加过滤

dev_local_2
cxt 5 years ago
parent 5d021c67d5
commit 04e8342223

@ -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) : "**"

@ -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

Loading…
Cancel
Save