@ -3015,9 +3015,9 @@ module ApplicationHelper
elsif params [ :controller ] == " courses " && params [ :action ] == " index "
title << ( " 翻转课堂 " )
elsif params [ :controller ] == " competitions " && params [ :action ] == " index "
title << ( " 竞赛" )
title << ( " 在线 竞赛" )
elsif @competition
title << ( @competition . name . nil? ? " 竞赛" : @competition . name )
title << ( @competition . name . nil? ? " 在线 竞赛" : @competition . name )
elsif @contest
title << ( @contest . name . nil? ? " 创新源于实践 " : @contest . name )
elsif @shixun
@ -3027,13 +3027,13 @@ module ApplicationHelper
elsif params [ :controller ] == " shixuns " && params [ :action ] == " index "
title << ( " 开发社区 " )
elsif @subject
title << ( @subject . name . nil? ? " 实 训 课程" : @subject . name )
title << ( @subject . name . nil? ? " 实 践 课程" : @subject . name )
elsif params [ :controller ] == " subjects " && params [ :action ] == " index "
title << ( " 实 训 课程" )
title << ( " 实 践 课程" )
elsif @organization
title << ( @organization . name . nil? ? " 创新源于实践 " : @organization . name )
elsif @forum || params [ :controller ] == " forums "
title << " 讨论区 "
title << " 交流问答 "
elsif @my_syllabuses
title << " 我的课堂 "
elsif params [ :controller ] == 'ecs'
@ -3080,7 +3080,7 @@ module ApplicationHelper
elsif @syllabus
title << ( @syllabus . title . nil? ? " 课堂 " : @syllabus . title )
else
title << ( User . current . anonymous? ? " Edu c oder实践教学" : User . current . show_name )
title << ( User . current . anonymous? ? " Edu C oder实践教学" : User . current . show_name )
end
# if first_page.nil? || first_page.web_title.nil?
# title << Setting.app_title unless Setting.app_title == title.last
@ -6490,7 +6490,7 @@ def visable_attachemnts_incourse course
member = course . members . where ( :user_id = > User . current . id ) . first
if member . try ( :course_group_id ) . to_i == 0 && attachment . unified_setting
result << attachment
elsif attachment . attachment_group_settings . where ( " course_group_id = #{ member . try ( :course_group_id ) } and publish_time > ' #{ Time . now } ' " ) . count == 0
elsif attachment . attachment_group_settings . where ( " course_group_id = #{ member . try ( :course_group_id ) . to_i } and publish_time > ' #{ Time . now } ' " ) . count == 0
result << attachment
end
end
@ -6602,7 +6602,7 @@ def update_shixun_work_status homework
myshixuns . each do | myshixun |
work = student_works . where ( :user_id = > myshixun . user_id ) . first
member = homework . course . members . find_by_user_id ( work . user_id )
setting_time = homework_group_setting homework , member . try ( :course_group_id )
setting_time = homework_group_setting homework , member . try ( :course_group_id ) . to_i
games = myshixun . games . where ( :challenge_id = > challeng_ids )
myshixun_endtime = games . select { | game | game . status == 2 } . size == games . size ? games . map ( & :end_time ) . max : nil
compelete_status = 0
@ -6613,7 +6613,7 @@ def update_shixun_work_status homework
compelete_status = 1
end
end
if setting . publish_time && setting . publish_time < Time . now && setting_time . end_time
if setting _time . publish_time && setting _time . publish_time < Time . now && setting_time . end_time
if setting_time . end_time > Time . now
work . update_attributes ( :work_status = > 1 , :late_penalty = > 0 , :commit_time = > myshixun . updated_at , :update_time = > myshixun . updated_at , :myshixun_id = > myshixun . id , :compelete_status = > compelete_status )
else
@ -7254,11 +7254,9 @@ end
# 作业的分班设置时间
def homework_group_setting homework , group_id
setting = nil
if homework . homework_group_settings . where ( :course_group_id = > group_id ) . first
setting = homework . homework_group_settings . where ( :course_group_id = > group_id ) . first
else
setting = homework
if homework . homework_group_settings . where ( :course_group_id = > group_id ) . first . present?
setting = homework . homework_group_settings . where ( :course_group_id = > group_id ) . first
end
setting
end