diff --git a/judge/contest_format/base.py b/judge/contest_format/base.py index 819e122368..0b70fb2c23 100644 --- a/judge/contest_format/base.py +++ b/judge/contest_format/base.py @@ -83,11 +83,12 @@ def get_problem_breakdown(self, participation, contest_problems): raise NotImplementedError() @abstractmethod - def get_contest_problem_label_script(self): + def get_label_for_problem(self, index): """ - Returns the default Lua script to generate contest problem labels. + Returns the problem label for a given zero-indexed index. - :return: A string, the Lua script. + :param index: The zero-indexed problem index. + :return: A string, the problem label. """ raise NotImplementedError() diff --git a/judge/contest_format/default.py b/judge/contest_format/default.py index 5ca0f9fa41..25c1fd41f1 100644 --- a/judge/contest_format/default.py +++ b/judge/contest_format/default.py @@ -70,9 +70,5 @@ def display_participation_result(self, participation): def get_problem_breakdown(self, participation, contest_problems): return [(participation.format_data or {}).get(str(contest_problem.id)) for contest_problem in contest_problems] - def get_contest_problem_label_script(self): - return ''' - function(n) - return tostring(math.floor(n + 1)) - end - ''' + def get_label_for_problem(self, index): + return str(index + 1) diff --git a/judge/contest_format/icpc.py b/judge/contest_format/icpc.py index 855a34b151..3e1918de8a 100644 --- a/judge/contest_format/icpc.py +++ b/judge/contest_format/icpc.py @@ -115,15 +115,10 @@ def display_user_problem(self, participation, contest_problem): else: return mark_safe('