1、老师打开编程作品报错

2、隐藏开启匿评按钮
This commit is contained in:
sw 2015-09-11 17:52:37 +08:00
parent da269ef716
commit 1673f4f960
3 changed files with 40 additions and 36 deletions

View File

@ -25,8 +25,8 @@
( <%= link_to homework.student_works.count, student_work_index_path(:homework => homework.id), :class => 'c_red'%> )
</p>
<% if @is_teacher%>
<%= homework_anonymous_comment(homework)%>
<%= link_to(l(:label_bid_respond_delete), homework_common_path(homework),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "fr mr10 work_edit") %>
<%#= homework_anonymous_comment(homework)%>
<%#= link_to(l(:label_bid_respond_delete), homework_common_path(homework),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "fr mr10 work_edit") %>
<%#= link_to(l(:button_edit),edit_homework_common_path(homework), :class => "fr mr10 work_edit") %>
<% elsif @is_student%>
<%= student_anonymous_comment homework %>

View File

@ -25,40 +25,44 @@
</li>
<% if @is_teacher%>
<li ><span class="tit_fb ">测试结果:</span>
<table class="border_ce" cellpadding="0" cellspacing="0">
<tbody>
<tr class=" b_lblue fb c_w">
<td class="td_tit ">输入</td>
<td class="td_tit border_l ">输出</td>
<td class="td_50 border_l ">测试结果</td>
</tr>
<%@homework.homework_tests.each do |test|%>
<tr class="<%= cycle("", "b_grey") %>">
<td class="td_tit hidden">
<%= test.input%>
</td>
<td class="td_tit border_l hidden">
<%= test.output%>
</td>
<% student_work_test = StudentWorkTest.where(:homework_test_id => test.id,:student_work_id => @work.id).first%>
<td class="td_50 c_red border_l"><%= student_work_test.nil? ? "正在编译" : student_work_test.status_to_s%></td>
<input type="hidden" value="<%= student_work_test.result if student_work_test%>">
</tr>
<% end%>
<% student_work_test = @work.student_work_test.first%>
<% if student_work_test && student_work_test.error_msg && !student_work_test.error_msg.empty?%>
<tr class="border_t" >
<td colspan="3" class="td_end" >
<%= student_work_test.error_msg%>
</td>
</tr>
<% end%>
</tbody>
</table>
<div class="cl"></div>
<li>
<span class="tit_fb ">
测试结果:
</span>
<div class="show_hwork_p break_word">
<% @work.student_work_tests.each_with_index do |test, index| %>
<div class="ProResultTop">
<p class="c_blue fl">第<%= @work.student_work_tests.count - index%>次测试</p><span class="fr c_grey"><%= test.created_at.to_s(:db) %></span>
<div class="cl"></div>
</div>
<% if test.status.to_i == -2 %>
<div class="ProResultCon "><%= test.results.first %></div>
<% else %>
<div class="ProResultTable " >
<ul class="ProResultUl " >
<% test.results.each_with_index do |x, i| %>
<li >
<span class="w60 T_C">测试<%=i+1%></span>
<% if x["status"].to_i != 0 %>
<span class="w150 c_red">测试错误!</span>
<span class="w60">您的输出:</span>
<span class="W200"><%=x["result"]%></span>
<span class="w60">正确输出:</span>
<span class="W200"><%=x["output"]%></span>
<div class="cl"></div>
<% else %>
<span class="w150 c_green">测试正确!</span>
<div class="cl"></div>
<% end %>
</li>
<% end %>
</ul>
</div>
<% end %>
<% end %>
</div>
</li>
<!-- 编程作业老师才可以评分 -->
<div id="add_student_score_<%= @work.id%>" class="mt10 evaluation">
<%= render :partial => 'add_score',:locals => {:work => @work,:score => @score}%>

View File

@ -123,7 +123,7 @@
<%= @homework.name%>
</h4>
<% if @is_teacher%>
<%= homework_anonymous_comment(@homework)%>
<%#= homework_anonymous_comment(@homework)%>
<% else%>
<%= student_anonymous_comment @homework %>
<%= student_new_homework @homework %>