[virtualcommons-svn] SF.net SVN: virtualcommons:[195] mentalmodels/trunk/flex/src
Status: Beta
Brought to you by:
alllee
From: <see...@us...> - 2009-07-22 01:16:45
|
Revision: 195 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=195&view=rev Author: seematalele Date: 2009-07-22 01:16:38 +0000 (Wed, 22 Jul 2009) Log Message: ----------- Added a check box in Question.mxml for communication question. Added variable in Question.as. Changed the InitialiseDatabase.mxml so that it will work properly according to changes in Question.as and Question.mxml. Modified Paths: -------------- mentalmodels/trunk/flex/src/InitialiseDatabase.mxml mentalmodels/trunk/flex/src/actionscript/questions/Question.as mentalmodels/trunk/flex/src/custom/db/Question.mxml Modified: mentalmodels/trunk/flex/src/InitialiseDatabase.mxml =================================================================== --- mentalmodels/trunk/flex/src/InitialiseDatabase.mxml 2009-07-22 01:13:40 UTC (rev 194) +++ mentalmodels/trunk/flex/src/InitialiseDatabase.mxml 2009-07-22 01:16:38 UTC (rev 195) @@ -38,14 +38,11 @@ <module title ="Game Round" sequenceNo="2" hours="1" min="30" sec="0" id="2"> <block name="Characterizing Own Strategy" sequenceNo="1" hours="0" min="30" sec="0" id="2"> <questiongroup header="What goals did you follow when designing your strategy" description="Please specify three goals..." hours="0" min="3" sec="0" sequenceNo="1" id="2"> - <question title="Most important goal" type="categorical" sequenceNo="1" id="1" > + <question title="Most important goal" type="categorical" sequenceNo="1" communication="true" id="1" > </question> - <question title="second important goal" type="psychometric" sequenceNo="2" id="2" > + <question title="second important goal" type="psychometric" sequenceNo="2" communication="false" id="2" > </question> - - </questiongroup> - </block> </module> @@ -61,7 +58,26 @@ private var survey:XML = <list> <module title="Survey Questions" id="0" sequenceNo="0" hours="0" min="0" sec="0"/> - + <module title="Preexperiment" sequenceNo="1" hours="0" min="3" sec="0" id="1"> + <block name="Introduction" sequenceNo="1" hours="0" min="3" sec="0" id="1"> + <questiongroup header="Welcome to E-Fishery Experiment" + description="In this experiment you will design..." sequenceNo="1" + hours="0" min="3" sec="0" id="1" /> + + </block> + + </module> + <module title ="Game Round" sequenceNo="2" hours="1" min="30" sec="0" id="2"> + <block name="Characterizing Own Strategy" sequenceNo="1" hours="0" min="30" sec="0" id="2"> + <questiongroup header="What goals did you follow when designing your strategy" description="Please specify three goals..." hours="0" min="3" sec="0" sequenceNo="1" id="2"> + <question title="Most important goal" type="categorical" sequenceNo="1" communication="true" id="1" > + </question> + <question title="second important goal" type="psychometric" sequenceNo="2" communication="false" id="2" > + </question> + </questiongroup> + </block> + + </module> </list>; /** @@ -250,16 +266,18 @@ newQNode.@title = psychometricResult.question; newQNode.@type = psychometricResult.type; newQNode.@id = psychometricResult.id; + //Check if this question is for communication round. + newQNode.@communication = psychometricResult.communicationQ; choices = ""; if(psychometricResult.choices != null) { - + //Alert.show("choices is eqaul to : " + choices); for(var k:int = 0; k < psychometricResult.choices.length; k++) { if(choices == "") { - Alert.show("choices is eqaul to : " + choices); + //Alert.show("choices is eqaul to : " + choices); choices = psychometricResult.choices[k]; } else @@ -283,6 +301,7 @@ newQNode.@title = categoricalResult.question; newQNode.@type = categoricalResult.type; newQNode.@id = categoricalResult.id; + newQNode.@communication = categoricalResult.communicationQ; /*var questionGroup:XMLList =survey.module.block.questiongroup.(@header == node.@header); if( questionGroup.length() > 0 ) @@ -352,7 +371,8 @@ newQNode.@title = question.question; newQNode.@type = question.type; newQNode.@id = question.id; - + newQNode.@communication = question.communicationQ; + Alert.show("communication : " + question.communicationQ); } return newQNode; @@ -401,7 +421,6 @@ if( node.localName() == "categorical" ) return node.@type; - else return node.@name; @@ -966,9 +985,9 @@ asPsychometric.question = questionInfo.getQuestion(); asPsychometric.sequenceNo = int(questionInfo.getSequenceNo()); asPsychometric.type = questionInfo.getType(); - + asPsychometric.communicationQ = questionInfo.isCommunicationQuestion(); //Alert.show("Psychometric Object :"); - //Alert.show("Question: " + asPsychometric.question); + Alert.show("Communication: " + asPsychometric.communicationQ); //Alert.show("SeQ No: " + asPsychometric.sequenceNo); //Alert.show("Type : " + asPsychometric.type); @@ -1011,6 +1030,7 @@ categoricalQuestion.type = questionInfo.getType(); categoricalQuestion.question = questionInfo.getQuestion(); categoricalQuestion.sequenceNo = int(questionInfo.getSequenceNo()); + categoricalQuestion.communicationQ = questionInfo.isCommunicationQuestion(); /*for(var i:int = 0; i < categoricalQuestion.categoricalOptions.length ; i++) { var testoption:actionscript.questions.CategoricalOption = new actionscript.questions.CategoricalOption(); @@ -1059,6 +1079,7 @@ categoricalSimpleQuestion.type = questionInfo.getType(); categoricalSimpleQuestion.question = questionInfo.getQuestion(); categoricalSimpleQuestion.sequenceNo = int(questionInfo.getSequenceNo()); + categoricalSimpleQuestion.communicationQ = questionInfo.isCommunicationQuestion(); /*for(var j:int = 0; j < categoricalSimpleQuestion.categoricalOptions.length ; j++) { var testoption:ASCategoricalOption = new ASCategoricalOption(); @@ -1099,7 +1120,8 @@ question.question = questionInfo.getQuestion(); question.sequenceNo = int(questionInfo.getSequenceNo()); question.type = questionInfo.getType(); - //Alert.show("Type : " + question.type); + question.communicationQ = questionInfo.isCommunicationQuestion(); + Alert.show("communication : " + questionInfo.isCommunicationQuestion()); if(questionInfo.getId() == 0) { if(checkSeqNoQuestion.length() > 0) @@ -1186,6 +1208,7 @@ newQNode.@sequenceNo = psychometricResult.sequenceNo; newQNode.@title = psychometricResult.question; newQNode.@type = psychometricResult.type; + newQNode.@communication = psychometricResult.communicationQ; choices = ""; if(psychometricResult.choices != null) { @@ -1216,7 +1239,7 @@ newQNode.@title = categoricalResult.question; newQNode.@type = categoricalResult.type; newQNode.@id = categoricalResult.id; - + newQNode.@communication = categoricalResult.communicationQ; //flagType false means it is simple type, otherwise it is relative type var flagType:Boolean = false; @@ -1397,6 +1420,8 @@ questionInfo.setQuestion(node.@title); questionInfo.setSequenceNo(node.@sequenceNo); questionInfo.setId(node.@id); + Alert.show("communication: " + node.@communication); + questionInfo.setCommunicationQuestion(node.@communication); var str:String = node.@type; /*Alert.show("q type is: " + node.@type); questionInfo.cmbType.selectedItem = str.toLowerCase();*/ Modified: mentalmodels/trunk/flex/src/actionscript/questions/Question.as =================================================================== --- mentalmodels/trunk/flex/src/actionscript/questions/Question.as 2009-07-22 01:13:40 UTC (rev 194) +++ mentalmodels/trunk/flex/src/actionscript/questions/Question.as 2009-07-22 01:16:38 UTC (rev 195) @@ -12,6 +12,7 @@ public var type:String; public var sequenceNo:int; public var questionGroup:QuestionGroup; + public var communicationQ:Boolean; } } \ No newline at end of file Modified: mentalmodels/trunk/flex/src/custom/db/Question.mxml =================================================================== --- mentalmodels/trunk/flex/src/custom/db/Question.mxml 2009-07-22 01:13:40 UTC (rev 194) +++ mentalmodels/trunk/flex/src/custom/db/Question.mxml 2009-07-22 01:16:38 UTC (rev 195) @@ -59,9 +59,8 @@ return questionInfo; } + - - public function setQuestionType(type:String):void { for (var i: int = 0; i < cmbType.dataProvider.length; i++) @@ -75,7 +74,18 @@ } + public function setCommunicationQuestion(flag:String):void + { + if(flag == "true") + chkboxCommunication.selected = true; + else + chkboxCommunication.selected = false; + } + public function isCommunicationQuestion():Boolean + { + return chkboxCommunication.selected; + } public function validateForm(event:Event):Boolean { @@ -153,6 +163,7 @@ return currentControlIsValid; } + public function reset():void { currentState = "text"; @@ -162,8 +173,8 @@ txtSeqNo.errorString =""; rchtxtQuestion.errorString =""; cmbType.selectedIndex = -1; + chkboxCommunication.selected = false; - } ]]> @@ -196,6 +207,11 @@ <mx:RichTextEditor id="rchtxtQuestion" change="{validateForm(event)}" title="Question Editor" width="500" height="500" /> </mx:FormItem> <mx:Spacer height="20" /> + <mx:FormItem label= "Is this question for communication Round?"> + <mx:CheckBox id="chkboxCommunication" /> + </mx:FormItem> + + <mx:Spacer height="20" /> <mx:FormItem label="Select Question Type:"> <mx:ComboBox id="cmbType" change="{showQuestionType()}" width="100%" prompt="-Select-"> <mx:ArrayCollection> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |