diff --git a/oioioi/programs/handlers.py b/oioioi/programs/handlers.py index a28cb207f..4f29a528b 100755 --- a/oioioi/programs/handlers.py +++ b/oioioi/programs/handlers.py @@ -695,9 +695,9 @@ def add_result_percentage(env, **kwargs): return env for test_name, test_result in env['test_results'].items(): - if (test_result['result_percentage'] == 100 - or test_result['result_percentage'] == 0): + percentage = test_result.get('result_percentage', 0) + if percentage == 100 or percentage == 0: continue - test_result['result_string'] = _("Granted %d%% points, comment") % test_result['result_percentage'] + \ + test_result['result_string'] = _("Granted %d%% points, comment") % percentage + \ ': ' + test_result['result_string'] return env