[virtualcommons-svn] SF.net SVN: virtualcommons:[442] mentalmodels/trunk/flex/src/custom/ questions
Status: Beta
Brought to you by:
alllee
From: <kj...@us...> - 2010-01-16 00:09:50
|
Revision: 442 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=442&view=rev Author: kjonas Date: 2010-01-16 00:09:43 +0000 (Sat, 16 Jan 2010) Log Message: ----------- strToLocation method replaced with intToLocation method. formerly a dummy method, this now takes an index (0,1,2,3,4...) and returns the Location associated with it from the DataModel (0=Harbor, 1=Bay1, etc (presumably)) Modified Paths: -------------- mentalmodels/trunk/flex/src/custom/questions/strategyDesign/PlannerRow.mxml mentalmodels/trunk/flex/src/custom/questions/strategyDesign/StrategyDesignQuestionC.mxml Modified: mentalmodels/trunk/flex/src/custom/questions/strategyDesign/PlannerRow.mxml =================================================================== --- mentalmodels/trunk/flex/src/custom/questions/strategyDesign/PlannerRow.mxml 2010-01-16 00:08:20 UTC (rev 441) +++ mentalmodels/trunk/flex/src/custom/questions/strategyDesign/PlannerRow.mxml 2010-01-16 00:09:43 UTC (rev 442) @@ -40,9 +40,9 @@ threshold.enabled = threshold.visible; } - public function getLocation():String + public function getLocation():int { - return location.selectedItem as String; + return location.selectedIndex; // if(location.selectedIndex == 0) // { // return "Harbor"; Modified: mentalmodels/trunk/flex/src/custom/questions/strategyDesign/StrategyDesignQuestionC.mxml =================================================================== --- mentalmodels/trunk/flex/src/custom/questions/strategyDesign/StrategyDesignQuestionC.mxml 2010-01-16 00:08:20 UTC (rev 441) +++ mentalmodels/trunk/flex/src/custom/questions/strategyDesign/StrategyDesignQuestionC.mxml 2010-01-16 00:09:43 UTC (rev 442) @@ -17,6 +17,7 @@ <mx:Script> <![CDATA[ + import actionscript.DataModel; import mx.controls.Alert; import mx.rpc.events.FaultEvent; import mx.rpc.events.ResultEvent; @@ -89,7 +90,7 @@ { tempArray = repeatedArray.getItemAt(i) as ArrayCollection; tempObject = new StudentStrategy(); - tempObject.location = strToLocation(tempArray.getItemAt(0) as String); + tempObject.location = intToLocation(tempArray.getItemAt(0) as int); tempObject.days = int(tempArray.getItemAt(1) as Number); tempObject.threshold = (tempArray.getItemAt(2) as Number); tempObject.round = repeated.round; @@ -102,9 +103,9 @@ return array; } - private function strToLocation(str:String):Location + private function intToLocation(index:int):Location { - return new Location(); + return DataModel.instance.locations.getItemAt(index) as Location; } ]]> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |