dev_course
SylorHuang 6 years ago
parent a76088fe30
commit 1961753273

@ -245,7 +245,7 @@ module ExportHelper
else else
user_course = "--" user_course = "--"
end end
user_obj_score = e_user.objective_score < 0.0 ? 0.0 : e_user.subjective_score.round(1).to_s user_obj_score = e_user.objective_score < 0.0 ? 0.0 : e_user.objective_score.round(1).to_s
user_suj_score = e_user.subjective_score < 0.0 ? 0.0 : e_user.subjective_score.round(1).to_s user_suj_score = e_user.subjective_score < 0.0 ? 0.0 : e_user.subjective_score.round(1).to_s
user_score = e_user.score.present? ? e_user.score.round(1).to_s : 0.0 user_score = e_user.score.present? ? e_user.score.round(1).to_s : 0.0
if e_user.commit_status.present? && e_user.commit_status == 1 if e_user.commit_status.present? && e_user.commit_status == 1

@ -13,13 +13,13 @@
</div> </div>
<div class="plr15"> <div class="plr15">
<p class="text-gray"> <p class="text-gray">
<%= @exercise.try(:exercise_description).nil? ? "" : @exercise.try(:exercise_description).html_safe %> <%= @exercise.try(:exercise_description).nil? ? "" : @exercise.try(:exercise_description)&.html_safe %>
</p> </p>
</div> </div>
</div> </div>
<div class="mbt20 bgc"> <div class="mbt20 bgc">
<div class="ex-scores pd10 text-gray fs13"> <div class="ex-scores pd10 text-gray fs13">
<div class="inline-block pull-left"> <div class="inline-block pull-left max-100">
<% if @exercise_single_ques_count > 0 %> <% if @exercise_single_ques_count > 0 %>
<span class="mr15">单选题<span class="mlr5"><%= @exercise_single_ques_count %></span>题, <span class="mr15">单选题<span class="mlr5"><%= @exercise_single_ques_count %></span>题,
共<span class="mlr5"><%= @exercise_single_ques_scores %></span>分</span> 共<span class="mlr5"><%= @exercise_single_ques_scores %></span>分</span>
@ -63,12 +63,12 @@
</div> </div>
<div class="pbt5"> <div class="pbt5">
<% if q.question_type == 5 %> <% if q.question_type == 5 %>
<span class="ques-title"><%= q.shixun_name.present? ? q.shixun_name.html_safe : "" %></span> <span class="ques-title"><%= q.shixun_name.present? ? q.shixun_name&.html_safe : "" %></span>
<div class="mt8 text-gray"> <div class="mt8 text-gray">
<span><%= q.question_title.present? ? q.question_title.html_safe : "" %></span> <span><%= q.question_title.present? ? q.question_title&.html_safe : "" %></span>
</div> </div>
<% else %> <% else %>
<span class="ques-title"><%= q.question_title.present? ? q.question_title.html_safe : "" %></span> <span class="ques-title"><%= q.question_title.present? ? q.question_title&.html_safe : "" %></span>
<% end %> <% end %>
</div> </div>
<div class="pbt5"> <div class="pbt5">

@ -303,6 +303,9 @@ textarea{
background-color:#eee; background-color:#eee;
line-height:2; line-height:2;
} }
.max-100{
max-width:100%;
}

@ -13,13 +13,13 @@
</div> </div>
<div class="plr15"> <div class="plr15">
<p class="text-gray"> <p class="text-gray">
<%= @exercise.try(:exercise_description).nil? ? "" : @exercise.try(:exercise_description).html_safe %> <%= @exercise.try(:exercise_description).nil? ? "" : @exercise.try(:exercise_description)&.html_safe %>
</p> </p>
</div> </div>
</div> </div>
<div class="mbt20 bgc"> <div class="mbt20 bgc">
<div class="ex-scores pd10 text-gray fs13"> <div class="ex-scores pd10 text-gray fs13">
<div class="inline-block pull-left"> <div class="inline-block pull-left max-100">
<% if @exercise_single_ques_count > 0 %> <% if @exercise_single_ques_count > 0 %>
<span class="mr15">单选题<span class="mlr5"><%= @exercise_single_ques_count %></span>题, <span class="mr15">单选题<span class="mlr5"><%= @exercise_single_ques_count %></span>题,
共<span class="mlr5"><%= @exercise_single_ques_scores %></span>分</span> 共<span class="mlr5"><%= @exercise_single_ques_scores %></span>分</span>
@ -162,14 +162,14 @@
</div> </div>
<div class="pbt5"> <div class="pbt5">
<% if q_type == 5 %> <% if q_type == 5 %>
<span class="ques-title"><%= q.shixun_name.html_safe %></span> <span class="ques-title"><%= q.shixun_name&.html_safe %></span>
<div class="mt8 text-gray"> <div class="mt8 text-gray">
<span><%= q.question_title.html_safe %></span> <span><%= q.question_title&.html_safe %></span>
</div> </div>
<% elsif q_type == 4 %> <% elsif q_type == 4 %>
<span class="ques-title"><%= q.question_title.html_safe %></span> <span class="ques-title"><%= q.question_title&.html_safe %></span>
<% else %> <% else %>
<span class="ques-title"><%= q.question_title.html_safe %></span> <span class="ques-title"><%= q.question_title&.html_safe %></span>
<% end %> <% end %>
</div> </div>
</div> </div>
@ -218,13 +218,13 @@
<% end %> <% end %>
<p class="pbt10 flex-nowrap"> <p class="pbt10 flex-nowrap">
<span class="pull-left line-34">答案(填空<%= index+1 %></span> <span class="pull-left line-34">答案(填空<%= index+1 %></span>
<span class="null-answer"><%= check_answer.html_safe %></span> <span class="null-answer"><%= check_answer&.html_safe %></span>
</p> </p>
<% end %> <% end %>
<% elsif q_type == 4 %> <% elsif q_type == 4 %>
<% check_answer = (user_answer.present? ? user_answer.first.answer_text : '--') %> <% check_answer = (user_answer.present? ? user_answer.first.answer_text : '--') %>
<p class="flex-nowrap"> <p class="flex-nowrap">
<span class="null-answer main-height"><%= check_answer.html_safe %></span> <span class="null-answer main-height"><%= check_answer&.html_safe %></span>
</p> </p>
<% else %> <% else %>
<div class="mbt10"> <div class="mbt10">

Loading…
Cancel
Save