Skip to content

Commit

Permalink
Hide samples for interactive problems.
Browse files Browse the repository at this point in the history
Fixes #926
  • Loading branch information
nickygerritsen committed Jul 28, 2023
1 parent cd7347c commit 153a585
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 1 addition & 2 deletions webapp/src/Service/DOMJudgeService.php
Original file line number Diff line number Diff line change
Expand Up @@ -964,7 +964,7 @@ public function getTwigDataForProblemsAction(
->join('cp.problem', 'p')
->leftJoin('p.testcases', 'tc')
->leftJoin('p.attachments', 'a')
->select('partial p.{probid,name,externalid,problemtext_type,timelimit,memlimit}', 'cp', 'a')
->select('partial p.{probid,name,externalid,problemtext_type,timelimit,memlimit,combined_run_compare}', 'cp', 'a')
->andWhere('cp.contest = :contest')
->andWhere('cp.allowSubmit = 1')
->setParameter('contest', $contest)
Expand All @@ -976,7 +976,6 @@ public function getTwigDataForProblemsAction(
->from(ContestProblem::class, 'cp')
->join('cp.problem', 'p')
->leftJoin('p.testcases', 'tc')
->leftJoin('p.attachments', 'a')
->select('p.probid', 'SUM(tc.sample) AS numsamples')
->andWhere('cp.contest = :contest')
->andWhere('cp.allowSubmit = 1')
Expand Down
3 changes: 3 additions & 0 deletions webapp/templates/partials/problem_list.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
{% for problem in problems %}
<div class="col">
{% set numsamples = samples[problem.probid] %}
{% if problem.problem.combinedRunCompare %}
{% set numsamples = 0 %}
{% endif %}
<div class="card">
<div class="card-body">
<h2 class="card-title">
Expand Down

0 comments on commit 153a585

Please sign in to comment.