Index: lams_flash/src/common/flash/org/lamsfoundation/lams/common/LearnerComplexActivity.as =================================================================== diff -u -read34e1c52dff95000dba4f8d26e050af854491a -r53e2ed3169bf5d20083e7ffdd9e24e8ed88bdaa9 --- lams_flash/src/common/flash/org/lamsfoundation/lams/common/LearnerComplexActivity.as (.../LearnerComplexActivity.as) (revision ead34e1c52dff95000dba4f8d26e050af854491a) +++ lams_flash/src/common/flash/org/lamsfoundation/lams/common/LearnerComplexActivity.as (.../LearnerComplexActivity.as) (revision 53e2ed3169bf5d20083e7ffdd9e24e8ed88bdaa9) @@ -154,7 +154,7 @@ childrenArray = _children; } - createChildren(childrenArray, children_mc); + createChildren(childrenArray); clearDelegates(); childHolder_mc._visible = (!_nested) ? false : true; @@ -175,18 +175,20 @@ MovieClipUtils.doLater(Proxy.create(this, clearDelegates)); } - private function createChildren(children:Array, container:Array, callback:Function, index:Number):Void { + private function createChildren(children:Array, index:Number):Void { - var rIndex:Number = drawChildren(children, container, index); + var rIndex:Number = drawChildren(children, index); - if(rIndex != null) delegates.push(Proxy.create(this, createChildren, children, container, callback, rIndex)); + if(rIndex != null) delegates.push(Proxy.create(this, createChildren, children, rIndex)); return; } - private function drawChildren(children:Array, container: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"); + var _idx=0; if(index != null) _idx = index; @@ -195,11 +197,14 @@ var progStatus:String = Progress.compareProgressData(learner, children[i].activityID); - Debugger.log("container length: " + container.length, Debugger.CRITICAL, "drawChildren", "LearnerComplexActivity"); + Debugger.log("children_mc length: " + children_mc.length, Debugger.CRITICAL, "drawChildren", "LearnerComplexActivity"); - if(container.length > 0) - childCoordY = (container[container.length-1] instanceof LearnerComplexActivity) ? container[container.length-1]._y + container[container.length-1].getChildrenHeight() : container[container.length-1]._y + 21; // (count*21); + if(children_mc.length > 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"); @@ -208,8 +213,8 @@ Debugger.log('attaching child movieL ' + learnerAct,Debugger.CRITICAL,'drawChildren','LearnerComplexActivity'); //set the positioning co-ords - if(container.length > 0) - learnerAct._y = (container[container.length-1].nested) ? container[container.length-1]._y + container[container.length-1].getChildrenHeight() : container[container.length-1]._y + 21; + if(children_mc.length > 0) + learnerAct._y = (children_mc[children_mc.length-1].nested) ? children_mc[children_mc.length-1]._y + children_mc[children_mc.length-1].getChildrenHeight() : children_mc[children_mc.length-1]._y + 21; else learnerAct._y = 0; @@ -225,12 +230,12 @@ learnerAct.lineBottomVisible = (i == children.length-1) ? true : false; } - container.push(learnerAct); + children_mc.push(learnerAct); if(learnerAct.activity == activeSequence) { if(activeSequence.firstActivityUIID != null) { var actOrder:Array = model.getDesignOrder(activeSequence.firstActivityUIID, true); - createChildren(actOrder, container, null, null, false); + createChildren(actOrder, null); return i+1; } @@ -239,7 +244,7 @@ if(learnerAct.isAttempted || learnerAct.isCompleted) { if(!isLearnerModule()) { - drawActiveBranch(learnerAct, container); + drawActiveBranch(learnerAct); } return i+1; @@ -249,7 +254,7 @@ Debugger.log("children length: " + _children.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})); - container.push(learnerAct); + children_mc.push(learnerAct); return i+1; } @@ -260,7 +265,7 @@ } - private function drawActiveBranch(learnerAct:LearnerActivity, container:Array):Void { + private function drawActiveBranch(learnerAct:LearnerActivity):Void { var children:Array = model.ddm.getComplexActivityChildren(learnerAct.activity.activityUIID); for(var i=0; i