[virtualcommons-svn] SF.net SVN: virtualcommons:[202] mentalmodels/trunk/flex/src
Status: Beta
Brought to you by:
alllee
From: <kj...@us...> - 2009-07-22 21:59:15
|
Revision: 202 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=202&view=rev Author: kjonas Date: 2009-07-22 21:59:10 +0000 (Wed, 22 Jul 2009) Log Message: ----------- Added help window to InformationWindowCreator.as. Added the Question object into Question components. Increased width of PsychometricQuestionC.mxml sliders. Added code for reporting values of questions in FisheryExperimentCore.mxml. Modified Paths: -------------- mentalmodels/trunk/flex/src/actionscript/InformationWindowCreator.as mentalmodels/trunk/flex/src/custom/FisheryExperimentCore.mxml mentalmodels/trunk/flex/src/custom/questions/CategoricalQuestionC.mxml mentalmodels/trunk/flex/src/custom/questions/TextQuestionC.mxml mentalmodels/trunk/flex/src/custom/questions/dayByDayDecisions/DayByDayDecisionsQuestionC.mxml mentalmodels/trunk/flex/src/custom/questions/forecasting/ForecastingFishQuestionC.mxml mentalmodels/trunk/flex/src/custom/questions/forecasting/ForecastingPeopleQuestionC.mxml mentalmodels/trunk/flex/src/custom/questions/psychometric/PsychometricQuestionC.mxml mentalmodels/trunk/flex/src/custom/questions/strategyDesign/StrategyDesignQuestionC.mxml Modified: mentalmodels/trunk/flex/src/actionscript/InformationWindowCreator.as =================================================================== --- mentalmodels/trunk/flex/src/actionscript/InformationWindowCreator.as 2009-07-22 21:50:39 UTC (rev 201) +++ mentalmodels/trunk/flex/src/actionscript/InformationWindowCreator.as 2009-07-22 21:59:10 UTC (rev 202) @@ -335,7 +335,7 @@ tempWindow.addItem(temp); temp = new StrategyDesignQuestionC(); - (temp as StrategyDesignQuestionC).description = "This is the strategy that you designed previously. Use it for reference."; + (temp as StrategyDesignQuestionC).question.question = "This is the strategy that you designed previously. Use it for reference."; (temp as StrategyDesignQuestionC).enabled = false; tempWindow.addItem(temp); updateObject.strategy = temp as StrategyDesignQuestionC; Modified: mentalmodels/trunk/flex/src/custom/FisheryExperimentCore.mxml =================================================================== --- mentalmodels/trunk/flex/src/custom/FisheryExperimentCore.mxml 2009-07-22 21:50:39 UTC (rev 201) +++ mentalmodels/trunk/flex/src/custom/FisheryExperimentCore.mxml 2009-07-22 21:59:10 UTC (rev 202) @@ -153,45 +153,87 @@ for(var j:int=0; j<curr.numChildren; j++) { studentResponse = new StudentResponse(); -// studentResponse.student = Id; + studentResponse.student = studentObject; + studentResponse.question = null; + var row:int, col:int; + if(curr.getChildAt(j) is TextQuestionC) { -// studentResponse.question = (curr.getChildAt(j) as TextQuestionC).description; + studentResponse.question = (curr.getChildAt(j) as TextQuestionC).question; studentResponse.response = (curr.getChildAt(j) as TextQuestionC).textAnswer.text; } else if(curr.getChildAt(j) is PsychometricQuestionC) { -// studentResponse.question = (curr.getChildAt(j) as PsychometricQuestionC).description; + studentResponse.question = (curr.getChildAt(j) as PsychometricQuestionC).question; studentResponse.response = (curr.getChildAt(j) as PsychometricQuestionC).slider1.getValue() + ""; } else if(curr.getChildAt(j) is CategoricalQuestionC) { -// studentResponse.question = (curr.getChildAt(j) as CategoricalQuestionC).description; + studentResponse.question = (curr.getChildAt(j) as CategoricalQuestionC).question; studentResponse.response = (curr.getChildAt(j) as CategoricalQuestionC).comboTopic.selectedItem as String; studentResponse.response += ", "; studentResponse.response += (curr.getChildAt(j) as CategoricalQuestionC).comboSpecific.selectedItem as String; } else if(curr.getChildAt(j) is DayByDayDecisionsQuestionC) { -// studentResponse.question = (curr.getChildAt(j) as DayByDayDecisionsQuestionC).description; + studentResponse.question = (curr.getChildAt(j) as DayByDayDecisionsQuestionC).question; studentResponse.response = null; } else if(curr.getChildAt(j) is ForecastingPeopleQuestionC) { -// studentResponse.question = (curr.getChildAt(j) as ForecastingPeopleQuestionC).description; - studentResponse.response = null; + var forecast1:ForecastingPeopleQuestionC = (curr.getChildAt(j) as ForecastingPeopleQuestionC); + for(row=0; row<locations.length; row++) + { + studentResponse = new StudentResponse(); + studentResponse.student = studentObject; + studentResponse.question = forecast1.question; + studentResponse.response = forecast1.peopleEntry.labels.getChildAt(row+1) + " "; + for(col=0; col<forecast1.peopleEntry.dataGrid.columnCount; col++) + { + studentResponse.response += (col+1) + ":" + forecast1.peopleEntry.getItem(row,col); + if(col<forecast1.peopleEntry.dataGrid.columnCount-1) + { + studentResponse.response += ", "; + } + } + // server: submit the response + } + studentResponse = new StudentResponse(); + studentResponse.question = null; } else if(curr.getChildAt(j) is ForecastingFishQuestionC) { -// studentResponse.question = (curr.getChildAt(j) as ForecastingFishQuestionC).description; - studentResponse.response = null; + var forecast2:ForecastingFishQuestionC = (curr.getChildAt(j) as ForecastingFishQuestionC); + for(row=0; row<locations.length-1; row++) + { + studentResponse = new StudentResponse(); + studentResponse.student = studentObject; + studentResponse.question = forecast2.question; + studentResponse.response = forecast2.fishEntry.labels.getChildAt(row+1) + " "; + for(col=0; col<forecast2.fishEntry.dataGrid.columnCount; col++) + { + studentResponse.response += (col+1) + ":" + forecast2.fishEntry.getItem(row,col); + if(col<forecast2.fishEntry.dataGrid.columnCount-1) + { + studentResponse.response += ", "; + } + } + // server: submit the response + } + studentResponse = new StudentResponse(); + studentResponse.question = null; } else if(curr.getChildAt(j) is StrategyDesignQuestionC) { -// studentResponse.question = (curr.getChildAt(j) as StrategyDesignQuestionC).description; + studentResponse.question = (curr.getChildAt(j) as StrategyDesignQuestionC).question; studentResponse.response = null; } + + if(studentResponse.question != null) + { + // server: submit the response + } } } } Modified: mentalmodels/trunk/flex/src/custom/questions/CategoricalQuestionC.mxml =================================================================== --- mentalmodels/trunk/flex/src/custom/questions/CategoricalQuestionC.mxml 2009-07-22 21:50:39 UTC (rev 201) +++ mentalmodels/trunk/flex/src/custom/questions/CategoricalQuestionC.mxml 2009-07-22 21:59:10 UTC (rev 202) @@ -1,10 +1,11 @@ <?xml version="1.0" encoding="utf-8"?> <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:as="actionscript.*"> - <mx:Text width="600" htmlText="{description}"/> + <mx:Text width="600" htmlText="{question.question}"/> <mx:Script> <![CDATA[ - [Bindable] public var description:String = ""; + import actionscript.questions.Question; + [Bindable] public var question:Question = new Question(); ]]> </mx:Script> @@ -58,7 +59,7 @@ comboTopic.selectedIndex = 0; comboSpecific.selectedIndex = -1; - description = question.question; + this.question = question; } ]]> Modified: mentalmodels/trunk/flex/src/custom/questions/TextQuestionC.mxml =================================================================== --- mentalmodels/trunk/flex/src/custom/questions/TextQuestionC.mxml 2009-07-22 21:50:39 UTC (rev 201) +++ mentalmodels/trunk/flex/src/custom/questions/TextQuestionC.mxml 2009-07-22 21:59:10 UTC (rev 202) @@ -1,10 +1,11 @@ <?xml version="1.0" encoding="utf-8"?> <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml"> - <mx:Text width="600" htmlText="{description}"/> + <mx:Text width="600" htmlText="{question.question}"/> <mx:Script> <![CDATA[ - [Bindable] public var description:String = ""; + import actionscript.questions.Question; + [Bindable] public var question:Question = new Question(); ]]> </mx:Script> @@ -32,7 +33,7 @@ public function loadFromQuestion(question:Question):void { - description = question.question; + this.question = question; initialize(); // init(); Modified: mentalmodels/trunk/flex/src/custom/questions/dayByDayDecisions/DayByDayDecisionsQuestionC.mxml =================================================================== --- mentalmodels/trunk/flex/src/custom/questions/dayByDayDecisions/DayByDayDecisionsQuestionC.mxml 2009-07-22 21:50:39 UTC (rev 201) +++ mentalmodels/trunk/flex/src/custom/questions/dayByDayDecisions/DayByDayDecisionsQuestionC.mxml 2009-07-22 21:59:10 UTC (rev 202) @@ -1,10 +1,11 @@ <?xml version="1.0" encoding="utf-8"?> <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" initialize="init()"> - <mx:Text width="600" htmlText="{description}"/> + <mx:Text width="600" htmlText="{question.question}"/> <mx:Script> <![CDATA[ - [Bindable] public var description:String = ""; + import actionscript.questions.Question; + [Bindable] public var question:Question = new Question(); ]]> </mx:Script> @@ -188,7 +189,7 @@ public function loadFromQuestion(question:Question):void { - description = question.question; + this.question = question; initialize(); init(); Modified: mentalmodels/trunk/flex/src/custom/questions/forecasting/ForecastingFishQuestionC.mxml =================================================================== --- mentalmodels/trunk/flex/src/custom/questions/forecasting/ForecastingFishQuestionC.mxml 2009-07-22 21:50:39 UTC (rev 201) +++ mentalmodels/trunk/flex/src/custom/questions/forecasting/ForecastingFishQuestionC.mxml 2009-07-22 21:59:10 UTC (rev 202) @@ -1,10 +1,11 @@ <?xml version="1.0" encoding="utf-8"?> <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:components="custom.questions.forecasting.*"> - <mx:Text width="600" htmlText="{description}"/> + <mx:Text width="600" htmlText="{question.question}"/> <mx:Script> <![CDATA[ - [Bindable] public var description:String = ""; + import actionscript.questions.Question; + [Bindable] public var question:Question = new Question(); ]]> </mx:Script> @@ -82,7 +83,7 @@ } public function loadFromQuestion(question:Question):void { - description = question.question; + this.question = question; initialize(); init(); Modified: mentalmodels/trunk/flex/src/custom/questions/forecasting/ForecastingPeopleQuestionC.mxml =================================================================== --- mentalmodels/trunk/flex/src/custom/questions/forecasting/ForecastingPeopleQuestionC.mxml 2009-07-22 21:50:39 UTC (rev 201) +++ mentalmodels/trunk/flex/src/custom/questions/forecasting/ForecastingPeopleQuestionC.mxml 2009-07-22 21:59:10 UTC (rev 202) @@ -1,10 +1,11 @@ <?xml version="1.0" encoding="utf-8"?> <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:components="custom.questions.forecasting.*"> - <mx:Text width="600" htmlText="{description}"/> + <mx:Text width="600" htmlText="{question.question}"/> <mx:Script> <![CDATA[ - [Bindable] public var description:String = ""; + import actionscript.questions.Question; + [Bindable] public var question:Question = new Question(); ]]> </mx:Script> @@ -65,7 +66,7 @@ } public function loadFromQuestion(question:Question):void { - description = question.question; + this.question = question; initialize(); init(); Modified: mentalmodels/trunk/flex/src/custom/questions/psychometric/PsychometricQuestionC.mxml =================================================================== --- mentalmodels/trunk/flex/src/custom/questions/psychometric/PsychometricQuestionC.mxml 2009-07-22 21:50:39 UTC (rev 201) +++ mentalmodels/trunk/flex/src/custom/questions/psychometric/PsychometricQuestionC.mxml 2009-07-22 21:59:10 UTC (rev 202) @@ -1,10 +1,11 @@ <?xml version="1.0" encoding="utf-8"?> <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:qComp="custom.questions.psychometric.*" initialize="false"> - <mx:Text width="600" htmlText="{description}"/> + <mx:Text width="600" htmlText="{question.question}"/> <mx:Script> <![CDATA[ - [Bindable] public var description:String = ""; + import actionscript.questions.Question; + [Bindable] public var question:Question = new Question(); ]]> </mx:Script> @@ -92,7 +93,7 @@ public function loadFromQuestion(question:Psychometric):void { - description = question.question; + this.question = question; maxValue = question.maxSliderValue; labels = loadChoices(question); Modified: mentalmodels/trunk/flex/src/custom/questions/strategyDesign/StrategyDesignQuestionC.mxml =================================================================== --- mentalmodels/trunk/flex/src/custom/questions/strategyDesign/StrategyDesignQuestionC.mxml 2009-07-22 21:50:39 UTC (rev 201) +++ mentalmodels/trunk/flex/src/custom/questions/strategyDesign/StrategyDesignQuestionC.mxml 2009-07-22 21:59:10 UTC (rev 202) @@ -1,10 +1,11 @@ <?xml version="1.0" encoding="utf-8"?> <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:qComp="custom.questions.strategyDesign.*"> - <mx:Text width="600" htmlText="{description}"/> + <mx:Text width="600" htmlText="{question.question}"/> <mx:Script> <![CDATA[ - [Bindable] public var description:String = ""; + import actionscript.questions.Question; + [Bindable] public var question:Question = new Question(); ]]> </mx:Script> @@ -81,7 +82,7 @@ public function loadFromQuestion(question:Question):void { - description = question.question; + this.question = question; initialize(); // init(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |