Sha256: 95e88d32adb8aed1cecd033a7fd563528d8336fd3037714489423d6da27e71c3

Contents?: true

Size: 716 Bytes

Versions: 5

Compression:

Stored size: 716 Bytes

Contents

<table class="answers-statistics">
  <% question.options.each do |option| %>
    <tr>
      <td>
        <%= option.text %>
        <% question.answers.by(current_user).each do |answer| %>
          <% answer.votes.each do |vote| %>
            <%= '*' if vote.option == option %>
          <% end %>
        <% end %>
      </td>
      <% percentage = ( 100 / question.votes.count ) * option.votes.count %>
      <td class="percentage-bar-container">
        <span style="width: <%= percentage %>%;">
          <%= percentage %>%
          (<%= option.votes.count %>)
        </span>
      </td>
      <td>
        <% if option.correct? %>
          ✔
        <% end %>
      </td>
    </tr>
  <% end %>
</table>

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
tasuku-1.1.0 app/views/tasuku/taskables/questions/answers/_statistics.html.erb
tasuku-1.0.1 app/views/tasuku/taskables/questions/answers/_statistics.html.erb
tasuku-0.1.1 app/views/tasuku/taskables/questions/answers/_statistics.html.erb
tasuku-0.1.0 app/views/tasuku/taskables/questions/answers/_statistics.html.erb
tasuku-0.0.1 app/views/tasks/taskables/questions/answers/_statistics.html.erb