作品列表报500
This commit is contained in:
parent
4dbeda8c21
commit
1396a56e06
|
@ -4025,7 +4025,7 @@ def get_hw_index(hw,is_teacher)
|
|||
homeworks = hw.course.homework_commons.where("publish_time <= '#{Time.now}'").order("created_at asc")
|
||||
end
|
||||
hw_ids = homeworks.map{|hw| hw.id} if !homeworks.empty?
|
||||
index = hw_ids.index(hw.id)
|
||||
index = hw_ids ? (hw_ids.index(hw.id).nil? ? hw_ids.count : hw_ids.index(hw.id)) : 0
|
||||
return index
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue