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

223 lines
10 KiB
Plaintext

<script type="text/javascript">
<% if @homework.homework_type == 1 && @homework.homework_detail_manual.comment_status == 2 && !@is_teacher && @stundet_works.count > 1%>
$(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%>
</script>
<div class="project_r_h">
<div id="menu_r">
<ul class="menu_r">
<li><a href="javascript:void(0);" class="parent">作业批次</a>
<ul>
<% @homework_commons.each_with_index { |homework_common,index |%>
<li>
<%= link_to "第#{@homework_commons.count - index}次作业",student_work_index_path(:homework => homework_common.id)%>
</li>
<%}%>
</ul>
</li><!---level1 end--->
</ul><!---menu_r end--->
</div>
</div><!--contentbox end-->
<div class="to_top" id="goTopBtn" style="display: none;">
返<br/>回<br/>顶<br/>部
</div>
<div class="cl"></div>
<div id="contentbox">
<div id="tb_" class="hwork_tb_">
<ul>
<li id="tb_1" class="hwork_hovertab" onclick="course_setting(1)">全部作品</li>
<li id="tb_2" class="hwork_normaltab" onclick="course_setting(2)">作业信息</li>
</ul>
</div>
<div class="cl"></div>
<div class="ctt">
<div class="dis" id="tbc_01">
<div class="code_list">
<span class="fl mt3">
<%= link_to "所有作品(<span class='c_red'>#{@stundet_works.count}</span>)".html_safe,student_work_index_path(:homework => @homework.id), :class => "fl"%>
</span>
<% if @show_all%>
<input type="text" id="course_student_name" value="<%= @name%>" placeholder="昵称、学号、姓名搜索" class="min_search ml10 fl" onkeypress="SearchByName('<%= student_work_index_path(:homework => @homework.id)%>',event);">
<%= select_tag(:late_penalty,options_for_select(course_group_list(@course),@group), {:class => "fl h22 w100 ml10"}) if(@is_teacher && course_group_list(@course).count > 0) %>
<a class="student_work_search fl" onclick="SearchByName_1('<%= student_work_index_path(:homework => @homework.id)%>');" href="javascript:void(0)">搜索</a>
<%= link_to("缺评情况",student_work_absence_penalty_student_work_index_path(:homework => @homework.id), :class => "student_work_search fl", :target => "_blank") if((@is_teacher || User.current.admin?) && @homework.homework_type == 1) %>
<% end%>
<% if @is_teacher%>
<div class="fr">
<% unless @homework.homework_type == 2%>
<% if @homework.student_works.empty?%>
<%= link_to "附件", "javascript:void(0)", class: "down_btn fr zip_download_alert", :onclick => "alert('没有学生提交作业,无法下载附件')" %>
<% else%>
<%= link_to "附件", zipdown_assort_path(obj_class: @homework.class, obj_id: @homework, format: :json),
remote: true, class: "down_btn fr zip_download_alert", :id => "download_homework_attachments" %>
<% end%>
<div class="info_ni_download" style="<%= @homework.homework_type == 1 ? '' : 'margin-left: 130px;'%>">
使用
<span class="c_red">winzip</span>
工具进行解压可能会导致
<span class="c_red">下载文件乱码</span>
,建议您使用
<span class="c_red">winrar</span>
工具进行解压
</div>
<% end%>
<%= link_to("匿评", evaluation_list_student_work_index_path(:homework => @homework.id, :format => 'xls'),:class=>'down_btn fr') if @homework.homework_type == 1%>
<%= link_to("缺评", absence_penalty_list_student_work_index_path(:homework => @homework.id, :format => 'xls'),:class=>'down_btn fr') if @homework.homework_type == 1%>
<%= link_to l(:label_list), student_work_index_path(:homework => @homework.id,:order => @order, :sort => @b_sort, :name => @name, :format => 'xls'),:class=>'down_btn fr'%>
<span class="mt3 fr " style="color:#136b3b;">导出全部:</span>
</div>
<% end%>
<div class="cl"></div>
</div><!---code_list end--->
<div class="cl"></div>
<% if @is_evaluation%>
<ul class="hwork_ul">
<%= render :partial => 'evaluation_work_title'%>
</ul><!---hwork_ul end-->
<div class="cl"></div>
<% @stundet_works.each do |student_work|%>
<%= render :partial => "evaluation_work",:locals => {:student_work => student_work}%>
<div id="about_hwork_<%= student_work.id%>" ></div>
<% end%>
<% else %>
<% if @homework.homework_type == 1 || @homework.homework_type == 2%>
<ul class="hwork_ul">
<%= render :partial => 'evaluation_student_work_title'%>
</ul><!---hwork_ul end-->
<div class="cl"></div>
<% @stundet_works.each do |student_work|%>
<%= render :partial => "evaluation_student_work",:locals => {:student_work => student_work}%>
<div id="about_hwork_<%= student_work.id%>" ></div>
<% end%>
<% else%>
<ul class="hwork_ul">
<%= render :partial => 'student_work_title'%>
</ul><!---hwork_ul end-->
<div class="cl"></div>
<% @stundet_works.each do |student_work|%>
<%= render :partial => "student_work",:locals => {:student_work => student_work}%>
<div id="about_hwork_<%= student_work.id%>" ></div>
<% end%>
<% end%>
<% end%>
<div class="cl"></div>
</div><!---tbc_01 end-->
<div class="undis" id="tbc_02">
<div class="problem_main mt10">
<%= link_to(image_tag(url_to_avatar(@homework.user), :width => "42", :height => "42"), user_path(@homework.user), :class => "problem_pic fl") %>
<div class="problem_txt fl mt5">
<h4 class="r_txt_tit mb5">
<%= @homework.name%>
</h4>
<% if @is_teacher%>
<%= homework_anonymous_comment(@homework)%>
<%= link_to(l(:button_edit),edit_homework_common_path(@homework), :class => "fr mr10 work_edit") %>
<% else%>
<%= student_anonymous_comment @homework %>
<%= student_new_homework @homework %>
<% end %>
<div class="cl"></div>
<div id="bid_description_<%= @homework.id%>" class="mt5 upload_img">
<%= @homework.description.html_safe %>
</div>
<div class="cl"></div>
<% if @homework.homework_type == 2 && @homework.homework_detail_programing%>
<% if @is_teacher%>
<table class="border_ce" cellpadding="0" cellspacing="0">
<tbody>
<tr class="<%= cycle("", "b_grey") %>">
<td class="td_tit">
输入
</td>
<td class="td_tit">
输出
</td>
</tr>
<% @homework.homework_tests.each do |test|%>
<tr class="<%= cycle("", "b_grey") %>">
<td class="td_tit">
<%=test.input%>
</td>
<td class="td_tit">
<%= test.output%>
</td>
</tr>
<% end%>
</tbody>
</table>
<div class="cl"></div>
<% end%>
<div class="mt5">
<span class="tit_fb" style="width: auto;"> 开发语言:</span>
<div class="fl">
<% if @homework.homework_detail_programing.language.to_i == 1%>
C
<% elsif @homework.homework_detail_programing.language.to_i == 2%>
C++
<% end%>
</div>
</div>
<div class="cl"></div>
<% end%>
<div class="mt5">
<% unless @homework.attachments.empty?%>
<span class="tit_fb" style="width: auto;"> 附件:</span>
<div class="fl mb5">
<%= render :partial => 'student_work/work_attachments', :locals => {:attachments => @homework.attachments} %>
</div>
<% end%>
</div>
<div class="cl"></div>
<div class="mt5">
<span class="tit_fb" style="width: auto;"> 扣分标准:</span>
<div class="fl mb5 c_red">
<% if @homework.homework_type == 1%>
<%= scoring_rules @homework.late_penalty,@homework.id,@is_teacher,@homework.homework_detail_manual.absence_penalty%>
<% else%>
<%= scoring_rules @homework.late_penalty,@homework.id,@is_teacher%>
<% end%>
</div>
</div>
<div class="cl"></div>
<span class="fl">截止时间:<%= @homework.end_time%></span>
<div >
<% if betweentime(@homework.end_time) < 0 %>
<span class='fr mr10 c_red '>
<%= l(:label_commit_limit)%>
</span>
<% else %>
<script type="text/javascript">
window.setInterval(function(){show_bid_dead_line(<%= @homework.end_time.year%>,<%= @homework.end_time.month%>,<%= @homework.end_time.day + 1%>,"bid_deadline_<%= @homework.id%>");},1000)
</script>
<div id="bid_deadline_<%= @homework.id%>">
</div>
<% end %>
</div>
</div> <!--problem_txt end-->
<div class="cl"></div>
</div><!--problem_main end-->
</div><!---tbc_02 end-->
</div><!--ctt end-->
</div><!--contentbox end-->