Skip to content

Commit

Permalink
[AWS] Use same terminology in submission_row and submission page
Browse files Browse the repository at this point in the history
  • Loading branch information
stefano-maggiolo committed Nov 28, 2015
1 parent 9abc1ca commit f5d4a9f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
18 changes: 12 additions & 6 deletions cms/server/admin/templates/submission.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
{% from cms.grading.scoretypes import get_score_type %}
{% set st = get_score_type(dataset=shown_dataset) %}
{% set sr = s.get_result(shown_dataset) %}
{% set status = SubmissionResult.COMPILING %}
{% if sr is not None %}
{% set status = sr.get_status() %}
{% end %}
<div class="core_title">
<h1>Submission {{ s.id }} (Task: <a href="{{ url_root }}/task/{{ s.task.id }}">{{ s.task.name }}</a>)</h1>
</div>
Expand Down Expand Up @@ -62,21 +66,23 @@ <h2 id="title_details" class="toggling_on">Submission details</h2>
<tr>
<td>Status</td>
<td id="submission_status">
{% if sr is None or sr.compilation_outcome is None %}
{% if status == SubmissionResult.COMPILING %}
Compiling...
{% elif sr.compilation_outcome == "fail" %}
{% elif status == SubmissionResult.COMPILATION_FAILED %}
Compilation failed
{% elif not sr.evaluated() %}
{% elif status == SubmissionResult.EVALUATING %}
Evaluating...
{% elif sr.scored() %}
{% elif status == SubmissionResult.SCORING %}
Scoring...
{% elif status == SubmissionResult.SCORED %}
{% try %}
{% set max_score = st.max_score %}
{% except %}
{% set max_score = "[Cannot get score type - see logs]" %}
{% end %}
Evaluated ({{ sr.score }} / {{ max_score }})
Scored ({{ sr.score }} / {{ max_score }})
{% else %}
Evaluated
N/A
{% end %}
</td>
</tr>
Expand Down
6 changes: 3 additions & 3 deletions cmstestsuite/Test.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ def check(self, *args, **kwargs):

class CheckOverallScore(Check):
# This check searches for a string such :
# Evaluated (100.0 / 100.0)
# Scored (100.0 / 100.0)
# in status and checks the score.

score_re = re.compile(r'^Evaluated \(([0-9.]+) / ([0-9/.]+)\)')
score_re = re.compile(r'^Scored \(([0-9.]+) / ([0-9/.]+)\)')

def __init__(self, expected_score, expected_total):
self.expected_score = expected_score
Expand Down Expand Up @@ -83,7 +83,7 @@ def __init__(self, short_adjective, failure_string):
self.failure_string = failure_string

def check(self, result_info):
if 'Evaluated' not in result_info['status']:
if 'Scored' not in result_info['status']:
raise TestFailure("Expected a successful evaluation, got: %s" %
result_info['status'])
if not result_info['evaluations']:
Expand Down

0 comments on commit f5d4a9f

Please sign in to comment.