Commit 8a180744 by polesye

Fix LTI max_score method.

parent 62a25824
...@@ -375,7 +375,7 @@ oauth_consumer_key="", oauth_signature="frVp4JuvT1mVXlxktiAUjQ7%2F1cw%3D"'} ...@@ -375,7 +375,7 @@ oauth_consumer_key="", oauth_signature="frVp4JuvT1mVXlxktiAUjQ7%2F1cw%3D"'}
return params return params
def max_score(self): def max_score(self):
return self.weight return self.weight if self.graded else 0
@XBlock.handler @XBlock.handler
......
...@@ -249,3 +249,13 @@ class LTIModuleTest(LogicTest): ...@@ -249,3 +249,13 @@ class LTIModuleTest(LogicTest):
def test_client_key_secret(self): def test_client_key_secret(self):
pass pass
def test_max_score(self):
self.xmodule.weight = 100.0
self.xmodule.graded = True
self.assertEqual(self.xmodule.max_score(), 100)
self.xmodule.graded = False
self.assertEqual(self.xmodule.max_score(), 0)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment