Commit 9d822fc3 by Calen Pennington

Make sequences record whether they have been visited or not (done somewhat…

Make sequences record whether they have been visited or not (done somewhat implicitly now, would be nice to be more explicit)
parent f3032ba7
...@@ -37,7 +37,7 @@ class SequenceModule(XModule): ...@@ -37,7 +37,7 @@ class SequenceModule(XModule):
# NOTE: Position is 1-indexed. This is silly, but there are now student # NOTE: Position is 1-indexed. This is silly, but there are now student
# positions saved on prod, so it's not easy to fix. # 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): def __init__(self, *args, **kwargs):
XModule.__init__(self, *args, **kwargs) XModule.__init__(self, *args, **kwargs)
...@@ -46,6 +46,13 @@ class SequenceModule(XModule): ...@@ -46,6 +46,13 @@ class SequenceModule(XModule):
if self.system.get('position'): if self.system.get('position'):
self.position = int(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 self.rendered = False
def get_instance_state(self): def get_instance_state(self):
......
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