Skip to content

Commit 07eed75

Browse files
committed
Fix progress page max_score scoring issue
1 parent 86906db commit 07eed75

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
*.egg-info/
44
*.pyc
55
*.sw[op]
6+
coverage.xml

submit_and_compare/submit_and_compare.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,16 @@ def studio_view(self, context=None):
272272
frag.initialize_js('SubmitAndCompareXBlockInitEdit')
273273
return frag
274274

275+
def max_score(self):
276+
"""
277+
Returns the configured number of possible points for this component.
278+
Arguments:
279+
None
280+
Returns:
281+
float: The number of possible points for this component
282+
"""
283+
return self.weight
284+
275285
@XBlock.json_handler
276286
def student_submit(self, submissions, suffix=''):
277287
# pylint: disable=unused-argument

submit_and_compare/tests.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,3 +191,11 @@ def test_submit_class_nodisplay(self):
191191
self.xblock.max_attempts = 5
192192
self.xblock.count_attempts = 6
193193
self.assertEquals('nodisplay', self.xblock._get_submit_class())
194+
195+
def test_max_score(self):
196+
"""
197+
Tests max_score function
198+
Should return the weight
199+
"""
200+
self.xblock.weight = 4
201+
self.assertEquals(self.xblock.weight, self.xblock.max_score())

0 commit comments

Comments
 (0)