|
|
|
@ -23,35 +23,18 @@
|
|
|
|
|
<%= link_to(bid.name, course_for_bid_path(bid), :class => 'bid_path') %>
|
|
|
|
|
</span>
|
|
|
|
|
<span style="float: right">
|
|
|
|
|
<% if User.current.logged? && is_cur_course_student(@course) %>
|
|
|
|
|
<% if(User.current.logged? && (!Member.where('user_id = ? and course_id = ?', User.current.id, bid.courses.first.id).first.nil? && (Member.where('user_id = ? and course_id = ?', User.current.id, bid.courses.first.id).first.roles&Role.where('id = ? or id = ? or id =?',5, 10, 7)).size >0)) %>
|
|
|
|
|
<% cur_user_homework = cur_user_homework_for_bid(bid) %>
|
|
|
|
|
<% if cur_user_homework!= nil && cur_user_homework.empty? %>
|
|
|
|
|
<% if bid.comment_status == 0 %>
|
|
|
|
|
<%= link_to l(:label_commit_homework),new_exercise_book_path(bid) %>
|
|
|
|
|
<% else %>
|
|
|
|
|
<span title="只有开启匿评之前才能创建作业哦!">
|
|
|
|
|
<a style="color:#8e8e8e;">提交作业</a>
|
|
|
|
|
</span>
|
|
|
|
|
<% end %>
|
|
|
|
|
<% if cur_user_homework!= nil && cur_user_homework.count == 0 %>
|
|
|
|
|
<%= link_to l(:label_commit_homework),new_homework_attach_path(bid) %>
|
|
|
|
|
<% else %>
|
|
|
|
|
<span style="color: green; float: right">
|
|
|
|
|
<%= l(:lable_has_commit_homework)%>
|
|
|
|
|
</span>
|
|
|
|
|
<% end %>
|
|
|
|
|
<% end %>
|
|
|
|
|
<% if (User.current.admin?||User.current.id==bid.author_id)%>
|
|
|
|
|
<% if bid.homeworks.count >= 2 %>
|
|
|
|
|
<span id="<%=bid.id %>_anonymous_comment">
|
|
|
|
|
<% case bid.comment_status %>
|
|
|
|
|
<% when 0 %>
|
|
|
|
|
<%= link_to '启动匿评', start_anonymous_comment_bid_path(bid), id: "#{bid.id}_start_anonymous_comment", remote: true, :confirm => "开启匿评后学生将不能对作业进行提交、修改、删除等操作\n是否确定开启匿评?", disable_with: '加载中...' %>
|
|
|
|
|
<% when 1 %>
|
|
|
|
|
<%= link_to '关闭匿评', stop_anonymous_comment_bid_path(bid), id: "#{bid.id}_stop_anonymous_comment", remote: true, :confirm => "关闭匿评后学生将不能对作业进行评分,且学生作业列表将会被公开\n是否确定关闭匿评?" %>
|
|
|
|
|
<% when 2 %>
|
|
|
|
|
匿评结束
|
|
|
|
|
<% end %>
|
|
|
|
|
</span>
|
|
|
|
|
<% end %>
|
|
|
|
|
<% if (User.current.admin?||User.current.id==bid.author_id) %>
|
|
|
|
|
<%= anonymous_comment_link(bid, @course) %>
|
|
|
|
|
<%= link_to(
|
|
|
|
|
l(:button_edit),
|
|
|
|
|
{:action => 'edit', :controller=>'bids', :course_id =>@course.id, :bid_id => bid.id},
|
|
|
|
|