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

This commit is contained in:
Victor Shnayder
2013-02-14 13:24:21 -05:00
parent d7f9bdda66
commit 1108137dc3
2 changed files with 13 additions and 19 deletions

View File

@@ -112,14 +112,9 @@ class FolditDescriptor(XmlDescriptor, EditingDescriptor):
js = {'coffee': [resource_string(__name__, 'js/src/html/edit.coffee')]}
js_module_name = "HTMLEditingDescriptor"
@property
def always_recalculate_grades(self):
"""
The grade changes without any student interaction with the edx website,
so always need to actually check.
"""
return True
# The grade changes without any student interaction with the edx website,
# so always need to actually check.
always_recalculate_grades = True
@classmethod
def definition_from_xml(cls, xml_object, system):

View File

@@ -515,6 +515,16 @@ class XModuleDescriptor(Plugin, HTMLSnippet, ResourceTemplates):
self._child_instances = None
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
def display_name(self):
'''
@@ -645,17 +655,6 @@ class XModuleDescriptor(Plugin, HTMLSnippet, ResourceTemplates):
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 ===========================
@staticmethod
def load_from_json(json_data, system, default_class=None):