在线测验的答题统计若客观题或者主观题下没有题目,不应该显示列

This commit is contained in:
cxt 2017-07-25 10:02:20 +08:00
parent 2d19cac4f2
commit 80b8eab4e7
1 changed files with 6 additions and 4 deletions

View File

@ -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 %>
<table class="hwork-table-wrap" style="border-bottom:1px solid #eaeaea;">
<tr class="b_grey hworkH30">
<th class="hworkList40 pl5 pr5"><span class="c_dark f14 fb">序号</span></th>
@ -5,8 +7,8 @@
<th class="hworkList130"><span class="c_dark f14 fb">姓名</span></th>
<th class="hworkList130"><span class="c_dark f14 fb">学号</span></th>
<th class="hworkList130"><span class="c_dark f14 fb">答题时间</span></th>
<th class="hworkList80">客观题</th>
<th class="hworkList80">主观题</th>
<th class="hworkList80"><%= has_ob_qus ? '客观题' : '' %></th>
<th class="hworkList80"><%= has_su_qus ? '主观题' : '' %></th>
<th class="hworkList80">
<%= link_to "成绩",'',:class => "c_dark f14 fb",:remote => true%>
</th>
@ -34,10 +36,10 @@
<% end %>
</td>
<td class="hworkList80 <%= score_color exercise.objective_score %> student_work_<%= exercise.id%>">
<%= 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)) : '' %>
</td>
<td class="hworkList80 <%= score_color(exercise.subjective_score == -1 ? nil : exercise.subjective_score) %> student_work_<%= exercise.id%>">
<%= exercise.subjective_score == -1 ? "未批" : format("%.1f",exercise.subjective_score)%>
<%= has_su_qus ? (exercise.subjective_score == -1 ? "未批" : format("%.1f",exercise.subjective_score)) : ''%>
</td>
<td class="hworkList80 <%= score_color exercise.score%> student_final_scor_info student_work_<%= exercise.id%>">
<%= exercise.score.nil? ? "--" : format("%.1f",exercise.score)%>