Code cleaned

This commit is contained in:
Li Chen 2013-11-12 16:52:50 +01:00
commit 2d77512cdc
13 changed files with 58 additions and 63 deletions

View file

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<theme>
<title>{$theme->get_name()}</title>
{if $theme->get_exercicesOrdered()}
{foreach from=$theme->get_exercicesOrdered() item=e}
{if $theme->get_exercices_ordered()}
{foreach from=$theme->get_exercices_ordered() item=e}
<exercice id="{$e->id}" level="{$e->level}"{if $e->require} depends="{$e->require}"{/if}>
<title>{$e->get_name()}</title>
<points>{$e->points}</points>

View file

@ -20,7 +20,7 @@
<li class="dropdown{if $menu_where == $t->get_name()} active{/if}">
<a href="/{$SALT_ADMIN}/{$t->get_id()}-{$t->get_name()}" class="dropdown-toggle" data-toggle="dropdown">{$t->get_name()} <b class="caret"></b></a>
<ul class="dropdown-menu">
{foreach from=$t->get_exercicesOrdered() item=e}
{foreach from=$t->get_exercices_ordered() item=e}
<li><a href="/{$SALT_ADMIN}/{$t->get_id()}-{$t->get_name()}/{$e->get_id()}">{$e->get_name()}</a></li>
{/foreach}
</ul>

View file

@ -21,7 +21,7 @@
</td>
<td><a href="/{$SALT_ADMIN}/{$t->id}-{$t->name}">{$t->name}</a></td>
<td><ul>
{foreach from=$t->get_exercicesOrdered() item=e}
{foreach from=$t->get_exercices_ordered() item=e}
<li><a href="/{$SALT_ADMIN}/{$t->id}-{$t->name}/{$e->id}">{$e->get_name()}</a></li>
{/foreach}
</ul></td>

View file

@ -15,13 +15,13 @@
<th>{$theme->get_name()}</th>
{$sum=0}
{$themeID=$theme->get_id()}
{$solvedExercices=$my_team->get_solvedExercices($themeID)}
{foreach from=$theme->get_exercicesOrdered() item=exo}
{$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($solvedExercices.$i)}
{if $solvedExercices.$i->get_id() == $exo->get_id()}
{$pts=$solvedExercices.$i->points}{$sum=$sum + $pts}
{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}

View file

@ -41,14 +41,14 @@
</p>
<p>
{$my_team->get_pts()} points<a class="badge pull-right" href="/{$SALT_USER}/{$my_team->get_id()}/summary">Synthèse</a><br>
{$my_team->get_rank()}<sup>e</sup> sur {Team::get_nbTeams()}
{$my_team->get_rank()}<sup>e</sup> sur {Team::get_nb_teams()}
</p>
</aside>
<div class="list-group">
{foreach from=$themes item=t key=k}
<a class="list-group-item" href="/{$SALT_USER}/{$my_team->get_id()}/{$t->get_id()}-{$t->get_name()}">
<span class="badge">{$my_team->get_nbResExercisesByTheme($t->get_id())}/{$t->get_nbExercices()}</span>
<span class="badge">{$my_team->get_nb_res_exercises_by_theme($t->get_id())}/{$t->get_nb_exercices()}</span>
{$t->get_name()}
</a>
{/foreach}

View file

@ -4,7 +4,7 @@
<div class="jumbotron">
<h3 style="font-variant: small-caps">{$cur_theme->get_name()}</h3>
<p>
{foreach from=$cur_theme->get_exercicesOrdered() item=exercice}
{foreach from=$cur_theme->get_exercices_ordered() item=exercice}
{if $exercice->has_solved($my_team)}
<a class="btn btn-success" role="button" href="/{$SALT_USER}/{$my_team->get_id()}/{$cur_theme->get_id()}-{$cur_theme->get_name()}/{$exercice->get_id()}">{$exercice->get_name()}</a>
{elseif $exercice->is_unlocked($my_team)}