socialforge/app/views/student_work/index.html.erb

218 lines
11 KiB
Plaintext
Raw Normal View History

2015-12-17 22:36:18 +08:00
<% content_for :header_tags do %>
<%= javascript_include_tag "/assets/codemirror/codemirror_python_ruby_c" %>
<%= stylesheet_link_tag "/assets/codemirror/codemirror" %>
<% end %>
<script type="text/javascript">
2015-09-16 15:51:35 +08:00
$(function(){
2015-09-17 09:20:35 +08:00
$("#RSide").removeAttr("id");
$("#homework_page_right").css("min-height",$("#LSide").height()-30);
2015-09-16 15:51:35 +08:00
$("#Container").css("width","1000px");
});
// 匿评弹框提示
2015-10-15 15:26:32 +08:00
<%# if @is_evaluation && !@stundet_works.empty?%>
// $(function(){
// $('#ajax-modal').html('<%#= escape_javascript(render :partial => 'student_work/praise_alert') %>');
// showModal('ajax-modal', '500px');
// $('#ajax-modal').siblings().remove();
// $('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
// "<a href='javascript:' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
// $('#ajax-modal').parent().css("top","").css("left","");
// $('#ajax-modal').parent().addClass("anonymos");
// });
<%# end%>
2015-09-17 16:04:16 +08:00
2015-09-17 20:20:20 +08:00
//设置评分规则
function set_score_rule(){
2015-10-23 14:45:56 +08:00
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/set_score_rule',:locals => {:homework => @homework,:student_path => true}) %>');
2015-09-17 20:20:20 +08:00
showModal('ajax-modal', '350px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
"<a href='javascript:' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
$('#ajax-modal').parent().css("top","25%").css("left","35%").css("position","fixed");
}
2015-10-22 16:57:36 +08:00
$(function(){
$("#homework_info_hidden").click(function(){
$("#homeworkInformation").hide();
$("#homework_info_hidden").hide();
$("#homework_info_show").show();
});
$("#homework_info_show").click(function(){
$("#homework_info_show").hide();
$("#homeworkInformation").show();
$("#homework_info_hidden").show();
});
if($("#homework_description").height() > 54) {
$("#homeworkDetailShow").show();
}
$("#homeworkDetailShow").click(function(){
$("#homeworkDetail").toggleClass("max_h54");
$("#homeworkDetailShow").hide();
$("#homeworkDetailHide").show();
});
$("#homeworkDetailHide").click(function(){
$("#homeworkDetail").toggleClass("max_h54");
$("#homeworkDetailHide").hide();
$("#homeworkDetailShow").show();
});
});
</script>
2015-09-16 15:51:35 +08:00
<div class="homepageRight mt0 ml10">
2015-09-17 09:20:35 +08:00
<div class="resources" id="homework_page_right">
2015-09-16 15:51:35 +08:00
<div class="hworkListBanner">
<div id="menu_r" class="fl">
<ul class="menu_r">
<li>
<a href="javascript:void(0);" class="parent">
<% @homework_commons.each_with_index do |homework_common,index |%>
<% if homework_common.id == @homework.id %>
<%="作业 #{@homework_commons.count - index}" %>
<% end %>
<% end%>
</a>
2015-09-16 15:51:35 +08:00
<ul>
<% @homework_commons.each_with_index do |homework_common,index |%>
<li class="pr10">
<%= link_to "作业#{@homework_commons.count - index}#{homework_common.name}",student_work_index_path(:homework => homework_common.id)%>
<%#= link_to "第#{@homework_commons.count - index}次作业",student_work_index_path(:homework => homework_common.id)%>
2015-09-16 15:51:35 +08:00
</li>
<% end%>
</ul>
</li>
<!---level1 end--->
</ul>
2015-09-16 15:51:35 +08:00
<!---menu_r end--->
</div>
<!--div class="hworkInfor"><a href="javascript:void(0);" class="linkBlue">作业信息</a></div-->
2015-09-17 14:16:13 +08:00
<% if @is_teacher%>
<div class="fr mt5">
<ul class="resourcesSelect">
<li class="resourcesSelected">
<a href="javascript:void(0);" class="resourcesIcon"></a>
<ul class="hworkMenu">
<li>
2015-09-22 16:16:55 +08:00
<%= link_to "导出作业成绩", student_work_index_path(:homework => @homework.id,:order => @order, :sort => @b_sort, :name => @name, :group => @group, :format => 'xls'),:class=>'hworkExport postTypeGrey', :id => "export_student_work"%>
</li>
<li>
<% if @homework.student_works.empty?%>
<%= link_to "导出作业附件", "javascript:void(0)", class: "hworkExport resourcesGrey", :onclick => "alert('没有学生提交作业,无法下载附件')" %>
<% else%>
<%= link_to "导出作业附件", zipdown_assort_path(obj_class: @homework.class, obj_id: @homework, format: :json),
remote: true, class: "hworkExport resourcesGrey", :id => "download_homework_attachments" %>
<% end%>
</li>
<li>
<%= link_to("导出缺评情况", absence_penalty_list_student_work_index_path(:homework => @homework.id, :format => 'xls'),:class=>'hworkExport resourcesGrey')%>
</li>
<li>
<%= link_to("导出匿评情况", evaluation_list_student_work_index_path(:homework => @homework.id, :format => 'xls'),:class=>'hworkExport resourcesGrey')%>
</li>
2015-09-17 20:20:20 +08:00
<li>
<a href="javascript:void(0);" class="hworkSetting resourcesGrey" onclick="set_score_rule();">评分设置</a>
</li>
2015-09-17 14:16:13 +08:00
</ul>
</li>
2015-09-16 15:51:35 +08:00
</ul>
2015-09-17 14:16:13 +08:00
</div>
<% end%>
<div class="cl"></div>
2015-09-16 15:51:35 +08:00
</div>
2015-09-22 15:03:03 +08:00
2015-10-22 16:57:36 +08:00
<div class="homeworkInfo" id="homeworkInformation">
<div class="">
<div class="homepagePostTitle fl hidden m_w460" title="<%= @homework.name %>"><%= @homework.name %></div>
2015-10-22 16:57:36 +08:00
<% if @homework.homework_detail_manual%>
<% if @homework.homework_detail_manual.comment_status == 0 %>
<span class="grey_homework_btn_cir ml5">未发布</span>
<% elsif @homework.homework_detail_manual.comment_status == 1%>
<% if @homework.anonymous_comment == 0%>
<span class="grey_homework_btn_cir ml5">未开启匿评</span>
<% else %>
<span class="grey_homework_btn_cir ml5">匿评已禁用</span>
<% end %>
2015-12-22 09:49:18 +08:00
<% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d")%>
<span class="green_homework_btn_cir ml5">作品提交中</span>
<% elsif Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d") %>
<span class="red_homework_btn_cir ml5">作品补交中</span>
<% end %>
2015-10-22 16:57:36 +08:00
<% elsif @homework.homework_detail_manual.comment_status == 2%>
<% if @homework.anonymous_comment == 0%>
<span class="green_homework_btn_cir ml5">匿评中</span>
<% else %>
<span class="grey_homework_btn_cir ml5">匿评已禁用</span>
<% end %>
<span class="green_homework_btn_cir ml5" title="目前教师和教辅正在评阅">教师评阅中</span>
2015-10-22 16:57:36 +08:00
<% elsif @homework.homework_detail_manual.comment_status == 3%>
<% if @homework.anonymous_comment == 0%>
<span class="grey_homework_btn_cir ml5">匿评已结束</span>
<% else %>
<span class="grey_homework_btn_cir ml5">匿评已禁用</span>
<% end %>
<span class="green_homework_btn_cir ml5" title="目前教师和教辅正在评阅">教师评阅中</span>
2015-10-22 16:57:36 +08:00
<% end%>
<% end%>
<span class="fr c_grey"> <a href="javascript:void(0);" class="linkGrey2" id="homework_info_hidden">[ 隐藏作业信息 ]</a> </span>
<div class="cl"></div>
<div class="fontGrey2 db mb5">发布者:<%= @homework.user.show_name %></div>
<div class="homeworkDetail upload_img break_word list_style max_h54" id="homeworkDetail">
<div id="homework_description"><%= @homework.description.html_safe %></div>
</div>
<div id="homeworkDetailShow" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
<div id="homeworkDetailHide" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
<div class="cl"></div>
<div>
<%= render :partial => 'student_work/work_attachments', :locals => {:attachments => @homework.attachments} %>
<div class="cl"></div>
</div>
2015-10-22 16:57:36 +08:00
<div class="mt5">
<% if @homework.homework_detail_manual && @homework.homework_detail_manual.comment_status < 2 %>
<div class="fontGrey2 db fl">提交截止时间:<%= @homework.end_time %>&nbsp;23:59</div>
<% elsif @homework.homework_detail_manual && @homework.homework_detail_manual.comment_status >= 2 %>
<div class="fontGrey2 db fl">匿评截止时间:<%= @homework.homework_detail_manual.evaluation_end %>&nbsp;23:59</div>
<% end %>
<% if @homework.homework_detail_manual.comment_status == 0 %>
<div class="fontGrey2 db fl ml10">发布时间:<%= @homework.publish_time %>&nbsp;00:00</div>
<% end %>
2015-10-22 16:57:36 +08:00
<% if @homework.homework_detail_manual%>
<% if @homework.homework_detail_manual.comment_status == 1%>
<% end_time = @homework.end_time.to_time.to_i + 24*60*60 - 1 %>
<% if end_time >= Time.now.to_i %>
<div class="fontGrey2 db fr">提交剩余时间: <span class="c_red"><%= (end_time - Time.now.to_i) / (24*60*60) %></span> 天
<span class="c_red"><%= ((end_time - Time.now.to_i) % (24*60*60)) / (60*60)%></span> 小时
<span class="c_red"><%= (((end_time - Time.now.to_i) % (24*60*60)) % (60*60)) / 60%></span> 分</div>
<% else %>
<div class="fontGrey2 db fr c_red">提交已截止</div>
<% end %>
<% elsif @homework.homework_detail_manual.comment_status == 2%>
<% end_time = @homework.homework_detail_manual.evaluation_end.to_time.to_i + 24*60*60 - 1 %>
<% if end_time >= Time.now.to_i %>
<div class="fontGrey2 db fr">匿评剩余时间: <span class="c_red"><%= (end_time - Time.now.to_i) / (24*60*60)%></span> 天
<span class="c_red"><%= ((end_time - Time.now.to_i) % (24*60*60)) / (60*60)%></span> 小时
<span class="c_red"><%= (((end_time - Time.now.to_i) % (24*60*60)) % (60*60)) / 60%></span> 分</div>
<% else %>
<div class="fontGrey2 db fr c_red">匿评已截止</div>
<% end %>
<% end%>
<% end%>
<div class="cl"></div>
</div>
</div>
</div>
2015-09-16 15:51:35 +08:00
<div class="hworkListContainer">
<div class="ctt2">
<div class="dis" id="homework_student_work_list">
<%= render :partial => "student_work/student_work_list"%>
</div>
2015-09-16 15:51:35 +08:00
</div>
</div>
2015-09-22 15:03:03 +08:00
2015-09-16 15:51:35 +08:00
<div class="cl"></div>
</div>
</div>
<div class="cl"></div>