From af20d0f7d2788147e955dbb9d573ad77a1c01794 Mon Sep 17 00:00:00 2001 From: aarif Date: Thu, 3 Oct 2019 15:52:52 +0500 Subject: [PATCH] Updated the comparison operation to fix None comparison with integer --- common/lib/xmodule/xmodule/randomize_module.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/lib/xmodule/xmodule/randomize_module.py b/common/lib/xmodule/xmodule/randomize_module.py index 2a5fdf9203..41d716dc3a 100644 --- a/common/lib/xmodule/xmodule/randomize_module.py +++ b/common/lib/xmodule/xmodule/randomize_module.py @@ -44,7 +44,7 @@ class RandomizeModule(RandomizeFields, XModule): # NOTE: calling self.get_children() doesn't work until we've picked a choice num_choices = len(self.descriptor.get_children()) - if self.choice > num_choices: + if self.choice is not None and self.choice > num_choices: # Oops. Children changed. Reset. self.choice = None