Skip to content

Commit

Permalink
Merge pull request #12 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 c3a802d + 88adfd4 commit d9b4461
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
10 changes: 10 additions & 0 deletions freetextresponse/freetextresponse.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,16 @@ def student_view(self, context=None):
)
return fragment

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

@classmethod
def _generate_validation_message(cls, msg):
"""
Expand Down
8 changes: 8 additions & 0 deletions freetextresponse/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,14 @@ def test_student_view(self):
student_view_html
)

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())

def test_studio_view(self):
"""
Checks studio view for instance variables specified by the instructor.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def run_tests(self):

setup(
name="xblock-free-text-response",
version="0.1.1",
version="0.1.2",
description="Enables instructors to create questions with free-text responses.",
license='AGPL-3.0',
packages=[
Expand Down

0 comments on commit d9b4461

Please sign in to comment.