|
|
@ -6,6 +6,7 @@ class HomeworkService
|
|
|
|
include WordsHelper
|
|
|
|
include WordsHelper
|
|
|
|
include ApiHelper
|
|
|
|
include ApiHelper
|
|
|
|
include HomeworkAttachHelper
|
|
|
|
include HomeworkAttachHelper
|
|
|
|
|
|
|
|
include CoursesHelper
|
|
|
|
|
|
|
|
|
|
|
|
# 作业详情(老师才显示启动匿评,学生不显示 )
|
|
|
|
# 作业详情(老师才显示启动匿评,学生不显示 )
|
|
|
|
# many_times 第几次(作业)
|
|
|
|
# many_times 第几次(作业)
|
|
|
@ -276,7 +277,7 @@ class HomeworkService
|
|
|
|
hw = bid.homeworks.where("user_id = #{current_user.id}")
|
|
|
|
hw = bid.homeworks.where("user_id = #{current_user.id}")
|
|
|
|
my_homeworks << hw[0] unless (hw.nil? || hw[0].nil?)
|
|
|
|
my_homeworks << hw[0] unless (hw.nil? || hw[0].nil?)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
course_list << {:course => mp.course,:img_url => url_to_avatar(mp.course),:my_homework => my_homeworks}
|
|
|
|
course_list << {:course => mp.course,:img_url => url_to_avatar(mp.course),:my_homework => my_homeworks,:current_user_is_member => current_user.member_of_course?(mp.course),:current_user_is_teacher => is_course_teacher(current_user,mp.course)}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
course_list
|
|
|
|
course_list
|
|
|
|
end
|
|
|
|
end
|
|
|
|