Commit 1108137d by Victor Shnayder

Address Cale's comment--make property a simple class var

parent d7f9bdda
...@@ -112,14 +112,9 @@ class FolditDescriptor(XmlDescriptor, EditingDescriptor): ...@@ -112,14 +112,9 @@ class FolditDescriptor(XmlDescriptor, EditingDescriptor):
js = {'coffee': [resource_string(__name__, 'js/src/html/edit.coffee')]} js = {'coffee': [resource_string(__name__, 'js/src/html/edit.coffee')]}
js_module_name = "HTMLEditingDescriptor" js_module_name = "HTMLEditingDescriptor"
@property # The grade changes without any student interaction with the edx website,
def always_recalculate_grades(self): # so always need to actually check.
""" always_recalculate_grades = True
The grade changes without any student interaction with the edx website,
so always need to actually check.
"""
return True
@classmethod @classmethod
def definition_from_xml(cls, xml_object, system): def definition_from_xml(cls, xml_object, system):
......
...@@ -515,6 +515,16 @@ class XModuleDescriptor(Plugin, HTMLSnippet, ResourceTemplates): ...@@ -515,6 +515,16 @@ class XModuleDescriptor(Plugin, HTMLSnippet, ResourceTemplates):
self._child_instances = None self._child_instances = None
self._inherited_metadata = set() self._inherited_metadata = set()
# Class level variable
always_recalculate_grades = False
"""
Return whether this descriptor always requires recalculation of grades, for
example if the score can change via an extrnal service, not just when the
student interacts with the module on the page. A specific example is
FoldIt, which posts grade-changing updates through a separate API.
"""
@property @property
def display_name(self): def display_name(self):
''' '''
...@@ -645,17 +655,6 @@ class XModuleDescriptor(Plugin, HTMLSnippet, ResourceTemplates): ...@@ -645,17 +655,6 @@ class XModuleDescriptor(Plugin, HTMLSnippet, ResourceTemplates):
return False return False
@property
def always_recalculate_grades(self):
"""
Return whether this descriptor always requires recalculation of grades,
for example if the score can change via an extrnal service, not just
when the student interacts with the module on the page. A specific
example is FoldIt, which posts grade-changing updates through a separate
API.
"""
return False
# ================================= JSON PARSING =========================== # ================================= JSON PARSING ===========================
@staticmethod @staticmethod
def load_from_json(json_data, system, default_class=None): def load_from_json(json_data, system, default_class=None):
......
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