2015-12-17 22:36:18 +08:00
|
|
|
|
<% content_for :header_tags do %>
|
|
|
|
|
<%= javascript_include_tag "/assets/codemirror/codemirror_python_ruby_c" %>
|
2016-05-27 14:44:32 +08:00
|
|
|
|
<%= javascript_include_tag "resizeable_table" %>
|
2015-12-17 22:36:18 +08:00
|
|
|
|
<%= stylesheet_link_tag "/assets/codemirror/codemirror" %>
|
2016-09-21 10:34:38 +08:00
|
|
|
|
<%= import_ke(enable_at: true, prettify: false, init_activity: true) %>
|
2015-12-17 22:36:18 +08:00
|
|
|
|
<% end %>
|
2016-11-11 16:50:25 +08:00
|
|
|
|
<% is_group_project_homework = @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %>
|
2015-12-17 22:36:18 +08:00
|
|
|
|
|
2015-06-25 16:06:32 +08:00
|
|
|
|
<script type="text/javascript">
|
2015-09-16 15:51:35 +08:00
|
|
|
|
$(function(){
|
2015-09-17 09:20:35 +08:00
|
|
|
|
$("#RSide").removeAttr("id");
|
2016-07-22 15:32:37 +08:00
|
|
|
|
$("#homework_page_right").css("min-height",$("#courseLSide").height()-33);
|
2015-09-16 15:51:35 +08:00
|
|
|
|
$("#Container").css("width","1000px");
|
2016-09-21 10:34:38 +08:00
|
|
|
|
<% if @tab == 2%>
|
|
|
|
|
$("#student_work_tab2").click();
|
2016-11-11 16:50:25 +08:00
|
|
|
|
<% elsif @tab == 3 %>
|
|
|
|
|
$("#student_work_tab3").click();
|
2016-09-21 10:34:38 +08:00
|
|
|
|
<% end %>
|
|
|
|
|
sd_create_editor_from_data(<%= @homework.id %>, null, "100%", "<%= @homework.class.to_s %>");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
function HoverLi(n){
|
2016-11-11 16:50:25 +08:00
|
|
|
|
for(var i=1;i<=3;i++){
|
2016-09-21 10:34:38 +08:00
|
|
|
|
$('#student_work_tab'+i).removeClass('selected');
|
|
|
|
|
$('#student_work_con'+i).addClass('undis');
|
|
|
|
|
}
|
|
|
|
|
$('#student_work_tab'+n).addClass('selected');
|
|
|
|
|
$('#student_work_con'+n).removeClass('undis');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$("#moreProject_<%=@homework.id %>").click(function(){
|
|
|
|
|
$("#relatePWrap_<%=@homework.id %>").toggleClass('relatePWrap');
|
|
|
|
|
$("#relatePWrap_<%=@homework.id %>").css("height","auto");
|
|
|
|
|
$(this).hide();
|
|
|
|
|
});
|
|
|
|
|
$("#hideProject_<%=@homework.id %>").click(function(){
|
|
|
|
|
$("#relatePWrap_<%=@homework.id %>").toggleClass('relatePWrap');
|
|
|
|
|
$("#moreProject_<%=@homework.id %>").show();
|
2015-09-16 15:51:35 +08:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 匿评弹框提示
|
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
|
|
|
|
|
2016-11-04 09:23:23 +08:00
|
|
|
|
function set_score_rule_submit() {
|
|
|
|
|
if($("#late_penalty_num").val() == ""){
|
|
|
|
|
$("#late_penalty_num").val("0");
|
|
|
|
|
}
|
|
|
|
|
if($("#absence_penalty_num").val() == ""){
|
|
|
|
|
$("#absence_penalty_num").val("0");
|
|
|
|
|
}
|
|
|
|
|
$('#muban_popup_box').find('form').submit();
|
|
|
|
|
hideModal();
|
|
|
|
|
}
|
|
|
|
|
|
2015-09-17 20:20:20 +08:00
|
|
|
|
//设置评分规则
|
|
|
|
|
function set_score_rule(){
|
2016-11-04 09:23:23 +08:00
|
|
|
|
<% if @homework.homework_type == 2 %>
|
|
|
|
|
<% if @homework.anonymous_comment == 0 %>
|
|
|
|
|
var htmlvalue = "<%= escape_javascript(render :partial => 'homework_common/set_score_rule_pro',:locals => {:homework => @homework, :student_path => true, :user_activity_id => -1,:hw_status => 5}) %>";
|
|
|
|
|
pop_box_new(htmlvalue, 570, 355);
|
|
|
|
|
<% else %>
|
|
|
|
|
var htmlvalue = "<%= escape_javascript(render :partial => 'homework_common/set_score_rule_pro_anon',:locals => {:homework => @homework, :student_path => true, :user_activity_id => -1,:hw_status => 5}) %>";
|
|
|
|
|
pop_box_new(htmlvalue, 500, 285);
|
|
|
|
|
<% end %>
|
|
|
|
|
<% else %>
|
|
|
|
|
<% if @homework.anonymous_comment == 0 %>
|
|
|
|
|
var htmlvalue = "<%= escape_javascript(render :partial => 'homework_common/set_score_rule_non_pro',:locals => {:homework => @homework, :student_path => true, :user_activity_id => -1,:hw_status => 5}) %>";
|
|
|
|
|
pop_box_new(htmlvalue, 500, 325);
|
|
|
|
|
<% else %>
|
|
|
|
|
var htmlvalue = "<%= escape_javascript(render :partial => 'homework_common/set_score_rule_none_pro_anon',:locals => {:homework => @homework, :student_path => true, :user_activity_id => -1,:hw_status => 5}) %>";
|
|
|
|
|
pop_box_new(htmlvalue, 500, 225);
|
|
|
|
|
<% end %>
|
|
|
|
|
<% end %>
|
2015-09-17 20:20:20 +08:00
|
|
|
|
}
|
2015-06-25 16:06:32 +08:00
|
|
|
|
</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">
|
2015-10-16 14:51:30 +08:00
|
|
|
|
<li>
|
|
|
|
|
<a href="javascript:void(0);" class="parent">
|
2016-05-20 19:11:09 +08:00
|
|
|
|
<% if @is_teacher %>
|
|
|
|
|
<% hcommons = @all_homework_commons %>
|
|
|
|
|
<% else %>
|
|
|
|
|
<% hcommons = @homework_commons %>
|
|
|
|
|
<% end %>
|
|
|
|
|
<% hcommons.each_with_index do |homework_common,index |%>
|
2015-10-16 14:51:30 +08:00
|
|
|
|
<% if homework_common.id == @homework.id %>
|
2016-05-20 19:11:09 +08:00
|
|
|
|
<%="作业 #{hcommons.count - index}" %>
|
2015-10-16 14:51:30 +08:00
|
|
|
|
<% end %>
|
|
|
|
|
<% end%>
|
|
|
|
|
</a>
|
2015-09-16 15:51:35 +08:00
|
|
|
|
<ul>
|
2016-05-20 19:11:09 +08:00
|
|
|
|
<% hcommons.each_with_index do |homework_common,index |%>
|
2015-10-16 14:51:30 +08:00
|
|
|
|
<li class="pr10">
|
2016-05-20 19:11:09 +08:00
|
|
|
|
<%= link_to "作业#{hcommons.count - index}:#{homework_common.name}",student_work_index_path(:homework => homework_common.id)%>
|
2015-10-16 14:51:30 +08:00
|
|
|
|
<%#= 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--->
|
2015-05-21 15:52:27 +08:00
|
|
|
|
</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">
|
2015-09-17 17:20:29 +08:00
|
|
|
|
<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"%>
|
2015-09-17 17:20:29 +08:00
|
|
|
|
</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>
|
2016-06-23 15:05:16 +08:00
|
|
|
|
<% if @homework.anonymous_comment == 0 %>
|
|
|
|
|
<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>
|
|
|
|
|
<% end %>
|
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%>
|
2015-05-21 15:52:27 +08:00
|
|
|
|
<div class="cl"></div>
|
2015-09-16 15:51:35 +08:00
|
|
|
|
</div>
|
2015-09-22 15:03:03 +08:00
|
|
|
|
|
2016-09-21 10:34:38 +08:00
|
|
|
|
<ul class="homework-detail-tab mb10 mt15 fb">
|
|
|
|
|
<li class="selected" id="student_work_tab1" onclick="HoverLi(1);">
|
|
|
|
|
<a href="javascript:void(0);" class="fontGrey3">作业信息</a>
|
|
|
|
|
</li>
|
|
|
|
|
<li onclick="HoverLi(2);" id="student_work_tab2">
|
|
|
|
|
<a href="javascript:void(0);" class="fontGrey3">作品列表</a>
|
|
|
|
|
</li>
|
2016-11-11 16:50:25 +08:00
|
|
|
|
<% if is_group_project_homework %>
|
|
|
|
|
<li onclick="HoverLi(3);" id="student_work_tab3">
|
|
|
|
|
<a href="javascript:void(0);" class="fontGrey3">关联项目列表</a>
|
|
|
|
|
</li>
|
|
|
|
|
<li style="width:415px;"> </li>
|
|
|
|
|
<% else %>
|
|
|
|
|
<li style="width:515px;"> </li>
|
|
|
|
|
<% end %>
|
2016-09-21 10:34:38 +08:00
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
<div id="student_work_con1">
|
|
|
|
|
<div class="homepagePostBrief" id="homework_post_brief">
|
|
|
|
|
<%= render :partial => 'student_work/homework_post_brief', :locals => {:homework => @homework, :is_teacher => @is_teacher} %>
|
2015-10-22 16:57:36 +08:00
|
|
|
|
</div>
|
2016-09-21 10:34:38 +08:00
|
|
|
|
<%= render :partial => 'users/homework_post_reply', :locals => {:activity => @homework, :user_activity_id => @homework.id, :hw_status => 3, :is_teacher => @is_teacher} %>
|
|
|
|
|
<div class="cl"></div>
|
2015-10-22 16:57:36 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
2016-09-21 10:34:38 +08:00
|
|
|
|
<div class="undis" id="student_work_con2">
|
|
|
|
|
<div class="hworkListContainer">
|
|
|
|
|
<div class="ctt2">
|
|
|
|
|
<div class="dis" id="homework_student_work_list">
|
|
|
|
|
<%= render :partial => "student_work/student_work_list"%>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2015-05-21 15:52:27 +08:00
|
|
|
|
</div>
|
2015-09-16 15:51:35 +08:00
|
|
|
|
</div>
|
2016-11-11 16:50:25 +08:00
|
|
|
|
|
|
|
|
|
<% if @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %>
|
|
|
|
|
<div class="undis" id="student_work_con3">
|
|
|
|
|
<% project_ids = @homework.student_work_projects.blank? ? "(-1)" : "(" + @homework.student_work_projects.map{|pro| pro.project_id}.join(",") + ")" %>
|
|
|
|
|
<% projects = Project.where("id in #{project_ids}") %>
|
|
|
|
|
<%= render :partial => "student_work/relate_projects", :locals => {:projects => projects}%>
|
|
|
|
|
</div>
|
|
|
|
|
<% end %>
|
2015-09-16 15:51:35 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="cl"></div>
|