42 lines
951 B
Smarty
42 lines
951 B
Smarty
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th></th>
|
|
{for $i=1 to $nbExoMax}
|
|
<th>Exercice {$i}</th>
|
|
{/for}
|
|
<th>Points</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{$total=0}
|
|
{foreach from=$themes item=theme}
|
|
<tr>
|
|
<th>{$theme->get_name()}</th>
|
|
{$sum=0}
|
|
{$themeID=$theme->get_id()}
|
|
{$solvedExercices=$my_team->get_solvedExercices($themeID)} {*TODO: This line give a Warning*}
|
|
{foreach from=$theme->get_exercicesOrdered() item=exo}
|
|
{$pts=0}
|
|
{for $i=0 to $nbExoMax}
|
|
{if !empty($solvedExercices.$i)}
|
|
{if $solvedExercices.$i->get_id() == $exo->get_id()}
|
|
{$pts=$solvedExercices.$i->points}{$sum=$sum + $pts}
|
|
{/if}
|
|
{/if}
|
|
{/for}
|
|
<td>{$pts}</td>
|
|
{/foreach}
|
|
<th>{$sum}</th>
|
|
</tr>
|
|
{$total=$total+$sum}
|
|
{/foreach}
|
|
</tbody>
|
|
<tfoot>
|
|
<tr>
|
|
<th colspan="{$nbExoMax+1}" style="text-align: right">Total :</th>
|
|
<th>{$total}</th>
|
|
</tr>
|
|
</tfoot>
|
|
</table>
|