Skip to content

Commit c0a8760

Browse files
Fix scoretypes' pydoc
1 parent 710ddb5 commit c0a8760

2 files changed

Lines changed: 8 additions & 26 deletions

File tree

cms/grading/ScoreType.py

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,11 @@ def max_scores(self):
108108
logger.error("Unimplemented method max_scores.")
109109
raise NotImplementedError("Please subclass this class.")
110110

111-
def compute_score(self, unused_submission_id):
112-
"""Computes a score of a single submission. We don't know here
113-
how to do it, but our subclasses will.
111+
def compute_score(self, unused_submission_result):
112+
"""Computes a score of a single submission.
114113
115-
unused_submission_id (int): the id of the submission to
116-
evaluate.
114+
unused_submission_result (SubmissionResult): the submission
115+
result of which we want the score
117116
118117
returns (float, str, float, str, [str]): respectively: the
119118
score, the HTML string with additional information (e.g.
@@ -235,11 +234,7 @@ class ScoreTypeGroup(ScoreTypeAlone):
235234
{% end %}"""
236235

237236
def max_scores(self):
238-
"""Compute the maximum score of a submission.
239-
240-
returns (float, float): maximum score overall and public.
241-
242-
"""
237+
"""See ScoreType.max_score."""
243238
score = 0.0
244239
public_score = 0.0
245240
headers = list()
@@ -260,12 +255,7 @@ def max_scores(self):
260255
return score, public_score, headers
261256

262257
def compute_score(self, submission_result):
263-
"""Compute the score of a submission.
264-
265-
submission_id (int): the submission to evaluate.
266-
returns (float): the score
267-
268-
"""
258+
"""See ScoreType.compute_score."""
269259
# Actually, this means it didn't even compile!
270260
if not submission_result.evaluated():
271261
return 0.0, "[]", 0.0, "[]", \

cms/grading/scoretypes/Sum.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,7 @@ class Sum(ScoreTypeAlone):
9494
</table>"""
9595

9696
def max_scores(self):
97-
"""Compute the maximum score of a submission.
98-
99-
returns (float, float): maximum score overall and public.
100-
101-
"""
97+
"""See ScoreType.max_score."""
10298
public_score = 0.0
10399
score = 0.0
104100
for public in self.public_testcases.itervalues():
@@ -108,11 +104,7 @@ def max_scores(self):
108104
return score, public_score, []
109105

110106
def compute_score(self, submission_result):
111-
"""Compute the score of a submission.
112-
113-
See the same method in ScoreType for details.
114-
115-
"""
107+
"""See ScoreType.compute_score."""
116108
# Actually, this means it didn't even compile!
117109
if not submission_result.evaluated():
118110
return 0.0, "[]", 0.0, "[]", json.dumps([])

0 commit comments

Comments
 (0)