mirror of
https://github.com/renbaoshuo/S2OJ.git
synced 2024-12-22 21:51:52 +00:00
feat(problem.php): Suppot show limits (#32)
The system will get the time_limit and memory_limit from problem.conf automatically. In addition, the problem that doesn't have any data will show: time_limit: N/A memory_limit: N/A
This commit is contained in:
parent
9c21c957c9
commit
ec54596ab4
@ -228,7 +228,23 @@ $('#contest-countdown').countdown(<?= $contest['end_time']->getTimestamp() - UOJ
|
||||
<h1 class="page-header text-center">#<?= $problem['id']?>. <?= $problem['title'] ?></h1>
|
||||
<a role="button" class="btn btn-info pull-right" href="/problem/<?= $problem['id'] ?>/statistics"><span class="glyphicon glyphicon-stats"></span> <?= UOJLocale::get('problems::statistics') ?></a>
|
||||
<?php endif ?>
|
||||
|
||||
<?php
|
||||
$limit = getUOJConf("/var/uoj_data/{$problem['id']}/problem.conf");
|
||||
$time_limit = $limit['time_limit'];
|
||||
$memory_limit = $limit['memory_limit'];
|
||||
?>
|
||||
<div class="row text-center">
|
||||
<?php if($time_limit != null ): ?>
|
||||
<span class="label label-info" style="font-size:15px">Time Limit: <?=$time_limit?> s</span>
|
||||
<?php else: ?>
|
||||
<span class="label label-info" style="font-size:15px">Time Limit: N/A</span>
|
||||
<?php endif ?>
|
||||
<?php if($memory_limit != null ): ?>
|
||||
<span class="label label-info" style="font-size:15px">Memory Limit: <?=$memory_limit?> MB</span>
|
||||
<?php else: ?>
|
||||
<span class="label label-info" style="font-size:15px">Memory Limit: N/A</span>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li class="active"><a href="#tab-statement" role="tab" data-toggle="tab"><span class="glyphicon glyphicon-book"></span> <?= UOJLocale::get('problems::statement') ?></a></li>
|
||||
<li><a href="#tab-submit-answer" role="tab" data-toggle="tab"><span class="glyphicon glyphicon-upload"></span> <?= UOJLocale::get('problems::submit') ?></a></li>
|
||||
@ -262,4 +278,4 @@ $('#contest-countdown').countdown(<?= $contest['end_time']->getTimestamp() - UOJ
|
||||
</div>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
<?php echoUOJPageFooter() ?>
|
||||
<?php echoUOJPageFooter() ?>
|
||||
|
Loading…
Reference in New Issue
Block a user