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'%> ) ( <%= link_to homework.student_works.count, student_work_index_path(:homework => homework.id), :class => 'c_red'%> )
</p> </p>
<% if @is_teacher%> <% if @is_teacher%>
<%= homework_anonymous_comment(homework)%> <%#= 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(: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") %> <%#= link_to(l(:button_edit),edit_homework_common_path(homework), :class => "fr mr10 work_edit") %>
<% elsif @is_student%> <% elsif @is_student%>
<%= student_anonymous_comment homework %> <%= student_anonymous_comment homework %>

View File

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

View File

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