Commit f1a8e07e by Justin Riley

fix choice reset when children/choices change

parent 7d351a0e
...@@ -57,10 +57,9 @@ class RandomizeModule(RandomizeFields, XModule): ...@@ -57,10 +57,9 @@ class RandomizeModule(RandomizeFields, XModule):
return v.lower() == 'true' return v.lower() == 'true'
def pick_choice(self, use_randrange=None, no_repeats=None): def pick_choice(self, use_randrange=None, no_repeats=None):
children = [c.location.url() for c in self.descriptor.get_children()]
choices = self.get_choices(no_repeats=no_repeats) choices = self.get_choices(no_repeats=no_repeats)
num_choices = len(choices) num_choices = len(choices)
if self.choice is not None and self.choice not in children: if self.choice is not None and self.choice not in choices:
# Children changed. Reset. # Children changed. Reset.
self.choice = None self.choice = 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