2014-11-26 15:24:41 +08:00
|
|
|
<li class="pic_head" style="line-height: 1.2;">
|
2014-11-03 09:50:36 +08:00
|
|
|
<% if is_student_batch_homework %>
|
|
|
|
<!-- 学生匿评 不现实姓名、头像,以及相关的连接 -->
|
|
|
|
<a><%= image_tag(url_to_avatar("匿名"), :width => "40", :height => "40")%></a>
|
|
|
|
<a>匿名</a>
|
|
|
|
<% else %>
|
|
|
|
<%= link_to image_tag(url_to_avatar(homework.user), :width => "40", :height => "40"), user_path(homework.user) %>
|
|
|
|
<span>
|
|
|
|
<% user_realname = homework.user.lastname.to_s + homework.user.firstname.to_s %>
|
|
|
|
<% user_name = is_teacher ? (user_realname.empty? ? homework.user.login : user_realname) : homework.user.login %>
|
|
|
|
<%= link_to user_name, user_path(homework.user), :title => user_name %>
|
|
|
|
</span>
|
|
|
|
<% end %>
|
2014-11-02 09:39:18 +08:00
|
|
|
</li>
|
|
|
|
<li class="wname">
|
|
|
|
<% if homework.name == nil || homework.name == "" %>
|
|
|
|
<% homework_filename = homework.user.name + "提交的作业" %>
|
|
|
|
<% else %>
|
|
|
|
<% homework_filename = homework.name %>
|
|
|
|
<% end %>
|
2014-11-04 10:41:34 +08:00
|
|
|
<%= link_to homework_filename , homework_attach_path(homework,:cur_page => @cur_page,:cur_type => @cur_type), :title => homework_filename, :remote => true%>
|
2014-11-02 09:39:18 +08:00
|
|
|
</li>
|
|
|
|
<li class="wdown">
|
|
|
|
<%= link_to "(#{homework.attachments.count.to_s}个附件)", zipdown_download_user_homework_path(:homework => homework)%>
|
|
|
|
</li>
|
|
|
|
<li class="wscore">
|
2014-11-06 11:58:26 +08:00
|
|
|
<% unless is_student_batch_homework %>
|
2014-11-06 08:44:24 +08:00
|
|
|
<%= l(:label_teacher_score)%>:
|
|
|
|
<span class="c_red">
|
|
|
|
<%= homework.t_score.nil? ? l(:label_without_score) : format("%.2f",homework.t_score)%>
|
|
|
|
</span>
|
|
|
|
|
|
|
|
<% end %>
|
2014-11-02 09:39:18 +08:00
|
|
|
</li>
|
|
|
|
<li class="wscore">
|
2014-11-06 11:58:26 +08:00
|
|
|
<%= is_student_batch_homework ? l(:label_my_score) : l(:label_student_score)%>:
|
2014-11-02 09:39:18 +08:00
|
|
|
<span class="c_red">
|
2014-11-10 10:37:12 +08:00
|
|
|
<%= is_student_batch_homework ? (homework.m_score.nil? ? l(:label_without_score) : format("%.2f",homework.m_score)) : (homework.s_score.nil? ? l(:label_without_score) : format("%.2f",homework.s_score))%>
|
2014-11-02 09:39:18 +08:00
|
|
|
</span>
|
|
|
|
</li>
|
|
|
|
<% if is_teacher %>
|
|
|
|
<!-- 是老师,所有列表正常显示 -->
|
|
|
|
<li class="wping">
|
2014-11-04 10:41:34 +08:00
|
|
|
<%= link_to l(:label_work_rating),homework_attach_path(homework,:cur_page => @cur_page,:cur_type => @cur_type),:remote => true %>
|
2014-11-02 09:39:18 +08:00
|
|
|
<% if Time.parse(@bid.deadline.to_s).strftime("%Y-%m-%d") < Time.parse(homework.created_at.to_s).strftime("%Y-%m-%d") %>
|
|
|
|
<span class="c_red"> 迟交!</span>
|
|
|
|
<% end %>
|
|
|
|
</li>
|
|
|
|
<% else %>
|
|
|
|
<!-- 是学生 -->
|
|
|
|
<% if is_my_homework %>
|
2014-11-25 10:15:34 +08:00
|
|
|
<!-- 我的作品,在未开启匿评和未使用匿评,显示为编辑和删除 -->
|
|
|
|
<% if @bid.comment_status == 0 || @bid.open_anonymous_evaluation == 0 %>
|
2014-11-26 15:24:41 +08:00
|
|
|
<li class="wmine">
|
2014-11-04 10:41:34 +08:00
|
|
|
<%= link_to l(:button_edit), edit_homework_attach_path(homework) %>
|
|
|
|
<% if homework.user == User.current || User.current.admin? %>
|
|
|
|
<!-- 作业创建者显示删除作业 -->
|
|
|
|
<%= link_to(l(:label_bid_respond_delete), homework,
|
|
|
|
method: :delete, :confirm => l(:text_are_you_sure), :remote => true ) %>
|
|
|
|
<% else %>
|
|
|
|
<!-- 作业参与者显示退出作业 -->
|
|
|
|
<%= link_to l(:label_logout), destory_homework_users_homework_attach_path(homework,:user_id=>User.current.id),
|
|
|
|
:remote => true, :confirm => l(:label_sure_exit_homework) %>
|
|
|
|
<% end %>
|
|
|
|
</li>
|
|
|
|
<% else %>
|
|
|
|
<li class="wmine" title="只有开启匿评之前才能修改和删除作业哦!">
|
|
|
|
<a style="color:#8e8e8e;"><%= l(:button_edit) %></a>
|
|
|
|
<% if homework.user == User.current || User.current.admin? %>
|
|
|
|
<!-- 作业创建者显示删除作业 -->
|
2014-11-25 10:15:34 +08:00
|
|
|
<a style="color:#8e8e8e;">
|
|
|
|
<%=l(:label_bid_respond_delete)%>
|
|
|
|
</a>
|
2014-11-04 10:41:34 +08:00
|
|
|
<% else %>
|
|
|
|
<!-- 作业参与者显示退出作业 -->
|
2014-11-25 10:15:34 +08:00
|
|
|
<a style="color:#8e8e8e;">
|
|
|
|
<%=l(:label_logout) %>
|
|
|
|
</a>
|
2014-11-04 10:41:34 +08:00
|
|
|
<% end %>
|
|
|
|
</li>
|
|
|
|
<% end %>
|
2014-11-02 09:39:18 +08:00
|
|
|
<% elsif is_student_batch_homework%>
|
2014-11-03 10:12:22 +08:00
|
|
|
<!-- 学生匿评列表 -->
|
|
|
|
<% if @bid.comment_status == 1 %>
|
|
|
|
<!-- 处于开启匿评阶段,可以正常评分 -->
|
|
|
|
<li class="wping">
|
2014-11-04 15:41:10 +08:00
|
|
|
<%= link_to l(:label_anonymous_comments),homework_attach_path(homework,:cur_page => @cur_page,:cur_type => @cur_type),:remote => true %>
|
2014-11-03 10:12:22 +08:00
|
|
|
<% if Time.parse(@bid.deadline.to_s).strftime("%Y-%m-%d") < Time.parse(homework.created_at.to_s).strftime("%Y-%m-%d") %>
|
|
|
|
<span class="c_red"> 迟交!</span>
|
|
|
|
<% end %>
|
|
|
|
</li>
|
|
|
|
<% elsif @bid.comment_status == 2%>
|
|
|
|
<!-- 处于匿评已关闭阶段,不容许评分 -->
|
2014-11-04 10:41:34 +08:00
|
|
|
<li class="wping" title="关闭匿评后不可继续评分">
|
2014-11-25 10:15:34 +08:00
|
|
|
<a style="background:#8e8e8e;">
|
|
|
|
<%= l(:label_anonymous_comments) %>
|
|
|
|
</a>
|
2014-11-03 10:12:22 +08:00
|
|
|
<% if Time.parse(@bid.deadline.to_s).strftime("%Y-%m-%d") < Time.parse(homework.created_at.to_s).strftime("%Y-%m-%d") %>
|
|
|
|
<span class="c_red"> 迟交!</span>
|
|
|
|
<% end %>
|
|
|
|
</li>
|
|
|
|
<% end %>
|
2014-11-02 09:39:18 +08:00
|
|
|
<% else %>
|
|
|
|
<!-- 学生众评列表,显示为点赞 -->
|
2014-11-02 10:34:22 +08:00
|
|
|
<li class="wzan" id="homeworl_praise_li_<%= homework.id%>">
|
|
|
|
<%= render :partial => "homework_attach/homework_praise", locals: {:homework => homework} %>
|
|
|
|
</li>
|
2014-11-02 09:39:18 +08:00
|
|
|
<% end %>
|
|
|
|
<% end %>
|