Skip to content

Commit

Permalink
Add more problem badges to the analysis controller.
Browse files Browse the repository at this point in the history
  • Loading branch information
meisterT committed Nov 24, 2023
1 parent 6d87eaa commit 40aedbb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions webapp/src/Service/StatisticsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -355,8 +355,14 @@ public function getProblemStats(
$results) ? ($results['correct'] / count($judgings)) * 100.0 : 0;
$misc['teams_correct_percentage'] = count($teamsAttempted) > 0 ? (count($teamsCorrect) / count($teamsAttempted)) * 100.0 : 0;

$contestProblem = $this->em->getRepository(ContestProblem::class)->findOneBy([
'contest' => $contest,
'problem' => $problem,
]);

return [
'contest' => $contest,
'contest_problem' => $contestProblem,
'problem' => $problem,
'timelimit' => $problem->getTimelimit(),
'submissions' => $submissions,
Expand Down
2 changes: 1 addition & 1 deletion webapp/templates/jury/analysis/contest_overview.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ $(function() {
{% set id=p.probid %}
<tr class='clickable-row' data-href="{{path('analysis_problem', {'probid': id, 'view': view}) }}">
<th scope="row">{{ id }}</th>
<td>{{ p.shortname ~ " - " ~ p.problem.name }}</td>
<td>{{ p | problemBadge }} {{ p.problem.name }}</td>
<td>{{ p.problem.timelimit }}</td>
<td>{{ p.problem.memlimit|default('default') }}</td>
<td>{{ misc.problem_num_testcases[id] }}</td>
Expand Down
4 changes: 2 additions & 2 deletions webapp/templates/jury/analysis/problem.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
height: 100%;
}
/* Don't show x-axis ticks/ticklines for max runtimes chart*/
/* Don't show x-axis ticks/ticklines for max runtimes chart. */
#maxruntime .nv-x.nv-axis .tick {
display: none;
}
</style>
{% endblock %}

{% block content %}
<h1>Problem {{ problem.probid }}: {{ problem.name }}</h1>
<h1>Problem {{ problem.probid }}: <span style="font-size: 60%;">{{ contest_problem | problemBadge }}</span> {{ problem.name }}</h1>
{% include 'jury/partials/analysis_filter.html.twig' %}
</div>
<div class="col-lg-3 col-sm-6 mt-3">
Expand Down

0 comments on commit 40aedbb

Please sign in to comment.