[virtualcommons-svn] SF.net SVN: virtualcommons:[339] mentalmodels/trunk
Status: Beta
Brought to you by:
alllee
From: <kj...@us...> - 2009-10-28 17:42:26
|
Revision: 339 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=339&view=rev Author: kjonas Date: 2009-10-28 17:42:18 +0000 (Wed, 28 Oct 2009) Log Message: ----------- Added error-checking so that the Instruction Pages are not updated with information that doesn't exist (information.saved* is null) increased duration to 20s Modified Paths: -------------- mentalmodels/trunk/flex/src/custom/FisheryExperimentCore.mxml mentalmodels/trunk/src/main/java/edu/asu/commons/mme/utility/MessageHandler.java Modified: mentalmodels/trunk/flex/src/custom/FisheryExperimentCore.mxml =================================================================== --- mentalmodels/trunk/flex/src/custom/FisheryExperimentCore.mxml 2009-10-27 06:53:06 UTC (rev 338) +++ mentalmodels/trunk/flex/src/custom/FisheryExperimentCore.mxml 2009-10-28 17:42:18 UTC (rev 339) @@ -11,7 +11,6 @@ x="{(content.width-socioDemographic.width)/2}" y="{(content.height-socioDemographic.height)/2}"/> </mx:AddChild> - <mx:SetProperty target="{content}" name="x"/> <mx:SetStyle target="{content}" name="horizontalCenter" value="0"/> </mx:State> @@ -35,7 +34,9 @@ </mx:State> <mx:State name="none"> - <mx:RemoveChild target="{instructions}"/> + <!--<mx:RemoveChild target="{instructions}"/>--> + <mx:AddChild relativeTo="{expiredContent}" target="{instructions}"/> + <mx:SetProperty target="{instructions}" name="visible" value="false"/> <mx:AddChild relativeTo="{content}"> <mx:Label id="end" text="Thank you for playing!" fontSize="30"/> </mx:AddChild> @@ -332,13 +333,23 @@ private function saveDataToShell():void { - shell.updateObjectA.updateDayByDayDecisions(instructions.savedDayByDayDecisions); - shell.updateObjectA.updateForecasting(instructions.savedForecastFish, instructions.savedForecastPeople); - shell.updateObjectA.updateStrategyDesign(instructions.savedStrategyDesign); + if(instructions.savedDayByDayDecisions != null) + { + shell.updateObjectA.updateDayByDayDecisions(instructions.savedDayByDayDecisions); + shell.updateObjectB.updateDayByDayDecisions(instructions.savedDayByDayDecisions); + } - shell.updateObjectB.updateDayByDayDecisions(instructions.savedDayByDayDecisions); - shell.updateObjectB.updateForecasting(instructions.savedForecastFish, instructions.savedForecastPeople); - shell.updateObjectB.updateStrategyDesign(instructions.savedStrategyDesign); + if(instructions.savedForecastFish != null && instructions.savedForecastPeople != null) + { + shell.updateObjectA.updateForecasting(instructions.savedForecastFish, instructions.savedForecastPeople); + shell.updateObjectB.updateForecasting(instructions.savedForecastFish, instructions.savedForecastPeople); + } + + if(instructions.savedStrategyDesign != null) + { + shell.updateObjectA.updateStrategyDesign(instructions.savedStrategyDesign); + shell.updateObjectB.updateStrategyDesign(instructions.savedStrategyDesign); + } } private function loadNextBlock(nextBlock:Block):void @@ -359,6 +370,7 @@ || currentBlock.questionGroups.length < 1) { currentState = "none"; + Alert.show("block is null or no question groups"); return; } @@ -377,30 +389,30 @@ shell.setProgressBarTime(0,0,currentBlock.duration); shell.progressBarInit(); } - private function moduleResultHandler(event:ResultEvent):void - { - currentModule = (event.result as actionscript.Module); - - if(currentModule == null) - { - currentState = "none"; - } - else if(currentModule.blocks == null || currentModule.blocks.length < 1 || - (currentModule.blocks.getItemAt(0) as Block) == null || - (currentModule.blocks.getItemAt(0) as Block).questionGroups == null || - (currentModule.blocks.getItemAt(0) as Block).questionGroups.length < 1) - { - currentState = "none"; - } - else if(!instructionsLoaded) - { - currentState = "instructionsLoad"; - } - else - { - gotoInstructions(); - } - } +// private function moduleResultHandler(event:ResultEvent):void +// { +// currentModule = (event.result as actionscript.Module); +// +// if(currentModule == null) +// { +// currentState = "none"; +// } +// else if(currentModule.blocks == null || currentModule.blocks.length < 1 || +// (currentModule.blocks.getItemAt(0) as Block) == null || +// (currentModule.blocks.getItemAt(0) as Block).questionGroups == null || +// (currentModule.blocks.getItemAt(0) as Block).questionGroups.length < 1) +// { +// currentState = "none"; +// } +// else if(!instructionsLoaded) +// { +// currentState = "instructionsLoad"; +// } +// else +// { +// gotoInstructions(); +// } +// } public function getLocation():void { @@ -543,4 +555,3 @@ </mx:Script> </mx:Canvas> - Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/utility/MessageHandler.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/utility/MessageHandler.java 2009-10-27 06:53:06 UTC (rev 338) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/utility/MessageHandler.java 2009-10-28 17:42:18 UTC (rev 339) @@ -79,7 +79,7 @@ { //int duration = block.getDuration(); - int duration = 5; + int duration = 20; Timer timer = new Timer(); Long startTime = System.currentTimeMillis()/1000; System.out.println("Started time is : " + System.currentTimeMillis()/1000); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |