Skip to content

Commit 1155e90

Browse files
committed
Add visibility notice to attempt files
1 parent c75e561 commit 1155e90

File tree

4 files changed

+14
-5
lines changed

4 files changed

+14
-5
lines changed

web/problems/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ def attempt_file(self, user):
7474
url = settings.SUBMISSION_URL + reverse("attempts-submit")
7575
problem_slug = slugify(self.title).replace("-", "_")
7676
extension = self.EXTENSIONS[self.language]
77-
filename = "{0}.{1}".format(problem_slug, extension)
77+
filename = f"{problem_slug}.{extension}"
7878
contents = render_to_string(
79-
"{0}/attempt.{1}".format(self.language, extension),
79+
f"{self.language}/attempt.{extension}",
8080
{
8181
"problem": self,
8282
"parts": parts,

web/problems/templates/octave/attempt.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44
% NE SPREMINJAJ prvih dveh vrstic
55

66
%
7-
% =============================================================================
7+
{% if not problem.visible %}% <ovo>========================================================================
8+
% {% trans "This problem is not visible." %}
9+
% ========================================================================<ovo>
10+
{% endif %}% =============================================================================
811
% {{ problem.title|safe }}{% if problem.description %}
912
%
1013
% {{ problem.description|indent:'% '|safe }}{% endif %}{% for part, solution_attempt in parts %}

web/problems/templates/python/attempt.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
{% load i18n %}# =============================================================================
1+
{% load i18n %}{% if not problem.visible %}# <ovo>========================================================================
2+
# {% trans "This problem is not visible." %}
3+
# ========================================================================<ovo>
4+
{% endif %}# =============================================================================
25
# {{ problem.title|safe }}{% if problem.description %}
36
#
47
# {{ problem.guarded_description|indent:"# "|safe }}{% endif %}{% for part, solution_attempt, _ in parts %}

web/problems/templates/r/attempt.r

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
{% load i18n %}# ========================================================================
1+
{% load i18n %}{% if not problem.visible %}# <ovo>========================================================================
2+
# {% trans "This problem is not visible." %}
3+
# ========================================================================<ovo>
4+
{% endif %}# ========================================================================
25
# {{ problem.title }} {% if problem.description %}
36
#
47
# {{ problem.description|indent:"# "|safe }}{% endif %}{% for part, solution_attempt in parts %}

0 commit comments

Comments
 (0)