|
36 | 36 |
|
37 | 37 | from cms import FEEDBACK_LEVEL_RESTRICTED |
38 | 38 | from cms.db import SubmissionResult |
| 39 | +from cms.grading.steps import EVALUATION_MESSAGES |
39 | 40 | from cms.locale import Translation, DEFAULT_TRANSLATION |
40 | 41 | from cms.server.jinja2_toolbox import GLOBAL_ENVIRONMENT |
41 | 42 | from jinja2 import Template |
@@ -295,7 +296,9 @@ class ScoreTypeGroup(ScoreTypeAlone): |
295 | 296 | </td> |
296 | 297 | {% if feedback_level == FEEDBACK_LEVEL_FULL %} |
297 | 298 | <td class="execution-time"> |
298 | | - {% if "time" in tc and tc["time"] is not none %} |
| 299 | + {% if "time_limit_was_exceeded" in tc and tc["time_limit_was_exceeded"] %} |
| 300 | + > {{ tc["time_limit"]|format_duration }} |
| 301 | + {% elif "time" in tc and tc["time"] is not none %} |
299 | 302 | {{ tc["time"]|format_duration }} |
300 | 303 | {% else %} |
301 | 304 | {% trans %}N/A{% endtrans %} |
@@ -430,11 +433,17 @@ def compute_score(self, submission_result): |
430 | 433 | tc_outcome = self.get_public_outcome( |
431 | 434 | tc_score, parameter) |
432 | 435 |
|
| 436 | + time_limit_was_exceeded = False |
| 437 | + if evaluations[tc_idx].text == [EVALUATION_MESSAGES.get("timeout").message]: |
| 438 | + time_limit_was_exceeded = True |
| 439 | + |
433 | 440 | testcases.append({ |
434 | 441 | "idx": tc_idx, |
435 | 442 | "outcome": tc_outcome, |
436 | 443 | "text": evaluations[tc_idx].text, |
437 | 444 | "time": evaluations[tc_idx].execution_time, |
| 445 | + "time_limit": evaluations[tc_idx].dataset.time_limit, |
| 446 | + "time_limit_was_exceeded": time_limit_was_exceeded, |
438 | 447 | "memory": evaluations[tc_idx].execution_memory, |
439 | 448 | "show_in_restricted_feedback": self.public_testcases[tc_idx], |
440 | 449 | "show_in_oi_restricted_feedback": self.public_testcases[tc_idx]}) |
|
0 commit comments