46 lines
1.1 KiB
Smarty
46 lines
1.1 KiB
Smarty
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th></th>
|
|
{for $i=1 to $nbExoMax}
|
|
<th class="text-center">Exercice {$i}</th>
|
|
{/for}
|
|
<th class="text-center">Points</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{$total=0}
|
|
{foreach from=$themes item=theme}
|
|
<tr>
|
|
<th>{$theme->get_name()}</th>
|
|
{$sum=0}
|
|
{$themeID=$theme->get_id()}
|
|
{$solved_exercices=$my_team->get_solved_exercices($themeID)}
|
|
{foreach from=$theme->get_exercices_ordered() item=exo}
|
|
{$pts=0}
|
|
{for $i=0 to $nbExoMax}
|
|
{if !empty($solved_exercices.$i)}
|
|
{if $solved_exercices.$i->get_id() == $exo->get_id()}
|
|
{$pts=$solved_exercices.$i->points}{$sum=$sum + $pts}
|
|
{/if}
|
|
{/if}
|
|
{/for}
|
|
{if $pts > 0}
|
|
<td class="success text-center">{$pts}</td>
|
|
{else}
|
|
<td class="danger text-center">{$pts}</td>
|
|
{/if}
|
|
{/foreach}
|
|
<th class="active text-center">{$sum}</th>
|
|
</tr>
|
|
{$total=$total+$sum}
|
|
{/foreach}
|
|
</tbody>
|
|
<tfoot>
|
|
<tr>
|
|
<th colspan="{$nbExoMax+1}" style="text-align: right">Total :</th>
|
|
<th class="active text-center">{$total}</th>
|
|
</tr>
|
|
</tfoot>
|
|
</table>
|