From 9d822fc359d068509ecdcfcc91326a3aab7ac887 Mon Sep 17 00:00:00 2001 From: Calen Pennington Date: Tue, 18 Dec 2012 11:35:55 -0500 Subject: [PATCH] Make sequences record whether they have been visited or not (done somewhat implicitly now, would be nice to be more explicit) --- common/lib/xmodule/xmodule/seq_module.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/common/lib/xmodule/xmodule/seq_module.py b/common/lib/xmodule/xmodule/seq_module.py index a136473653..3fc3a5dbaa 100644 --- a/common/lib/xmodule/xmodule/seq_module.py +++ b/common/lib/xmodule/xmodule/seq_module.py @@ -37,7 +37,7 @@ class SequenceModule(XModule): # NOTE: Position is 1-indexed. This is silly, but there are now student # positions saved on prod, so it's not easy to fix. - position = Int(help="Last tab viewed in this sequence", default=1, scope=Scope.student_state) + position = Int(help="Last tab viewed in this sequence", scope=Scope.student_state) def __init__(self, *args, **kwargs): XModule.__init__(self, *args, **kwargs) @@ -46,6 +46,13 @@ class SequenceModule(XModule): if self.system.get('position'): self.position = int(self.system.get('position')) + # Default to the first child + # Don't set 1 as the default in the property definition, because + # there is code that looks for the existance of the position value + # to determine if the student has visited the sequence before or not + if self.position is None: + self.position = 1 + self.rendered = False def get_instance_state(self):