2015-05-21 17:17:54 +08:00
|
|
|
<div class="show_hwork_arrow"></div>
|
2015-09-17 16:04:16 +08:00
|
|
|
<div class="showHwork">
|
2015-12-11 14:57:09 +08:00
|
|
|
<% is_teacher = User.current.allowed_to?(:as_teacher, @homework.course) || User.current.admin? %>
|
|
|
|
<% if @homework.homework_type != 3 %>
|
|
|
|
<% is_my_work = work.user == User.current%>
|
|
|
|
<% else %>
|
|
|
|
<% pro = @homework.student_work_projects.where(:user_id => User.current.id).first %>
|
|
|
|
<% is_my_work = pro && pro.student_work_id == work.id%>
|
|
|
|
<% end %>
|
2015-09-17 16:04:16 +08:00
|
|
|
<ul>
|
|
|
|
<li class="fl" >
|
|
|
|
<span class="tit_fb">上交时间:</span>
|
2015-11-05 10:40:24 +08:00
|
|
|
<%=format_time work.created_at %>
|
2015-09-17 16:04:16 +08:00
|
|
|
</li>
|
2015-05-28 15:54:42 +08:00
|
|
|
|
2015-11-05 16:25:40 +08:00
|
|
|
<% if work.user == User.current && Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d") %>
|
2015-09-17 16:04:16 +08:00
|
|
|
<!-- 我的作业 && 匿评作业 && 未开启匿评,显示编辑和删除按钮 -->
|
|
|
|
<li class="fr" >
|
2015-11-12 11:31:35 +08:00
|
|
|
<%= link_to("", student_work_path(work),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "pic_del",:title=>"删除") %>
|
2015-09-17 16:04:16 +08:00
|
|
|
</li>
|
2015-11-12 11:31:35 +08:00
|
|
|
<li class="fr mr5" >
|
|
|
|
<%= link_to "",edit_student_work_path(work),:class => "pic_edit",:title => "修改"%>
|
2015-09-17 16:04:16 +08:00
|
|
|
</li>
|
|
|
|
<% end%>
|
2015-12-11 14:57:09 +08:00
|
|
|
<% if @homework.homework_detail_manual.comment_status == 3 && !is_my_work %>
|
2015-09-17 16:04:16 +08:00
|
|
|
<!-- 匿评结束阶段,显示点赞按钮 -->
|
2015-11-05 10:40:24 +08:00
|
|
|
<li class="fr" id="student_work_praise_<%= work.id%>">
|
2015-09-17 16:04:16 +08:00
|
|
|
<%= render :partial => 'student_work_praise' %>
|
|
|
|
</li>
|
|
|
|
<% end%>
|
2015-05-22 14:45:01 +08:00
|
|
|
<div class="cl"></div>
|
2015-09-17 16:04:16 +08:00
|
|
|
|
|
|
|
<!--<li ><span class="tit_fb"> 参与人员:</span>程梦雯 王强</li>-->
|
|
|
|
|
2015-12-11 14:57:09 +08:00
|
|
|
<% if @homework.homework_type == 3 && work.student_work_projects && (@homework.homework_detail_manual.comment_status != 2 || is_my_work || is_teacher ) %>
|
|
|
|
<div class="cl"></div>
|
|
|
|
<li>
|
|
|
|
<span class="tit_fb"> 参与人员:</span>
|
|
|
|
<%= link_to(work.user.show_name+"(组长)", user_path(work.user.id), :class => "linkBlue" )%>
|
|
|
|
<% members = work.student_work_projects.where("is_leader = 0") %>
|
|
|
|
<% members.each do |member| if !members.empty? %>
|
|
|
|
、<%=link_to((User.find member.user_id).show_name, user_path(member.user.id), :class => "linkBlue" ) %>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
2015-09-17 16:04:16 +08:00
|
|
|
</li>
|
2015-12-11 14:57:09 +08:00
|
|
|
<% if @homework.homework_detail_group.base_on_project == 1 %>
|
|
|
|
<li>
|
|
|
|
<span class="tit_fb"> 关联项目:</span>
|
|
|
|
<%= link_to( work.project.name, project_path(work.project.id), :class => "linkBlue" )%>
|
|
|
|
<span class="ml5">(综合评分:<font class="c_red"><%=work.project.project_score.score.to_i %></font>)</span>
|
|
|
|
</li>
|
|
|
|
<% end %>
|
2015-05-22 14:45:01 +08:00
|
|
|
<% end%>
|
2015-05-26 17:51:56 +08:00
|
|
|
|
2015-09-17 16:04:16 +08:00
|
|
|
<li >
|
|
|
|
<span class="tit_fb ">内容:</span>
|
|
|
|
<div class="showHworkP break_word">
|
2015-11-05 10:40:24 +08:00
|
|
|
<%= text_format(work.description) if work.description%>
|
2015-05-28 15:54:42 +08:00
|
|
|
</div>
|
2015-09-17 16:04:16 +08:00
|
|
|
<div class="cl"></div>
|
|
|
|
</li>
|
|
|
|
<li >
|
|
|
|
<span class="tit_fb"> 附件:</span>
|
2015-12-04 16:21:11 +08:00
|
|
|
<% com_attachments = work.attachments.where("attachtype IS NULL OR attachtype <> 7") %>
|
|
|
|
<% if com_attachments.empty?%>
|
2015-09-17 16:04:16 +08:00
|
|
|
<span style="color: #999999">尚未提交附件</span>
|
|
|
|
<% else%>
|
|
|
|
<div class="fl" style="width: 90%;">
|
2015-12-04 16:21:11 +08:00
|
|
|
<%= render :partial => 'work_attachments_status', :locals => {:attachments => com_attachments, :status => @homework.homework_detail_manual.comment_status} %>
|
2015-09-17 16:04:16 +08:00
|
|
|
</div>
|
|
|
|
<% end%>
|
|
|
|
<div class="cl"></div>
|
|
|
|
</li>
|
|
|
|
<li >
|
2015-12-11 14:57:09 +08:00
|
|
|
<% if @is_teacher || (@homework.homework_detail_manual.comment_status == 2 && !is_my_work)%>
|
2015-09-17 16:04:16 +08:00
|
|
|
<!-- 老师 || 开启匿评状态 && 不是当前用户自己的作品 -->
|
2015-11-05 10:40:24 +08:00
|
|
|
<div id="add_student_score_<%= work.id%>" class="mt10 evaluation">
|
|
|
|
<%= render :partial => 'add_score',:locals => {:work => work,:score => score}%>
|
2015-09-17 16:04:16 +08:00
|
|
|
</div>
|
|
|
|
<% end%>
|
|
|
|
<div class="cl"></div>
|
|
|
|
</li>
|
|
|
|
</ul>
|
2015-05-22 14:45:01 +08:00
|
|
|
|
2015-12-04 16:21:11 +08:00
|
|
|
<div id="revise_attachment">
|
|
|
|
<%= render :partial => 'student_work/revise_attachment', :locals => {:work => work} %>
|
2015-12-03 18:33:08 +08:00
|
|
|
</div>
|
2015-12-04 16:21:11 +08:00
|
|
|
<div class="cl"></div>
|
2015-12-03 18:33:08 +08:00
|
|
|
|
2015-11-05 10:40:24 +08:00
|
|
|
<div class="ping_box fl" id="score_list_<%= work.id%>" style="<%= work.student_works_scores.empty? ? 'padding:0px;' : ''%>">
|
|
|
|
<%student_work_scores.each do |student_score|%>
|
|
|
|
<div id="work_score_<%= student_score.id%>">
|
|
|
|
<%= render :partial => 'student_work_score',:locals => {:score => student_score,:is_last => student_score == student_work_scores.last}%>
|
2015-09-17 16:04:16 +08:00
|
|
|
</div>
|
|
|
|
<% end%>
|
|
|
|
</div>
|
|
|
|
<!---ping_box end--->
|
2015-11-05 10:40:24 +08:00
|
|
|
<a href="javascript:void(0);" class="fr linkBlue mt5 mb5" onclick="$('#about_hwork_<%= work.id%>').html('');">收起</a>
|
2015-09-17 16:04:16 +08:00
|
|
|
<div class="cl"></div>
|
2015-12-04 16:21:11 +08:00
|
|
|
</div>
|
|
|
|
<script type="text/javascript">
|
|
|
|
function show_upload(){
|
|
|
|
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'student_work/upload_attachment' ,:locals => {:work=>work})%>');
|
|
|
|
showModal('ajax-modal', '452px');
|
|
|
|
$('#ajax-modal').siblings().remove();
|
|
|
|
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='closeModal();' style='margin-left: 435px;' class='resourceClose'></a>");
|
|
|
|
$('#ajax-modal').parent().css("top","40%").css("left","46%");
|
|
|
|
$('#ajax-modal').parent().addClass("resourceUploadPopup");
|
|
|
|
$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px");
|
|
|
|
}
|
|
|
|
function submit_files(){
|
|
|
|
$("#upload_form").submit();
|
|
|
|
}
|
|
|
|
function closeModal(){
|
|
|
|
hideModal($(".uploadBoxContainer"));
|
|
|
|
}
|
|
|
|
function disable_choose(){
|
|
|
|
if ($("#attachments_fields .attachment").size() >= 1) {
|
|
|
|
$("#choose_revise_attach").attr("onclick","return false;").addClass(disable_link);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|