Commit e4c06fab by Calen Pennington

Cleaning up ABTest properties

parent 9bd42278
...@@ -39,13 +39,15 @@ class ABTestModule(XModule): ...@@ -39,13 +39,15 @@ class ABTestModule(XModule):
group_portions = Object(help="What proportions of students should go in each group", default={DEFAULT: 1}, scope=Scope.content) group_portions = Object(help="What proportions of students should go in each group", default={DEFAULT: 1}, scope=Scope.content)
group_assignments = Object(help="What group this user belongs to", scope=Scope.student_preferences, default={}) group_assignments = Object(help="What group this user belongs to", scope=Scope.student_preferences, default={})
group_content = Object(help="What content to display to each group", scope=Scope.content, default={DEFAULT: []}) group_content = Object(help="What content to display to each group", scope=Scope.content, default={DEFAULT: []})
experiment = String(help="Experiment that this A/B test belongs to", scope=Scope.content)
has_children = True
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
XModule.__init__(self, *args, **kwargs) XModule.__init__(self, *args, **kwargs)
if self.group is None: if self.group is None:
self.group = group_from_value( self.group = group_from_value(
self.group_portions, self.group_portions.items(),
random.uniform(0, 1) random.uniform(0, 1)
) )
...@@ -80,6 +82,7 @@ class ABTestDescriptor(RawDescriptor, XmlDescriptor): ...@@ -80,6 +82,7 @@ class ABTestDescriptor(RawDescriptor, XmlDescriptor):
experiment = String(help="Experiment that this A/B test belongs to", scope=Scope.content) experiment = String(help="Experiment that this A/B test belongs to", scope=Scope.content)
group_portions = Object(help="What proportions of students should go in each group", default={}) group_portions = Object(help="What proportions of students should go in each group", default={})
group_content = Object(help="What content to display to each group", scope=Scope.content, default={DEFAULT: []}) group_content = Object(help="What content to display to each group", scope=Scope.content, default={DEFAULT: []})
has_children = True
@classmethod @classmethod
def definition_from_xml(cls, xml_object, system): def definition_from_xml(cls, xml_object, system):
......
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