diff --git a/judge/views/problem.py b/judge/views/problem.py index 050f8fa..7fd44a1 100644 --- a/judge/views/problem.py +++ b/judge/views/problem.py @@ -305,6 +305,12 @@ class ProblemDetail(ProblemMixin, SolvedProblemMixin, CommentedDetailView): ) context["meta_description"] = self.object.summary or metadata[0] context["og_image"] = self.object.og_image or metadata[1] + if hasattr(self.object, "data_files"): + context["fileio_input"] = self.object.data_files.fileio_input + context["fileio_output"] = self.object.data_files.fileio_output + else: + context["fileio_input"] = None + context["fileio_output"] = None return context diff --git a/templates/problem/problem.html b/templates/problem/problem.html index 83ca7e4..672f303 100644 --- a/templates/problem/problem.html +++ b/templates/problem/problem.html @@ -261,12 +261,12 @@
{{ _('Input:') }} - {{ problem.data_files.fileio_input or _('stdin') }} + {{ fileio_input or _('stdin') }}
{{ _('Output:') }} - {{ problem.data_files.fileio_output or _('stdout') }} + {{ fileio_output or _('stdout') }}
{% for name, limit in problem.language_memory_limit %} diff --git a/templates/problem/raw.html b/templates/problem/raw.html index f677ab6..591bedb 100644 --- a/templates/problem/raw.html +++ b/templates/problem/raw.html @@ -61,10 +61,10 @@
- {{ _('Input:') }} {{ problem.data_files.fileio_input or _('stdin') }} + {{ _('Input:') }} {{ fileio_input or _('stdin') }}
- {{ _('Output:') }} {{ problem.data_files.fileio_output or _('stdout') }} + {{ _('Output:') }} {{ fileio_output or _('stdout') }}
{{ _('Time Limit:') }} {{ problem.time_limit }}s