|
|
|
@ -239,7 +239,12 @@ module HomeworkCommonsHelper
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def student_redo_work work, homework
|
|
|
|
|
status = false
|
|
|
|
|
publish_time = homework.homework_group_setting(work.user_id)&.publish_time
|
|
|
|
|
work.myshixun && publish_time && work.myshixun.games.where("status = 2 and answer_open = 1 and end_time <= '#{publish_time}'").count > 0 ? true : false
|
|
|
|
|
if work.myshixun && publish_time && work.myshixun.created_at < publish_time && work.myshixun.games.where("answer_open > 0").count > 0
|
|
|
|
|
min_time = Grade.where(container_type: "Answer", container_id: work.myshixun.games.where("answer_open > 0").pluck(:id)).pluck(:created_at).min
|
|
|
|
|
status = min_time && min_time < publish_time
|
|
|
|
|
end
|
|
|
|
|
status
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|