非课程成员 --课程动态中不显示 提交 ,匿评等信息

tmp
huang 10 years ago
parent e747599925
commit c11905707d

@ -2349,22 +2349,25 @@ module ApplicationHelper
#根据传入作业确定显示为编辑作品还是新建作品,或者显示作品数量 #根据传入作业确定显示为编辑作品还是新建作品,或者显示作品数量
def user_for_homework_common homework,is_teacher def user_for_homework_common homework,is_teacher
if is_teacher #老师显示作品数量 if User.current.member_of_course?(homework.course)
link_to "提交(#{homework.student_works.count})",student_work_index_path(:homework => homework.id),:class => "c_blue" if is_teacher #老师显示作品数量
else #学生显示提交作品、修改作品等按钮 link_to "提交(#{homework.student_works.count})",student_work_index_path(:homework => homework.id),:class => "c_blue"
work = cur_user_works_for_homework homework else #学生显示提交作品、修改作品等按钮
if work.nil? work = cur_user_works_for_homework homework
link_to "提交作品", new_student_work_path(:homework => homework.id),:class => 'c_blue' if work.nil?
else link_to "提交作品", new_student_work_path(:homework => homework.id),:class => 'c_blue'
if homework.homework_detail_manual && homework.homework_detail_manual.comment_status != 1 #匿评作业,且作业状态不是在开启匿评之前
link_to "作品匿评", student_work_index_path(:homework => homework.id), :class => 'c_blue', :title => "开启匿评后不可修改作品"
elsif homework.homework_type == 2 #编程作业不能修改作品
link_to "修改作品", new_student_work_path(:homework => homework.id),:class => 'c_blue'
else else
link_to "修改作品", edit_student_work_path(work.id),:class => 'c_blue' if homework.homework_detail_manual && homework.homework_detail_manual.comment_status != 1 #匿评作业,且作业状态不是在开启匿评之前
link_to "作品匿评", student_work_index_path(:homework => homework.id), :class => 'c_blue', :title => "开启匿评后不可修改作品"
elsif homework.homework_type == 2 #编程作业不能修改作品
link_to "修改作品", new_student_work_path(:homework => homework.id),:class => 'c_blue'
else
link_to "修改作品", edit_student_work_path(work.id),:class => 'c_blue'
end
end end
end end
end end
end end
def student_anonymous_comment homework def student_anonymous_comment homework

@ -24,10 +24,12 @@
<span class="grey_btn_cir ml10">匿评已结束</span> <span class="grey_btn_cir ml10">匿评已结束</span>
<% end%> <% end%>
<div class="homepagePostSubmitContainer"> <div class="homepagePostSubmitContainer">
<div class="homepagePostSubmit"> <% if User.current.member_of_course?(activity.course) %>
<% is_teacher = User.current.allowed_to?(:as_teacher,activity.course) %> <div class="homepagePostSubmit">
<%= user_for_homework_common activity,is_teacher %> <% is_teacher = User.current.allowed_to?(:as_teacher,activity.course) %>
</div> <%= user_for_homework_common activity,is_teacher %>
</div>
<% end %>
<% if activity.homework_type == 2 && is_teacher%> <% if activity.homework_type == 2 && is_teacher%>
<div class="homepagePostSubmit"> <div class="homepagePostSubmit">

Loading…
Cancel
Save