diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index 076082d93..532fbb51e 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -428,7 +428,7 @@ private @attachment.container.board.course) @course = @attachment.container.board.course else - unless @attachment.container_type == 'Bid' || @attachment.container_type == 'HomeworkAttach' || @attachment.container_type == 'Memo' || @attachment.container_type == 'Softapplication' || @attachment.container_type == 'PhoneAppVersion' || @attachment.container_type = 'StudentWorksScore' + unless @attachment.container_type == 'Bid' || @attachment.container_type == 'HomeworkAttach' || @attachment.container_type == 'Memo' || @attachment.container_type == 'Softapplication' || @attachment.container_type == 'PhoneAppVersion' || @attachment.container_type == 'StudentWorksScore'|| @attachment.container_type == 'StudentWorks' @project = @attachment.project end end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 446ad994b..268781df3 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1844,7 +1844,11 @@ module ApplicationHelper attachment.container.board.course course = attachment.container.board.course candown= User.current.member_of_course?(course) || (course.is_public==1 && attachment.is_public == 1) - elsif attachment.container.class.to_s=="HomeworkAttach" && attachment.container.bid.reward_type == 3 + elsif attachment.container.class.to_s=="HomeworkAttach" + candown = true + elsif attachment.container.class.to_s=="StudentWorksScore" + candown = true + elsif attachment.container.class.to_s=="StudentWork" candown = true elsif attachment.container_type == "Bid" && attachment.container && attachment.container.courses course = attachment.container.courses.first