Skip to content

Commit 428b0d0

Browse files
authored
Merge pull request #18 from caseylitton/max-score-for-progess-fix
Fix progress page max_score scoring issue
2 parents 08137ee + b5f219a commit 428b0d0

File tree

4 files changed

+20
-1
lines changed

4 files changed

+20
-1
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

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def run_tests(self):
4545

4646
setup(
4747
name='xblock-submit-and-compare',
48-
version='0.5',
48+
version='0.5.1',
4949
description='Submit and Compare XBlock for self assessment',
5050
packages=[
5151
'submit_and_compare',

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)