server/onyx/tpl/bootstrap/teams/exercice.tpl

80 lines
2.5 KiB
Smarty

{extends file="teams/theme.tpl"}
{block name=exercices}
<div class="panel panel-info">
<div class="panel-heading">
<h3 class="panel-title">Exercice {$cur_exercice->number} <small>{$solved} équipe{if $solved > 1}s ont{else} a{/if} résolu cet exercice</small></h3>
</div>
<div class="panel-body">
<ul>
<li><strong>Gain :</strong> {$cur_exercice->points}</li>
<li><strong>Description :</strong> {$cur_exercice->statement|escape|nl2br}</li>
</ul>
</div>
</div>
{if $cur_exercice->files}
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Téléchargements</h3>
</div>
<table class="table">
<thead>
<tr>
<th></th>
<th>Nom</th>
<th>SHA1</th>
<th>Taille</th>
</tr>
</thead>
<tbody>
{foreach from=$cur_exercice->files item=file}
{if file_exists($file['path'])}
<tr>
<td>
<a href="files/{$file['path_hash']}">
<span class="glyphicon glyphicon-download"></span>
</a>
</td>
<td>{$file['name']}</td>
<td>{$file['sha1']}</td>
<td>{filesize($file['path'])}</td>
</tr>
{/if}
{/foreach}
</tbody>
</table>
</div>
{/if}
<div class="panel panel-success">
<div class="panel-heading">
<h3 class="panel-title">{if $my_team->id}Soumettre une solution{else}Solutions{/if}</h3>
</div>
<div class="panel-body">
{if empty($my_team->id)}
Vérifiez votre solution parmi les algorithmes suivants :<br><br>
<dl class="dl-horizontal">
{foreach from=$cur_exercice->keys item=key}
<dt>{$key.format}</dt>
<dd><samp>{$key.value}</samp></dd>
{/foreach}
</dl>
{else if $cur_exercice->has_solved($my_team)}
<strong>R&eacute;solu &agrave; {$cur_exercice->has_solved($my_team)|date_format:"%H:%M:%S"} :)</strong>
{else}
{if $cur_exercice->last_try($my_team)}
<label>Derni&egrave;re solution test&eacute;e &agrave;</label> {$cur_exercice->last_try($my_team)|date_format:"%H:%M:%S"}
{/if}
<form role="form" method="post" action="/{$SALT_USER}/{$my_team->get_id()}/{$cur_theme->get_id()}-{$cur_theme->get_name_url()}/{$cur_exercice->id}/submission" >
<div class="form-group">
<label for="solution">Soumettre la solution :</label>
<input type="text" class="form-control" id="solution" name="solution">
</div>
<button type="submit" class="btn btn-success" {if isset($submission_disabled)}disabled="disabled"{/if}>Soumettre</button>
</form>
{/if}
</div>
</div>
{/block}