Skip to content

Commit

Permalink
Merge pull request #18 from caseylitton/max-score-for-progess-fix
Browse files Browse the repository at this point in the history
Fix progress page max_score scoring issue
  • Loading branch information
caseylitton authored Feb 13, 2017
2 parents 08137ee + b5f219a commit 428b0d0
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
*.egg-info/
*.pyc
*.sw[op]
coverage.xml
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def run_tests(self):

setup(
name='xblock-submit-and-compare',
version='0.5',
version='0.5.1',
description='Submit and Compare XBlock for self assessment',
packages=[
'submit_and_compare',
Expand Down
10 changes: 10 additions & 0 deletions submit_and_compare/submit_and_compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,16 @@ def studio_view(self, context=None):
frag.initialize_js('SubmitAndCompareXBlockInitEdit')
return frag

def max_score(self):
"""
Returns the configured number of possible points for this component.
Arguments:
None
Returns:
float: The number of possible points for this component
"""
return self.weight

@XBlock.json_handler
def student_submit(self, submissions, suffix=''):
# pylint: disable=unused-argument
Expand Down
8 changes: 8 additions & 0 deletions submit_and_compare/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,3 +191,11 @@ def test_submit_class_nodisplay(self):
self.xblock.max_attempts = 5
self.xblock.count_attempts = 6
self.assertEquals('nodisplay', self.xblock._get_submit_class())

def test_max_score(self):
"""
Tests max_score function
Should return the weight
"""
self.xblock.weight = 4
self.assertEquals(self.xblock.weight, self.xblock.max_score())

0 comments on commit 428b0d0

Please sign in to comment.