Index: lams_flash/src/central/flash/org/lamsfoundation/lams/learner/Application.as =================================================================== diff -u -r8e4fc8d67f4733b5b989e9baf079daa75832193d -r691459c3a8be6d76fa38516c01f9bb1e0add7e86 --- lams_flash/src/central/flash/org/lamsfoundation/lams/learner/Application.as (.../Application.as) (revision 8e4fc8d67f4733b5b989e9baf079daa75832193d) +++ lams_flash/src/central/flash/org/lamsfoundation/lams/learner/Application.as (.../Application.as) (revision 691459c3a8be6d76fa38516c01f9bb1e0add7e86) @@ -92,8 +92,7 @@ private static var _instance:Application = null; private var _container_mc:MovieClip; //Main container private var _tooltipContainer_mc:MovieClip; //Tooltip container - private var _debugDialog:MovieClip; //Reference to the debug dialog - + private var _debugDialog:MovieClip; //Reference to the debug dialog /** * Application - Constructor @@ -105,8 +104,7 @@ _headerLoaded = false; _scratchpadLoaded = false; - _module = Application.MODULE; - + _module = Application.MODULE; } /** @@ -115,7 +113,8 @@ public static function getInstance():Application{ if(Application._instance == null){ Application._instance = new Application(); - } + } + return Application._instance; } @@ -138,7 +137,6 @@ //Assign the config load event to _config.addEventListener('load',Delegate.create(this,configLoaded)); - Key.addListener(this); } @@ -165,14 +163,13 @@ _dictionary = Dictionary.getInstance(); _dictionary.addEventListener('load',Delegate.create(this,onDictionaryLoad)); _dictionary.load(language); - - //Set reference to StyleManager and load Themes and setup load handler. var theme:String = String(_config.getItem('theme')); _themeManager = ThemeManager.getInstance(); _themeManager.addEventListener('load',Delegate.create(this,onThemeLoad)); _themeManager.loadTheme(theme); + Debugger.getInstance().crashDumpSeverityLevel = Number(_config.getItem('crashDumpSeverityLevelLog')); Debugger.getInstance().severityLevel = Number(_config.getItem('severityLevelLog')); @@ -193,13 +190,10 @@ setupUI(); checkUILoaded(); - } else if(_dataLoadCheckCount >= DATA_LOAD_CHECK_TIMEOUT_COUNT) { Debugger.log('reached timeout waiting for data to load.',Debugger.CRITICAL,'checkDataLoaded','Application'); clearInterval(_DataLoadCheckIntervalID); - - } } } @@ -314,8 +308,6 @@ Header(_header_mc).resize(w); _lesson.setSize(w,h-(LESSON_Y+_lesson.model.getSpadHeight())); - //Property Inspector - //_pi_mc.setSize(w-_toolkit.width,_pi_mc._height) _scratchpad_mc._y = h - _lesson.model.getSpadHeight(); } Index: lams_flash/src/central/flash/org/lamsfoundation/lams/learner/ls/Lesson.as =================================================================== diff -u -r9aab591f71aa913ad9b848d8cd406728c171470b -r691459c3a8be6d76fa38516c01f9bb1e0add7e86 --- lams_flash/src/central/flash/org/lamsfoundation/lams/learner/ls/Lesson.as (.../Lesson.as) (revision 9aab591f71aa913ad9b848d8cd406728c171470b) +++ lams_flash/src/central/flash/org/lamsfoundation/lams/learner/ls/Lesson.as (.../Lesson.as) (revision 691459c3a8be6d76fa38516c01f9bb1e0add7e86) @@ -185,11 +185,9 @@ lessonModel.setActive(); getURL(_root.serverURL + 'learning'+String(pkt)+'?lessonID='+lessonModel.getLessonID(),'contentFrame'); - // check was successful join getFlashProgress(); - } public function moveToActivity(fromAct, toAct){ Index: lams_flash/src/central/flash/org/lamsfoundation/lams/learner/ls/LessonModel.as =================================================================== diff -u -re7c09cb004a9982fc2e56acda769e7a5df38b8b2 -r691459c3a8be6d76fa38516c01f9bb1e0add7e86 --- lams_flash/src/central/flash/org/lamsfoundation/lams/learner/ls/LessonModel.as (.../LessonModel.as) (revision e7c09cb004a9982fc2e56acda769e7a5df38b8b2) +++ lams_flash/src/central/flash/org/lamsfoundation/lams/learner/ls/LessonModel.as (.../LessonModel.as) (revision 691459c3a8be6d76fa38516c01f9bb1e0add7e86) @@ -307,7 +307,7 @@ return _active; } - private function orderDesign(activity:Activity, order:Array):Void{ + private function orderDesign(activity:Activity, order:Array):Boolean{ Debugger.log("order design activity: " + activity.title, Debugger.CRITICAL, "orderDesign", "LessonModel"); order.push(activity); @@ -321,9 +321,11 @@ for(var i=0; i 0 || ddm_activity.parentUIID > 0) { if(_learningDesignModel.getActivityByUIID(ddm_activity.parentUIID).isSequenceActivity()) broadcastViewUpdate("DRAW_ACTIVITY", ddm_activity); - return; } else { broadcastViewUpdate("DRAW_ACTIVITY",ddm_activity); } @@ -438,8 +422,11 @@ public function updateDesign(){ var indexArray:Array = setDesignOrder(); - if(indexArray.length > activitiesDisplayed.length) { - removeAllActivities(indexArray); + Debugger.log("indexArray length: " + indexArray.length, Debugger.CRITICAL, "updateDesign", "LessonModel"); + Debugger.log("activitiesDisplayed length: " + activitiesDisplayed.size(), Debugger.CRITICAL, "updateDesign", "LessonModel"); + + if(indexArray.length > activitiesDisplayed.size()) { + broadcastViewUpdate("REMOVE_ACTIVITY_ALL"); } //go through the design and get the activities and transitions @@ -457,19 +444,12 @@ if(ddm_activity.parentActivityID > 0 || ddm_activity.parentUIID > 0){ if(_learningDesignModel.getActivityByUIID(ddm_activity.parentUIID).isSequenceActivity()) broadcastViewUpdate("UPDATE_ACTIVITY",ddm_activity); - return; } else { broadcastViewUpdate("UPDATE_ACTIVITY",ddm_activity); } } } - private function removeAllActivities(indexArray:Array):Void { - for(var i=0; i < indexArray.length; i++) { - broadcastViewUpdate("REMOVE_ACTIVITY", _learningDesignModel.getActivityByUIID(indexArray[i].activityUIID)); - } - } - public function broadcastViewUpdate(updateType, data){ setChanged(); Index: lams_flash/src/central/flash/org/lamsfoundation/lams/learner/ls/LessonView.as =================================================================== diff -u -re7c09cb004a9982fc2e56acda769e7a5df38b8b2 -r691459c3a8be6d76fa38516c01f9bb1e0add7e86 --- lams_flash/src/central/flash/org/lamsfoundation/lams/learner/ls/LessonView.as (.../LessonView.as) (revision e7c09cb004a9982fc2e56acda769e7a5df38b8b2) +++ lams_flash/src/central/flash/org/lamsfoundation/lams/learner/ls/LessonView.as (.../LessonView.as) (revision 691459c3a8be6d76fa38516c01f9bb1e0add7e86) @@ -70,14 +70,12 @@ private var ACT_X:Number = -20; private static var ACT_X_OFFSET:Number = 65; private var ACT_Y:Number = 32.5; - //These are defined so that the compiler can 'see' the events that are added at runtime by EventDispatcher private var dispatchEvent:Function; public var addEventListener:Function; public var removeEventListener:Function; - /** * Constructor */ @@ -151,21 +149,21 @@ case 'REMOVE_ACTIVITY' : removeActivity(infoObj.data, lm); break; + case 'REMOVE_ACTIVITY_ALL' : + removeAll(lm); + break; case 'LESSON' : - trace('setting lesson name'); setLessonName(lm.name); Application.getInstance().getHeader().showExportButton(lm.learnerExportAvailable); break; case 'DESIGNMODEL' : - trace('updating design model for lesson..'); lm.getLesson().finishedDesign = true; break; case 'PROGRESS' : Debugger.log('progress data receieved for user..' + lm.progressData.getUserName(),Debugger.CRITICAL,'update','org.lamsfoundation.lams.LessonView'); break; case 'PROGRESS_UPDATE' : Debugger.log('progress data receieved for user..' + lm.progressData.getUserName(),Debugger.CRITICAL,'update','org.lamsfoundation.lams.LessonView'); - //removeAll(lm); lm.updateDesign(); break; case 'CLOSE_COMPLEX_ACTIVITY' : @@ -181,6 +179,7 @@ if (lessonName.length > LESSON_NAME_LENGTH_LIMIT){ lessonName = lessonName.substr(0, LESSON_NAME_LENGTH_LIMIT)+STRING_CONT; } + Application.getInstance().getHeader().setLessonName(lessonName); } @@ -199,7 +198,9 @@ } - private function removeAll(lm:LessonModel){ + public function removeAll(lm:LessonModel){ + Debugger.log("removin all", Debugger.CRITICAL, "removeAll", "LessonView"); + var keys = lm.activitiesDisplayed.keys(); for(var i=0; i 19){ toolTitle = toolTitle.substr(0, 17)+"..." - } - //} - //else { - //if(_activity.activityTypeID == Activity.OPTIONAL_ACTIVITY_TYPE){ - //title_lbl.text = 'Optional Activities'; - //containerPanelHeader.title_lbl.text = 'Optional Activities'; - //} else { - //title_lbl.text = 'Parallel Activities'; - //containerPanelHeader.title_lbl.text = 'Parallel Activities'; - //} - //} + } + title_lbl.text = toolTitle; containerPanelHeader.title_lbl.text = toolTitle; - container_pnl.setStyle ("backgroundColor", 0x4289FF); + container_pnl.setStyle("backgroundColor", 0x4289FF); //position the container (this) - container_pnl._height = 16+(numOfChildren * 21); + container_pnl._height = 16 + (numOfChildren * 21); - Debugger.log ("I am in Draw :" + _activity.title + 'uiID:' + _activity.activityUIID + ' children:' + _children.length, Debugger.GEN, 'Draw', 'LearnerOptionalActivity'); _visible = true; } @@ -260,12 +312,13 @@ var Xpos = appData.compX+ this._x - 10; var Ypos = appData.compY+( (this._y+btnObj._height)-4); var ttHolder = appData.ttHolder; - trace("x pos: "+Xpos+" and y pos: "+Ypos+" and tt holder is: "+ttHolder) + if (btnTT == undefined || btnTT == null || btnTT == "" || btnTT == "undefined"){ var ttMessage = ""+ _activity.title+"" }else { var ttMessage = ""+ _activity.title+" \n"+Dictionary.getValue(btnTT); } + var ttWidth = 140; _tip.DisplayToolTip(ttHolder, ttMessage, Xpos, Ypos, undefined, ttWidth); @@ -276,41 +329,44 @@ } private function localOnRollOver(){ - if (actStatus == "completed_mc"){ + if(isCompleted){ showToolTip(this.clickTarget_mc, "completed_act_tooltip"); - }else if (actStatus == "current_mc"){ + } else if(isCurrent){ showToolTip(this.clickTarget_mc, "current_act_tooltip"); - }else if (actStatus == "attempted_mc"){ + } else if(isAttempted){ showToolTip(this.clickTarget_mc, "current_act_tooltip"); - }else { - if (String(_activity.title).length > 19){ + } else { + if(String(_activity.title).length > 19){ showToolTip(this.clickTarget_mc, "undefined"); } } } private function localOnRollOut(){ - hideToolTip(); } private function localOnPress():Void{ hideToolTip(); + this.swapDepths(this._parent.getNextHighestDepth()); // check double-click + var now : Number = new Date ().getTime (); if ((now - _dcStartTime) <= Config.DOUBLE_CLICK_DELAY) { Debugger.log ('DoubleClicking:' + this, Debugger.GEN, 'localOnPress', 'LearnerOptionalActivity'); _doubleClicking = true; + //if we double click on the glass mask - then open the container to allow the usr to see the activities inside. draw (); controller.activityDoubleClick(this); - }else { + } else { Debugger.log ('SingleClicking:+' + this, Debugger.GEN, 'localOnPress', 'LearnerOptionalActivity'); _doubleClicking = false; - } + } + _dcStartTime = now; } @@ -319,12 +375,10 @@ Debugger.log ('_doubleClicking:' + _doubleClicking + ', localOnRelease:' + this, Debugger.GEN, 'localOnRelease', 'LearnerOptionalActivity'); if (_locked && !_doubleClicking){ collapse(); - controller.complexActivityRelease(this, _doubleClicking); - + controller.complexActivityRelease(this, _doubleClicking); } else { expand(); - controller.complexActivityRelease(this,_doubleClicking); - + controller.complexActivityRelease(this,_doubleClicking); } } @@ -420,7 +474,20 @@ public function get panelHeight():Number { return _panelHeight; } + public function setSelected(isSelected) { + + } + + public function get isCurrent():Boolean { + return (actStatus == 'current_mc'); + } + + public function get isCompleted():Boolean { + return (actStatus == 'completed_mc'); + } + + public function get isAttempted():Boolean { + return (actStatus == 'attempted_mc'); } - }