|
16 | 16 | problemset |
17 | 17 | </a> |
18 | 18 | {% endif %} |
19 | | -</h1> |
20 | | - |
21 | | -{% for identifier, problems in allproblems %} |
22 | | - {% if problems is empty %} |
23 | | - {% if not identifier %} |
24 | | - <div class="alert alert-secondary">No problem texts available at this point.</div> |
25 | | - {% endif %} |
26 | | - {% else %} |
27 | | - <div class="container"> |
28 | | - {% if show_jury_warning is defined and show_jury_warning %} |
29 | | - <div class="alert alert-warning"> |
30 | | - This is a preview of how the page will look like for teams and the public after the contest has started. |
31 | | - </div> |
32 | | - {% endif %} |
33 | | - |
34 | | - {% if identifier %} |
35 | | - <h1 class="mt-4 text-center" data-bs-toggle="collapse" href="#alreadySolved"> |
36 | | - Already solved problems |
37 | | - <i class="fas fa-chevron-down"></i> |
38 | | - </h1> |
39 | | - {% endif%} |
40 | | - |
41 | | - <div class="row row-cols-1 row-cols-md-2 row-cols-lg-3 g-3 problem-list{% if identifier %} collapse{% endif %}" {% if identifier %}id="alreadySolved"{% endif %}> |
42 | | - {% for problem in problems %} |
43 | | - <div class="col"> |
44 | | - {% set numsamples = samples[problem.probid] %} |
45 | | - {% if problem.problem.interactiveProblem %} |
46 | | - {% set numsamples = 0 %} |
47 | | - {% endif %} |
48 | | - <div class="card"> |
49 | | - <div class="card-body"> |
50 | | - <h2 class="card-title"> |
51 | | - {{ problem | problemBadge }} |
52 | | - </h2> |
53 | | - <h3 class="card-subtitle mb-2 text-muted"> |
54 | | - {{ problem.problem.name }} |
55 | | - </h3> |
56 | | - {% if showLimits %} |
57 | | - <h4 class="card-subtitle mb-2 text-muted"> |
58 | | - Limits: {{ problem.problem.timelimit }} |
59 | | - second |
60 | | - {%- if problem.problem.timelimit > 1 %}s{% endif %} |
61 | | - {%- if timeFactorDiffers -%} |
62 | | - <sup>*</sup> |
63 | | - {% endif %} |
64 | | - / |
65 | | - {{ ((problem.problem.memlimit | default(defaultMemoryLimit)) * 1024) | printSize }} |
66 | | - </h4> |
67 | | - {% endif %} |
68 | | - {% if problem.problem.languages | length != 0 %} |
69 | | - <h4 class="card-subtitle mb-2 text-muted"> |
70 | | - Language{% if problem.problem.languages | length > 1 %}s{% endif %}: |
71 | | - {% for lang in problem.problem.languages %} |
72 | | - <code>{{ lang.name }}</code>{% if not loop.last %}, {% endif %} |
73 | | - {% endfor %} |
74 | | - </h4> |
75 | | - {% endif %} |
76 | | - <h4 class="card-subtitle mb-2 text-muted"> |
77 | | - Type: {{ problem.problem.typesAsString }} |
78 | | - </h4> |
79 | 19 |
|
80 | | - {% if stats is defined %} |
81 | | - <div class="mt-3"> |
82 | | - {% for correct in [true, false] %} |
83 | | - <div class="problem-stats d-flex justify-content-center"> |
84 | | - {% for bucket in 0..stats.numBuckets - 1 %} |
85 | | - {% if correct %} |
86 | | - {% set index = 'correct' %} |
87 | | - {% set maxBucketSize = stats.maxBucketSizeCorrect %} |
88 | | - {% else %} |
89 | | - {% set index = 'incorrect' %} |
90 | | - {% set maxBucketSize = stats.maxBucketSizeIncorrect %} |
91 | | - {% endif %} |
92 | | - {% set stat = stats.problems[problem.problem.probid][index][bucket] %} |
93 | | - {% set count = stat.count %} |
94 | | - {% if maxBucketSize == 0 %} |
95 | | - {% set bucket = 0 %} |
96 | | - {% else %} |
97 | | - {% set bucket = (count / maxBucketSize * 9) | round(0, 'ceil') %} |
98 | | - {% endif %} |
99 | | - {% if count == 1 %} |
100 | | - {% set submissionText = 'submission' %} |
101 | | - {% else %} |
102 | | - {% set submissionText = 'submissions' %} |
103 | | - {% endif %} |
104 | | - {% if not contest.freezeData.showFinal and contest.freezetime and stat.end.timestamp >= contest.freezetime %} |
105 | | - {% set maxBucketSize = max(1, stats.maxBucketSizeCorrect, stats.maxBucketSizeIncorrect) %} |
106 | | - {% set bucket = (count / maxBucketSize * 9) | round(0, 'ceil') %} |
107 | | - {% set itemClass = 'frozen' ~ '-' ~ bucket %} |
108 | | - {% set label = count ~ ' ' ~ submissionText ~ ' in freeze' %} |
109 | | - {% else %} |
110 | | - {% set itemClass = index ~ '-' ~ bucket %} |
111 | | - {% set label = count ~ ' ' ~ index ~ ' ' ~ submissionText %} |
112 | | - {% endif %} |
113 | | - <div |
114 | | - class="problem-stats-item {{ itemClass }}" |
115 | | - data-bs-toggle="tooltip" |
116 | | - data-bs-placement="top" |
117 | | - data-bs-html="true" |
118 | | - title="Between {{ stat.start.timestamp | printtime(null, contest) }} and {{ stat.end.timestamp | printtime(null, contest) }}:<br/>{{ label }}"> |
119 | | - </div> |
120 | | - {% endfor %} |
121 | | - </div> |
122 | | - {% endfor %} |
123 | | - </div> |
124 | | - <div> |
125 | | - <br/> |
126 | | - </div> |
127 | | - {% endif %} |
128 | | - |
129 | | - <div class="text-center"> |
130 | | - {% if show_submit_button | default(false) %} |
131 | | - {% if is_granted('ROLE_JURY') or (current_team_contest is not null and current_team_contest.freezeData.started) %} |
132 | | - <a class="justify-content-center" data-ajax-modal data-ajax-modal-after="initSubmitModal" href="{{ path('team_submit', {problem: problem.probid}) }}"> |
133 | | - <span class="btn btn-success"> |
134 | | - <i class="fas fa-cloud-upload-alt"></i> Submit |
135 | | - </span> |
136 | | - </a> |
137 | | - {% else %} |
138 | | - <a class="justify-content-center"> |
139 | | - <span class="btn btn-success disabled" disabled> |
140 | | - <i class="fas fa-cloud-upload-alt"></i> Submit |
141 | | - </span> |
142 | | - </a> |
143 | | - {% endif %} |
144 | | - {% endif %} |
145 | | - |
146 | | - {% set clarificationsCount = 0 %} |
147 | | - {% set unseenClarificationCount = 0 %} |
148 | | - {% if clarifications[problem.probid] is defined %} |
149 | | - {% set clarificationsCount = clarifications[problem.probid] | length %} |
150 | | - {% for clar in clarifications[problem.probid] %} |
151 | | - {% if team and team.unreadClarifications.contains(clar) %} |
152 | | - {% set unseenClarificationCount = unseenClarificationCount + 1 %} |
153 | | - {% endif %} |
154 | | - {% endfor %} |
155 | | - {% endif %} |
156 | | - {% if clarificationsCount > 0 %} |
157 | | - <a data-ajax-modal class="btn btn-secondary" role="button" |
158 | | - href="{{ path('team_clarification_by_prob', {'probId': problem.probid}) }}"> |
159 | | - <i class="fas fa-question-circle"></i> |
160 | | - {% if clarificationsCount > 0 %} |
161 | | - {% set badgeClass = 'text-bg-info' %} |
162 | | - {% if unseenClarificationCount > 0 %} |
163 | | - {% set badgeClass = 'text-bg-danger' %} |
164 | | - {% endif %} |
165 | | - <span class="badge {{ badgeClass }}">{{ clarificationsCount }}</span> |
166 | | - {% endif %} |
167 | | - clarifications |
168 | | - </a> |
169 | | - {% endif %} |
170 | | - |
171 | | - <div style="margin-top: 10px;"> |
172 | | - </div> |
| 20 | + {% if allproblems['solved'] is defined and allproblems['solved'] is not empty %} |
| 21 | + <a class="btn btn-secondary" role="button" |
| 22 | + data-bs-toggle="collapse" data-bs-target=".collapse-solved-problems"> |
| 23 | + <i class="fas fa-check-double"></i> |
| 24 | + show solved problems |
| 25 | + </a> |
| 26 | + {% endif %} |
| 27 | +</h1> |
173 | 28 |
|
174 | | - {% if problem.problem.problemstatementType is not empty %} |
175 | | - <a class="btn btn-secondary" role="button" |
176 | | - href="{{ path(problem_statement_path, {'probId': problem.probid}) }}"> |
177 | | - <i class="fas fa-file-{{ problem.problem.problemstatementType }}"></i> |
178 | | - statement |
179 | | - </a> |
180 | | - {% endif %} |
| 29 | +{% set found_problem_texts = false %} |
| 30 | +{% for problems in allproblems %} |
| 31 | + {% if problems is not empty %} |
| 32 | + {% set found_problem_texts = true %} |
| 33 | + {% endif %} |
| 34 | +{% endfor %} |
181 | 35 |
|
182 | | - {% if numsamples > 0 %} |
183 | | - <a class="btn btn-secondary" role="button" |
184 | | - href="{{ path(problem_sample_zip_path, {'probId': problem.probid}) }}"> |
185 | | - <i class="fas fa-file-archive"></i> samples |
186 | | - </a> |
187 | | - {% endif %} |
188 | | - </div> |
| 36 | +{% if not found_problem_texts %} |
| 37 | + <div class="alert alert-secondary">No problem texts available at this point.</div> |
| 38 | +{% else %} |
| 39 | + <div class="container"> |
| 40 | + {% if show_jury_warning is defined and show_jury_warning %} |
| 41 | + <div class="alert alert-warning"> |
| 42 | + This is a preview of how the page will look like for teams and the public after the contest has started. |
| 43 | + </div> |
| 44 | + {% endif %} |
189 | 45 |
|
190 | | - {% if problem.problem.attachments | length > 0 %} |
191 | | - <hr/> |
192 | | - <ol class="text-center list-group list-group-flush"> |
193 | | - {% for attachment in problem.problem.attachments %} |
194 | | - <li class="list-group-item"> |
195 | | - <a class="btn btn-outline-secondary" role="button" |
196 | | - href="{{ path(problem_attachment_path, {'probId': problem.probid, 'attachmentId': attachment.attachmentid}) }}"> |
197 | | - <i class="{{ attachment.type | fileTypeIcon }}"></i> {{ attachment.name }} |
198 | | - </a> |
199 | | - </li> |
200 | | - {% endfor %} |
201 | | - </ol> |
202 | | - {% endif %} |
| 46 | + <h3>Alternative 1: Enable/Disable with button</h3> |
| 47 | + {% include 'partials/problem_list_cards.html.twig' with {'problems': fullallproblems[null], 'collapse': 2} %} |
| 48 | + <hr> |
| 49 | + <h3>Alternative 2: Those would be there by default</h3> |
| 50 | + {% include 'partials/problem_list_cards.html.twig' with {'problems': allproblems[null], 'collapse': 0} %} |
203 | 51 |
|
204 | | - </div> |
205 | | - </div> |
206 | | - </div> |
207 | | - {% endfor %} |
208 | | - </div> |
| 52 | + {% if allproblems['solved'] is defined %} |
| 53 | + <h1 class="mt-4 text-center" data-bs-toggle="collapse" href="#alreadySolved"> |
| 54 | + Alternative 2: Already solved problems |
| 55 | + <i class="fas fa-chevron-down"></i> |
| 56 | + </h1> |
| 57 | + {% include 'partials/problem_list_cards.html.twig' with {'problems': allproblems['solved'], 'collapse': 1} %} |
| 58 | + {% endif %} |
209 | 59 |
|
210 | | - {% if showLimits and timeFactorDiffers %} |
211 | | - <div class="row"> |
212 | | - <div class="col-md-12 my-sm-3"> |
213 | | - <div class=" alert alert-secondary" role="alert"> |
214 | | - * language time factors apply |
215 | | - </div> |
| 60 | + {% if showLimits and timeFactorDiffers %} |
| 61 | + <div class="row"> |
| 62 | + <div class="col-md-12 my-sm-3"> |
| 63 | + <div class=" alert alert-secondary" role="alert"> |
| 64 | + * language time factors apply |
216 | 65 | </div> |
217 | 66 | </div> |
218 | | - {% endif %} |
219 | | - </div> |
220 | | - {% endif %} |
221 | | -{% endfor %} |
| 67 | + </div> |
| 68 | + {% endif %} |
| 69 | + </div> |
| 70 | +{% endif %} |
0 commit comments