I have the following question:
I have the following question:
The result of the mean is not appearing at the end because you need the amount of <th></th>
to be the same amount of <td></td>
.
In your example you have 12% with% tags and only 3% with%.
You should always leave the same amount and in your case you will need as you place the notes (proof -> 1,2,3,4,5,6,7,8, end)
<table class="table table-sm table-striped table-bordered shadow-sm">
<thead class="thead-dark">
<tr>
<th>Disciplina</th>
<th>Faltas Atribuidas</th>
<th>Prova 1</th>
<th>Prova 2</th>
<th>Prova 3</th>
<th>Prova 4</th>
<th>Prova 5</th>
<th>Prova 6</th>
<th>Prova 7</th>
<th>Prova 8</th>
<th>Prova Final</th>
<th>Média</th>
</tr>
</thead>
<tbody>
<% block.disciplines.distinct.each do |discipline| %>
<tr>
<td><%= discipline.name %></td>
<td>
<%= number_of_absences(current_user, discipline) %>
</td>
<% discipline.evaluations.each do |evaluation| %>
<td><%= Evaluate.get_evaluate(current_user.id, evaluation.id).present? ? Evaluate.get_evaluate(current_user.id, evaluation.id).note : '0,0' %></td>
<% end %>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td><%= get_media(current_user, discipline) %></td>
</tr>
<% end %>
</tbody>
</table>
Use the "times" to make a loop of the times you have to repeat it, being the difference between 8 and the size of the notes.
<% discipline.evaluations.each do |evaluation| %>
<td><%= Evaluate.get_evaluate(current_user.id, evaluation.id).present? ? Evaluate.get_evaluate(current_user.id, evaluation.id).note : '0,0' %></td>
<% end %>
<% (8 - discipline.evaluations.length).times do %>
<td></td>
<% end %>
I just do not know if it looks "pretty".