diff --git a/app/views/exercise/_student_table.html.erb b/app/views/exercise/_student_table.html.erb index a5b804671..88cc9e24c 100644 --- a/app/views/exercise/_student_table.html.erb +++ b/app/views/exercise/_student_table.html.erb @@ -1,3 +1,5 @@ +<% has_ob_qus = @exercise.exercise_questions.where(:question_type => [1, 2, 3]).count > 0 %> +<% has_su_qus = @exercise.exercise_questions.where(:question_type => 4).count > 0 %> @@ -5,8 +7,8 @@ - - + + @@ -34,10 +36,10 @@ <% end %>
序号姓名 学号 答题时间客观题主观题<%= has_ob_qus ? '客观题' : '' %><%= has_su_qus ? '主观题' : '' %> <%= link_to "成绩",'',:class => "c_dark f14 fb",:remote => true%> - <%= exercise.objective_score == -1 ? "0.0" : format("%.1f",exercise.objective_score)%> + <%= has_ob_qus ? (exercise.objective_score == -1 ? "0.0" : format("%.1f",exercise.objective_score)) : '' %> - <%= exercise.subjective_score == -1 ? "未批" : format("%.1f",exercise.subjective_score)%> + <%= has_su_qus ? (exercise.subjective_score == -1 ? "未批" : format("%.1f",exercise.subjective_score)) : ''%> <%= exercise.score.nil? ? "--" : format("%.1f",exercise.score)%>