TPI单选多选题,全部列表刷新
This commit is contained in:
parent
9dc48292eb
commit
ab3cfc69bd
|
|
@ -49,6 +49,14 @@ class Challenge < ActiveRecord::Base
|
|||
return score
|
||||
end
|
||||
|
||||
def choose_tags_num
|
||||
num = 0
|
||||
self.challenge_chooses.each do |choose|
|
||||
num += choose.challenge_tags.count
|
||||
end
|
||||
return num
|
||||
end
|
||||
|
||||
def next_challenge
|
||||
challenge_count = Challenge.where(:shixun_id => self.shixun_id).count
|
||||
render_404 if self.position ==challenge_count
|
||||
|
|
|
|||
|
|
@ -37,10 +37,16 @@
|
|||
|
||||
<div class="cl"></div>
|
||||
<div style="display: flex;" class="with80 ml30">
|
||||
<% if game.try(:status) == 0 || game.try(:status) == 1 || game.try(:status) == 3 %>
|
||||
<span class="color-dark-grey font-12 mr15 info-partly" id="shixun_exp_<%=challenge.id %>">经验值<span class="ml5"><%= challenge.score %></span></span>
|
||||
<span class="color-dark-grey font-12 mr15 info-partly" id="shixun_grade_<%=challenge.id %>">金币<span class="ml5"><%= challenge.score %></span></span>
|
||||
<span class="color-dark-grey font-12 mr15 info-partly" id="shixun_tag_<%=challenge.id %>">技能标签<span class="ml5"><%= challenge.challenge_tags.count %></span></span>
|
||||
<% if game.try(:status) != 2 %>
|
||||
<% if challenge.st == 0 %>
|
||||
<span class="color-dark-grey font-12 mr15 info-partly" id="shixun_exp_<%=challenge.id %>">经验值<span class="ml5"><%= challenge.score %></span></span>
|
||||
<span class="color-dark-grey font-12 mr15 info-partly" id="shixun_grade_<%=challenge.id %>">金币<span class="ml5"><%= challenge.score %></span></span>
|
||||
<span class="color-dark-grey font-12 mr15 info-partly" id="shixun_tag_<%=challenge.id %>">技能标签<span class="ml5"><%= challenge.challenge_tags.count %></span></span>
|
||||
<% else %>
|
||||
<span class="color-dark-grey font-12 mr15 info-partly" id="shixun_exp_<%=challenge.id %>">经验值<span class="ml5"><%= challenge.choose_score %></span></span>
|
||||
<span class="color-dark-grey font-12 mr15 info-partly" id="shixun_grade_<%=challenge.id %>">金币<span class="ml5"><%= challenge.choose_score %></span></span>
|
||||
<span class="color-dark-grey font-12 mr15 info-partly" id="shixun_tag_<%=challenge.id %>">技能标签<span class="ml5"><%= challenge.choose_tags_num %></span></span>
|
||||
<% end %>
|
||||
<% elsif game.try(:status) == 2 %>
|
||||
<% final_score = (game.answer_open? || @myshixun.shixun.status <= 1) ? 0 : game.final_score.to_i %>
|
||||
<% gold_score = @myshixun.shixun.status <= 1 ? 0 : (game.answer_open? ? -challenge.score.to_i : game.final_score.to_i) %>
|
||||
|
|
@ -48,6 +54,7 @@
|
|||
<span class="color-dark-grey font-12 mr15 info-partly" id="shixun_grade_<%=challenge.id %>">金币<span class="<%= gold_score < 0 ? "u-color-light-red" : "color-light-green" %> ml5"><%= gold_score < 0 ? gold_score : "+"+gold_score.to_s %></span></span>
|
||||
<span class="color-dark-grey font-12 mr15 info-partly" id="shixun_tag_<%=challenge.id %>">技能标签<span class="color-light-green ml5">+<%= (game.answer_open? || @myshixun.shixun.status <= 1) ? 0 : challenge.challenge_tags.count %></span></span>
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue