{% set status = sr.get_status() if sr is defined else SubmissionResult.COMPILING %} {% if show_date %} {{ s.timestamp|format_datetime }} {% else %} {{ s.timestamp|format_time }} {% endif %} {% if status == SubmissionResult.COMPILING %} {% trans %}Compiling...{% endtrans %} {% elif status == SubmissionResult.COMPILATION_FAILED %} {% trans %}Compilation failed{% endtrans %} {% trans %}details{% endtrans %} {% elif status == SubmissionResult.EVALUATING %} {% trans %}Evaluating...{% endtrans %} {% elif status == SubmissionResult.SCORING %} {% trans %}Scoring...{% endtrans %} {% elif status == SubmissionResult.SCORED %} {% trans %}Evaluated{% endtrans %} {% trans %}details{% endtrans %} {% endif %} {% if score_type is defined and score_type.max_public_score > 0 %} {% if status == SubmissionResult.SCORED %} {{ score_type.format_score(sr.public_score, score_type.max_public_score, sr.public_score_details, task.score_precision, translation=translation) }} {% else %} {% trans %}N/A{% endtrans %} {% endif %} {% endif %} {% if score_type is defined and score_type.max_public_score < score_type.max_score %} {% if status == SubmissionResult.SCORED and (s.token is not none or actual_phase == 3) %} {{ score_type.format_score(sr.score, score_type.max_score, sr.score_details, task.score_precision, translation=translation) }} {% else %} {% trans %}N/A{% endtrans %} {% endif %} {% endif %} {% if actual_phase >= +3 %} {% if s.official %} Yes {% else %} No {% endif %} {% endif %} {% if submissions_download_allowed %} {# We replace '.%l' with the actual language only when it occurs as an extension at the end of the string and only when #} {# there isn't another file with that name. This allows to securily reverse the replacement and should work great in #} {# the common case. Yet, it still allows the marginal case of both 'foo.%l' and 'foo.c' in the submission format. #} {% if s.files|length == 0 %} {% trans %}None{% endtrans %} {% elif s.files|length == 1 %} {% set filename = next(iterkeys(s.files)) %} {% if s.language is not none %} {% set filename = filename|replace(".%l", (s.language|to_language).source_extension) %} {% endif %} {% trans %}Download{% endtrans %} {% else %}
{% trans %}Download{% endtrans %}
{% endif %} {% endif %} {% if can_use_tokens and actual_phase == 0 %} {% if s.token is not none %} {% trans %}Played{% endtrans %} {% else %} {# TODO If the expiration or generation time are greater than valid_phase_end they "don't exist". It's useless to show "Wait..." in those cases. #} {% if can_play_token and not need_to_wait %}
{{ xsrf_form_html|safe }}
{% elif (can_play_token and need_to_wait) or (not can_play_token and tokens_info[1] is not none) %} {% trans %}Wait...{% endtrans %} {% else %} {% trans %}No tokens{% endtrans %} {% endif %} {% endif %} {% endif %}