Commit 115cae1f by Piotr Mitros

Added LMS magic

parent 92e6ae6b
...@@ -26,6 +26,8 @@ class DoneXBlock(XBlock): ...@@ -26,6 +26,8 @@ class DoneXBlock(XBlock):
default = "left" default = "left"
) )
has_score = True
def resource_string(self, path): def resource_string(self, path):
"""Handy helper for getting resources from our kit.""" """Handy helper for getting resources from our kit."""
data = pkg_resources.resource_string(__name__, path) data = pkg_resources.resource_string(__name__, path)
...@@ -78,3 +80,41 @@ class DoneXBlock(XBlock): ...@@ -78,3 +80,41 @@ class DoneXBlock(XBlock):
</vertical_demo> </vertical_demo>
"""), """),
] ]
## Everything below is stolen from https://github.com/edx/edx-ora2/blob/master/apps/openassessment/xblock/lms_mixin.py
## It's needed to keep the LMS+Studio happy.
## It should be included as a mixin.
display_name = String(
default="Completion", scope=Scope.settings,
help="Display name"
)
start = DateTime(
default=None, scope=Scope.settings,
help="ISO-8601 formatted string representing the start date of this assignment. We ignore this."
)
due = DateTime(
default=None, scope=Scope.settings,
help="ISO-8601 formatted string representing the due date of this assignment. We ignore this."
)
weight = Float(
display_name="Problem Weight",
help=("Defines the number of points each problem is worth. "
"If the value is not set, the problem is worth the sum of the "
"option point values."),
values={"min": 0, "step": .1},
scope=Scope.settings
)
def has_dynamic_children(self):
"""Do we dynamically determine our children? No, we don't have any.
"""
return False
def max_score(self):
"""The maximum raw score of our problem.
"""
return 1
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