Make user profiles work again after the switch to an XMLModuleStore. Staff user histograms are still broken

This commit is contained in:
Calen Pennington
2012-06-28 13:08:09 -04:00
parent 5cd388d638
commit 23195e9d76
10 changed files with 133 additions and 162 deletions

View File

@@ -88,8 +88,5 @@ class Module(XModule):
def get_children(self):
return [self.module_from_xml(child) for child in self._xml_children()]
def rendered_children(self):
return [self.render_function(child) for child in self._xml_children()]
def get_html(self):
return '\n'.join(child.get_html() for child in self.get_children())

View File

@@ -229,7 +229,13 @@ class CapaModule(XModule):
# TODO: Should be: self.filename=only_one(dom2.xpath('/problem/@filename'))
self.filename = "problems/" + only_one(dom2.xpath('/problem/@filename')) + ".xml"
self.name = only_one(dom2.xpath('/problem/@name'))
self.weight = only_one(dom2.xpath('/problem/@weight'))
weight_string = only_one(dom2.xpath('/problem/@weight'))
if weight_string:
self.weight = float(weight_string)
else:
self.weight = 1
if self.rerandomize == 'never':
seed = 1
elif self.rerandomize == "per_student" and hasattr(system, 'id'):

View File

@@ -50,7 +50,6 @@ class VideoModule(XModule):
'id': self.location.html_id(),
'position': self.position,
'name': self.name,
'annotations': self.annotations,
})
def __init__(self, system, location, definition, instance_state=None, shared_state=None, **kwargs):
@@ -65,9 +64,6 @@ class VideoModule(XModule):
if 'position' in state:
self.position = int(float(state['position']))
self.annotations = [(e.get("name"), self.render_function(e)) \
for e in xmltree]
class VideoDescriptor(RawDescriptor):
module_class = VideoModule

View File

@@ -83,6 +83,7 @@ class XModule(object):
self.id = self.location.url()
self.name = self.location.name
self.display_name = kwargs.get('display_name', '')
self.type = self.location.category
self._loaded_children = None
def get_name(self):