Index: lams_flash/src/central/flash/org/lamsfoundation/lams/learner/ls/LessonModel.as =================================================================== diff -u -read34e1c52dff95000dba4f8d26e050af854491a -r671c1333c43faa197288fc20e38713d7b70110e3 --- lams_flash/src/central/flash/org/lamsfoundation/lams/learner/ls/LessonModel.as (.../LessonModel.as) (revision ead34e1c52dff95000dba4f8d26e050af854491a) +++ lams_flash/src/central/flash/org/lamsfoundation/lams/learner/ls/LessonModel.as (.../LessonModel.as) (revision 671c1333c43faa197288fc20e38713d7b70110e3) @@ -427,10 +427,14 @@ } public function checkComplexHasCurrentActivity(a:Activity, learner:Progress):Boolean { + Debugger.log("learner current: " + learner.getCurrentActivityId(), Debugger.CRITICAL, "checkComplexHasCurrentActivity", "LessonModel"); + var cChildren:Array = learningDesignModel.getComplexActivityChildren(a.activityUIID); if(cChildren.length > 0) { for(var i=0; i 0) { MovieClipUtils.doLater(Function(delegates.shift())); } else { - MovieClipUtils.doLater(Proxy.create(this, draw, checkIfSequenceActive)); + MovieClipUtils.doLater(Proxy.create(this, draw, Proxy.create(this, checkIfSequenceActive))) return; } MovieClipUtils.doLater(Proxy.create(this, clearDelegates)); } - private function createChildren(children:Array, index:Number):Void { + private function createChildren(_children:Array, index:Number):Void { - var rIndex:Number = drawChildren(children, index); + var rIndex:Number = drawChildren(_children, index); - if(rIndex != null) delegates.push(Proxy.create(this, createChildren, children, rIndex)); - + if(rIndex != null) delegates.push(Proxy.create(this, createChildren, _children, rIndex)); + return; } - private function drawChildren(children:Array, index:Number):Number { + private function drawChildren(_children:Array, index:Number):Number { var childCoordY:Number = 0; - Debugger.log("draw children: " + children.length + " :: index: " + index, Debugger.CRITICAL, "drawChildren", "LearnerComplexActivity"); + Debugger.log("draw children: " + _children.length + " :: index: " + index, Debugger.CRITICAL, "drawChildren", "LearnerComplexActivity"); var _idx=0; if(index != null) _idx = index; - for(var i=_idx; i 0) childCoordY = (children_mc[children_mc.length-1] instanceof LearnerComplexActivity) ? children_mc[children_mc.length-1]._y + children_mc[children_mc.length-1].getChildrenHeight() : children_mc[children_mc.length-1]._y + 21; // (count*21); - - //if(children_mc[children_mc.length-1].activity.activityUIID == children[i].activityUIID) - // return null; Debugger.log("progStatus: " + progStatus, Debugger.CRITICAL, "drawChildren", "LearnerComplexActivity"); Debugger.log("childCoordY: " + childCoordY, Debugger.CRITICAL, "drawChildren", "LearnerComplexActivity"); - learnerAct = LearnerActivity(childHolder_mc.createChildAtDepth("LearnerActivity_forComplex", childHolder_mc.getNextHighestDepth(), {_activity:children[i], _controller:_controller, _view:_view, learner:learner, actStatus:progStatus, _complex:true, xPos:this._x, yPos:childCoordY})); + learnerAct = LearnerActivity(childHolder_mc.createChildAtDepth("LearnerActivity_forComplex", childHolder_mc.getNextHighestDepth(), {_activity:_children[i], _controller:_controller, _view:_view, learner:learner, actStatus:progStatus, _complex:true, xPos:this._x, yPos:childCoordY})); Debugger.log('attaching child movieL ' + learnerAct,Debugger.CRITICAL,'drawChildren','LearnerComplexActivity'); @@ -222,12 +226,12 @@ Debugger.log('x: ' + learnerAct._x + ' y: ' + learnerAct._y, Debugger.CRITICAL, 'drawChildren', 'LearnerComplexActivity'); - var parentAct:Activity = (model instanceof LessonModel) ? model.learningDesignModel.getActivityByUIID(Activity(children[i]).parentUIID) : model.ddm.getActivityByUIID(Activity(children[i]).parentUIID); + var parentAct:Activity = (model instanceof LessonModel) ? model.learningDesignModel.getActivityByUIID(Activity(_children[i]).parentUIID) : model.ddm.getActivityByUIID(Activity(_children[i]).parentUIID); if((activity.isBranchingActivity() && parentAct.isSequenceActivity()) || (activity.isOptionsWithSequencesActivity() && parentAct.isSequenceActivity())) { /** TODO: Use for Sequence in Optional */ learnerAct.lineTopVisible = (i != 0) ? false : true; - learnerAct.lineBottomVisible = (i == children.length-1) ? true : false; + learnerAct.lineBottomVisible = (i == _children.length-1) ? true : false; } children_mc.push(learnerAct); @@ -250,30 +254,32 @@ return i+1; } } else if(learnerAct.activity == activeComplex) { - var _children:Array = (model instanceof LessonModel) ? model.learningDesignModel.getComplexActivityChildren(activeComplex.activityUIID) : model.ddm.getComplexActivityChildren(activeComplex.activityUIID); - Debugger.log("children length: " + _children.length, Debugger.CRITICAL, "drawChildren", "LearnerComplexActivity"); + var _cChildren:Array = (model instanceof LessonModel) ? model.learningDesignModel.getComplexActivityChildren(activeComplex.activityUIID) : model.ddm.getComplexActivityChildren(activeComplex.activityUIID); + Debugger.log("children length: " + _cChildren.length, Debugger.CRITICAL, "drawChildren", "LearnerComplexActivity"); - learnerAct = LearnerComplexActivity(childHolder_mc.createChildAtDepth("LearnerComplexActivity_Nested", DepthManager.kTop, {_activity:children[i], _children:_children, _controller:_controller, _view:_view, learner:learner, actStatus:progStatus, _nested:true, _level: _level+1, _x:0, _y:childCoordY+21})); + learnerAct = LearnerComplexActivity(childHolder_mc.createChildAtDepth("LearnerComplexActivity_Nested", DepthManager.kTop, {_activity:_children[i], _children:_cChildren, _controller:_controller, _view:_view, learner:learner, actStatus:progStatus, _nested:true, _level: _level+1, _x:0, _y:childCoordY+21})); children_mc.push(learnerAct); return i+1; } } + Debugger.log("children_mc length: " + children_mc.length, Debugger.CRITICAL, "drawChildren", "LearnerComplexActivity"); + return null; } private function drawActiveBranch(learnerAct:LearnerActivity):Void { - var children:Array = model.ddm.getComplexActivityChildren(learnerAct.activity.activityUIID); + var _cChildren:Array = model.ddm.getComplexActivityChildren(learnerAct.activity.activityUIID); - for(var i=0; i