virtualcommons-svn Mailing List for Virtual Commons Experiment Software (Page 65)
Status: Beta
Brought to you by:
alllee
You can subscribe to this list here.
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
(21) |
Aug
(31) |
Sep
(6) |
Oct
(15) |
Nov
(2) |
Dec
(9) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2009 |
Jan
(4) |
Feb
(6) |
Mar
(12) |
Apr
(52) |
May
(14) |
Jun
(19) |
Jul
(81) |
Aug
(115) |
Sep
(36) |
Oct
(88) |
Nov
(46) |
Dec
(58) |
2010 |
Jan
(52) |
Feb
(55) |
Mar
(48) |
Apr
(15) |
May
(5) |
Jun
(38) |
Jul
(27) |
Aug
(24) |
Sep
(28) |
Oct
(1) |
Nov
(2) |
Dec
(29) |
2011 |
Jan
(87) |
Feb
(39) |
Mar
(63) |
Apr
(42) |
May
(26) |
Jun
(53) |
Jul
(23) |
Aug
(43) |
Sep
(37) |
Oct
(25) |
Nov
(4) |
Dec
(7) |
2012 |
Jan
(73) |
Feb
(79) |
Mar
(62) |
Apr
(28) |
May
(12) |
Jun
(2) |
Jul
(9) |
Aug
(1) |
Sep
(8) |
Oct
|
Nov
(3) |
Dec
(3) |
2013 |
Jan
(8) |
Feb
(16) |
Mar
(38) |
Apr
(74) |
May
(62) |
Jun
(15) |
Jul
(49) |
Aug
(19) |
Sep
(9) |
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
(25) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <see...@us...> - 2009-08-31 18:51:11
|
Revision: 272 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=272&view=rev Author: seematalele Date: 2009-08-31 18:50:59 +0000 (Mon, 31 Aug 2009) Log Message: ----------- Written code for server pushing blocks. Modified Paths: -------------- mentalmodels/trunk/flex/src/custom/FisheryExperimentCore.mxml Modified: mentalmodels/trunk/flex/src/custom/FisheryExperimentCore.mxml =================================================================== --- mentalmodels/trunk/flex/src/custom/FisheryExperimentCore.mxml 2009-08-28 23:25:58 UTC (rev 271) +++ mentalmodels/trunk/flex/src/custom/FisheryExperimentCore.mxml 2009-08-31 18:50:59 UTC (rev 272) @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:net="flash.net.*" xmlns:comp="custom.*" clipContent="false" verticalScrollPolicy="off" horizontalScrollPolicy="off" - currentState="socioDemographic" initialize="init()" + currentState="socioDemographic" creationComplete="init()" width="720" height="490"> <mx:states> @@ -71,9 +71,15 @@ <mx:method name="getAllLocations" result="locationResultHandler(event)"/> </mx:RemoteObject> - <mx:Producer id="producer" destination="DataPush" acknowledge="ack(event)"/> - <mx:Consumer id="consumer" destination="DataPush" message="messageHandler(event.message)" /> + + <mx:Consumer id="consumer" destination="chat" message="messageHandler(event)" fault="faultMsgHandler(event)" channelSet="{cs}" /> + <mx:ChannelSet id="cs"> + <!-- <mx:StreamingAMFChannel url="http://localhost:8080/messagebroker/streamingamf"/> --> + <mx:AMFChannel url="http://localhost:8080/mme/messagebroker/amflongpolling"/> + <mx:AMFChannel url="http://localhost:8080/mme/messagebroker/amfpolling"/> + </mx:ChannelSet> + <mx:Script> <![CDATA[ import custom.*; @@ -97,6 +103,7 @@ import mx.messaging.events.MessageFaultEvent; import mx.messaging.FlexClient; import mx.messaging.messages.AsyncMessage; + import mx.messaging.events.MessageEvent; // // Important Variables @@ -119,6 +126,42 @@ [Bindable] public var studentObject:actionscript.Student; [Bindable] public var roundObject:actionscript.Round; + public function faultMsgHandler(msgevent:MessageFaultEvent):void + { + Alert.show("Error in getting message: " + msgevent.faultString); + } + + private function messageHandler(event:MessageEvent):void + { + Alert.show("Block from server came.."); + + if(currentState == "none") + { + Alert.show("Block received in End of Game state.","Unexpected Block"); + return; + } + else if(currentState == "wait") + { + loadNextBlock(event.message.body as actionscript.Block); + } + else if(currentState == "instructions") + { + finishBlockEarly(); + loadNextBlock(event.message.body as actionscript.Block); + } + else if(currentState == "socioDemographic") + { + currentState = "none"; + Alert.show("Block received in Socio Demographic state.","Unexpected Block"); + } + else if(currentState == "instructionsLoad") + { + currentState = "none"; + Alert.show("Block received in Instructions (load) state.","Unexpected Block"); + } + + } + private function newLocation(maxCapacity:Number,growth:Number):Location { var newLoc:Location = new Location(); @@ -128,14 +171,10 @@ return newLoc; } - [Bindable] public var randomNumbers:String; - private function ack(event:MessageAckEvent):void - { - randomNumbers = event.message.body as String; - } - + public function init():void { + getLocations(); } @@ -271,7 +310,7 @@ currentBlockNumber++; //server request - roundService.getBlock(); + //roundService.getBlock(); } private function blockResultHandler(event:ResultEvent):void { @@ -400,25 +439,24 @@ private function studentResultHandler(event:ResultEvent):void { - if(event.result == null) + studentObject = event.result as actionscript.Student; + + if(studentObject == null) { Alert.show("event.result is null"); } - Alert.show("GameCode is '" + (event.result as actionscript.Student).gameCode + "'"); - studentObject = event.result as actionscript.Student; - consumer.disconnect(); + else + { + consumer.subscribe(); + //Alert.show("GameCode is '" + studentObject.gameCode + "'"); + //Alert.show("subscribed to destination: " + consumer.destination); + } } private function faultHandler(event:FaultEvent):void { Alert.show("Fault:\n"+event.fault.message + "\n" + event.fault.getStackTrace()); } - - private function messageHandler(message:IMessage):void - { - randomNumbers = message.body as String; - } - public function back():Boolean { if(content.numChildren == 0) @@ -496,7 +534,7 @@ currentState = "wait"; //consumer.subscribe(); - getNextBlock(); + //getNextBlock(); returnValue = true; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <see...@us...> - 2009-08-28 23:26:05
|
Revision: 271 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=271&view=rev Author: seematalele Date: 2009-08-28 23:25:58 +0000 (Fri, 28 Aug 2009) Log Message: ----------- Finally blocks are pushed to the client and also to StartGame In StartGame.java 5 blocks are pushed for testing purpose after every 20 seconds. When client received the first block it gets an error on DayByDayDecisionQuestionC.mxml on line number 175 Client are getting subsequent blocks (Tested using Alert.show) but is not displaying question groups in the browser Modified Paths: -------------- mentalmodels/trunk/flex/src/FisheryExperimentShell.mxml mentalmodels/trunk/flex/src/StartGame.mxml mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/RoundService.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StartGame.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StartupService.java mentalmodels/trunk/src/main/webapp/FisheryExperimentShell.swf mentalmodels/trunk/src/main/webapp/StartGame.swf mentalmodels/trunk/src/main/webapp/WEB-INF/applicationContext.xml mentalmodels/trunk/src/main/webapp/WEB-INF/classes/log4j.properties mentalmodels/trunk/src/main/webapp/WEB-INF/flex/messaging-config.xml mentalmodels/trunk/src/main/webapp/WEB-INF/flex/services-config.xml Modified: mentalmodels/trunk/flex/src/FisheryExperimentShell.mxml =================================================================== --- mentalmodels/trunk/flex/src/FisheryExperimentShell.mxml 2009-08-25 19:54:34 UTC (rev 270) +++ mentalmodels/trunk/flex/src/FisheryExperimentShell.mxml 2009-08-28 23:25:58 UTC (rev 271) @@ -76,6 +76,9 @@ <mx:Script> <![CDATA[ + import mx.messaging.events.MessageEvent; + import mx.messaging.MessageAgent; + import mx.messaging.messages.IMessage; import actionscript.InformationWindow; import mx.controls.Alert; import mx.controls.Label; @@ -85,6 +88,7 @@ import mx.collections.ArrayCollection; import custom.InformationWindowPopup; import mx.managers.PopUpManager; + import mx.messaging.events.MessageFaultEvent; public var popupA:InformationWindowPopup = null; public var popupB:InformationWindowPopup = null; @@ -102,6 +106,16 @@ public var currModule:Module = null; public var currBlock:Block = null; + public function faultMsgHandler(msgevent:MessageFaultEvent):void + { + Alert.show("Error in getting message: " + msgevent.faultString); + } + + public function messageHandler(msg:IMessage):void + { + var str:String = msg.body as String; + Alert.show("String came from server: " + str); + } public function init():void { // temporarily store all 3 objects returned... @@ -120,6 +134,7 @@ // Display only the default windows. selectCurrentWindows( new ArrayCollection() ); + } public function popupInformationWindow(window:int):void Modified: mentalmodels/trunk/flex/src/StartGame.mxml =================================================================== --- mentalmodels/trunk/flex/src/StartGame.mxml 2009-08-25 19:54:34 UTC (rev 270) +++ mentalmodels/trunk/flex/src/StartGame.mxml 2009-08-28 23:25:58 UTC (rev 271) @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical"> +<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" applicationComplete="init()" creationComplete="initLogging()"> <mx:VBox visible="{pageNum==0}" horizontalAlign="center"> <mx:HBox horizontalAlign="right" width="330" id="firstBox"> @@ -30,25 +30,77 @@ <mx:RemoteObject id="startupService" destination="startupService" fault="faultHandler(event)"> <mx:method name="createGame" result="gameObjectResultHandler(event)"/> - <mx:method name="startGame" result="noResultHandler(event)"/> + <mx:method name="startGame"/> </mx:RemoteObject> + + <mx:Consumer id="consumer" destination="chat" message="messageHandler(event)" fault="faultMsgHandler(event)" channelSet="{cs}" /> + + <mx:ChannelSet id="cs"> + <!--<mx:StreamingAMFChannel url="http://localhost:8080/mme/messagebroker/streamingamf"/>--> + <mx:AMFChannel url="http://localhost:8080/mme/messagebroker/amfpolling"/> + <mx:AMFChannel url="http://localhost:8080/mme/messagebroker/amflongpolling"/> + + </mx:ChannelSet> <mx:Script> <![CDATA[ + import mx.messaging.events.MessageEvent; import actionscript.Game; import actionscript.Block; import mx.rpc.events.ResultEvent; import mx.rpc.events.FaultEvent; import mx.controls.Alert; + import mx.messaging.messages.IMessage; + import mx.messaging.events.MessageAckEvent; + import mx.messaging.events.MessageFaultEvent; + import mx.messaging.FlexClient; + import mx.messaging.messages.AsyncMessage; + import mx.logging.*; + import mx.logging.targets.*; + + private const logger:ILogger = Log.getLogger("StartGame.mxml"); + [Bindable]private var pageNum:int = 0; + public var currentBlock:Block = null; + public function init():void + { + + } + private function initLogging():void { + // Create a target. + var logTarget:TraceTarget = new TraceTarget(); + + // Log only messages for the classes in the mx.rpc.* and + // mx.messaging packages. + logTarget.filters=["mx.rpc.*","mx.messaging.*"]; + + // Log all log levels. + logTarget.level = LogEventLevel.ALL; + + // Add date, time, category, and log level to the output. + logTarget.includeDate = true; + logTarget.includeTime = true; + logTarget.includeCategory = true; + logTarget.includeLevel = true; + + // Begin logging. + Log.addTarget(logTarget); + } + + // Universal Fault Handler public function faultHandler(event:FaultEvent):void { Alert.show(event.fault.getStackTrace()); } + public function faultMsgHandler(msgevent:MessageFaultEvent):void + { + Alert.show("Error in getting message: " + msgevent.faultString); + } + // Button Click Events public function create():void { @@ -64,12 +116,23 @@ gameObject.title = "test Game Title"; startupService.createGame(gameObject); + /* var message:AsyncMessage = new AsyncMessage(); + message.body = "got gameObject" + gameObject.description; + producer.send(message); + Alert.show("message is send"); */ + consumer.subscribe(); + Alert.show("subscribed to destination: " + consumer.destination); + } public function start():void { btnStartGame.enabled = false; + /*consumer.subscribe(); + Alert.show("subscribed to destination: " + consumer.destination);*/ startupService.startGame(); + //consumer.subtopic = "hello3"; + } public function getResponses():void { @@ -94,6 +157,21 @@ } + private function messageHandler(event:MessageEvent):void + { + //Alert.show("message from server came.."); + var block:actionscript.Block = event.message.body as actionscript.Block; + Alert.show("String came from server is: " + block.id + " " + block.description); + + + /* if(currentBlock == null) + { + Alert.show("Game is over!!"); + } + else + Alert.show("Block from server is : " + currentBlock.description); */ + } + ]]> </mx:Script> Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/RoundService.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/RoundService.java 2009-08-25 19:54:34 UTC (rev 270) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/RoundService.java 2009-08-28 23:25:58 UTC (rev 271) @@ -17,13 +17,11 @@ import edu.asu.commons.mme.entity.CategoricalQuestion; import edu.asu.commons.mme.entity.Game; import edu.asu.commons.mme.entity.InformationWindow; -import edu.asu.commons.mme.entity.Location; import edu.asu.commons.mme.entity.Module; import edu.asu.commons.mme.entity.ModuleRoundConfig; import edu.asu.commons.mme.entity.Question; import edu.asu.commons.mme.entity.QuestionGroup; import edu.asu.commons.mme.entity.Round; -import edu.asu.commons.mme.entity.RoundLocation; @Transactional public class RoundService extends Service.Base<Round, HibernateRoundConfigDao> { Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StartGame.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StartGame.java 2009-08-25 19:54:34 UTC (rev 270) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StartGame.java 2009-08-28 23:25:58 UTC (rev 271) @@ -1,7 +1,7 @@ package edu.asu.commons.mme.service; import java.util.List; - +import org.apache.log4j.Logger; import edu.asu.commons.mme.entity.Block; import edu.asu.commons.mme.entity.Game; import edu.asu.commons.mme.entity.ModuleRoundConfig; @@ -13,6 +13,7 @@ public class StartGame extends Thread { + private static Logger logger = Logger.getLogger(StartGame.class); private boolean running; private RoundService roundService; private LocationService locationService; @@ -73,31 +74,22 @@ MessageBroker msgBroker = MessageBroker.getMessageBroker("_messageBroker"); String clientID = UUIDUtils.createUUID(); int i=0; - while (i<3) { + while (i<5) { i++; String msgDestination = roundService.getCurrentGame().getDescription(); - /*if(getCurrentModuleRoundConfig() == null) - { - setCurrentModuleRoundConfig(new ModuleRoundConfig()); - System.out.println("new currentmoduleroundconfig is created."); - }*/ //Push the first block to the clients AsyncMessage msg = new AsyncMessage(); - msg.setDestination("mme"); - //msg.setHeader("DSSubtopic", "hello"); + msg.setDestination("chat"); + //msg.setHeader("DSSubtopic", "hello3"); msg.setClientId(clientID); msg.setMessageId(UUIDUtils.createUUID()); msg.setTimestamp(System.currentTimeMillis()); - -// System.out.println("in while loop: "); block = roundService.getBlock(); - // System.out.println("after block "); msg.setBody(block); msgBroker.routeMessageToService(msg, null); - System.out.println("Message broker is: "+ msgBroker); - System.out.println("Message is: "+ block.getDescription()); + logger.debug("message is sent to the client: " + msg); /* if(block.getDescription().equalsIgnoreCase("Day-by-day decisions game")) { @@ -115,7 +107,7 @@ //start the timer for the block sent try { //for testing purpose 5000 is given as an argument - Thread.sleep(10000); + Thread.sleep(20000); if(block == null) { running = false; @@ -125,10 +117,9 @@ } + } - - - + private boolean isGameOver() { // TODO Auto-generated method stub Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StartupService.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StartupService.java 2009-08-25 19:54:34 UTC (rev 270) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StartupService.java 2009-08-28 23:25:58 UTC (rev 271) @@ -15,6 +15,7 @@ import flex.messaging.util.UUIDUtils; @Transactional + public class StartupService implements ApplicationContextAware { //private QuestionCreatorService questionCreatorService; Modified: mentalmodels/trunk/src/main/webapp/FisheryExperimentShell.swf =================================================================== (Binary files differ) Modified: mentalmodels/trunk/src/main/webapp/StartGame.swf =================================================================== (Binary files differ) Modified: mentalmodels/trunk/src/main/webapp/WEB-INF/applicationContext.xml =================================================================== --- mentalmodels/trunk/src/main/webapp/WEB-INF/applicationContext.xml 2009-08-25 19:54:34 UTC (rev 270) +++ mentalmodels/trunk/src/main/webapp/WEB-INF/applicationContext.xml 2009-08-28 23:25:58 UTC (rev 271) @@ -182,8 +182,8 @@ <flex:remoting-destination ref="feed" /> <!-- Expose services for Flex/BlazeDS messaging --> - <flex:message-destination id="mme" allow-subtopics="true" subtopic-separator="." /> - + <flex:message-destination id="chat" /> + <flex:message-destination id="mme" /> <!-- Flex related information ended--> <bean id="mmeDataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> Modified: mentalmodels/trunk/src/main/webapp/WEB-INF/classes/log4j.properties =================================================================== --- mentalmodels/trunk/src/main/webapp/WEB-INF/classes/log4j.properties 2009-08-25 19:54:34 UTC (rev 270) +++ mentalmodels/trunk/src/main/webapp/WEB-INF/classes/log4j.properties 2009-08-28 23:25:58 UTC (rev 271) @@ -11,5 +11,5 @@ # Add packages to log log4j.logger.edu.asu.commons=DEBUG -log4j.logger.org.springframework=ERROR +log4j.logger.org.springframework=DEBUG log4j.logger.org.hibernate=ERROR Modified: mentalmodels/trunk/src/main/webapp/WEB-INF/flex/messaging-config.xml =================================================================== --- mentalmodels/trunk/src/main/webapp/WEB-INF/flex/messaging-config.xml 2009-08-25 19:54:34 UTC (rev 270) +++ mentalmodels/trunk/src/main/webapp/WEB-INF/flex/messaging-config.xml 2009-08-28 23:25:58 UTC (rev 271) @@ -1,34 +1,15 @@ <?xml version="1.0" encoding="UTF-8"?> -<service id="message-service" class="flex.messaging.services.MessageService" - messageTypes="flex.messaging.messages.AsyncMessage"> +<service id="message-service" + class="flex.messaging.services.MessageService"> - <adapters> - <adapter-definition id="actionscript" - class="flex.messaging.services.messaging.adapters.ActionScriptAdapter" - default="true" /> - <!-- - <adapter-definition id="jms" - class="flex.messaging.services.messaging.adapters.JMSAdapter"/> - --> - <adapter-definition id="DataPushAdapter" class="StartupService" /> - </adapters> + <adapters> + <adapter-definition id="actionscript" + class="flex.messaging.services.messaging.adapters.ActionScriptAdapter" + default="true"/> + </adapters> - <default-channels> - <channel ref="my-polling-amf" /> - <channel ref="my-streaming-amf" /> - </default-channels> - - <!--<destination id="mme"> - <properties> - <server> - <allow-subtopics>true</allow-subtopics> - <subtopic-separator>.</subtopic-separator> - </server> - </properties> - <channels> - <channel ref="my-streaming-amf" /> - </channels> - <adapter ref="DataPushAdapter"/> - - </destination> --> - </service> + <default-channels> + <channel ref="my-polling-amf"/> + </default-channels> + +</service> \ No newline at end of file Modified: mentalmodels/trunk/src/main/webapp/WEB-INF/flex/services-config.xml =================================================================== --- mentalmodels/trunk/src/main/webapp/WEB-INF/flex/services-config.xml 2009-08-25 19:54:34 UTC (rev 270) +++ mentalmodels/trunk/src/main/webapp/WEB-INF/flex/services-config.xml 2009-08-28 23:25:58 UTC (rev 271) @@ -1,104 +1,99 @@ -<?xml version="1.0" encoding="UTF-8"?> -<services-config> - <services> - <service-include file-path="remoting-config.xml"/> - <service-include file-path="proxy-config.xml"/> - <service-include file-path="messaging-config.xml"/> - <default-channels> - <channel ref="my-amf"/> - </default-channels> - </services> - <security> - <login-command class="flex.messaging.security.TomcatLoginCommand" server="Tomcat"/> - <!-- Uncomment the correct app server - <login-command class="flex.messaging.security.TomcatLoginCommand" server="JBoss"> - <login-command class="flex.messaging.security.JRunLoginCommand" server="JRun"/> - <login-command class="flex.messaging.security.WeblogicLoginCommand" server="Weblogic"/> - <login-command class="flex.messaging.security.WebSphereLoginCommand" server="WebSphere"/> - --> - <!-- - <security-constraint id="basic-read-access"> - <auth-method>Basic</auth-method> - <roles> - <role>guests</role> - <role>accountants</role> - <role>employees</role> - <role>managers</role> - </roles> - </security-constraint> - --> - </security> - <channels> - <channel-definition id="my-streaming-amf" class="mx.messaging.channels.StreamingAMFChannel"> - <endpoint url="http://{server.name}:{server.port}/{context.root}/msgbroker/streamingamf" class="flex.messaging.endpoints.StreamingAMFEndpoint"/> - <properties> - <idle-timeout-minutes>0</idle-timeout-minutes> - <max-streaming-clients>10</max-streaming-clients> - <server-to-client-heartbeat-millis>5000</server-to-client-heartbeat-millis> - <user-agent-settings> - <user-agent match-on="MSIE" kickstart-bytes="2048" max-streaming-connections-per-session="3"/> - <user-agent match-on="Firefox" kickstart-bytes="2048" max-streaming-connections-per-session="3"/> - </user-agent-settings> - - </properties> - </channel-definition> - <channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel"> - <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint"/> - </channel-definition> - <channel-definition id="my-secure-amf" class="mx.messaging.channels.SecureAMFChannel"> - <endpoint url="https://{server.name}:{server.port}/{context.root}/msgbroker/amfsecure" class="flex.messaging.endpoints.SecureAMFEndpoint"/> - <properties> - <add-no-cache-headers>false</add-no-cache-headers> - </properties> - </channel-definition> - <channel-definition id="my-polling-amf" class="mx.messaging.channels.AMFChannel"> - <endpoint url="http://{server.name}:{server.port}/{context.root}/msgbroker/amfpolling" class="flex.messaging.endpoints.AMFEndpoint"/> - <properties> - <polling-enabled>true</polling-enabled> - <polling-interval-seconds>4</polling-interval-seconds> - </properties> - </channel-definition> - <!-- - <channel-definition id="my-http" class="mx.messaging.channels.HTTPChannel"> - <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/http" class="flex.messaging.endpoints.HTTPEndpoint"/> - </channel-definition> - - <channel-definition id="my-secure-http" class="mx.messaging.channels.SecureHTTPChannel"> - <endpoint url="https://{server.name}:{server.port}/{context.root}/messagebroker/httpsecure" class="flex.messaging.endpoints.SecureHTTPEndpoint"/> - <properties> - <add-no-cache-headers>false</add-no-cache-headers> - </properties> - </channel-definition> - --> - </channels> - <logging> - <target class="flex.messaging.log.ConsoleTarget" level="Error"> - <properties> - <prefix>[BlazeDS] </prefix> - <includeDate>false</includeDate> - <includeTime>false</includeTime> - <includeLevel>false</includeLevel> - <includeCategory>false</includeCategory> - </properties> - <filters> - <pattern>Endpoint.*</pattern> - <pattern>Service.*</pattern> - <pattern>Configuration</pattern> - </filters> - </target> - </logging> - <system> - <redeploy> - <enabled>false</enabled> - <!-- - <watch-interval>20</watch-interval> - <watch-file>{context.root}/WEB-INF/flex/services-config.xml</watch-file> - <watch-file>{context.root}/WEB-INF/flex/proxy-config.xml</watch-file> - <watch-file>{context.root}/WEB-INF/flex/remoting-config.xml</watch-file> - <watch-file>{context.root}/WEB-INF/flex/messaging-config.xml</watch-file> - <watch-file>{context.root}/WEB-INF/flex/data-management-config.xml</watch-file> - <touch-file>{context.root}/WEB-INF/web.xml</touch-file> - --> - </redeploy> - </system> -</services-config> +<?xml version="1.0" encoding="UTF-8"?> +<services-config> + + <services> + <service-include file-path="proxy-config.xml" /> + <!-- <service-include file-path="messaging-config.xml" /> --> + + <default-channels> + <channel ref="my-amf"/> + + </default-channels> + + </services> + + + + <channels> + + <channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel"> + <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint"/> + </channel-definition> + + <channel-definition id="my-secure-amf" class="mx.messaging.channels.SecureAMFChannel"> + <endpoint url="https://{server.name}:{server.port}/{context.root}/messagebroker/amfsecure" class="flex.messaging.endpoints.SecureAMFEndpoint"/> + <properties> + <add-no-cache-headers>false</add-no-cache-headers> + </properties> + </channel-definition> + + <channel-definition id="my-polling-amf" class="mx.messaging.channels.AMFChannel"> + <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amfpolling" class="flex.messaging.endpoints.AMFEndpoint"/> + <properties> + <polling-enabled>true</polling-enabled> + <polling-interval-seconds>4</polling-interval-seconds> + </properties> + </channel-definition> + + <channel-definition id="my-longpolling-amf" class="mx.messaging.channels.AMFChannel"> + <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amflongpolling" class="flex.messaging.endpoints.AMFEndpoint"/> + <properties> + <polling-enabled>true</polling-enabled> + <polling-interval-seconds>5</polling-interval-seconds> + <!-- <wait-interval-millis>60000</wait-interval-millis>--> +<!-- <client-wait-interval-millis>1</client-wait-interval-millis>--> + <max-waiting-poll-requests>200</max-waiting-poll-requests> + </properties> + </channel-definition> + + <channel-definition id="my-streaming-amf" class="mx.messaging.channels.StreamingAMFChannel"> + <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/streamingamf" class="flex.messaging.endpoints.StreamingAMFEndpoint"/> + </channel-definition> + + <!-- + <channel-definition id="my-http" class="mx.messaging.channels.HTTPChannel"> + <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/http" class="flex.messaging.endpoints.HTTPEndpoint"/> + </channel-definition> + + <channel-definition id="my-secure-http" class="mx.messaging.channels.SecureHTTPChannel"> + <endpoint url="https://{server.name}:{server.port}/{context.root}/messagebroker/httpsecure" class="flex.messaging.endpoints.SecureHTTPEndpoint"/> + <properties> + <add-no-cache-headers>false</add-no-cache-headers> + </properties> + </channel-definition> + --> + </channels> + + <logging> + <target class="flex.messaging.log.ConsoleTarget" level="Warn"> + <properties> + <prefix>[BlazeDS] </prefix> + <includeDate>false</includeDate> + <includeTime>false</includeTime> + <includeLevel>false</includeLevel> + <includeCategory>false</includeCategory> + </properties> + <filters> + <pattern>Endpoint.*</pattern> + <pattern>Service.*</pattern> + <pattern>Configuration</pattern> + </filters> + </target> + </logging> + + <system> + <redeploy> + <enabled>false</enabled> + <!-- + <watch-interval>20</watch-interval> + <watch-file>{context.root}/WEB-INF/flex/services-config.xml</watch-file> + <watch-file>{context.root}/WEB-INF/flex/proxy-config.xml</watch-file> + <watch-file>{context.root}/WEB-INF/flex/remoting-config.xml</watch-file> + <watch-file>{context.root}/WEB-INF/flex/messaging-config.xml</watch-file> + <watch-file>{context.root}/WEB-INF/flex/data-management-config.xml</watch-file> + <touch-file>{context.root}/WEB-INF/web.xml</touch-file> + --> + </redeploy> + </system> + +</services-config> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: Kalin J. <kj...@as...> - 2009-08-28 19:12:00
|
I leave work today at 12:00pm (1hr) I will be coming back to finish working on saveStrategy later tonight On Fri, Aug 28, 2009 at 11:10 AM, Kalin Jonas <kj...@as...> wrote: > I come in to work today at 11:00am > I will continue working on saveStrategy, trying to see if getting the > locations would help. > |
From: Kalin J. <kj...@as...> - 2009-08-28 18:10:38
|
I come in to work today at 11:00am I will continue working on saveStrategy, trying to see if getting the locations would help. |
From: Kalin J. <kj...@as...> - 2009-08-27 23:29:59
|
I chck out at 16:00 (2hr) today I can't seem to get the saveStrategy to work. I will commit my code. What I have been doing is: create game, create student (using gamecode), and saveStrategy with a single strategy. I'll look at what I've been doing and try to understand the problem more . On Thu, Aug 27, 2009 at 2:10 PM, Kalin Jonas <kj...@as...> wrote: > Today i start work at 14:00pm > I will be checking to see if I can use the saveStrategy method. > |
From: Kalin J. <kj...@as...> - 2009-08-27 21:11:02
|
Today i start work at 14:00pm I will be checking to see if I can use the saveStrategy method. |
From: Kalin J. <kj...@as...> - 2009-08-25 20:07:38
|
I have seen the client still working with the server. I have implemented the small popup button on InitialiseDatabase. I leave work today at 13:00pm (2.25hr) On Tue, Aug 25, 2009 at 10:52 AM, Kalin Jonas <kj...@as...> wrote: > Today I come in at 10:45am > I will be making sure the server is still contacting the client, and keep > working on the mini information window popup for Initialize Database > |
From: <kj...@us...> - 2009-08-25 19:54:45
|
Revision: 270 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=270&view=rev Author: kjonas Date: 2009-08-25 19:54:34 +0000 (Tue, 25 Aug 2009) Log Message: ----------- Added button to InitialiseDatabase.mxml which will pop up any information window, based off an ID FisheryExperimentShell.mxml now loads which information windows to show from the Block itself, defaults to basic windows that always display Added code to work with GameCode in FisheryExperimentCore.mxml Modified Paths: -------------- mentalmodels/trunk/flex/src/FisheryExperimentShell.mxml mentalmodels/trunk/flex/src/InitialiseDatabase.mxml mentalmodels/trunk/flex/src/_InstructionsTest.mxml mentalmodels/trunk/flex/src/actionscript/Round.as mentalmodels/trunk/flex/src/custom/FisheryExperimentCore.mxml mentalmodels/trunk/flex/src/custom/InformationWindowPopup.mxml mentalmodels/trunk/flex/src/custom/InstructionPage.mxml mentalmodels/trunk/flex/src/test.mxml mentalmodels/trunk/src/main/webapp/FisheryExperimentShell.swf mentalmodels/trunk/src/main/webapp/InitialiseDatabase.swf mentalmodels/trunk/src/main/webapp/StartGame.swf mentalmodels/trunk/src/main/webapp/test.html mentalmodels/trunk/src/main/webapp/test.swf Added Paths: ----------- mentalmodels/trunk/flex/src/custom/InformationWindowButton.mxml Modified: mentalmodels/trunk/flex/src/FisheryExperimentShell.mxml =================================================================== --- mentalmodels/trunk/flex/src/FisheryExperimentShell.mxml 2009-08-25 00:20:46 UTC (rev 269) +++ mentalmodels/trunk/flex/src/FisheryExperimentShell.mxml 2009-08-25 19:54:34 UTC (rev 270) @@ -17,7 +17,7 @@ } public function progressBarInit():void { - progressTimer = new Timer(100, repetitions); // 21600 * 1000 = 6hrs + progressTimer = new Timer(100, repetitions); // 10rep:1sec, 600rep:1min, 3000rep:5min progressTimer.addEventListener(TimerEvent.TIMER, timerTick); progressTimer.start(); } @@ -70,12 +70,13 @@ </mx:HBox> </mx:HBox> </mx:VBox> - <custom:FisheryExperimentCore id="fisheryContent" blockLoader="loadBlock" shell="{this}"/> + <custom:FisheryExperimentCore id="fisheryContent" shell="{this}"/> </mx:VBox> </mx:HBox> <mx:Script> <![CDATA[ + import actionscript.InformationWindow; import mx.controls.Alert; import mx.controls.Label; import actionscript.Block; @@ -117,11 +118,8 @@ allInfoWindowsA = allInfoWindowsA.getItemAt(0) as ArrayCollection; allInfoWindowsB = allInfoWindowsB.getItemAt(0) as ArrayCollection; - - var arry:ArrayCollection = new ArrayCollection(); // fix when communicating with server... - for(var i:int=0;i<30;i++) arry.addItem(i); // fix when communicating with server... - selectCurrentWindows( arry ); // fix when communicating with server... - cbxChanged(); + // Display only the default windows. + selectCurrentWindows( new ArrayCollection() ); } public function popupInformationWindow(window:int):void @@ -226,6 +224,8 @@ cbxPickerA.dataProvider = currInfoWindowsDescriptions; cbxPickerB.dataProvider = currInfoWindowsDescriptions; + + cbxChanged(); } public function cbxChanged():void @@ -260,9 +260,25 @@ } } - public function loadBlock(module:Module, block:Block):void + public function loadBlock(block:Block, module:Module=null):void { + if(block != null) + { + currBlock = block; + + var tempArray:ArrayCollection = new ArrayCollection(); + for(var i:int = 0; i<currBlock.informationWindows.length; i++) + { + var temp:InformationWindow = (currBlock.informationWindows.getItemAt(i) as InformationWindow); + tempArray.addItem(temp.id); + } + selectCurrentWindows( tempArray ); + } + if(module != null) + { + currModule = module; + } } ]]> Modified: mentalmodels/trunk/flex/src/InitialiseDatabase.mxml =================================================================== --- mentalmodels/trunk/flex/src/InitialiseDatabase.mxml 2009-08-25 00:20:46 UTC (rev 269) +++ mentalmodels/trunk/flex/src/InitialiseDatabase.mxml 2009-08-25 19:54:34 UTC (rev 270) @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:net="flash.net.*" xmlns:comp="custom.db.questions.*" xmlns:basicComp="custom.db.*" backgroundGradientAlphas="[1.0, 1.0]" backgroundGradientColors="[#FFFFFF, #80FFAA]" - width="100%" height="100%" clipContent="false" layout="absolute" currentState="none" initialize="init()"> + width="100%" height="100%" clipContent="false" layout="absolute" currentState="none" initialize="init()" xmlns:custom="custom.*"> <mx:Script> <![CDATA[ import mx.binding.utils.BindingUtils; @@ -1661,10 +1661,10 @@ <mx:GridRow width="100%" height="100%" id="gridrow2"> <mx:GridItem width="100%" height="100%" id="griditem1"> <mx:Button label="Remove Item" id="butRemModule" click ="{removeItem()}"/> - </mx:GridItem> - - + <mx:GridItem width="100%" height="100%" id="griditem100"> + <custom:InformationWindowButton superParent="{this}"/> + </mx:GridItem> </mx:GridRow> </mx:Grid> Modified: mentalmodels/trunk/flex/src/_InstructionsTest.mxml =================================================================== --- mentalmodels/trunk/flex/src/_InstructionsTest.mxml 2009-08-25 00:20:46 UTC (rev 269) +++ mentalmodels/trunk/flex/src/_InstructionsTest.mxml 2009-08-25 19:54:34 UTC (rev 270) @@ -1,8 +1,12 @@ <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:comp="custom.*" xmlns:as="actionscript.*" - layout="horizontal" - backgroundGradientColors="[#FFFFFF, #B0B0FF]" xmlns:strategyDesign="custom.questions.strategyDesign.*" xmlns:dayByDayDecisions="custom.questions.dayByDayDecisions.*"> + layout="vertical" + backgroundGradientColors="[#FFFFFF, #B0B0FF]" xmlns:strategyDesign="custom.questions.strategyDesign.*" xmlns:dayByDayDecisions="custom.questions.dayByDayDecisions.*" xmlns:psychometric="custom.questions.psychometric.*"> + <comp:InformationWindowButton superParent="{this}"/> + + <comp:InstructionPage id="ins" initialize="ins.init(makeBlock())"/> + <mx:VBox> <mx:Button id="save" click="save_click()" label="Save"/> <mx:Button id="load" click="load_click()" label="Load"/> Modified: mentalmodels/trunk/flex/src/actionscript/Round.as =================================================================== --- mentalmodels/trunk/flex/src/actionscript/Round.as 2009-08-25 00:20:46 UTC (rev 269) +++ mentalmodels/trunk/flex/src/actionscript/Round.as 2009-08-25 19:54:34 UTC (rev 270) @@ -1,6 +1,8 @@ package actionscript { + import mx.collections.ArrayCollection; + [Bindable] [RemoteClass(alias="edu.asu.commons.mme.entity.Round")] public class Round Modified: mentalmodels/trunk/flex/src/custom/FisheryExperimentCore.mxml =================================================================== --- mentalmodels/trunk/flex/src/custom/FisheryExperimentCore.mxml 2009-08-25 00:20:46 UTC (rev 269) +++ mentalmodels/trunk/flex/src/custom/FisheryExperimentCore.mxml 2009-08-25 19:54:34 UTC (rev 270) @@ -109,7 +109,6 @@ public var currentRoundNumber:int = 0; [Bindable] public var locations:ArrayCollection = new ArrayCollection([newLocation(0, 0)]); - public var blockLoader:Function = null; public var shell:FisheryExperimentShell = null; public var updateObjectA:InformationWindowCreator = null; @@ -276,14 +275,60 @@ } private function blockResultHandler(event:ResultEvent):void { + if(currentState == "none") + { + Alert.show("Block received in End of Game state.","Unexpected Block"); + return; + } + else if(currentState == "wait") + { + loadNextBlock(event.result as actionscript.Block); + } + else if(currentState == "instructions") + { + finishBlockEarly(); + loadNextBlock(event.result as actionscript.Block); + } + else if(currentState == "socioDemographic") + { + currentState = "none"; + Alert.show("Block received in Socio Demographic state.","Unexpected Block"); + } + else if(currentState == "instructionsLoad") + { + currentState = "none"; + Alert.show("Block received in Instructions (load) state.","Unexpected Block"); + } + } + + private function finishBlockEarly():void + { + + } + + private function saveDataToShell():void + { + shell.updateObjectA.updateDayByDayDecisions(instructions.savedDayByDayDecisions); + shell.updateObjectA.updateForecasting(instructions.savedForecastFish, instructions.savedForecastPeople); + shell.updateObjectA.updateStrategyDesign(instructions.savedStrategyDesign); + + shell.updateObjectB.updateDayByDayDecisions(instructions.savedDayByDayDecisions); + shell.updateObjectB.updateForecasting(instructions.savedForecastFish, instructions.savedForecastPeople); + shell.updateObjectB.updateStrategyDesign(instructions.savedStrategyDesign); + } + + private function loadNextBlock(nextBlock:Block):void + { // save questions from previous Block if(currentBlock != null) { sendBlockQuestions(); + instructions.saveData(); + saveDataToShell(); } // update with new block - currentBlock = (event.result as actionscript.Block); + currentBlock = nextBlock; if(currentBlock == null || currentBlock.questionGroups == null @@ -355,6 +400,11 @@ private function studentResultHandler(event:ResultEvent):void { + if(event.result == null) + { + Alert.show("event.result is null"); + } + Alert.show("GameCode is '" + (event.result as actionscript.Student).gameCode + "'"); studentObject = event.result as actionscript.Student; consumer.disconnect(); } @@ -418,7 +468,7 @@ obj.visible = false; expiredContent.addChild(obj); - var newStudent:actionscript.Student = new Student(); + var newStudent:actionscript.Student = new actionscript.Student(); newStudent.birthYear = ((obj as SocioDemographicPage).getYear() as int); newStudent.gender = (obj as SocioDemographicPage).getGender(); newStudent.major = (obj as SocioDemographicPage).getMajor(); Added: mentalmodels/trunk/flex/src/custom/InformationWindowButton.mxml =================================================================== --- mentalmodels/trunk/flex/src/custom/InformationWindowButton.mxml (rev 0) +++ mentalmodels/trunk/flex/src/custom/InformationWindowButton.mxml 2009-08-25 19:54:34 UTC (rev 270) @@ -0,0 +1,52 @@ +<?xml version="1.0" encoding="utf-8"?> +<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" horizontalAlign="center"> + + <mx:Text width="{idBox.width}" text="Click the button to show popup with that ID"/> + + <mx:HBox id="idBox"> + <mx:Label text="Window ID #:"/> + <mx:NumericStepper id="stpValue" minimum="0" maximum="15" value="0" stepSize="1"/> + </mx:HBox> + + <mx:Button id="btnPopup" label="Show Popup" click="on_click()"/> + + <mx:Script> + <![CDATA[ + import mx.events.CloseEvent; + import mx.controls.Alert; + import mx.managers.PopUpManager; + import actionscript.InformationWindowCreator; + import mx.collections.ArrayCollection; + + private var windows:ArrayCollection = InformationWindowCreator.makeWindows().getItemAt(0) as ArrayCollection; + public var superParent:DisplayObject = null; + private var old:InformationWindowPopup = null; + + private function on_click():void + { + if(superParent == null) superParent = this; + + if(old != null) + { + old.titleWindow_close(new CloseEvent("")); + } + + if(stpValue.value < windows.length) + { + var popup:InformationWindowPopup = PopUpManager.createPopUp(superParent, InformationWindowPopup, false) as InformationWindowPopup; + + var window:ArrayCollection = windows.getItemAt(stpValue.value) as ArrayCollection; + for(var i:int=0; i<window.length; i++) + { + popup.addChild(window.getItemAt(i) as DisplayObject); + } + + PopUpManager.centerPopUp(popup); + old = popup; + } + } + + ]]> + </mx:Script> + +</mx:VBox> Modified: mentalmodels/trunk/flex/src/custom/InformationWindowPopup.mxml =================================================================== --- mentalmodels/trunk/flex/src/custom/InformationWindowPopup.mxml 2009-08-25 00:20:46 UTC (rev 269) +++ mentalmodels/trunk/flex/src/custom/InformationWindowPopup.mxml 2009-08-25 19:54:34 UTC (rev 270) @@ -13,9 +13,17 @@ public var valid:Boolean = true; public var window:int = -1; - private function titleWindow_close(evt:CloseEvent):void + public function titleWindow_close(evt:CloseEvent):void { - closedFunction.call(this,window); + if(closedFunction != null) + { + closedFunction.call(this,window); + } + else + { + removeAllChildren(); + PopUpManager.removePopUp(this); + } } ]]> </mx:Script> Modified: mentalmodels/trunk/flex/src/custom/InstructionPage.mxml =================================================================== --- mentalmodels/trunk/flex/src/custom/InstructionPage.mxml 2009-08-25 00:20:46 UTC (rev 269) +++ mentalmodels/trunk/flex/src/custom/InstructionPage.mxml 2009-08-25 19:54:34 UTC (rev 270) @@ -3,6 +3,8 @@ <mx:Script> <![CDATA[ + import custom.questions.strategyDesign.StrategyDesignQuestionC; + import custom.questions.dayByDayDecisions.DayByDayDecisionsQuestionC; import actionscript.Location; import actionscript.QuestionGroup; import actionscript.Module; @@ -26,7 +28,6 @@ public var savedForecastFish:ArrayCollection = null; public var savedStrategyDesign:ArrayCollection = null; public var savedDayByDayDecisions:ArrayCollection = null; -// public var savedDayByDayDecisions:ArrayCollection = null; private function newLocation(maxCapacity:Number,growth:Number):Location { @@ -178,6 +179,30 @@ } } + public function saveData():void + { + var currPageArray:Array = (pageDisplay.currentPage as VBox).getChildren(); + for(var i:int = 0; i < currPageArray.length; i++) + { + if(currPageArray[i] is ForecastingPeopleQuestionC) + { + savedForecastPeople = (currPageArray[i] as ForecastingPeopleQuestionC).save(); + } + else if(currPageArray[i] is ForecastingFishQuestionC) + { + savedForecastFish = (currPageArray[i] as ForecastingFishQuestionC).save(); + } + else if(currPageArray[i] is DayByDayDecisionsQuestionC) + { + savedDayByDayDecisions = (currPageArray[i] as DayByDayDecisionsQuestionC).save(); + } + else if(currPageArray[i] is StrategyDesignQuestionC) + { + savedStrategyDesign = (currPageArray[i] as StrategyDesignQuestionC).save(); + } + } + } + public function save():ArrayCollection { var saveArray:ArrayCollection = new ArrayCollection(); Modified: mentalmodels/trunk/flex/src/test.mxml =================================================================== --- mentalmodels/trunk/flex/src/test.mxml 2009-08-25 00:20:46 UTC (rev 269) +++ mentalmodels/trunk/flex/src/test.mxml 2009-08-25 19:54:34 UTC (rev 270) @@ -1,10 +1,12 @@ <?xml version="1.0" encoding="utf-8"?> -<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical"> +<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" xmlns:actionscript="actionscript.*"> + <actionscript:Student id="stu" gameCode="test1" birthYear="1991" gender="M" major="cse"/> + <mx:HBox> <mx:Button label="roundService.getBlock()" click="roundService.getBlock()"/> <mx:Button label="roundService.getCurrentRound()" click="roundService.getCurrentRound()"/> - <mx:Button label="startupService.createStudent()" click="startupService.createStudent()"/> + <mx:Button label="startupService.createStudent()" click="startupService.createStudent(stu)"/> <mx:Button label="answeringService.saveStrategy()" click="answeringService.saveStrategy()"/> <mx:Button label="locationService.getAllLocations()" click="locationService.getAllLocations()"/> </mx:HBox> Modified: mentalmodels/trunk/src/main/webapp/FisheryExperimentShell.swf =================================================================== (Binary files differ) Modified: mentalmodels/trunk/src/main/webapp/InitialiseDatabase.swf =================================================================== (Binary files differ) Modified: mentalmodels/trunk/src/main/webapp/StartGame.swf =================================================================== (Binary files differ) Modified: mentalmodels/trunk/src/main/webapp/test.html =================================================================== --- mentalmodels/trunk/src/main/webapp/test.html 2009-08-25 00:20:46 UTC (rev 269) +++ mentalmodels/trunk/src/main/webapp/test.html 2009-08-25 19:54:34 UTC (rev 270) @@ -28,6 +28,15 @@ <style> body { margin: 0px; overflow:hidden } </style> + +<script language="JavaScript"> + window.onbeforeunload = confirmExit; + function confirmExit() + { + return "If you are connected to the server, you will be disconnected if the page closes. Students in the experiment will be removed if the window closes."; + } +</script> + <script language="JavaScript" type="text/javascript"> <!-- // ----------------------------------------------------------------------------- @@ -44,8 +53,12 @@ </head> <body scroll="no"> + <script language="JavaScript" type="text/javascript"> <!-- + +var clientIP = '<!--#echo var="REMOTE_ADDR"-->'; + // Version check for the Flash Player that has the ability to start Player Product Install (6.0r65) var hasProductInstall = DetectFlashVer(6, 0, 65); @@ -57,12 +70,12 @@ // Location visited after installation is complete if installation is required var MMPlayerType = (isIE == true) ? "ActiveX" : "PlugIn"; var MMredirectURL = window.location; - document.title = document.title.slice(0, 47) + " - Flash Player Installation"; - var MMdoctitle = document.title; + document.title = document.title.slice(0, 47) + " - Flash Player Installation"; + var MMdoctitle = document.title; AC_FL_RunContent( "src", "playerProductInstall", - "FlashVars", "MMredirectURL="+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle+"", + "FlashVars", "MMredirectURL="+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle+'&ip=test'+clientIP+"", "width", "100%", "height", "100%", "align", "middle", @@ -82,27 +95,30 @@ "width", "100%", "height", "100%", "align", "middle", + "valign", "middle", "id", "test", "quality", "high", "bgcolor", "#869ca7", "name", "test", "allowScriptAccess","sameDomain", "type", "application/x-shockwave-flash", - "pluginspage", "http://www.adobe.com/go/getflashplayer" + "pluginspage", "http://www.adobe.com/go/getflashplayer", + "FlashVars", "ip=test"+clientIP+"" ); - } else { // flash is too old or we can't detect the plugin - var alternateContent = 'Alternate HTML content should be placed here. ' - + 'This content requires the Adobe Flash Player. ' - + '<a href=http://www.adobe.com/go/getflash/>Get Flash</a>'; - document.write(alternateContent); // insert non-flash content +} else { // flash is too old or we can't detect the plugin + var alternateContent = 'Alternate HTML content should be placed here. ' + + 'This content requires the Adobe Flash Player. ' + + '<a href=http://www.adobe.com/go/getflash/>Get Flash</a>'; + document.write(alternateContent); // insert non-flash content } // --> </script> <noscript> - <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" + <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="test" width="100%" height="100%" codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab"> <param name="movie" value="test.swf" /> + <PARAM NAME=FlashVars VALUE="ip=test${clientIP}"> <param name="quality" value="high" /> <param name="bgcolor" value="#869ca7" /> <param name="allowScriptAccess" value="sameDomain" /> Modified: mentalmodels/trunk/src/main/webapp/test.swf =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: Kalin J. <kj...@as...> - 2009-08-25 17:53:10
|
Today I come in at 10:45am I will be making sure the server is still contacting the client, and keep working on the mini information window popup for Initialize Database |
From: <see...@us...> - 2009-08-25 00:22:17
|
Revision: 269 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=269&view=rev Author: seematalele Date: 2009-08-25 00:20:46 +0000 (Tue, 25 Aug 2009) Log Message: ----------- Changed the pom.xml so that it will point to spring-flex 1.0.0.RC2 version. Configured the project using new version of BlazeDS(spring-flex-1.0.0.RC2) Modified Paths: -------------- mentalmodels/trunk/flex/src/custom/FisheryExperimentCore.mxml mentalmodels/trunk/pom.xml mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StartGame.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StartupService.java mentalmodels/trunk/src/main/webapp/WEB-INF/applicationContext.xml mentalmodels/trunk/src/main/webapp/WEB-INF/flex/messaging-config.xml mentalmodels/trunk/src/main/webapp/WEB-INF/flex/services-config.xml Modified: mentalmodels/trunk/flex/src/custom/FisheryExperimentCore.mxml =================================================================== --- mentalmodels/trunk/flex/src/custom/FisheryExperimentCore.mxml 2009-08-21 23:37:51 UTC (rev 268) +++ mentalmodels/trunk/flex/src/custom/FisheryExperimentCore.mxml 2009-08-25 00:20:46 UTC (rev 269) @@ -430,7 +430,7 @@ currentState = "wait"; btnBack.enabled = btnForward.enabled = btnReset.enabled = true; - getNextBlock(); + //getNextBlock(); returnValue = true; } } Modified: mentalmodels/trunk/pom.xml =================================================================== --- mentalmodels/trunk/pom.xml 2009-08-21 23:37:51 UTC (rev 268) +++ mentalmodels/trunk/pom.xml 2009-08-25 00:20:46 UTC (rev 269) @@ -1,220 +1,230 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- + <!-- vim:sts=2:sw=2 --> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - <organization> - <name>The Virtual Commons</name> - <url>http://dev.commons.asu.edu</url> - </organization> - <modelVersion>4.0.0</modelVersion> - <groupId>edu.asu.commons</groupId> - <artifactId>mme</artifactId> - <version>0.1-SNAPSHOT</version> - <name>Mental Models Application</name> - <packaging>war</packaging> - <repositories> - <repository> - <id>dev.commons.asu.edu</id> - <url>http://dev.commons.asu.edu/archiva/repository/internal/</url> - <releases> - <enabled>true</enabled> - </releases> - <snapshots> - <enabled>false</enabled> - </snapshots> - </repository> - </repositories> - <dependencies> - <!-- mysql jdbc --> - <dependency> - <groupId>mysql</groupId> - <artifactId>mysql-connector-java</artifactId> - <version>5.1.6</version> - </dependency> - <!-- spring dependencies --> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring</artifactId> - <version>2.5.6</version> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-webmvc</artifactId> - <version>2.5.6</version> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-flex</artifactId> - <version>1.0.0.M2</version> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-hibernate3</artifactId> - <version>2.0-m3</version> - </dependency> - <dependency> - <groupId>cglib</groupId> - <artifactId>cglib-nodep</artifactId> - <version>2.2</version> - </dependency> - <!-- hibernate and JPA persistence --> - <dependency> - <groupId>javax.persistence</groupId> - <artifactId>persistence-api</artifactId> - <version>1.0</version> - </dependency> - <dependency> - <groupId>org.hibernate</groupId> - <artifactId>hibernate-annotations</artifactId> - <version>3.4.0.GA</version> - </dependency> - <dependency> - <groupId>org.hibernate</groupId> - <artifactId>hibernate-ehcache</artifactId> - <version>3.3.1.GA</version> - </dependency> - <dependency> - <groupId>org.hibernate</groupId> - <artifactId>hibernate-tools</artifactId> - <version>3.2.3.GA</version> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-log4j12</artifactId> - <version>1.5.2</version> - </dependency> - <dependency> - <groupId>commons-httpclient</groupId> - <artifactId>commons-httpclient</artifactId> - <version>3.1</version> - </dependency> - <dependency> - <groupId>commons-dbcp</groupId> - <artifactId>commons-dbcp</artifactId> - <version>1.2.2</version> - </dependency> - <dependency> - <groupId>javassist</groupId> - <artifactId>javassist</artifactId> - <version>3.8.0.GA</version> - </dependency> - <!-- - <dependency> - <groupId>org.apache.httpcomponents</groupId> - <artifactId>httpclient</artifactId> - <version>4.0-beta2</version> - </dependency> - --> - <dependency> - <groupId>com.adobe.blazeds</groupId> - <artifactId>blazeds-core</artifactId> - <version>3.2.0.3978</version> - </dependency> - <dependency> - <groupId>com.adobe.blazeds</groupId> - <artifactId>blazeds-remoting</artifactId> - <version>3.2.0.3978</version> - </dependency> - <dependency> - <groupId>com.adobe.blazeds</groupId> - <artifactId>blazeds-common</artifactId> - <version>3.2.0.3978</version> - </dependency> - <dependency> - <groupId>com.adobe.blazeds</groupId> - <artifactId>blazeds-proxy</artifactId> - <version>3.2.0.3978</version> - </dependency> - <dependency> - <groupId>com.adobe.blazeds</groupId> - <artifactId>blazeds-opt</artifactId> - <version>3.2.0.3978</version> - </dependency> - <dependency> - <groupId>xalan</groupId> - <artifactId>xalan</artifactId> - <version>2.7.1</version> - </dependency> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <organization> + <name>The Virtual Commons</name> + <url>http://dev.commons.asu.edu</url> + </organization> + <modelVersion>4.0.0</modelVersion> + <groupId>edu.asu.commons</groupId> + <artifactId>mme</artifactId> + <version>0.1-SNAPSHOT</version> + <name>Mental Models Application</name> + <packaging>war</packaging> + <repositories> + <repository> + <id>dev.commons.asu.edu</id> + <url>http://dev.commons.asu.edu/archiva/repository/internal/</url> + <releases> + <enabled>true</enabled> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </repository> + <repository> + <id>spring-milestone</id> + <name>Spring Portfolio Milestone Repository</name> + <url>http://maven.springframework.org/milestone</url> + <releases> + <enabled>true</enabled> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </repository> + </repositories> + <dependencies> + <!-- mysql jdbc --> + <dependency> + <groupId>mysql</groupId> + <artifactId>mysql-connector-java</artifactId> + <version>5.1.6</version> + </dependency> + <!-- spring dependencies --> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring</artifactId> + <version>2.5.6</version> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-webmvc</artifactId> + <version>2.5.6</version> + </dependency> + <dependency> +<groupId>org.springframework.flex</groupId> +<artifactId>spring-flex</artifactId> +<version>1.0.0.RC2</version> +</dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-hibernate3</artifactId> + <version>2.0-m3</version> + </dependency> + <dependency> + <groupId>cglib</groupId> + <artifactId>cglib-nodep</artifactId> + <version>2.2</version> + </dependency> + <!-- hibernate and JPA persistence --> + <dependency> + <groupId>javax.persistence</groupId> + <artifactId>persistence-api</artifactId> + <version>1.0</version> + </dependency> + <dependency> + <groupId>org.hibernate</groupId> + <artifactId>hibernate-annotations</artifactId> + <version>3.4.0.GA</version> + </dependency> + <dependency> + <groupId>org.hibernate</groupId> + <artifactId>hibernate-ehcache</artifactId> + <version>3.3.1.GA</version> + </dependency> + <dependency> + <groupId>org.hibernate</groupId> + <artifactId>hibernate-tools</artifactId> + <version>3.2.3.GA</version> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + <version>1.5.2</version> + </dependency> + <dependency> + <groupId>commons-httpclient</groupId> + <artifactId>commons-httpclient</artifactId> + <version>3.1</version> + </dependency> + <dependency> + <groupId>commons-dbcp</groupId> + <artifactId>commons-dbcp</artifactId> + <version>1.2.2</version> + </dependency> + <dependency> + <groupId>javassist</groupId> + <artifactId>javassist</artifactId> + <version>3.8.0.GA</version> + </dependency> + <!-- + <dependency> <groupId>org.apache.httpcomponents</groupId> + <artifactId>httpclient</artifactId> <version>4.0-beta2</version> + </dependency> + --> + <dependency> + <groupId>com.adobe.blazeds</groupId> + <artifactId>blazeds-core</artifactId> + <version>3.2.0.3978</version> + </dependency> + <dependency> + <groupId>com.adobe.blazeds</groupId> + <artifactId>blazeds-remoting</artifactId> + <version>3.2.0.3978</version> + </dependency> + <dependency> + <groupId>com.adobe.blazeds</groupId> + <artifactId>blazeds-common</artifactId> + <version>3.2.0.3978</version> + </dependency> + <dependency> + <groupId>com.adobe.blazeds</groupId> + <artifactId>blazeds-proxy</artifactId> + <version>3.2.0.3978</version> + </dependency> + <dependency> + <groupId>com.adobe.blazeds</groupId> + <artifactId>blazeds-opt</artifactId> + <version>3.2.0.3978</version> + </dependency> + <dependency> + <groupId>xalan</groupId> + <artifactId>xalan</artifactId> + <version>2.7.1</version> + </dependency> - </dependencies> - <build> - <finalName>mme</finalName> - <testResources> - <testResource> - <directory>src/main/webapp</directory> - </testResource> - </testResources> - <plugins> - <plugin> - <artifactId>maven-compiler-plugin</artifactId> - <configuration> - <source>1.6</source> - <target>1.6</target> - </configuration> - </plugin> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>tomcat-maven-plugin</artifactId> - <configuration> - <server>myserver</server> - </configuration> + </dependencies> + <build> + <finalName>mme</finalName> + <testResources> + <testResource> + <directory>src/main/webapp</directory> + </testResource> + </testResources> + <plugins> + <plugin> + <artifactId>maven-compiler-plugin</artifactId> + <configuration> + <source>1.6</source> + <target>1.6</target> + </configuration> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>tomcat-maven-plugin</artifactId> + <configuration> + <server>myserver</server> + </configuration> - </plugin> - <plugin> - <groupId>org.mortbay.jetty</groupId> - <artifactId>maven-jetty-plugin</artifactId> - <configuration> - <connectors> - <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector"> - <port>8080</port> - <maxIdleTime>60000</maxIdleTime> - </connector> - </connectors> - <scanIntervalSeconds>10</scanIntervalSeconds> - <stopKey>tdar</stopKey> - <stopPort>12919</stopPort> - </configuration> - </plugin> - </plugins> - </build> - <profiles> - <profile> - <id>ant</id> - <build> - <defaultGoal>antrun:run</defaultGoal> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-antrun-plugin</artifactId> - <goals> - <goal>load</goal> - </goals> - <configuration> - <tasks> - <!-- - can be invoked via - mvn -P ant -D target=initialize-data - --> - <property name="compile.classpath" refid="maven.compile.classpath"/> - <property name="runtime.classpath" refid="maven.runtime.classpath"/> - <property name="test.classpath" refid="maven.test.classpath"/> - <property name="plugin.classpath" refid="maven.plugin.classpath"/> - <ant antfile="${basedir}/init-db.ant.xml" inheritRefs="true" inheritAll="true"> - <target name="${target}"/> - </ant> - </tasks> - </configuration> - </plugin> - </plugins> - </build> - <dependencies> - <dependency> - <groupId>ant-contrib</groupId> - <artifactId>ant-contrib</artifactId> - <version>1.0b2</version> - </dependency> - </dependencies> - </profile> - </profiles> + </plugin> + <plugin> + <groupId>org.mortbay.jetty</groupId> + <artifactId>maven-jetty-plugin</artifactId> + <configuration> + <connectors> + <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector"> + <port>8080</port> + <maxIdleTime>60000</maxIdleTime> + </connector> + </connectors> + <scanIntervalSeconds>10</scanIntervalSeconds> + <stopKey>tdar</stopKey> + <stopPort>12919</stopPort> + </configuration> + </plugin> + </plugins> + </build> + <profiles> + <profile> + <id>ant</id> + <build> + <defaultGoal>antrun:run</defaultGoal> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-antrun-plugin</artifactId> + <goals> + <goal>load</goal> + </goals> + <configuration> + <tasks> + <!-- + can be invoked via mvn -P ant -D target=initialize-data + --> + <property name="compile.classpath" refid="maven.compile.classpath" /> + <property name="runtime.classpath" refid="maven.runtime.classpath" /> + <property name="test.classpath" refid="maven.test.classpath" /> + <property name="plugin.classpath" refid="maven.plugin.classpath" /> + <ant antfile="${basedir}/init-db.ant.xml" inheritRefs="true" + inheritAll="true"> + <target name="${target}" /> + </ant> + </tasks> + </configuration> + </plugin> + </plugins> + </build> + <dependencies> + <dependency> + <groupId>ant-contrib</groupId> + <artifactId>ant-contrib</artifactId> + <version>1.0b2</version> + </dependency> + </dependencies> + </profile> + </profiles> </project> Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StartGame.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StartGame.java 2009-08-21 23:37:51 UTC (rev 268) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StartGame.java 2009-08-25 00:20:46 UTC (rev 269) @@ -70,12 +70,13 @@ //roundService.test(); - MessageBroker msgBroker = MessageBroker.getMessageBroker(null); + MessageBroker msgBroker = MessageBroker.getMessageBroker("_messageBroker"); String clientID = UUIDUtils.createUUID(); int i=0; - while (running) { + while (i<3) { i++; + String msgDestination = roundService.getCurrentGame().getDescription(); /*if(getCurrentModuleRoundConfig() == null) { setCurrentModuleRoundConfig(new ModuleRoundConfig()); @@ -84,19 +85,21 @@ //Push the first block to the clients AsyncMessage msg = new AsyncMessage(); - msg.setDestination("DataPush"); + msg.setDestination("mme"); //msg.setHeader("DSSubtopic", "hello"); msg.setClientId(clientID); msg.setMessageId(UUIDUtils.createUUID()); msg.setTimestamp(System.currentTimeMillis()); - System.out.println("in while loop: "); + +// System.out.println("in while loop: "); block = roundService.getBlock(); - System.out.println("after block "); - msg.setBody("Here is a block!!!" + block); + // System.out.println("after block "); + msg.setBody(block); + msgBroker.routeMessageToService(msg, null); System.out.println("Message broker is: "+ msgBroker); System.out.println("Message is: "+ block.getDescription()); - msgBroker.routeMessageToService(msg, null); - if(block.getDescription().equalsIgnoreCase("Day-by-day decisions game")) + + /* if(block.getDescription().equalsIgnoreCase("Day-by-day decisions game")) { //start day by day decision //getDayBydayDecisionService(). @@ -106,13 +109,13 @@ { //start communication round - } + }*/ //get the timer for the block Integer timer = roundService.getTimerforBlock(block); //start the timer for the block sent try { //for testing purpose 5000 is given as an argument - Thread.sleep(5000); + Thread.sleep(10000); if(block == null) { running = false; Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StartupService.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StartupService.java 2009-08-21 23:37:51 UTC (rev 268) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StartupService.java 2009-08-25 00:20:46 UTC (rev 269) @@ -62,7 +62,7 @@ public void startGame() { //push assign groups to all the students - assignGroups(); + //assignGroups(); //start the game this.startGame.run(); Modified: mentalmodels/trunk/src/main/webapp/WEB-INF/applicationContext.xml =================================================================== --- mentalmodels/trunk/src/main/webapp/WEB-INF/applicationContext.xml 2009-08-21 23:37:51 UTC (rev 268) +++ mentalmodels/trunk/src/main/webapp/WEB-INF/applicationContext.xml 2009-08-25 00:20:46 UTC (rev 269) @@ -26,7 +26,11 @@ <!-- Flex related information started --> - <flex:message-broker /> + <flex:message-broker> +<flex:message-service + default-channels="my-streaming-amf,my-longpolling-amf,my-polling-amf" /> + +</flex:message-broker> <!-- XXX: Split these out into separate XML files and import them if this file gets too large --> <!-- spring managed daos --> @@ -109,7 +113,7 @@ <property name='moduleDao' ref='moduleDao'/> <property name='gameDao' ref='gameDao' /> <property name='moduleRoundDao' ref='moduleRoundDao' /> - <property name='blockDao' ref='blockDao'/> + <!-- <property name='blockDao' ref='blockDao'/> --> </bean> @@ -168,14 +172,17 @@ <!-- Expose services for Flex/BlazeDS remoting --> - <flex:remote-service ref="studentService" /> - <flex:remote-service ref="moduleService" /> - <flex:remote-service ref="questionCreatorService" /> - <flex:remote-service ref="roundService" /> - <flex:remote-service ref="startupService" /> - <flex:remote-service ref="answeringService" /> - <flex:remote-service ref="locationService" /> - <flex:remote-service ref="feed" /> + <flex:remoting-destination ref="studentService" /> + <flex:remoting-destination ref="moduleService" /> + <flex:remoting-destination ref="questionCreatorService" /> + <flex:remoting-destination ref="roundService" /> + <flex:remoting-destination ref="startupService" /> + <flex:remoting-destination ref="answeringService" /> + <flex:remoting-destination ref="locationService" /> + <flex:remoting-destination ref="feed" /> + + <!-- Expose services for Flex/BlazeDS messaging --> + <flex:message-destination id="mme" allow-subtopics="true" subtopic-separator="." /> <!-- Flex related information ended--> Modified: mentalmodels/trunk/src/main/webapp/WEB-INF/flex/messaging-config.xml =================================================================== --- mentalmodels/trunk/src/main/webapp/WEB-INF/flex/messaging-config.xml 2009-08-21 23:37:51 UTC (rev 268) +++ mentalmodels/trunk/src/main/webapp/WEB-INF/flex/messaging-config.xml 2009-08-25 00:20:46 UTC (rev 269) @@ -1,28 +1,34 @@ <?xml version="1.0" encoding="UTF-8"?> -<service id="message-service" - class="flex.messaging.services.MessageService" - messageTypes="flex.messaging.messages.AsyncMessage" > +<service id="message-service" class="flex.messaging.services.MessageService" + messageTypes="flex.messaging.messages.AsyncMessage"> - <adapters> - <adapter-definition id="actionscript" class="flex.messaging.services.messaging.adapters.ActionScriptAdapter" default ="true"/> - <!-- <adapter-definition id="jms" class="flex.messaging.services.messaging.adapters.JMSAdapter"/> --> - <adapter-definition id="DataPushAdapter" class="Feed"/> - </adapters> + <adapters> + <adapter-definition id="actionscript" + class="flex.messaging.services.messaging.adapters.ActionScriptAdapter" + default="true" /> + <!-- + <adapter-definition id="jms" + class="flex.messaging.services.messaging.adapters.JMSAdapter"/> + --> + <adapter-definition id="DataPushAdapter" class="StartupService" /> + </adapters> - <default-channels> - <channel ref="my-polling-amf"/> - <channel ref="my-streaming-amf"/> - </default-channels> - - <destination id="DataPush"> -<channels> -<channel ref="my-polling-amf"/> -</channels> -<!--<adapter ref="DataPushAdapter"/> - ---></destination> - + <default-channels> + <channel ref="my-polling-amf" /> + <channel ref="my-streaming-amf" /> + </default-channels> - + <!--<destination id="mme"> + <properties> + <server> + <allow-subtopics>true</allow-subtopics> + <subtopic-separator>.</subtopic-separator> + </server> + </properties> + <channels> + <channel ref="my-streaming-amf" /> + </channels> + <adapter ref="DataPushAdapter"/> -</service> + </destination> --> + </service> Modified: mentalmodels/trunk/src/main/webapp/WEB-INF/flex/services-config.xml =================================================================== --- mentalmodels/trunk/src/main/webapp/WEB-INF/flex/services-config.xml 2009-08-21 23:37:51 UTC (rev 268) +++ mentalmodels/trunk/src/main/webapp/WEB-INF/flex/services-config.xml 2009-08-25 00:20:46 UTC (rev 269) @@ -39,6 +39,7 @@ <user-agent match-on="MSIE" kickstart-bytes="2048" max-streaming-connections-per-session="3"/> <user-agent match-on="Firefox" kickstart-bytes="2048" max-streaming-connections-per-session="3"/> </user-agent-settings> + </properties> </channel-definition> <channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <see...@us...> - 2009-08-22 00:22:22
|
Revision: 268 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=268&view=rev Author: seematalele Date: 2009-08-21 23:37:51 +0000 (Fri, 21 Aug 2009) Log Message: ----------- Resolve the bug in creating Student. Modified Paths: -------------- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StartGame.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StudentService.java Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StartGame.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StartGame.java 2009-08-21 22:09:28 UTC (rev 267) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StartGame.java 2009-08-21 23:37:51 UTC (rev 268) @@ -22,7 +22,6 @@ public StartGame() { - System.out.println("module service object is "); /*moduleService.test(); moduleService.setStartModule(true);*/ @@ -31,14 +30,16 @@ public Student createStudent(Student student) { - Game game = new Game(); - game = roundService.getCurrentGame(); +// Game game = new Game(); + Game game = roundService.getCurrentGame(); Student studentReturn = null; - if(game.getDescription() == student.getGameCode()) + //System.out.println("game description: " + game.getDescription() + " student game code is: " + student.getGameCode()); + if(game.getDescription().equals(student.getGameCode())) { student.setGame(game); studentReturn = new Student(); studentReturn = studentService.createStudent(student); + //System.out.println("student Return info: " + studentReturn.getGameCode()); } return studentReturn; } Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StudentService.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StudentService.java 2009-08-21 22:09:28 UTC (rev 267) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StudentService.java 2009-08-21 23:37:51 UTC (rev 268) @@ -33,16 +33,23 @@ public Student createStudent(Student student) { Student studentSave = new Student(); - studentSave = student; - studentSave.setTimestamp(new Timestamp(new Date().getTime())); + studentSave.setBirthYear(student.getBirthYear()); + studentSave.setGame(student.getGame()); + studentSave.setGameCode(student.getGameCode()); + studentSave.setGender(student.getGender()); + studentSave.setMajor(student.getMajor()); + studentSave.setSemester(student.getSemester()); + studentSave.setTimestamp(student.getTimestamp()); + + //studentSave.setTimestamp(new Timestamp(new Date().getTime())); save(studentSave); getLogger().debug("Student id is: " + studentSave.getId()); - if(!checkStudentAlreadyExists(studentSave)) + /*if(!checkStudentAlreadyExists(studentSave)) { students.add(studentSave); } else - return null; + return null;*/ initializeStudent(student); return student; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: Kalin J. <kj...@as...> - 2009-08-22 00:04:05
|
I leave work today at 17:00pm (3.5hr) (5hr total today) I am in the process of creating a display element for the Initialize Database which should work as a stand-alone component. It will display to the user what the different information windows look like, and they will be able to see what ID's are being used. On Fri, Aug 21, 2009 at 1:30 PM, Kalin Jonas <kj...@as...> wrote: > I am leaving for lunch at 12:30 (1.5hr) *(for some reason this email did > not send)* > I committed the modified init-mme file, with unused sections removed, or > modified. > > I return from lunch at 13:30 > > > On Fri, Aug 21, 2009 at 11:15 AM, Kalin Jonas <kj...@as...> wrote: > >> Today I come in to work at around 11:00am >> I will discuss the experiment with Seema, and figure out what to work on >> today from there. >> > > |
From: <see...@us...> - 2009-08-21 22:09:37
|
Revision: 267 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=267&view=rev Author: seematalele Date: 2009-08-21 22:09:28 +0000 (Fri, 21 Aug 2009) Log Message: ----------- 1) Resolve the bug for sending the current round to the client 2) Created RoundLocation entity in flex and java which maps with round and location, so removed the many to many mapping between round and location 3) made changes in the actionscript files accordingly. 4) Changed the test.mxml which will show alert message for getcurrent round function. Modified Paths: -------------- mentalmodels/trunk/flex/src/actionscript/Location.as mentalmodels/trunk/flex/src/actionscript/Round.as mentalmodels/trunk/flex/src/test.mxml mentalmodels/trunk/src/main/db/init-mme.sql mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/CategoricalQuestion.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Game.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Group.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Location.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Module.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/ModuleRoundConfig.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/QuestionGroup.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Round.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Student.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/StudentStrategy.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/AnsweringService.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/DayByDayDecisionsService.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/LocationService.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/RoundService.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StartGame.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StartupService.java mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.cfg.xml mentalmodels/trunk/src/main/webapp/test.html mentalmodels/trunk/src/main/webapp/test.swf Added Paths: ----------- mentalmodels/trunk/flex/src/actionscript/RoundLocation.as mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/RoundLocation.java Modified: mentalmodels/trunk/flex/src/actionscript/Location.as =================================================================== --- mentalmodels/trunk/flex/src/actionscript/Location.as 2009-08-21 19:05:54 UTC (rev 266) +++ mentalmodels/trunk/flex/src/actionscript/Location.as 2009-08-21 22:09:28 UTC (rev 267) @@ -11,5 +11,6 @@ public var maxCapacity:int; public var growthRate:Number; public var initialPopulation:int; + public var roundLocations:ArrayCollection; } } \ No newline at end of file Modified: mentalmodels/trunk/flex/src/actionscript/Round.as =================================================================== --- mentalmodels/trunk/flex/src/actionscript/Round.as 2009-08-21 19:05:54 UTC (rev 266) +++ mentalmodels/trunk/flex/src/actionscript/Round.as 2009-08-21 22:09:28 UTC (rev 267) @@ -9,5 +9,6 @@ public var roundNo:int; public var game:Game; public var communicationFlag:Boolean; + public var roundLocations:ArrayCollection; } } \ No newline at end of file Added: mentalmodels/trunk/flex/src/actionscript/RoundLocation.as =================================================================== --- mentalmodels/trunk/flex/src/actionscript/RoundLocation.as (rev 0) +++ mentalmodels/trunk/flex/src/actionscript/RoundLocation.as 2009-08-21 22:09:28 UTC (rev 267) @@ -0,0 +1,15 @@ +package actionscript +{ + [Bindable] + [RemoteClass(alias="edu.asu.commons.mme.entity.RoundLocation")] + public class RoundLocation + { + + public var id:int; + + public var round:Round; + + public var location:Location; + + } +} \ No newline at end of file Modified: mentalmodels/trunk/flex/src/test.mxml =================================================================== --- mentalmodels/trunk/flex/src/test.mxml 2009-08-21 19:05:54 UTC (rev 266) +++ mentalmodels/trunk/flex/src/test.mxml 2009-08-21 22:09:28 UTC (rev 267) @@ -25,6 +25,7 @@ <mx:Script> <![CDATA[ + import actionscript.Round; import mx.core.UIComponent; import mx.controls.Alert; import mx.rpc.events.FaultEvent; @@ -37,6 +38,10 @@ str += "event.result == null : " + (event.result == null) + "\n"; Alert.show(str, "resultHandler()"); + var round:actionscript.Round = event.result as actionscript.Round; + Alert.show("round no is : " + round.roundNo + " " + round.id); + //Alert.show + } public function faultHandler(event:FaultEvent):void Modified: mentalmodels/trunk/src/main/db/init-mme.sql =================================================================== --- mentalmodels/trunk/src/main/db/init-mme.sql 2009-08-21 19:05:54 UTC (rev 266) +++ mentalmodels/trunk/src/main/db/init-mme.sql 2009-08-21 22:09:28 UTC (rev 267) @@ -1,8 +1,8 @@ --- MySQL dump 10.13 Distrib 5.1.36, for Win32 (ia32) +-- MySQL dump 10.13 Distrib 5.1.33, for Win32 (ia32) -- -- Host: localhost Database: mme -- ------------------------------------------------------ --- Server version 5.1.36-community +-- Server version 5.1.33-community /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -283,7 +283,7 @@ KEY `FK304BF219A3AF27` (`current_round_id`), CONSTRAINT `FK304BF219A3AF27` FOREIGN KEY (`current_round_id`) REFERENCES `round_config` (`id`), CONSTRAINT `FK304BF2F1265AC7` FOREIGN KEY (`current_block_id`) REFERENCES `block` (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -292,7 +292,7 @@ LOCK TABLES `game` WRITE; /*!40000 ALTER TABLE `game` DISABLE KEYS */; -INSERT INTO `game` VALUES (1,'First game','island.jpg',30,5,0,4,4,'2009-07-19 17:30:35','Mental Model Experiment',3,2); +INSERT INTO `game` VALUES (1,'First game','island.jpg',30,5,0,4,4,'2009-07-19 17:30:35','Mental Model Experiment',3,2),(2,'dell2','null',30,100,0.01,0,2,'2009-08-21 14:58:14','test Game Title',1,1); /*!40000 ALTER TABLE `game` ENABLE KEYS */; UNLOCK TABLES; @@ -402,34 +402,6 @@ UNLOCK TABLES; -- --- Table structure for table `location_round_config` --- - -DROP TABLE IF EXISTS `location_round_config`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `location_round_config` ( - `location_id` bigint(20) NOT NULL, - `rounds_id` bigint(20) NOT NULL, - PRIMARY KEY (`location_id`,`rounds_id`), - KEY `FK979C4B5D224FD013` (`location_id`), - KEY `FK979C4B5D479268AA` (`rounds_id`), - CONSTRAINT `FK979C4B5D479268AA` FOREIGN KEY (`rounds_id`) REFERENCES `round_config` (`id`), - CONSTRAINT `FK979C4B5D224FD013` FOREIGN KEY (`location_id`) REFERENCES `location` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `location_round_config` --- - -LOCK TABLES `location_round_config` WRITE; -/*!40000 ALTER TABLE `location_round_config` DISABLE KEYS */; -INSERT INTO `location_round_config` VALUES (1,1),(1,2),(2,1),(2,2),(3,1),(3,2),(4,1),(4,2); -/*!40000 ALTER TABLE `location_round_config` ENABLE KEYS */; -UNLOCK TABLES; - --- -- Table structure for table `module` -- @@ -623,33 +595,6 @@ UNLOCK TABLES; -- --- Table structure for table `round_config_game` --- - -DROP TABLE IF EXISTS `round_config_game`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `round_config_game` ( - `round_config_id` bigint(20) NOT NULL, - `game_id` bigint(20) NOT NULL, - UNIQUE KEY `game_id` (`game_id`), - KEY `FKDF98659E7AC42F73` (`game_id`), - KEY `FKDF98659E2B8C177C` (`round_config_id`), - CONSTRAINT `FKDF98659E2B8C177C` FOREIGN KEY (`round_config_id`) REFERENCES `round_config` (`id`), - CONSTRAINT `FKDF98659E7AC42F73` FOREIGN KEY (`game_id`) REFERENCES `game` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `round_config_game` --- - -LOCK TABLES `round_config_game` WRITE; -/*!40000 ALTER TABLE `round_config_game` DISABLE KEYS */; -/*!40000 ALTER TABLE `round_config_game` ENABLE KEYS */; -UNLOCK TABLES; - --- -- Table structure for table `round_config_location` -- @@ -657,13 +602,14 @@ /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `round_config_location` ( - `round_config_id` bigint(20) NOT NULL, - `locations_id` bigint(20) NOT NULL, - PRIMARY KEY (`round_config_id`,`locations_id`), - KEY `FKC67B0361FDF88BCA` (`locations_id`), - KEY `FKC67B03612B8C177C` (`round_config_id`), - CONSTRAINT `FKC67B03612B8C177C` FOREIGN KEY (`round_config_id`) REFERENCES `round_config` (`id`), - CONSTRAINT `FKC67B0361FDF88BCA` FOREIGN KEY (`locations_id`) REFERENCES `location` (`id`) + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `location_id` bigint(20) NOT NULL, + `round_id` bigint(20) NOT NULL, + PRIMARY KEY (`id`), + KEY `FKC67B0361224FD013` (`location_id`), + KEY `FKC67B036147CF2321` (`round_id`), + CONSTRAINT `FKC67B036147CF2321` FOREIGN KEY (`round_id`) REFERENCES `round_config` (`id`), + CONSTRAINT `FKC67B0361224FD013` FOREIGN KEY (`location_id`) REFERENCES `location` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; @@ -673,7 +619,6 @@ LOCK TABLES `round_config_location` WRITE; /*!40000 ALTER TABLE `round_config_location` DISABLE KEYS */; -INSERT INTO `round_config_location` VALUES (1,1),(2,1),(1,2),(2,2),(1,3),(2,3),(1,4),(2,4); /*!40000 ALTER TABLE `round_config_location` ENABLE KEYS */; UNLOCK TABLES; @@ -812,15 +757,15 @@ `repeated_decisions` tinyint(1) NOT NULL, `threshold` double NOT NULL, `location_id` bigint(20) NOT NULL, - `roundConfig_id` bigint(20) NOT NULL, + `round_id` bigint(20) NOT NULL, `student_id` bigint(20) NOT NULL, PRIMARY KEY (`id`), - KEY `FK9615A4F7297B31F` (`roundConfig_id`), KEY `FK9615A4F7224FD013` (`location_id`), + KEY `FK9615A4F747CF2321` (`round_id`), KEY `FK9615A4F7992B5A41` (`student_id`), CONSTRAINT `FK9615A4F7992B5A41` FOREIGN KEY (`student_id`) REFERENCES `student` (`id`), CONSTRAINT `FK9615A4F7224FD013` FOREIGN KEY (`location_id`) REFERENCES `location` (`id`), - CONSTRAINT `FK9615A4F7297B31F` FOREIGN KEY (`roundConfig_id`) REFERENCES `round_config` (`id`) + CONSTRAINT `FK9615A4F747CF2321` FOREIGN KEY (`round_id`) REFERENCES `round_config` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; @@ -872,4 +817,4 @@ /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2009-08-21 12:00:07 +-- Dump completed on 2009-08-21 22:03:41 Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/CategoricalQuestion.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/CategoricalQuestion.java 2009-08-21 19:05:54 UTC (rev 266) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/CategoricalQuestion.java 2009-08-21 22:09:28 UTC (rev 267) @@ -1,11 +1,8 @@ package edu.asu.commons.mme.entity; -import java.util.Iterator; import java.util.List; - - import javax.persistence.CascadeType; import javax.persistence.Entity; import javax.persistence.JoinColumn; Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Game.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Game.java 2009-08-21 19:05:54 UTC (rev 266) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Game.java 2009-08-21 22:09:28 UTC (rev 267) @@ -13,7 +13,6 @@ import javax.persistence.Lob; import javax.persistence.ManyToMany; import javax.persistence.ManyToOne; -import javax.persistence.OneToMany; import javax.persistence.Table; import org.hibernate.annotations.CollectionOfElements; @@ -57,7 +56,7 @@ // FIXME: should this be many-to-many instead? @ManyToMany - @CollectionOfElements(fetch=FetchType.EAGER) + @CollectionOfElements private List<Round> rounds; @ManyToOne @@ -95,12 +94,12 @@ return money; } - public void setRoundconfig(List<Round> roundconfig) { + /*public void setRoundconfig(List<Round> roundconfig) { this.rounds = roundconfig; } public List<Round> getRoundconfig() { return rounds; - } + }*/ public void setTimestamp(Timestamp timestamp) { this.timestamp = timestamp; } Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Group.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Group.java 2009-08-21 19:05:54 UTC (rev 266) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Group.java 2009-08-21 22:09:28 UTC (rev 267) @@ -7,8 +7,6 @@ import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; import javax.persistence.Table; Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Location.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Location.java 2009-08-21 19:05:54 UTC (rev 266) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Location.java 2009-08-21 22:09:28 UTC (rev 267) @@ -5,15 +5,11 @@ import javax.persistence.Column; import javax.persistence.Entity; -import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToMany; +import javax.persistence.OneToMany; import javax.persistence.Table; -import org.hibernate.annotations.CollectionOfElements; - @Entity @Table(name = "location") public class Location implements Serializable{ @@ -24,9 +20,8 @@ @GeneratedValue private Long id; - @ManyToMany - @CollectionOfElements - private List<Round> rounds; + @OneToMany(mappedBy = "location") + private List<RoundLocation> roundLocations; @Column(nullable=false,name="location_name") private String locationName; @@ -51,7 +46,6 @@ return id; } - public Double getGrowthRate() { return growthRate; } @@ -76,17 +70,18 @@ public void setInitialPopulation(Integer initialPopulation) { this.initialPopulation = initialPopulation; } - public void setRounds(List<Round> rounds) { - this.rounds = rounds; - } - public List<Round> getRounds() { - return rounds; - } + public void setCurrentPopulation(Integer currentPopulation) { this.currentPopulation = currentPopulation; } public Integer getCurrentPopulation() { return currentPopulation; } + public void setRoundLocations(List<RoundLocation> roundLocations) { + this.roundLocations = roundLocations; + } + public List<RoundLocation> getRoundLocations() { + return roundLocations; + } } Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Module.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Module.java 2009-08-21 19:05:54 UTC (rev 266) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Module.java 2009-08-21 22:09:28 UTC (rev 267) @@ -3,16 +3,11 @@ import java.io.Serializable; import java.util.List; -import java.util.Set; import javax.persistence.Column; import javax.persistence.Entity; -import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToMany; -import javax.persistence.ManyToOne; import javax.persistence.OneToMany; import javax.persistence.OrderBy; import javax.persistence.Table; Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/ModuleRoundConfig.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/ModuleRoundConfig.java 2009-08-21 19:05:54 UTC (rev 266) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/ModuleRoundConfig.java 2009-08-21 22:09:28 UTC (rev 267) @@ -1,7 +1,6 @@ package edu.asu.commons.mme.entity; import java.io.Serializable; -import java.util.List; import javax.persistence.Column; import javax.persistence.Entity; @@ -9,8 +8,6 @@ import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; -import javax.persistence.OneToMany; -import javax.persistence.OrderBy; import javax.persistence.Table; Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/QuestionGroup.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/QuestionGroup.java 2009-08-21 19:05:54 UTC (rev 266) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/QuestionGroup.java 2009-08-21 22:09:28 UTC (rev 267) @@ -3,13 +3,11 @@ import java.io.Serializable; import java.util.ArrayList; -import java.util.Iterator; import java.util.List; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; -import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.JoinColumn; Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Round.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Round.java 2009-08-21 19:05:54 UTC (rev 266) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Round.java 2009-08-21 22:09:28 UTC (rev 267) @@ -3,20 +3,15 @@ import java.io.Serializable; import java.util.List; -import java.util.Set; import javax.persistence.Column; import javax.persistence.Entity; -import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToMany; import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; import javax.persistence.Table; -import org.hibernate.annotations.CollectionOfElements; - @Entity @Table(name="round_config") public class Round implements Serializable { @@ -30,9 +25,9 @@ @Column(name="round_no",nullable=false) private Integer roundNo; - @ManyToMany - @CollectionOfElements(fetch=FetchType.EAGER) - private List<Game> game; + /*@ManyToMany + @CollectionOfElements + private List<Game> game;*/ @Column(name="communication_flag",nullable=false,columnDefinition="Boolean default false") private boolean communicationFlag; @@ -41,9 +36,8 @@ private ModuleRoundConfig round_config;*/ - @ManyToMany - @CollectionOfElements(fetch=FetchType.EAGER) - private List<Location> locations; + @OneToMany(mappedBy = "round") + private List<RoundLocation> roundLocations; public void setId(Long id) { this.id = id; @@ -64,24 +58,24 @@ public boolean getCommunicationFlag() { return communicationFlag; } - - public List<Location> getLocations() { - return locations; + public void setRoundLocations(List<RoundLocation> roundLocations) { + this.roundLocations = roundLocations; } - public void setLocations(List<Location> locations) { - this.locations = locations; + public List<RoundLocation> getRoundLocations() { + return roundLocations; } + /*public void setRound_config(ModuleRoundConfig round_config) { this.round_config = round_config; } public ModuleRoundConfig getRound_config() { return round_config; }*/ - public void setGame(List<Game> game) { + /*public void setGame(List<Game> game) { this.game = game; } public List<Game> getGame() { return game; - } + }*/ } Added: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/RoundLocation.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/RoundLocation.java (rev 0) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/RoundLocation.java 2009-08-21 22:09:28 UTC (rev 267) @@ -0,0 +1,57 @@ +package edu.asu.commons.mme.entity; + +import java.io.Serializable; + +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +@Entity +@Table(name="round_config_location") +public class RoundLocation implements Serializable { + + /** + * + */ + private static final long serialVersionUID = -3215898164475817212L; + + @Id + @GeneratedValue + private Long id; + + @ManyToOne + @JoinColumn(nullable=false) + private Round round; + + @ManyToOne + @JoinColumn(nullable=false) + private Location location; + + public void setId(Long id) { + this.id = id; + } + + public Long getId() { + return id; + } + + public void setRound(Round round) { + this.round = round; + } + + public Round getRound() { + return round; + } + + public void setLocation(Location location) { + this.location = location; + } + + public Location getLocation() { + return location; + } + +} Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Student.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Student.java 2009-08-21 19:05:54 UTC (rev 266) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Student.java 2009-08-21 22:09:28 UTC (rev 267) @@ -5,8 +5,6 @@ import javax.persistence.Column; import javax.persistence.Entity; -import javax.persistence.EnumType; -import javax.persistence.Enumerated; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.JoinColumn; Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/StudentStrategy.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/StudentStrategy.java 2009-08-21 19:05:54 UTC (rev 266) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/StudentStrategy.java 2009-08-21 22:09:28 UTC (rev 267) @@ -2,7 +2,6 @@ import java.io.Serializable; -import java.util.List; import javax.persistence.Column; import javax.persistence.Entity; @@ -10,7 +9,6 @@ import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; -import javax.persistence.OneToMany; import javax.persistence.Table; Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/AnsweringService.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/AnsweringService.java 2009-08-21 19:05:54 UTC (rev 266) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/AnsweringService.java 2009-08-21 22:09:28 UTC (rev 267) @@ -4,13 +4,9 @@ import org.springframework.transaction.annotation.Transactional; -import edu.asu.commons.mme.dao.HibernateDayByDayDecisionsDao; -import edu.asu.commons.mme.dao.HibernateStudentDao; import edu.asu.commons.mme.dao.HibernateStudentResponseDao; import edu.asu.commons.mme.dao.HibernateStudentStrategyDao; -import edu.asu.commons.mme.entity.Block; import edu.asu.commons.mme.entity.DayByDayDecisions; -import edu.asu.commons.mme.entity.Location; import edu.asu.commons.mme.entity.Student; import edu.asu.commons.mme.entity.StudentResponse; import edu.asu.commons.mme.entity.StudentStrategy; Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/DayByDayDecisionsService.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/DayByDayDecisionsService.java 2009-08-21 19:05:54 UTC (rev 266) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/DayByDayDecisionsService.java 2009-08-21 22:09:28 UTC (rev 267) @@ -6,7 +6,6 @@ import org.springframework.transaction.annotation.Transactional; import edu.asu.commons.mme.dao.HibernateDayByDayDecisionsDao; -import edu.asu.commons.mme.dao.HibernateLocationDao; import edu.asu.commons.mme.entity.DayByDayDecisions; import edu.asu.commons.mme.entity.Location; Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/LocationService.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/LocationService.java 2009-08-21 19:05:54 UTC (rev 266) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/LocationService.java 2009-08-21 22:09:28 UTC (rev 267) @@ -1,18 +1,13 @@ package edu.asu.commons.mme.service; import java.util.ArrayList; -import java.util.Iterator; import java.util.List; - - import org.hibernate.Hibernate; import org.springframework.transaction.annotation.Transactional; import edu.asu.commons.mme.dao.HibernateLocationDao; -import edu.asu.commons.mme.entity.Game; import edu.asu.commons.mme.entity.Location; -import edu.asu.commons.mme.entity.Round; @Transactional public class LocationService extends Service.Base<Location, HibernateLocationDao>{ @@ -27,27 +22,9 @@ { initLocation = locations.get(i); Hibernate.initialize(initLocation); - List<Round> rounds = initLocation.getRounds(); - for(int j = 0; j < rounds.size(); j++) - { - Round round = rounds.get(j); - Hibernate.initialize(round); - - Iterator <Game> games = round.getGame().iterator(); - while(games.hasNext()) - { - Hibernate.initialize(games.next()); - - } - - List<Location> roundlocations = round.getLocations(); - for(int k=0;k<roundlocations.size();k++) - { - Hibernate.initialize(roundlocations.get(k)); - } - //round.getLocations() - } + Hibernate.initialize(initLocation.getRoundLocations()); + } return locations; } Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/RoundService.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/RoundService.java 2009-08-21 19:05:54 UTC (rev 266) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/RoundService.java 2009-08-21 22:09:28 UTC (rev 267) @@ -23,6 +23,7 @@ import edu.asu.commons.mme.entity.Question; import edu.asu.commons.mme.entity.QuestionGroup; import edu.asu.commons.mme.entity.Round; +import edu.asu.commons.mme.entity.RoundLocation; @Transactional public class RoundService extends Service.Base<Round, HibernateRoundConfigDao> { @@ -37,7 +38,7 @@ private Round currentRound; private Block currentBlock; private Game currentGame; - + private int blockSeqNo; private ModuleRoundConfig currentModuleRoundConfig; @@ -57,33 +58,52 @@ public Game createGame(Game game) { + currentGame = new Game(); - currentGame = game; + //currentGame = game; + + currentGame.setDescription(game.getDescription()); + currentGame.setMaxDays(game.getMaxDays()); + currentGame.setMaxFishHarvest(game.getMaxFishHarvest()); + currentGame.setMoney(game.getMoney()); + currentGame.setNumberOfRounds(game.getNumberOfRounds()); + currentGame.setNumberOfLocations(game.getNumberOfLocations()); + currentGame.setTimestamp(game.getTimestamp()); + currentGame.setTitle(game.getTitle()); + currentGame.setImageLocation("null"); +// currentGame.setro// getGameDao().save(currentGame); String str = currentGame.getDescription()+currentGame.getId(); - if(getGameDao().findAllByProperty("description", str) !=null) + + if(getGameDao().findAllByProperty("description", str).size() != 0) { - setCurrentGame(null); + getLogger().debug("in if loop "); + currentGame = null; + setCurrentGame(currentGame); } else { currentGame.setDescription(str); getGameDao().save(currentGame); + getLogger().debug("in else loop 1 " + str); setCurrentGame(currentGame); - initializeGame(currentGame); + getLogger().debug("in else loop 2 " + str); + //initializeGame(currentGame); + getLogger().debug("in else loop 3 " + str); } - return getCurrentGame(); + getLogger().debug("current game from flex is: " + currentGame.getDescription()); + return currentGame; } private void initializeGame(Game game) { // TODO Auto-generated method stub Hibernate.initialize(game); Hibernate.initialize(game.getCurrentBlock()); Hibernate.initialize(game.getCurrentRound()); - Iterator<Round> rounds = game.getRounds().iterator(); + /*Iterator<Round> rounds = game.getRounds().iterator(); while(rounds.hasNext()) { initializeRound(rounds.next()); - } + }*/ } public Module getNextModule(int sequenceNo) @@ -99,10 +119,12 @@ public Block getBlock() { /* - *1) Find out the current module number - *2) check if it is finished, if yes find out the current round number - *3) Find out the current block number - *4) Return the next block + *1) Check if the current module round config is null, this object keeps track of which round + * and which module in that round is going on + *2) Find out the current module number + *3) check if it is finished, if yes find out the current round number + *4) Find out the current block number + *5) Return the next block */ //getLogger().debug("in getBlock "); //setCurrentModuleRoundConfig(currentModuleRoundConfig); @@ -210,6 +232,7 @@ currentRound = new Round(); currentRound = getDao().findByProperty("roundNo", 1); setCurrentRound(currentRound); + initializeRound(currentRound); } else { @@ -422,10 +445,11 @@ private void saveGameState(Block currentBlock) { //FIXME: Game id 1 is hard coded but needs to make it dynamic - Game game = gameDao.find(1L); - game.setCurrentBlock(currentBlock); - game.setCurrentRound(currentRound); - gameDao.save(game); + //Game game = gameDao.find(1L); + + currentGame.setCurrentBlock(currentBlock); + currentGame.setCurrentRound(currentRound); + gameDao.save(currentGame); } public Integer getTimerforBlock(Block block) @@ -477,9 +501,9 @@ public Block getCurrentBlock() { //FIXEME: game id 1 is hard coded, it should be dynamic - Game game = gameDao.find(1L); +// Game game = gameDao.find(1L); Block block = new Block(); - block = game.getCurrentBlock(); + block = currentGame.getCurrentBlock(); // Hibernate.initialize(block); return block; @@ -502,40 +526,30 @@ public Round getCurrentRound() { - initializeRound(currentRound); + getLogger().debug("in get current round funciton"); + /*Round round = currentGame.getCurrentRound(); + //Round round = getDao().find(getCurrentRound().getId()); + + initializeRound(round);*/ + getLogger().debug("round no is " + currentRound.getRoundNo() + " " + currentRound.getId()); return currentRound; } - private void initializeRound(Round currentRound) { + private void initializeRound(Round round) { // TODO Auto-generated method stub - Hibernate.initialize(currentRound); + Hibernate.initialize(round); - Iterator <Game> games = currentRound.getGame().iterator(); - while(games.hasNext()) - { + Hibernate.initialize(round.getRoundLocations()); + + /*for (RoundLocation roundLocation: round.getRoundLocations()) { + Hibernate.initialize(roundLocation); + //hibernateroundLocation.getLocation(); + }*/ - initializeGame(games.next()); - - } - - List<Location> roundlocations = currentRound.getLocations(); - for(int k=0;k<roundlocations.size();k++) - { - Hibernate.initialize(roundlocations.get(k)); - } + //Hibernate.initialize(currentRound.getLocations()); } - /*public void setStartModule(Boolean startModule) { - this.startGame = startModule; - } - - - public Boolean getStartModule() { - return startGame; - }*/ - - public void setGameDao(HibernateGameDao gameDao) { this.gameDao = gameDao; } Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StartGame.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StartGame.java 2009-08-21 19:05:54 UTC (rev 266) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StartGame.java 2009-08-21 22:09:28 UTC (rev 267) @@ -10,6 +10,7 @@ import flex.messaging.messages.AsyncMessage; import flex.messaging.util.UUIDUtils; + public class StartGame extends Thread { private boolean running; @@ -44,6 +45,7 @@ public Game createGame(Game game) { + System.out.println("game came from flex is: " + game.getDescription()); return roundService.createGame(game); } Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StartupService.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StartupService.java 2009-08-21 19:05:54 UTC (rev 266) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StartupService.java 2009-08-21 22:09:28 UTC (rev 267) @@ -16,26 +16,29 @@ @Transactional public class StartupService implements ApplicationContextAware { - + //private QuestionCreatorService questionCreatorService; private StartGame startGame; private ApplicationContext ctx; - + /*public void setQuestionCreatorService(QuestionCreatorService questionCreatorService) { this.questionCreatorService = questionCreatorService; }*/ + public Student createStudent(Student student) { - public Student createStudent(Student student) { - return getStartGame().createStudent(student); } - + public Game createGame(Game game) { - return getStartGame().createGame(game); + if(getStartGame() == null) + { + setStartGame(); + } + return startGame.createGame(game); } - + public void assignGroups() { MessageBroker msgBroker = MessageBroker.getMessageBroker(null); @@ -47,20 +50,20 @@ msg.setMessageId(UUIDUtils.createUUID()); msg.setTimestamp(System.currentTimeMillis()); List<Student> students = new ArrayList<Student>(); - + msg.setBody(students); System.out.println("Message broker is: "+ msgBroker); System.out.println("Students size is: " + students.size()); - + msgBroker.routeMessageToService(msg, null); - + } - + public void startGame() { //push assign groups to all the students assignGroups(); - + //start the game this.startGame.run(); } @@ -69,8 +72,8 @@ startGame.setRunning(false); startGame = null; } - - + + @Override public void setApplicationContext(ApplicationContext context) throws BeansException { @@ -78,12 +81,12 @@ this.ctx = context; } - + public void setStartGame() { try{ if (startGame == null) { this.startGame = (StartGame)ctx.getBean("startGame"); - + } }catch(Exception e) { @@ -92,9 +95,9 @@ } public StartGame getStartGame() { - + return startGame; } - + } Modified: mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.cfg.xml =================================================================== --- mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.cfg.xml 2009-08-21 19:05:54 UTC (rev 266) +++ mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.cfg.xml 2009-08-21 22:09:28 UTC (rev 267) @@ -10,9 +10,12 @@ <mapping class='edu.asu.commons.mme.entity.Game'/> <mapping class='edu.asu.commons.mme.entity.Round'/> <mapping class='edu.asu.commons.mme.entity.Location'/> + <mapping class='edu.asu.commons.mme.entity.RoundLocation'/> <mapping class='edu.asu.commons.mme.entity.Communication'/> <mapping class='edu.asu.commons.mme.entity.Group'/> <mapping class='edu.asu.commons.mme.entity.Student'/> + + <mapping class='edu.asu.commons.mme.entity.StudentRoundConfig'/> <mapping class='edu.asu.commons.mme.entity.StudentStrategy'/> Modified: mentalmodels/trunk/src/main/webapp/test.html =================================================================== --- mentalmodels/trunk/src/main/webapp/test.html 2009-08-21 19:05:54 UTC (rev 266) +++ mentalmodels/trunk/src/main/webapp/test.html 2009-08-21 22:09:28 UTC (rev 267) @@ -28,15 +28,6 @@ <style> body { margin: 0px; overflow:hidden } </style> - -<script language="JavaScript"> - window.onbeforeunload = confirmExit; - function confirmExit() - { - return "If you are connected to the server, you will be disconnected if the page closes. Students in the experiment will be removed if the window closes."; - } -</script> - <script language="JavaScript" type="text/javascript"> <!-- // ----------------------------------------------------------------------------- @@ -53,12 +44,8 @@ </head> <body scroll="no"> - <script language="JavaScript" type="text/javascript"> <!-- - -var clientIP = '<!--#echo var="REMOTE_ADDR"-->'; - // Version check for the Flash Player that has the ability to start Player Product Install (6.0r65) var hasProductInstall = DetectFlashVer(6, 0, 65); @@ -70,12 +57,12 @@ // Location visited after installation is complete if installation is required var MMPlayerType = (isIE == true) ? "ActiveX" : "PlugIn"; var MMredirectURL = window.location; - document.title = document.title.slice(0, 47) + " - Flash Player Installation"; - var MMdoctitle = document.title; + document.title = document.title.slice(0, 47) + " - Flash Player Installation"; + var MMdoctitle = document.title; AC_FL_RunContent( "src", "playerProductInstall", - "FlashVars", "MMredirectURL="+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle+'&ip=test'+clientIP+"", + "FlashVars", "MMredirectURL="+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle+"", "width", "100%", "height", "100%", "align", "middle", @@ -95,30 +82,27 @@ "width", "100%", "height", "100%", "align", "middle", - "valign", "middle", "id", "test", "quality", "high", "bgcolor", "#869ca7", "name", "test", "allowScriptAccess","sameDomain", "type", "application/x-shockwave-flash", - "pluginspage", "http://www.adobe.com/go/getflashplayer", - "FlashVars", "ip=test"+clientIP+"" + "pluginspage", "http://www.adobe.com/go/getflashplayer" ); -} else { // flash is too old or we can't detect the plugin - var alternateContent = 'Alternate HTML content should be placed here. ' - + 'This content requires the Adobe Flash Player. ' - + '<a href=http://www.adobe.com/go/getflash/>Get Flash</a>'; - document.write(alternateContent); // insert non-flash content + } else { // flash is too old or we can't detect the plugin + var alternateContent = 'Alternate HTML content should be placed here. ' + + 'This content requires the Adobe Flash Player. ' + + '<a href=http://www.adobe.com/go/getflash/>Get Flash</a>'; + document.write(alternateContent); // insert non-flash content } // --> </script> <noscript> - <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" + <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="test" width="100%" height="100%" codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab"> <param name="movie" value="test.swf" /> - <PARAM NAME=FlashVars VALUE="ip=test${clientIP}"> <param name="quality" value="high" /> <param name="bgcolor" value="#869ca7" /> <param name="allowScriptAccess" value="sameDomain" /> Modified: mentalmodels/trunk/src/main/webapp/test.swf =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: Kalin J. <kj...@as...> - 2009-08-21 20:30:14
|
I am leaving for lunch at 12:30 (1.5hr) *(for some reason this email did not send)* I committed the modified init-mme file, with unused sections removed, or modified. I return from lunch at 13:30 On Fri, Aug 21, 2009 at 11:15 AM, Kalin Jonas <kj...@as...> wrote: > Today I come in to work at around 11:00am > I will discuss the experiment with Seema, and figure out what to work on > today from there. > |
From: <kj...@us...> - 2009-08-21 19:06:10
|
Revision: 266 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=266&view=rev Author: kjonas Date: 2009-08-21 19:05:54 +0000 (Fri, 21 Aug 2009) Log Message: ----------- deleted some unused items in database, new swf files Modified Paths: -------------- mentalmodels/trunk/src/main/db/init-mme.sql mentalmodels/trunk/src/main/webapp/FisheryExperimentShell.swf mentalmodels/trunk/src/main/webapp/InitialiseDatabase.swf mentalmodels/trunk/src/main/webapp/StartGame.swf mentalmodels/trunk/src/main/webapp/test.swf Modified: mentalmodels/trunk/src/main/db/init-mme.sql =================================================================== --- mentalmodels/trunk/src/main/db/init-mme.sql 2009-08-19 21:05:30 UTC (rev 265) +++ mentalmodels/trunk/src/main/db/init-mme.sql 2009-08-21 19:05:54 UTC (rev 266) @@ -327,6 +327,16 @@ -- Table structure for table `grp` -- +DROP TABLE IF EXISTS `grp`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `grp` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `grp_number` int(11) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + -- -- Dumping data for table `grp` -- @@ -498,7 +508,7 @@ LOCK TABLES `psychometric_question` WRITE; /*!40000 ALTER TABLE `psychometric_question` DISABLE KEYS */; -INSERT INTO `psychometric_question` VALUES (10,'Unipolar',4),(10,'unipolar',7),(10,'unipolar',9),(10,'unipolar',12),(10,'unipolar',14),(10,'bipolar',15),(10,'unipolar',16),(10,'unipolar',17),(10,'unipolar',18),(10,'bipolar',19),(10,'unipolar',20),(10,'unipolar',21),(10,'unipolar',22),(10,'unipolar',23),(10,'unipolar',24),(10,'unipolar',25),(10,'unipolar',26),(10,'unipolar',27),(10,'unipolar',28),(10,'unipolar',29),(10,'unipolar',30),(10,'bipolar',31),(10,'unipolar',32),(10,'unipolar',33),(10,'bipolar',34),(10,'unipolar',40),(10,'unipolar',41),(10,'unipolar',42),(10,'unipolar',43),(10,'unipolar',44),(10,'bipolar',45),(10,'unipolar',46),(10,'unipolar',47),(10,'unipolar',48),(10,'unipolar',49),(10,'bipolar',50),(10,'unipolar',54),(10,'unipolar',55),(10,'bipolar',56),(10,'bipolar',57),(10,'bipolar',58),(10,'unipolar',59),(10,'unipolar',60),(10,'unipolar',61),(10,'unipolar',62),(10,'bipolar',63),(10,'bipolar',67),(10,'unipolar',68),(10,'unipolar',69),(10,'unipolar',70),(10,'unipolar',71),(10,'unipolar',78),(10,'unipolar',79),(10,'unipolar',80),(10,'bipolar',81),(10,'bipolar',82),(10,'bipolar',83),(10,'bipolar',84),(10,'bipolar',85),(10,'unipolar',86),(10,'unipolar',87),(10,'unipolar',88),(10,'unipolar',89),(10,'unipolar',90),(10,'unipolar',91),(10,'unipolar',92),(10,'unipolar',93),(10,'unipolar',98),(10,'unipolar',99),(10,'bipolar',100),(10,'bipolar',101),(10,'bipolar',102),(10,'bipolar',103),(10,'bipolar',104),(10,'unipolar',105),(10,'unipolar',106),(10,'unipolar',107),(10,'unipolar',108),(10,'unipolar',109),(10,'unipolar',110),(10,'unipolar',111),(10,'unipolar',112),(10,'unipolar',119),(10,'unipolar',123),(10,'unipolar',125),(10,'unipolar',128),(10,'unipolar',130),(10,'bipolar',131),(10,'unipolar',132),(10,'unipolar',133),(10,'unipolar',134),(10,'bipolar',135),(10,'unipolar',136),(10,'unipolar',137),(10,'unipolar',138),(10,'unipolar',139),(10,'unipolar',140),(10,'unipolar',141),(10,'unipolar',142),(10,'unipolar',143),(10,'unipolar',144),(10,'unipolar',145),(10,'unipolar',146),(10,'bipolar',147),(10,'unipolar',148),(10,'unipolar',149),(10,'bipolar',150); +INSERT INTO `psychometric_question` VALUES (10,'unipolar',4),(10,'unipolar',7),(10,'unipolar',9),(10,'unipolar',12),(10,'unipolar',14),(10,'bipolar',15),(10,'unipolar',16),(10,'unipolar',17),(10,'unipolar',18),(10,'bipolar',19),(10,'unipolar',20),(10,'unipolar',21),(10,'unipolar',22),(10,'unipolar',23),(10,'unipolar',24),(10,'unipolar',25),(10,'unipolar',26),(10,'unipolar',27),(10,'unipolar',28),(10,'unipolar',29),(10,'unipolar',30),(10,'bipolar',31),(10,'unipolar',32),(10,'unipolar',33),(10,'bipolar',34),(10,'unipolar',40),(10,'unipolar',41),(10,'unipolar',42),(10,'unipolar',43),(10,'unipolar',44),(10,'bipolar',45),(10,'unipolar',46),(10,'unipolar',47),(10,'unipolar',48),(10,'unipolar',49),(10,'bipolar',50),(10,'unipolar',54),(10,'unipolar',55),(10,'bipolar',56),(10,'bipolar',57),(10,'bipolar',58),(10,'unipolar',59),(10,'unipolar',60),(10,'unipolar',61),(10,'unipolar',62),(10,'bipolar',63),(10,'bipolar',67),(10,'unipolar',68),(10,'unipolar',69),(10,'unipolar',70),(10,'unipolar',71),(10,'unipolar',78),(10,'unipolar',79),(10,'unipolar',80),(10,'bipolar',81),(10,'bipolar',82),(10,'bipolar',83),(10,'bipolar',84),(10,'bipolar',85),(10,'unipolar',86),(10,'unipolar',87),(10,'unipolar',88),(10,'unipolar',89),(10,'unipolar',90),(10,'unipolar',91),(10,'unipolar',92),(10,'unipolar',93),(10,'unipolar',98),(10,'unipolar',99),(10,'bipolar',100),(10,'bipolar',101),(10,'bipolar',102),(10,'bipolar',103),(10,'bipolar',104),(10,'unipolar',105),(10,'unipolar',106),(10,'unipolar',107),(10,'unipolar',108),(10,'unipolar',109),(10,'unipolar',110),(10,'unipolar',111),(10,'unipolar',112),(10,'unipolar',123),(10,'unipolar',125),(10,'unipolar',128),(10,'unipolar',130),(10,'bipolar',131),(10,'unipolar',132),(10,'unipolar',133),(10,'unipolar',134),(10,'bipolar',135),(10,'unipolar',136),(10,'unipolar',137),(10,'unipolar',138),(10,'unipolar',139),(10,'unipolar',140),(10,'unipolar',141),(10,'unipolar',142),(10,'unipolar',143),(10,'unipolar',144),(10,'unipolar',145),(10,'unipolar',146),(10,'bipolar',147),(10,'unipolar',148),(10,'unipolar',149),(10,'bipolar',150); /*!40000 ALTER TABLE `psychometric_question` ENABLE KEYS */; UNLOCK TABLES; @@ -523,7 +533,7 @@ LOCK TABLES `psychometric_question_choices` WRITE; /*!40000 ALTER TABLE `psychometric_question_choices` DISABLE KEYS */; -INSERT INTO `psychometric_question_choices` VALUES (4,'nearly as important'),(4,'not important at all'),(7,'very important'),(7,'not important at all'),(9,'nearly as important'),(9,'not important at all'),(12,'nearly as important'),(12,'not important at all'),(14,'nearly as important'),(14,'not important at all'),(15,'I like my group very much'),(15,'neutral'),(15,'I do not like my group at all'),(16,'very important'),(16,'not important at all'),(17,'very important'),(17,'not important at all'),(18,'very important'),(18,'not important at all'),(19,'completely as a team'),(19,'neutral'),(19,'completely as competing players'),(20,'very much'),(20,'not at all'),(21,'very important'),(21,'not important at all'),(22,'very much'),(22,'not at all'),(23,'very much'),(23,'not at all'),(24,'very much'),(24,'not at all'),(25,'very much'),(25,'not at all'),(26,'very much'),(27,'very much'),(27,'not at all'),(28,'very much'),(28,'not at all'),(29,'very much'),(29,'not at all'),(30,'perfectly'),(30,'not at all'),(31,'much better'),(31,'same as me'),(31,'much worse'),(32,'very confident'),(32,'not at all confident'),(33,'totally'),(33,'not at all'),(34,'completely ‘safe’'),(34,'balancing risk and outcomes'),(34,'completely ‘risky’'),(26,'not at all'),(40,'I am very surprised'),(40,'I am not surprised at all'),(41,'very much'),(41,'not at all'),(42,'very much'),(42,'not at all'),(43,'very much'),(43,'not at all'),(44,'very much'),(45,'much more positively'),(45,'same as before'),(45,'much more negatively'),(46,'very much'),(46,'not at all'),(47,'very much'),(47,'not at all'),(48,'very much'),(48,'not at all'),(49,'very much'),(49,'not at all'),(50,'much more positively'),(50,'same as before'),(50,'much more negatively'),(54,'…developed by all group members'),(54,'…made up by a single player'),(55,'…very fair'),(55,'…not fair at all'),(56,'…leading to much higher earnings for the group'),(56,' '),(56,'…leading to much lower earnings for the group'),(57,'…protecting the fish population'),(57,' '),(57,'…destroying the fish population'),(58,'…overall a very good solution'),(58,' '),(58,'…overall a very bad solution'),(59,'totally clear'),(59,'not clear at all'),(60,'…totally understood'),(60,'…did not understand at all'),(61,'I will totally follow the rule'),(61,'I will not at all follow the rule'),(62,'totally follow the rule'),(62,'not at all follow the rule'),(63,'the group will do much better'),(63,' '),(63,'the group will do much worse'),(67,'very interesting'),(67,'neutral'),(67,'very boring'),(68,'very much effort'),(68,'no effort at all'),(69,'very difficult'),(69,'not at all difficult'),(70,'very difficult'),(70,'not at all difficult'),(71,'very clear'),(71,'not clear at all'),(78,'I am very surprised'),(78,'I am not surprised at all'),(79,'I am very satisfied'),(79,'I am not satisfied at all'),(80,'very fair'),(80,'not at all fair'),(81,'I got too much fish'),(81,'I got the right amount of fish'),(81,'I got too few fish'),(82,'the others got too much fish'),(82,'the others got the right amount of fish'),(82,'the others got too few fish'),(83,'the earnings were too equal'),(83,'the earnings had the right variance'),(83,'the earnings were too varied'),(84,'the fishermen acted too similarly'),(84,'the actions had the right variance'),(84,'the fishermen acted too differently'),(85,'too much fish remained'),(85,'the right amount of fish remained'),(85,'too few fish remained'),(86,'applies completely'),(86,'applies not at all'),(87,'applies completely'),(87,'applies not at all'),(88,'applies completely'),(88,'applies not at all'),(89,'applies completely'),(89,'applies not at all'),(90,'applies completely'),(90,'applies not at all'),(91,'applies completely'),(91,'applies not at all'),(92,'applies completely'),(92,'applies not at all'),(93,'applies completely'),(93,'applies not at all'),(98,'I am very satisfied'),(98,'I am not satisfied at all'),(99,'very fair'),(99,'not at all fair'),(100,'I got too much fish'),(100,'I got the right amount of fish'),(100,'I got too few fish'),(101,'the others got too much fish'),(101,'the others got the right amount of fish'),(101,'the others got too few fish'),(102,'the earnings were too equal'),(102,'the earnings had the right variance'),(102,'the earnings were too varied'),(103,'the fishermen acted too similarly'),(103,'the actions had the right variance'),(103,'the fishermen acted too differently'),(104,'too much fish remained'),(104,'the right amount of fish remained'),(104,'too few fish remained'),(106,'applies completely'),(106,'applies not at all'),(105,'applies completely'),(105,'applies not at all'),(107,'applies completely'),(107,'applies not at all'),(108,'applies completely'),(108,'applies not at all'),(109,'applies completely'),(109,'applies not at all'),(110,'applies completely'),(110,'applies not at all'),(111,'applies completely'),(111,'applies not at all'),(112,'applies completely'),(112,'applies not at all'),(119,'very important'),(119,'not important at all'),(123,'nearly as important'),(123,'not important at all'),(125,'nearly as important'),(125,'not important at all'),(128,'nearly as important'),(128,'not important at all'),(130,'nearly as important'),(130,'not important at all'),(131,'I like my group very much'),(131,'neutral'),(131,'I do not like my group at all'),(132,'very important'),(132,'not important at all'),(133,'very important'),(133,'not important at all'),(134,'very important'),(134,'not important at all'),(135,'completely as a team'),(135,'neutral'),(135,'completely as competing players'),(136,'very much'),(136,'not at all'),(137,'very important'),(137,'not important at all'),(138,'very much'),(138,'not at all'),(139,'very much'),(139,'not at all'),(140,'very much'),(140,'not at all'),(141,'very much'),(141,'not at all'),(142,'very much'),(142,'not at all'),(143,'very much'),(143,'not at all'),(144,'very much'),(144,'not at all'),(145,'very much'),(145,'not at all'),(146,'perfectly'),(146,'not at all'),(147,'much better'),(147,'same as me'),(147,'much worse'),(148,'very confident'),(148,'not at all confident'),(149,'totally'),(149,'not at all'),(150,'completely safe'),(150,'balancing risk and outcomes'),(150,'completely risky'); +INSERT INTO `psychometric_question_choices` VALUES (4,'nearly as important'),(4,'not important at all'),(7,'very important'),(7,'not important at all'),(9,'nearly as important'),(9,'not important at all'),(12,'nearly as important'),(12,'not important at all'),(14,'nearly as important'),(14,'not important at all'),(15,'I like my group very much'),(15,'neutral'),(15,'I do not like my group at all'),(16,'very important'),(16,'not important at all'),(17,'very important'),(17,'not important at all'),(18,'very important'),(18,'not important at all'),(19,'completely as a team'),(19,'neutral'),(19,'completely as competing players'),(20,'very much'),(20,'not at all'),(21,'very important'),(21,'not important at all'),(22,'very much'),(22,'not at all'),(23,'very much'),(23,'not at all'),(24,'very much'),(24,'not at all'),(25,'very much'),(25,'not at all'),(26,'very much'),(27,'very much'),(27,'not at all'),(28,'very much'),(28,'not at all'),(29,'very much'),(29,'not at all'),(30,'perfectly'),(30,'not at all'),(31,'much better'),(31,'same as me'),(31,'much worse'),(32,'very confident'),(32,'not at all confident'),(33,'totally'),(33,'not at all'),(34,'completely ‘safe’'),(34,'balancing risk and outcomes'),(34,'completely ‘risky’'),(26,'not at all'),(40,'I am very surprised'),(40,'I am not surprised at all'),(41,'very much'),(41,'not at all'),(42,'very much'),(42,'not at all'),(43,'very much'),(43,'not at all'),(44,'very much'),(45,'much more positively'),(45,'same as before'),(45,'much more negatively'),(46,'very much'),(46,'not at all'),(47,'very much'),(47,'not at all'),(48,'very much'),(48,'not at all'),(49,'very much'),(49,'not at all'),(50,'much more positively'),(50,'same as before'),(50,'much more negatively'),(54,'…developed by all group members'),(54,'…made up by a single player'),(55,'…very fair'),(55,'…not fair at all'),(56,'…leading to much higher earnings for the group'),(56,' '),(56,'…leading to much lower earnings for the group'),(57,'…protecting the fish population'),(57,' '),(57,'…destroying the fish population'),(58,'…overall a very good solution'),(58,' '),(58,'…overall a very bad solution'),(59,'totally clear'),(59,'not clear at all'),(60,'…totally understood'),(60,'…did not understand at all'),(61,'I will totally follow the rule'),(61,'I will not at all follow the rule'),(62,'totally follow the rule'),(62,'not at all follow the rule'),(63,'the group will do much better'),(63,' '),(63,'the group will do much worse'),(67,'very interesting'),(67,'neutral'),(67,'very boring'),(68,'very much effort'),(68,'no effort at all'),(69,'very difficult'),(69,'not at all difficult'),(70,'very difficult'),(70,'not at all difficult'),(71,'very clear'),(71,'not clear at all'),(78,'I am very surprised'),(78,'I am not surprised at all'),(79,'I am very satisfied'),(79,'I am not satisfied at all'),(80,'very fair'),(80,'not at all fair'),(81,'I got too much fish'),(81,'I got the right amount of fish'),(81,'I got too few fish'),(82,'the others got too much fish'),(82,'the others got the right amount of fish'),(82,'the others got too few fish'),(83,'the earnings were too equal'),(83,'the earnings had the right variance'),(83,'the earnings were too varied'),(84,'the fishermen acted too similarly'),(84,'the actions had the right variance'),(84,'the fishermen acted too differently'),(85,'too much fish remained'),(85,'the right amount of fish remained'),(85,'too few fish remained'),(86,'applies completely'),(86,'applies not at all'),(87,'applies completely'),(87,'applies not at all'),(88,'applies completely'),(88,'applies not at all'),(89,'applies completely'),(89,'applies not at all'),(90,'applies completely'),(90,'applies not at all'),(91,'applies completely'),(91,'applies not at all'),(92,'applies completely'),(92,'applies not at all'),(93,'applies completely'),(93,'applies not at all'),(98,'I am very satisfied'),(98,'I am not satisfied at all'),(99,'very fair'),(99,'not at all fair'),(100,'I got too much fish'),(100,'I got the right amount of fish'),(100,'I got too few fish'),(101,'the others got too much fish'),(101,'the others got the right amount of fish'),(101,'the others got too few fish'),(102,'the earnings were too equal'),(102,'the earnings had the right variance'),(102,'the earnings were too varied'),(103,'the fishermen acted too similarly'),(103,'the actions had the right variance'),(103,'the fishermen acted too differently'),(104,'too much fish remained'),(104,'the right amount of fish remained'),(104,'too few fish remained'),(106,'applies completely'),(106,'applies not at all'),(105,'applies completely'),(105,'applies not at all'),(107,'applies completely'),(107,'applies not at all'),(108,'applies completely'),(108,'applies not at all'),(109,'applies completely'),(109,'applies not at all'),(110,'applies completely'),(110,'applies not at all'),(111,'applies completely'),(111,'applies not at all'),(112,'applies completely'),(112,'applies not at all'),(123,'nearly as important'),(123,'not important at all'),(125,'nearly as important'),(125,'not important at all'),(128,'nearly as important'),(128,'not important at all'),(130,'nearly as important'),(130,'not important at all'),(131,'I like my group very much'),(131,'neutral'),(131,'I do not like my group at all'),(132,'very important'),(132,'not important at all'),(133,'very important'),(133,'not important at all'),(134,'very important'),(134,'not important at all'),(135,'completely as a team'),(135,'neutral'),(135,'completely as competing players'),(136,'very much'),(136,'not at all'),(137,'very important'),(137,'not important at all'),(138,'very much'),(138,'not at all'),(139,'very much'),(139,'not at all'),(140,'very much'),(140,'not at all'),(141,'very much'),(141,'not at all'),(142,'very much'),(142,'not at all'),(143,'very much'),(143,'not at all'),(144,'very much'),(144,'not at all'),(145,'very much'),(145,'not at all'),(146,'perfectly'),(146,'not at all'),(147,'much better'),(147,'same as me'),(147,'much worse'),(148,'very confident'),(148,'not at all confident'),(149,'totally'),(149,'not at all'),(150,'completely safe'),(150,'balancing risk and outcomes'),(150,'completely risky'); /*!40000 ALTER TABLE `psychometric_question_choices` ENABLE KEYS */; UNLOCK TABLES; @@ -553,7 +563,7 @@ LOCK TABLES `question` WRITE; /*!40000 ALTER TABLE `question` DISABLE KEYS */; -INSERT INTO `question` VALUES (1,0,'Most important goal:',1,'categorical',10),(2,0,'Second most important goal:',2,'categorical',10),(3,0,'Third most important goal:',4,'categorical',10),(4,0,'Compared to the most important goal, this goal is',3,'psychometric',10),(6,0,'',1,'daybydaydecisions',6),(7,0,'An example of a scale would be',1,'psychometric',11),(8,0,'<ul>\r<li>Why did you design the strategy the way you did? What did you consider and why do you think your strategy is an adequate solution?</li>\r<li>What actions do you expect from the other fishermen in your group? Why do you think, they might act this way?</li>\r<li>How do you think your strategy will work? Will the fish population grow or shrink in the different bays? What earnings do you expect?</li>\r</ul>\r',1,'text',12),(9,0,'Compared to the most important goal, this goal is',5,'psychometric',10),(10,0,'<b>Most important goal:</b>',1,'categorical',13),(11,0,'<b>Second most important goal:</b>',2,'categorical',13),(12,0,'Compared to the most important goal, this goal is',3,'psychometric',13),(13,0,'<b>Third most important goal:</b>',4,'categorical',13),(14,0,'Compared to the most important goal, this goal is',5,'psychometric',13),(15,0,'Over all, how much do like your group (i.e. the other players)?',1,'psychometric',14),(16,0,'How important is it for you what the others think about you and your behavior (i.e. your reputation in the group)?',2,'psychometric',14),(17,0,'How important is it for you that the others can reach their goals (i.e. the outcomes are fair)?',3,'psychometric',14),(18,0,'What do you think, how important is it for the others that you can reach your goals (i.e. the outcomes are fair)?',4,'psychometric',14),(19,0,'Do you perceive the group as a team or as competing players?',5,'psychometric',14),(20,0,'How much do you trust the others in your group?',1,'psychometric',15),(21,0,'How important is it for you that the others in your group can and do trust you?',2,'psychometric',15),(22,0,'How much do you think your group trying to coordinate their actions to reach better outcomes for all?',3,'psychometric',15),(23,1,'How much are you trying to follow rules or agreements that emerged from the communication?',4,'psychometric',15),(24,1,'How much do you think <i>the others</i> are trying to follow rules or agreements that emerged from the communica-tion?',5,'psychometric',15),(25,0,'Do you feel a sense of ‘commitment’ to act in the way you specified in your strategy?',1,'psychometric',16),(26,0,'Would you feel any discomfort or tension if you would act differently than you specified in your strategy?',2,'psychometric',16),(27,0,'Do you feel any sort of ‘social pressure’ to act in the way you specified in your strategy?',3,'psychometric',16),(28,0,'Would you feel guilt or shame if you had acted differently than you specified in your strategy?',4,'psychometric',16),(29,0,'Are you afraid of some sort of ‘punishment’ if you had acted differently as specified in your strategy?',5,'psychometric',16),(30,0,'How well did you understand the dynamics of the fish population?',1,'psychometric',17),(31,0,'Did the others in your group understand the dynamics better or worse than you?',2,'psychometric',17),(32,0,'How confident are you in having developed a strategy that leads to ‘good’ outcomes regarding your goals?',3,'psychometric',17),(33,0,'How much does your strategy depend on how the others in the group will act to reach the desired outcomes?',4,'psychometric',17),(34,0,'Would you classify your strategy as ‘safe’ in the sense of having acceptable but suboptimal results for sure, or rather as ‘risky’ in the sense of having the optimal results if everything runs like expected or very poor results otherwise?',5,'psychometric',17),(35,0,'',1,'forecastingfishermen',18),(36,0,'',1,'forecastingfish',19),(37,0,'',1,'strategydesign',9),(38,0,'',1,'strategydesign',22),(39,0,'',1,'daybydaydecisions',24),(40,0,'',1,'psychometric',27),(41,0,'… better understand the dynamics of the fish population.',1,'psychometric',29),(42,0,'… better understand the other fishermen in my group.',2,'psychometric',29),(43,0,'… better understand how to design the strategy.',3,'psychometric',29),(44,0,'… feel a ‘team spirit’ in the group.',4,'psychometric',29),(45,0,'… appraise the other fishermen in my group differently. Now I think about the others…',5,'psychometric',29),(46,0,'… better understand the dynamics of the fish population.',1,'psychometric',30),(47,0,'… better understand the other fishermen.',2,'psychometric',30),(48,0,'… better understand how to design the strategy.',3,'psychometric',30),(49,0,'… feel a ‘team spirit’ in the group.',4,'psychometric',30),(50,0,'… appraise the other fishermen in my group differently. Now I think about the others …',5,'psychometric',30),(51,0,'Did the communication have any form of reference to how to fish or design the strategy?',1,'categorical',31),(54,0,'',1,'psychometric',32),(55,0,'',2,'psychometric',32),(56,0,'',3,'psychometric',32),(57,0,'',4,'psychometric',32),(58,0,'',5,'psychometric',32),(59,0,'How clear is it to you, that you have to fish conforming to this rule, agreement or coordination attempt?',1,'psychometric',33),(60,0,'Do you think the other fishermen understood how they have to act according to this rule?<br>I think the others… ',2,'psychometric',33),(61,0,'Will you follow the rule, agreement, or coordination attempt that emerged from communication?<br>I will follow the rule…',3,'psychometric',33),(62,0,'Do you think, the other fishermen in you group will follow the rule, agreement, or coordination attempt?<br>\rI think, the others will… ',4,'psychometric',33),(63,0,'Considering the effects you expect for following the rule and your expectations of how the group will follow the rule, do you think the group will do better or worse due to the rule?',5,'psychometric',33),(64,0,'New understanding of fish dynamics',1,'text',34),(65,0,'New Expectations on how the others of the group will act',2,'text',34),(66,0,'Ideas for improving your strategy',3,'text',34),(67,0,'How interesting was the experiment for you?',1,'psychometric',35),(68,0,'How would you rate the effort you invested to design your strategy?',2,'psychometric',35),(69,0,'How difficult was it to understand the problem?',3,'psychometric',35),(70,0,'How difficult was it to find a good strategy?',4,'psychometric',35),(71,0,'How clear was it what you had to do?',5,'psychometric',35),(72,0,'How many times have you participated in problem solving experiments similar to this one?',1,'text',36),(73,0,'If you already participated in such experiments, when was the last time?',2,'categorical',36),(74,0,'Comments and Feedback',1,'text',37),(75,0,'',1,'strategydesign',40),(76,0,'',1,'strategydesign',53),(77,0,'',1,'daybydaydecisions',55),(78,0,'',1,'psychometric',58),(79,0,'',2,'psychometric',27),(80,0,'I feel the outcomes are:',3,'psychometric',27),(81,0,'',1,'psychometric',59),(82,0,'',2,'psychometric',59),(83,0,'',3,'psychometric',59),(84,0,'',4,'psychometric',59),(85,0,'',5,'psychometric',59),(86,0,'I did not understand the dynamics of the fish population well enough.',1,'psychometric',60),(87,0,'Some of the other fishermen did not understand the dynamics of the fish population well enough.',2,'psychometric',60),(88,0,'The actions of the others in my group did not help my strategy work well.',3,'psychometric',60),(89,0,'Some of the other fishermen acted too reluctantly (harvested too few).',4,'psychometric',60),(90,0,'Some of the other fishermen acted too aggressively (harvested too much).',5,'psychometric',60),(91,0,'The group was too uncoordinated',6,'psychometric',60),(92,0,'The group did not follow the rules or agreements that emerged from the communication enough.',7,'psychometric',60),(93,0,'The rules or agreements that emerged from the communication did not work out well.',8,'psychometric',60),(94,0,'What were the most important reasons for you to deviate from your strategy during the day-by-day decisions?<br>\rIf you did not deviate from your strategy then please write something like \"No difference\" in the text field.',1,'text',61),(95,0,'New understanding of fish dynamics',1,'text',62),(96,0,'New expectations on how the others of the group will act',2,'text',62),(97,0,'Ideas for improving your strategy',3,'text',62),(98,0,'',2,'psychometric',58),(99,0,'I feel the outcomes are:',3,'psychometric',58),(100,0,'',1,'psychometric',63),(101,0,'',2,'psychometric',63),(102,0,'',3,'psychometric',63),(103,0,'',4,'psychometric',63),(104,0,'',5,'psychometric',63),(105,0,'I did not understand the dynamics of the fish population well enough.',1,'psychometric',64),(106,0,'Some of the other fishermen did not understand the dynamics of the fish population well enough',2,'psychometric',64),(107,0,'The actions of the others in my group did not help my strategy work well.',3,'psychometric',64),(108,0,'Some of the other fishermen acted too reluctantly (harvested too few).',4,'psychometric',64),(109,0,'Some of the other fishermen acted too aggressively (harvested too much).',5,'psychometric',64),(110,0,'The group was too uncoordinated',6,'psychometric',64),(111,0,'The group did not follow the rules or agreements that emerged from the communication enough.',7,'psychometric',64),(112,0,'The rules or agreements that emerged from the communication did not work out well.',8,'psychometric',64),(113,0,'What were the most important reasons for you to deviate from your strategy during the day-by-day decisions?<br>\rIf you did not deviate from your strategy then please write something like \"No difference\" in the text field.',1,'text',65),(114,0,'New understanding of fish dynamics',1,'text',66),(115,0,'New expectations on how the others of the group will act',2,'text',66),(116,0,'Ideas for improving your strategy',3,'text',66),(117,0,'Describe in your own words what the rule, agreement, or other coordination attempt states. Describe how you and the others should act and what would happen if one does not act in this way.<br>\rIf you cannot identify any sort of coordination attempt in the communication, write \"no coordination\" in the field below.<br>\r(The information you write in this field will be available the next time you edit your strategy.)',2,'text',31),(118,0,'How often do you play strategy games (i.e. any games where you have to anticipate the moves of other players and plan your own moves ahead, like computer games, card games, board games, etc)?',3,'categorical',36),(119,0,'An example of a scale would be',1,'psychometric',41),(120,0,'<ul>\r<li>Why did you design the strategy the way you did? What did you consider and why do you think your strategy is an adequate solution?</li>\r<li>What actions do you expect from the other fishermen in your group? Why do you think, they might act this way?</li>\r<li>How do you think your strategy will work? Will the fish population grow or shrink in the different bays? What earnings do you expect?</li>\r</ul>\r',1,'text',42),(121,0,'Most important goal:',1,'categorical',43),(122,0,'Second most important goal:',2,'categorical',43),(123,0,'Compared to the most important goal, this goal is',3,'psychometric',43),(124,0,'Third most important goal:',4,'categorical',43),(125,0,'Compared to the most important goal, this goal is',5,'psychometric',43),(126,0,'<b>Most important goal:</b>',1,'categorical',44),(127,0,'<b>Second most important goal:</b>',2,'categorical',44),(128,0,'Compared to the most important goal, this goal is',3,'psychometric',44),(129,0,'<b>Third most important goal:</b>',4,'categorical',44),(130,0,'Compared to the most important goal, this goal is',5,'psychometric',44),(131,0,'Over all, how much do like your group (i.e. the other players)?',1,'psychometric',45),(132,0,'How important is it for you what the others think about you and your behavior (i.e. your reputation in the group)?',2,'psychometric',45),(133,0,'How important is it for you that the others can reach their goals (i.e. the outcomes are fair)?',3,'psychometric',45),(134,0,'What do you think, how important is it for the others that you can reach your goals (i.e. the outcomes are fair)?',4,'psychometric',45),(135,0,'Do you perceive the group as a team or as competing players?',5,'psychometric',45),(136,0,'How much do you trust the others in your group?',1,'psychometric',46),(137,0,'How important is it for you that the others in your group can and do trust you?',2,'psychometric',46),(138,0,'How much do you think your group trying to coordinate their actions to reach better outcomes for all?',3,'psychometric',46),(139,0,'How much are you trying to follow rules or agreements that emerged from the communication?',4,'psychometric',46),(140,0,'How much do you think <i>the others</i> are trying to follow rules or agreements that emerged from the communica-tion?',5,'psychometric',46),(141,0,'Do you feel a sense of ‘commitment’ to act in the way you specified in your strategy?',1,'psychometric',47),(142,0,'Would you feel any discomfort or tension if you would act differently than you specified in your strategy?',2,'psychometric',47),(143,0,'Do you feel any sort of ‘social pressure’ to act in the way you specified in your strategy?',3,'psychometric',47),(144,0,'Would you feel guilt or shame if you had acted differently than you specified in your strategy?',4,'psychometric',47),(145,0,'Are you afraid of some sort of ‘punishment’ if you had acted differently as specified in your strategy?',5,'psychometric',47),(146,0,'How well did you understand the dynamics of the fish population?',1,'psychometric',48),(147,0,'Did the others in your group understand the dynamics better or worse than you?',2,'psychometric',48),(148,0,'How confident are you in having developed a strategy that leads to ‘good’ outcomes regarding your goals?',3,'psychometric',48),(149,0,'How much does your strategy depend on how the others in the group will act to reach the desired outcomes?',4,'psychometric',48),(150,0,'Would you classify your strategy as ‘safe’ in the sense of having acceptable but suboptimal results for sure, or rather as ‘risky’ in the sense of having the optimal results if everything runs like expected or very poor results otherwise?',5,'psychometric',48),(151,0,'',1,'forecastingfishermen',49),(152,0,'',1,'forecastingfish',50); +INSERT INTO `question` VALUES (1,0,'Most important goal:',1,'categorical',10),(2,0,'Second most important goal:',2,'categorical',10),(3,0,'Third most important goal:',4,'categorical',10),(4,0,'Compared to the most important goal, this goal is',3,'psychometric',10),(6,0,'',1,'daybydaydecisions',6),(7,0,'An example of a scale would be',1,'psychometric',11),(8,0,'<ul>\r<li>Why did you design the strategy the way you did? What did you consider and why do you think your strategy is an adequate solution?</li>\r<li>What actions do you expect from the other fishermen in your group? Why do you think, they might act this way?</li>\r<li>How do you think your strategy will work? Will the fish population grow or shrink in the different bays? What earnings do you expect?</li>\r</ul>\r',1,'text',12),(9,0,'Compared to the most important goal, this goal is',5,'psychometric',10),(10,0,'<b>Most important goal:</b>',1,'categorical',13),(11,0,'<b>Second most important goal:</b>',2,'categorical',13),(12,0,'Compared to the most important goal, this goal is',3,'psychometric',13),(13,0,'<b>Third most important goal:</b>',4,'categorical',13),(14,0,'Compared to the most important goal, this goal is',5,'psychometric',13),(15,0,'Over all, how much do like your group (i.e. the other players)?',1,'psychometric',14),(16,0,'How important is it for you what the others think about you and your behavior (i.e. your reputation in the group)?',2,'psychometric',14),(17,0,'How important is it for you that the others can reach their goals (i.e. the outcomes are fair)?',3,'psychometric',14),(18,0,'What do you think, how important is it for the others that you can reach your goals (i.e. the outcomes are fair)?',4,'psychometric',14),(19,0,'Do you perceive the group as a team or as competing players?',5,'psychometric',14),(20,0,'How much do you trust the others in your group?',1,'psychometric',15),(21,0,'How important is it for you that the others in your group can and do trust you?',2,'psychometric',15),(22,0,'How much do you think your group trying to coordinate their actions to reach better outcomes for all?',3,'psychometric',15),(23,1,'How much are you trying to follow rules or agreements that emerged from the communication?',4,'psychometric',15),(24,1,'How much do you think <i>the others</i> are trying to follow rules or agreements that emerged from the communica-tion?',5,'psychometric',15),(25,0,'Do you feel a sense of ‘commitment’ to act in the way you specified in your strategy?',1,'psychometric',16),(26,0,'Would you feel any discomfort or tension if you would act differently than you specified in your strategy?',2,'psychometric',16),(27,0,'Do you feel any sort of ‘social pressure’ to act in the way you specified in your strategy?',3,'psychometric',16),(28,0,'Would you feel guilt or shame if you had acted differently than you specified in your strategy?',4,'psychometric',16),(29,0,'Are you afraid of some sort of ‘punishment’ if you had acted differently as specified in your strategy?',5,'psychometric',16),(30,0,'How well did you understand the dynamics of the fish population?',1,'psychometric',17),(31,0,'Did the others in your group understand the dynamics better or worse than you?',2,'psychometric',17),(32,0,'How confident are you in having developed a strategy that leads to ‘good’ outcomes regarding your goals?',3,'psychometric',17),(33,0,'How much does your strategy depend on how the others in the group will act to reach the desired outcomes?',4,'psychometric',17),(34,0,'Would you classify your strategy as ‘safe’ in the sense of having acceptable but suboptimal results for sure, or rather as ‘risky’ in the sense of having the optimal results if everything runs like expected or very poor results otherwise?',5,'psychometric',17),(35,0,'',1,'forecastingfishermen',18),(36,0,'',1,'forecastingfish',19),(37,0,'',1,'strategydesign',9),(38,0,'',1,'strategydesign',22),(39,0,'',1,'daybydaydecisions',24),(40,0,'',1,'psychometric',27),(41,0,'… better understand the dynamics of the fish population.',1,'psychometric',29),(42,0,'… better understand the other fishermen in my group.',2,'psychometric',29),(43,0,'… better understand how to design the strategy.',3,'psychometric',29),(44,0,'… feel a ‘team spirit’ in the group.',4,'psychometric',29),(45,0,'… appraise the other fishermen in my group differently. Now I think about the others…',5,'psychometric',29),(46,0,'… better understand the dynamics of the fish population.',1,'psychometric',30),(47,0,'… better understand the other fishermen.',2,'psychometric',30),(48,0,'… better understand how to design the strategy.',3,'psychometric',30),(49,0,'… feel a ‘team spirit’ in the group.',4,'psychometric',30),(50,0,'… appraise the other fishermen in my group differently. Now I think about the others …',5,'psychometric',30),(51,0,'Did the communication have any form of reference to how to fish or design the strategy?',1,'categorical',31),(54,0,'',1,'psychometric',32),(55,0,'',2,'psychometric',32),(56,0,'',3,'psychometric',32),(57,0,'',4,'psychometric',32),(58,0,'',5,'psychometric',32),(59,0,'How clear is it to you, that you have to fish conforming to this rule, agreement or coordination attempt?',1,'psychometric',33),(60,0,'Do you think the other fishermen understood how they have to act according to this rule?<br>I think the others… ',2,'psychometric',33),(61,0,'Will you follow the rule, agreement, or coordination attempt that emerged from communication?<br>I will follow the rule…',3,'psychometric',33),(62,0,'Do you think, the other fishermen in you group will follow the rule, agreement, or coordination attempt?<br>\rI think, the others will… ',4,'psychometric',33),(63,0,'Considering the effects you expect for following the rule and your expectations of how the group will follow the rule, do you think the group will do better or worse due to the rule?',5,'psychometric',33),(64,0,'New understanding of fish dynamics',1,'text',34),(65,0,'New Expectations on how the others of the group will act',2,'text',34),(66,0,'Ideas for improving your strategy',3,'text',34),(67,0,'How interesting was the experiment for you?',1,'psychometric',35),(68,0,'How would you rate the effort you invested to design your strategy?',2,'psychometric',35),(69,0,'How difficult was it to understand the problem?',3,'psychometric',35),(70,0,'How difficult was it to find a good strategy?',4,'psychometric',35),(71,0,'How clear was it what you had to do?',5,'psychometric',35),(72,0,'How many times have you participated in problem solving experiments similar to this one?',1,'text',36),(73,0,'If you already participated in such experiments, when was the last time?',2,'categorical',36),(74,0,'Comments and Feedback',1,'text',37),(75,0,'',1,'strategydesign',40),(76,0,'',1,'strategydesign',53),(77,0,'',1,'daybydaydecisions',55),(78,0,'',1,'psychometric',58),(79,0,'',2,'psychometric',27),(80,0,'I feel the outcomes are:',3,'psychometric',27),(81,0,'',1,'psychometric',59),(82,0,'',2,'psychometric',59),(83,0,'',3,'psychometric',59),(84,0,'',4,'psychometric',59),(85,0,'',5,'psychometric',59),(86,0,'I did not understand the dynamics of the fish population well enough.',1,'psychometric',60),(87,0,'Some of the other fishermen did not understand the dynamics of the fish population well enough.',2,'psychometric',60),(88,0,'The actions of the others in my group did not help my strategy work well.',3,'psychometric',60),(89,0,'Some of the other fishermen acted too reluctantly (harvested too few).',4,'psychometric',60),(90,0,'Some of the other fishermen acted too aggressively (harvested too much).',5,'psychometric',60),(91,0,'The group was too uncoordinated',6,'psychometric',60),(92,0,'The group did not follow the rules or agreements that emerged from the communication enough.',7,'psychometric',60),(93,0,'The rules or agreements that emerged from the communication did not work out well.',8,'psychometric',60),(94,0,'What were the most important reasons for you to deviate from your strategy during the day-by-day decisions?<br>\rIf you did not deviate from your strategy then please write something like \"No difference\" in the text field.',1,'text',61),(95,0,'New understanding of fish dynamics',1,'text',62),(96,0,'New expectations on how the others of the group will act',2,'text',62),(97,0,'Ideas for improving your strategy',3,'text',62),(98,0,'',2,'psychometric',58),(99,0,'I feel the outcomes are:',3,'psychometric',58),(100,0,'',1,'psychometric',63),(101,0,'',2,'psychometric',63),(102,0,'',3,'psychometric',63),(103,0,'',4,'psychometric',63),(104,0,'',5,'psychometric',63),(105,0,'I did not understand the dynamics of the fish population well enough.',1,'psychometric',64),(106,0,'Some of the other fishermen did not understand the dynamics of the fish population well enough',2,'psychometric',64),(107,0,'The actions of the others in my group did not help my strategy work well.',3,'psychometric',64),(108,0,'Some of the other fishermen acted too reluctantly (harvested too few).',4,'psychometric',64),(109,0,'Some of the other fishermen acted too aggressively (harvested too much).',5,'psychometric',64),(110,0,'The group was too uncoordinated',6,'psychometric',64),(111,0,'The group did not follow the rules or agreements that emerged from the communication enough.',7,'psychometric',64),(112,0,'The rules or agreements that emerged from the communication did not work out well.',8,'psychometric',64),(113,0,'What were the most important reasons for you to deviate from your strategy during the day-by-day decisions?<br>\rIf you did not deviate from your strategy then please write something like \"No difference\" in the text field.',1,'text',65),(114,0,'New understanding of fish dynamics',1,'text',66),(115,0,'New expectations on how the others of the group will act',2,'text',66),(116,0,'Ideas for improving your strategy',3,'text',66),(117,0,'Describe in your own words what the rule, agreement, or other coordination attempt states. Describe how you and the others should act and what would happen if one does not act in this way.<br>\rIf you cannot identify any sort of coordination attempt in the communication, write \"no coordination\" in the field below.<br>\r(The information you write in this field will be available the next time you edit your strategy.)',2,'text',31),(118,0,'How often do you play strategy games (i.e. any games where you have to anticipate the moves of other players and plan your own moves ahead, like computer games, card games, board games, etc)?',3,'categorical',36),(120,0,'<ul>\r<li>Why did you design the strategy the way you did? What did you consider and why do you think your strategy is an adequate solution?</li>\r<li>What actions do you expect from the other fishermen in your group? Why do you think, they might act this way?</li>\r<li>How do you think your strategy will work? Will the fish population grow or shrink in the different bays? What earnings do you expect?</li>\r</ul>\r',1,'text',42),(121,0,'Most important goal:',1,'categorical',43),(122,0,'Second most important goal:',2,'categorical',43),(123,0,'Compared to the most important goal, this goal is',3,'psychometric',43),(124,0,'Third most important goal:',4,'categorical',43),(125,0,'Compared to the most important goal, this goal is',5,'psychometric',43),(126,0,'<b>Most important goal:</b>',1,'categorical',44),(127,0,'<b>Second most important goal:</b>',2,'categorical',44),(128,0,'Compared to the most important goal, this goal is',3,'psychometric',44),(129,0,'<b>Third most important goal:</b>',4,'categorical',44),(130,0,'Compared to the most important goal, this goal is',5,'psychometric',44),(131,0,'Over all, how much do like your group (i.e. the other players)?',1,'psychometric',45),(132,0,'How important is it for you what the others think about you and your behavior (i.e. your reputation in the group)?',2,'psychometric',45),(133,0,'How important is it for you that the others can reach their goals (i.e. the outcomes are fair)?',3,'psychometric',45),(134,0,'What do you think, how important is it for the others that you can reach your goals (i.e. the outcomes are fair)?',4,'psychometric',45),(135,0,'Do you perceive the group as a team or as competing players?',5,'psychometric',45),(136,0,'How much do you trust the others in your group?',1,'psychometric',46),(137,0,'How important is it for you that the others in your group can and do trust you?',2,'psychometric',46),(138,0,'How much do you think your group trying to coordinate their actions to reach better outcomes for all?',3,'psychometric',46),(139,0,'How much are you trying to follow rules or agreements that emerged from the communication?',4,'psychometric',46),(140,0,'How much do you think <i>the others</i> are trying to follow rules or agreements that emerged from the communica-tion?',5,'psychometric',46),(141,0,'Do you feel a sense of ‘commitment’ to act in the way you specified in your strategy?',1,'psychometric',47),(142,0,'Would you feel any discomfort or tension if you would act differently than you specified in your strategy?',2,'psychometric',47),(143,0,'Do you feel any sort of ‘social pressure’ to act in the way you specified in your strategy?',3,'psychometric',47),(144,0,'Would you feel guilt or shame if you had acted differently than you specified in your strategy?',4,'psychometric',47),(145,0,'Are you afraid of some sort of ‘punishment’ if you had acted differently as specified in your strategy?',5,'psychometric',47),(146,0,'How well did you understand the dynamics of the fish population?',1,'psychometric',48),(147,0,'Did the others in your group understand the dynamics better or worse than you?',2,'psychometric',48),(148,0,'How confident are you in having developed a strategy that leads to ‘good’ outcomes regarding your goals?',3,'psychometric',48),(149,0,'How much does your strategy depend on how the others in the group will act to reach the desired outcomes?',4,'psychometric',48),(150,0,'Would you classify your strategy as ‘safe’ in the sense of having acceptable but suboptimal results for sure, or rather as ‘risky’ in the sense of having the optimal results if everything runs like expected or very poor results otherwise?',5,'psychometric',48),(151,0,'',1,'forecastingfishermen',49),(152,0,'',1,'forecastingfish',50); /*!40000 ALTER TABLE `question` ENABLE KEYS */; UNLOCK TABLES; @@ -583,7 +593,7 @@ LOCK TABLES `question_group` WRITE; /*!40000 ALTER TABLE `question_group` DISABLE KEYS */; -INSERT INTO `question_group` VALUES (1,'In this experiment you will design a strategy to fish in an abstract fishing ground together with three other persons. As we are mainly interested in the reasons <i>why</i> you choose a certain strategy, we will ask you a number of questions. For the same reason, there are no correct or wrong strategies and no correct or wrong answers. However, since for each pound of fish you get during the experiment you will receive $1.00 US, you might be interested in finding a strategy that fits your goals well. For this, you will need to understand the dynamics of the (simulated) fish population and anticipate well the behavior of the other persons of your group.',30,'<b>Welcome to the E-Fishery Experiment</b>',1,1),(2,'<p>The experiment will run as follows:</p> <ul> <li><b>Introduction</b>: We will explain the interface and how the dynamics of the fish population are modeled. We will also ask you some questions about you and you will have the opportunity to make your decisions on how to fish on a (simulated) day-by-day basis to get a feeling for the dynamics of the fish population. </li> <li><b>Strategy design 1</b>: You will design a fishing strategy that will be simulated together with the strategies of the other persons in your group, and we ask you a larger amount of questions to understand your decisions and to help you reflect on those decisions. </li> <li><b>Fishing and evaluation 1</b>: Besides simulating the strategies you will decide on how to fish on a (simulated) day-by-day basis. Then, we will ask you some questions on your evaluation of the results. </li> <li><b>Communication</b>:You will have the opportunity to chat with the other persons in your group. After the chat we will ask some questions to asses your evaluation of the communication. </li> <li><b>Strategy design, fishing and evaluation 2</b>: The strategy design, fishing and evaluation are repeated as described above. </li> <li><b>Finishing the experiment</b>: The experiment closes with some final questions and more information on the experiment, and you will have the opportunity to give a feedback if you wish to do so. </li> </ul> <p> In the <b>information bar above the main window</b> you can see which part of the experiment you are in, your progress and how you are doing with the time. </p>',30,'<b>Experimental procedure</b>',2,1),(3,'<p>The <b>information window "Fishing Ground"</b> gives you an overview that will be explained here.</p> <p> Imagine you are living on an island and your only income is from a species of fish that only survives in the shallow bays formed by the island. The fish can leave crowed bays and move to less crowded bays, but they cannot survive in the ocean. Nor can new fish arrive from the ocean. </p> <p> The fish population grows at a constant rate. Thus, the more fish are in a bay the faster the population grows. However, the population a bay can sustain is limited and fish leave crowed bays to find less crowded bays. The more crowded a bay, the more fish leave and the less fish enter the bay (the movement is directly proportional to the percentage to which a bay is filled up). The number of fish leaving the bay is proportional to the rate of growth, and the number of fish entering the bay is also proportional to the amount of fish leaving the three bays (i.e. fish in the ocean). </p> <p> The equations of these dynamics are given in the information windows. It is, however, not necessary to know them for designing a strategy. For this, you only have to <b>understand the following five principles</b>: </p> <ul> <li>If all bays are <b>filled up</b> with fish, then the total growth is highest, but all additional lbs of fish are lost to the ocean and the amount of fish in the bays stops growing.</li> <li>If the bays are <b>half filled</b>, then the amount of fish in the bays grows fastest.</li> <li>If the bays are <b>nearly empty</b>, the population grows very slowly.</li> <li>If there is <b>no fish</b> in any of the bays, there will be never any fish again.</li> <li>If there are both <b>crowded and empty</b> bays, a lot of fish move from the crowded to the empty bays.</li> </ul> ',120,'<b>How the dynamics of the fish population are modeled</b>',3,1),(4,'<p>The three bays are different in size and characteristics leading to different growth rates and capacities (i.e. the maximal amount of fish the bay can sustain). At the start of the simulation each bay is half filled.</p> <table> <thead> <th></th><th>Bay 1</th><th>Bay 2</th><th>Bay 3</th> </thead> <tbody> <tr> <td>Capacity:</td><td>10 lb</td><td>20 lb</td><td>30 lb</td> </tr> <tr> <td>Starts with:</td><td>5 lb</td><td>10 lb</td><td>15 lb</td> </tr> <tr> <td>Growth rate:</td><td>50% per day</td><td>15% per day</td><td>5% per day</td> </tr> </tbody> </table> <p> <b>How much fish</b> you take out in a day is <b>directly proportional with the extent that the bay is filled up with fish</b>. Your fishing gear allows you to harvest a maximum of 5 lbs. Thus, if the bay is completely filled up you get 5 lb of fish. If the bay is half filled, you get 2.5 lb of fish. If the bay is filled up only to 20 % you will get 1 lb, etc. The fish population is diminished by the same amount. If several persons fish the same bay and together would get more fish than the bay holds, then all the fish in the bay are distributed equally among these fishermen. </p> <p>However, you can <b>stay in the harbor</b> instead of fishing. This way, you do not get anything and the fish population is not diminished. </p> <p> Your task is to design a strategy of how to fish this fishing ground for 30 days together with three other persons (thus, with you the group compromises 4 persons). You will define the number of days that you stay in each bay or in the harbor. Please note that this is not an exam! We do not expect you to find the mathematically optimal solution to this problem. We want to know how you come up with a solution that sufficiently fulfills your goals. As long as we can understand why you choose a certain strategy you can come up with whatever you like. </p> ',120,'<b>Differences of bays and effects of fishing</b>',4,1),(5,'<p>Before designing the strategy, you have the opportunity to make your decisions on a day-by-day basis for the simulation. You will interact with the actual model of the fishing ground together with the other persons of your group. Thus, the problems and possibilities you will experience in this warm-up are relevant for the design of your strategy. </p> <p> The <b>interface</b> you will encounter on the next page has the following elements: <ul> <li>Information on the day of the simulation</li> <li>Buttons for your decision. If you want to fish in Bay 1, for example, click on Button "Bay 1". </li> <li>Time remaining. You have 10 seconds for each decision. If you do not press any button within these 10 seconds then you will stay in the harbor for this day. However, you can change your decision within these 10 seconds (i.e. if you clicked on "Bay 1" after 4 seconds and after another 4 seconds on "Bay 3", you will go to Bay 3). </li> <li>Table of past results. Your previous locations from past days are highlighted. The table shows you how much you fished and who else was in the same location as you. You do not have any information of locations where you not have been. </li> ',60,'<b>A warm-up</b>',5,1),(6,'',345,'<b>Day-by-day-decisions</b>',6,1),(7,'<p>In what we refer to as a \'strategy\' you predefine your decisions of where to go each day of the simulation.\r Al-though only 30 days will be simulated, your strategy should represent your decisions for an indefinite period. Therefore you define a <b>set of decisions that will be repeated</b> until the end of the simulation. The set can contain as many decisions as you want but try to use as few as possible. Remember: Often simple strategies are more effective!</p> <p>It might be that you want to base your set of repeated decisions on another state of the fish population. In this case you can define a set of not repeated decisions that are applied at the beginning of the simulation. For example, you might first stay in the harbor to let the fish population increase or first fish all the bays to reduce the fish population before you start the repeated sequence of decisions.</p> <p>In this strategy you define how many days you stay at a certain location and to which other location you will move on.\r If, for example, you define to repeat the sequence \"2 days in harbor - 3 days in Bay 1 - 2 days in Bay 2\" you will not fish for two days, then fish in Bay 1 for three days, then fish in Bay 2 for two days, then not fish for two days, then fish in Bay 1 for three days, etc.</p> ',480,'<b>Designing your Strategy</b>',1,2),(8,'<p>Your strategy is mainly based on the number of days you stay at a certain location. However, things might run differently than you expected and you might wish to leave a bay earlier than the days you specified because you get too few fish out of that bay. For doing so you can specify a threshold of income. If you fish less then this threshold, the next day you will not fish this bay anymore but move on to the next location specified in your strategy.</p> <p>Note: Thresholds refer to the quantity of fish you get during one day fishing in a bay and not, for example, to the quantity of fish in the bay, fish fished by others, sum of fish already fished, etc.</p> <p>The final option you have is to stop repeating your strategy and stay in the harbor for some days. This op-tion can be used to prevent the total destruction of the fish population. For this you define a threshold and a number of days. If during one repetition of your decision set you never fished the amount defined by the threshold, then you stay in the harbor for the specified number of days before you start the next repetition.</p> <p>Note: Intentionally we do not allow designing \'intelligent\' strategies that search for solutions during the game. You have to think about what would be the best solution for you and express it with the options explained above.</p> ',90,'<b>Some special features of the strategy design</b>',2,2),(9,'<p>Design your strategy by clicking on <b>\'New\'</b> and <b>\'Delete\'</b>. You have to specify at least one repeated decision! If you are not sure about the meaning of the concepts used, refer to the information window \'Help for strategy design\'. </br>\rWhen you are done, click on <b>\'Next\'</b> </p>',480,'<b>Design your strategy</b>',3,2),(10,'<p>Please specify three goals that most influenced the design of your strategy. You can select from 18 different goals grouped in three categories (foci). </p><p>First select the focus of the goal (earnings, fish population or the other fishermen). Based on this selection, the list on the right hand sight will be filled and you can select one of these goals. For the second and third most important goal, also state, how much less important they are in relation to the most important goal.</p><p> The information you write into these fields will be available the next time you edit your strategy.</p>',30,'<b>What goals did you follow when designing your strategy?</b>',3,3),(11,'<p>We will ask you a number of questions on the strategy you just designed. This will help us to better understand how you came up with your strategy and it might help you reflect on certain aspects to improve your strategy.</p>\r<p>Besides <b>large fields</b> to write text and <b>small fields</b> to write numbers, you will encounter drop-down lists for selecting predefined values and scales. </p>\r<p>To give an answer on a scale, click on the location between the labels that comes closest to your opinion. By clicking on the scale, a slider appears that marks the value you selected. You can change the value by clicking on another position on the scale. By clicking on the reset button, the sliders of all scales on a page are removed and you can start selecting values again.</p>\r<p>Please try to answer all questions even if you are not sure. We are not testing your abilities but rather want to understand how you came up with your strategy.</p>\r',30,'<b>Introduction to questionnaire</b>',1,3),(12,'<p>Please explain your strategy with a few sentences. Particularly consider the following aspects:</p>',300,'<b>Explain the strategy in your own words</b>',2,3),(13,'<p>Specify the three goals that you think most influenced the design of the strategy of the other fishermen in your group. You can select from 18 different goals grouped in three categories (foci).</p>\r<p>First select the focus of the goal (earnings, fish population or the other fishermen). Based on this selection, the list on the right hand sight will be filled and you can select one of these goals. For the second and third most important goal, also state, how much less important they are in relation to the most important goal</p>\r',30,'<b>What goals do you think the others follow?</b>',4,3),(14,'',30,'<b>How do you perceive your group?</b>',5,3),(15,'',30,'<b>How much do you count on others and how much can they count on you?</b>',6,3),(16,'',30,'<b>What else influenced your strategy design?</b>',7,3),(17,'',60,'<b>How confident are you in reaching the outcomes you are expecting?</b>',8,3),(18,'<p>Fill in the following table your expectations of the others’ actions (i.e. the number of fishermen in each bay) for the first 15 days. Please note that we ask only for the expectations of where the others will go. </p>',... [truncated message content] |
From: Kalin J. <kj...@as...> - 2009-08-21 18:15:18
|
Today I come in to work at around 11:00am I will discuss the experiment with Seema, and figure out what to work on today from there. |
From: Kalin J. <kj...@as...> - 2009-08-21 01:54:04
|
I check out tonight at 18:00pm I am finishing up working on the saving methods now, and am going to go over the added things for communication round in database On Thu, Aug 20, 2009 at 3:08 PM, Kalin Jonas <kj...@as...> wrote: > I was not able to get back to tempe as the shuttles are not operating, so I > work from home at 15:00pm today > I will go through the database question-by-question looking to make sure > that every question in the design document is in there. (this hasn't been > done yet) > After this, I will make sure that special questions have their answers > saved client-side, so that the client can use the information to display > things like information windows. > |
From: Kalin J. <kj...@as...> - 2009-08-20 22:37:02
|
I was not able to get back to tempe as the shuttles are not operating, so I work from home at 15:00pm today I will go through the database question-by-question looking to make sure that every question in the design document is in there. (this hasn't been done yet) After this, I will make sure that special questions have their answers saved client-side, so that the client can use the information to display things like information windows. |
From: <kj...@us...> - 2009-08-19 21:05:42
|
Revision: 265 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=265&view=rev Author: kjonas Date: 2009-08-19 21:05:30 +0000 (Wed, 19 Aug 2009) Log Message: ----------- Student.as contains GameCode core updated to have GameCode field; sends students as objects, not parameters StartGame edited to send request to server StartGame (edited).html included as a sample of an html file with full-url so you can see the embedded flex Modified Paths: -------------- mentalmodels/trunk/flex/src/StartGame.mxml mentalmodels/trunk/flex/src/actionscript/Student.as mentalmodels/trunk/flex/src/custom/FisheryExperimentCore.mxml mentalmodels/trunk/flex/src/custom/SocioDemographicPage.mxml mentalmodels/trunk/src/main/webapp/FisheryExperimentShell.swf mentalmodels/trunk/src/main/webapp/InitialiseDatabase.swf mentalmodels/trunk/src/main/webapp/StartGame.swf mentalmodels/trunk/src/main/webapp/test.swf Added Paths: ----------- mentalmodels/trunk/src/main/webapp/StartGame (edited).html Modified: mentalmodels/trunk/flex/src/StartGame.mxml =================================================================== --- mentalmodels/trunk/flex/src/StartGame.mxml 2009-08-19 17:37:51 UTC (rev 264) +++ mentalmodels/trunk/flex/src/StartGame.mxml 2009-08-19 21:05:30 UTC (rev 265) @@ -57,6 +57,13 @@ var gameObject:Game = new Game(); gameObject.money = stpMoney.value; gameObject.description = txtDescription.text; + gameObject.numberOfRounds = 2; + gameObject.maxDays = 30; + gameObject.maxFishHarvest = 100; + gameObject.timestamp = new Date(); + gameObject.title = "test Game Title"; + + startupService.createGame(gameObject); } public function start():void { @@ -91,4 +98,3 @@ </mx:Script> </mx:Application> - Modified: mentalmodels/trunk/flex/src/actionscript/Student.as =================================================================== --- mentalmodels/trunk/flex/src/actionscript/Student.as 2009-08-19 17:37:51 UTC (rev 264) +++ mentalmodels/trunk/flex/src/actionscript/Student.as 2009-08-19 21:05:30 UTC (rev 265) @@ -10,11 +10,12 @@ public var id:int; public var group:int; public var studentNo:int; - public var birthYear:int; - public var major:String; - public var semester:String; + public var birthYear:int; + public var major:String; + public var semester:String; public var timestamp:Date; public var gender:String; + public var gameCode:String; /** * input: Modified: mentalmodels/trunk/flex/src/custom/FisheryExperimentCore.mxml =================================================================== --- mentalmodels/trunk/flex/src/custom/FisheryExperimentCore.mxml 2009-08-19 17:37:51 UTC (rev 264) +++ mentalmodels/trunk/flex/src/custom/FisheryExperimentCore.mxml 2009-08-19 21:05:30 UTC (rev 265) @@ -246,7 +246,7 @@ for(var k:int=0;k<tempDBObjects.length;k++) { (tempDBObjects.getItemAt(k) as StudentStrategy).student = studentObject; - (tempDBObjects.getItemAt(k) as StudentStrategy).roundConfig = roundObject; + (tempDBObjects.getItemAt(k) as StudentStrategy).round = roundObject; } answeringService.saveStrategy(tempDBObjects); @@ -413,15 +413,20 @@ if(obj is SocioDemographicPage) { - var Id:uint = 0; if( (SocioDemographicPage)(obj).accept() ) { obj.visible = false; expiredContent.addChild(obj); - var info:SocioDemographicPage = SocioDemographicPage(obj); - Id = startupService.createStudent(info.getYear(), info.getSemester(), info.getGender(),info.getMajor()); + var newStudent:actionscript.Student = new Student(); + newStudent.birthYear = ((obj as SocioDemographicPage).getYear() as int); + newStudent.gender = (obj as SocioDemographicPage).getGender(); + newStudent.major = (obj as SocioDemographicPage).getMajor(); + newStudent.semester = (obj as SocioDemographicPage).getSemester(); + newStudent.gameCode = (obj as SocioDemographicPage).getGameCode(); + startupService.createStudent(newStudent); + currentState = "wait"; btnBack.enabled = btnForward.enabled = btnReset.enabled = true; Modified: mentalmodels/trunk/flex/src/custom/SocioDemographicPage.mxml =================================================================== --- mentalmodels/trunk/flex/src/custom/SocioDemographicPage.mxml 2009-08-19 17:37:51 UTC (rev 264) +++ mentalmodels/trunk/flex/src/custom/SocioDemographicPage.mxml 2009-08-19 21:05:30 UTC (rev 265) @@ -23,6 +23,10 @@ { return cbxSemester.selectedItem as String; } + public function getGameCode():String + { + return txtGameCode.text; + } public function accept():Boolean { @@ -129,6 +133,11 @@ <mx:ComboBox id="cbxSemester" selectedIndex="0" dataProvider="{new ArrayCollection(['Freshman','Sophomore','Junior','Senior','Graduate/Other'])}"/> <!--<mx:TextInput id="txtSemester" width="75" maxChars="6"/>--> </mx:HBox> + + <mx:HBox> + <mx:Label text="Game Code:" fontWeight="bold" width="100" textAlign="right"/> + <mx:TextInput id="txtGameCode" width="120" maxChars="10"/> + </mx:HBox> </mx:VBox> </mx:VBox> Modified: mentalmodels/trunk/src/main/webapp/FisheryExperimentShell.swf =================================================================== (Binary files differ) Modified: mentalmodels/trunk/src/main/webapp/InitialiseDatabase.swf =================================================================== (Binary files differ) Added: mentalmodels/trunk/src/main/webapp/StartGame (edited).html =================================================================== --- mentalmodels/trunk/src/main/webapp/StartGame (edited).html (rev 0) +++ mentalmodels/trunk/src/main/webapp/StartGame (edited).html 2009-08-19 21:05:30 UTC (rev 265) @@ -0,0 +1,139 @@ +<!-- saved from url=(0014)about:internet --> +<html lang="en"> + +<!-- +Smart developers always View Source. + +This application was built using Adobe Flex, an open source framework +for building rich Internet applications that get delivered via the +Flash Player or to desktops via Adobe AIR. + +Learn more about Flex at http://flex.org +// --> + +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + +<!-- BEGIN Browser History required section --> +<link rel="stylesheet" type="text/css" href="history/history.css" /> +<!-- END Browser History required section --> + +<title></title> +<script src="AC_OETags.js" language="javascript"></script> + +<!-- BEGIN Browser History required section --> +<script src="history/history.js" language="javascript"></script> +<!-- END Browser History required section --> + +<style> +body { margin: 0px; overflow:hidden } +</style> + +<script language="JavaScript"> + window.onbeforeunload = confirmExit; + function confirmExit() + { + return "If you are connected to the server, you will be disconnected if the page closes. Students in the experiment will be removed if the window closes."; + } +</script> + +<script language="JavaScript" type="text/javascript"> +<!-- +// ----------------------------------------------------------------------------- +// Globals +// Major version of Flash required +var requiredMajorVersion = 9; +// Minor version of Flash required +var requiredMinorVersion = 0; +// Minor version of Flash required +var requiredRevision = 124; +// ----------------------------------------------------------------------------- +// --> +</script> +</head> + +<body scroll="no"> + + + <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" + id="StartGame" width="100%" height="100%" + codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab"> + <param name="movie" value="StartGame.swf" /> + <PARAM NAME=FlashVars VALUE="ip=test${clientIP}"> + <param name="quality" value="high" /> + <param name="bgcolor" value="#869ca7" /> + <param name="allowScriptAccess" value="sameDomain" /> + <embed src="http://127.0.0.1:8080/mme/StartGame.swf" quality="high" bgcolor="#869ca7" + width="100%" height="100%" name="StartGame" align="middle" + play="true" + loop="false" + quality="high" + allowScriptAccess="sameDomain" + type="application/x-shockwave-flash" + pluginspage="http://www.adobe.com/go/getflashplayer"> + </embed> + </object> +</body> +</html> + AC_FL_RunContent( + "src", "playerProductInstall", + "FlashVars", "MMredirectURL="+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle+'&ip=test'+clientIP+"", + "width", "100%", + "height", "100%", + "align", "middle", + "id", "StartGame", + "quality", "high", + "bgcolor", "#869ca7", + "name", "StartGame", + "allowScriptAccess","sameDomain", + "type", "application/x-shockwave-flash", + "pluginspage", "http://www.adobe.com/go/getflashplayer" + ); +} else if (hasRequestedVersion) { + // if we've detected an acceptable version + // embed the Flash Content SWF when all tests are passed + AC_FL_RunContent( + "src", "http://127.0.0.1:8080/mme/StartGame", + "width", "100%", + "height", "100%", + "align", "middle", + "valign", "middle", + "id", "StartGame", + "quality", "high", + "bgcolor", "#869ca7", + "name", "StartGame", + "allowScriptAccess","sameDomain", + "type", "application/x-shockwave-flash", + "pluginspage", "http://www.adobe.com/go/getflashplayer", + "FlashVars", "ip=test"+clientIP+"" + ); +} else { // flash is too old or we can't detect the plugin + var alternateContent = 'Alternate HTML content should be placed here. ' + + 'This content requires the Adobe Flash Player. ' + + '<a href=http://www.adobe.com/go/getflash/>Get Flash</a>'; + document.write(alternateContent); // insert non-flash content + } +// --> +</script> +<noscript> + <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" + id="StartGame" width="100%" height="100%" + codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab"> + <param name="movie" value="StartGame.swf" /> + <PARAM NAME=FlashVars VALUE="ip=test${clientIP}"> + <param name="quality" value="high" /> + <param name="bgcolor" value="#869ca7" /> + <param name="allowScriptAccess" value="sameDomain" /> + <embed src="http://127.0.0.1:8080/mme/StartGame.swf" quality="high" bgcolor="#869ca7" + width="100%" height="100%" name="StartGame" align="middle" + play="true" + loop="false" + quality="high" + allowScriptAccess="sameDomain" + type="application/x-shockwave-flash" + pluginspage="http://www.adobe.com/go/getflashplayer"> + </embed> + </object> +</noscript> +</body> +</html> Modified: mentalmodels/trunk/src/main/webapp/StartGame.swf =================================================================== (Binary files differ) Modified: mentalmodels/trunk/src/main/webapp/test.swf =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: Kalin J. <kj...@as...> - 2009-08-19 21:01:16
|
I will be leaving at 14:00pm today (4hr) I have identified the next step in completing the CreateGame code: find a place to call setStartGame() in StartupService. It threw an error when I tried to call it whenever there was a null StartGame variable. (I sent this error to Seema) I have put the necessary code to create student with the gameCode, but that also needs to be interpreted into which game the student belongs to. checking how saveStrategy works might take a while - at least until the student can connect to server properly. On Wed, Aug 19, 2009 at 10:32 AM, Kalin Jonas <kj...@as...> wrote: > Today I came in at around 10am > I have been sifting through the SVN repository, checking which changes have > been made, and correcting errors. > My plan for the day begins with saveStrategy and createStudent. > I will then test the experiment as a whole, starting with using > StartGame.mxml to create the game, connecting a client, and seeing what > happens. > |
From: <kj...@us...> - 2009-08-19 17:37:58
|
Revision: 264 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=264&view=rev Author: kjonas Date: 2009-08-19 17:37:51 +0000 (Wed, 19 Aug 2009) Log Message: ----------- Game.as: Timestamp becomes Date in flex PageDisplay.as: removed unused Alert import StudentStrategy.as: flex has compile errors unless actionscript.Student or actionscript.Round is used. renamed 'roundConfig' to just 'round' Modified Paths: -------------- mentalmodels/trunk/flex/src/actionscript/StudentStrategy.as Modified: mentalmodels/trunk/flex/src/actionscript/StudentStrategy.as =================================================================== --- mentalmodels/trunk/flex/src/actionscript/StudentStrategy.as 2009-08-19 01:26:13 UTC (rev 263) +++ mentalmodels/trunk/flex/src/actionscript/StudentStrategy.as 2009-08-19 17:37:51 UTC (rev 264) @@ -14,8 +14,6 @@ public var threshold:Number; public var location:Location; public var repeatedDecisions:Boolean; - public var student:Student; - public var round:Round; - public var roundConfig:actionscript.Round; + public var round:actionscript.Round; } -} \ No newline at end of file +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: Kalin J. <kj...@as...> - 2009-08-19 17:32:11
|
Today I came in at around 10am I have been sifting through the SVN repository, checking which changes have been made, and correcting errors. My plan for the day begins with saveStrategy and createStudent. I will then test the experiment as a whole, starting with using StartGame.mxml to create the game, connecting a client, and seeing what happens. |
From: <see...@us...> - 2009-08-19 01:26:19
|
Revision: 263 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=263&view=rev Author: seematalele Date: 2009-08-19 01:26:13 +0000 (Wed, 19 Aug 2009) Log Message: ----------- Written code for executing Day by day decision but it is not complete. Modified Paths: -------------- mentalmodels/trunk/flex/src/actionscript/StudentStrategy.as mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/DayByDayDecisionsService.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/LocationService.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/RoundService.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StartupService.java Modified: mentalmodels/trunk/flex/src/actionscript/StudentStrategy.as =================================================================== --- mentalmodels/trunk/flex/src/actionscript/StudentStrategy.as 2009-08-18 23:19:35 UTC (rev 262) +++ mentalmodels/trunk/flex/src/actionscript/StudentStrategy.as 2009-08-19 01:26:13 UTC (rev 263) @@ -14,7 +14,8 @@ public var threshold:Number; public var location:Location; public var repeatedDecisions:Boolean; - public var dayOutput:ArrayCollection; + public var student:Student; + public var round:Round; public var roundConfig:actionscript.Round; } } \ No newline at end of file Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/DayByDayDecisionsService.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/DayByDayDecisionsService.java 2009-08-18 23:19:35 UTC (rev 262) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/DayByDayDecisionsService.java 2009-08-19 01:26:13 UTC (rev 263) @@ -6,13 +6,17 @@ import org.springframework.transaction.annotation.Transactional; import edu.asu.commons.mme.dao.HibernateDayByDayDecisionsDao; +import edu.asu.commons.mme.dao.HibernateLocationDao; import edu.asu.commons.mme.entity.DayByDayDecisions; -import edu.asu.commons.mme.entity.Question; -import edu.asu.commons.mme.entity.Student; +import edu.asu.commons.mme.entity.Location; @Transactional public class DayByDayDecisionsService extends Service.Base<DayByDayDecisions, HibernateDayByDayDecisionsDao> { + LocationService locationService; + + + private List<DayByDayDecisions> studentDecisions = new ArrayList<DayByDayDecisions>(); public void setStudentDecisions(List<DayByDayDecisions> studentDecisions) { @@ -43,12 +47,53 @@ } } - public void executeStrategy() + public void allocateStudentForEachBay() { + DayByDayDecisions studentDecision = new DayByDayDecisions(); + List<DayByDayDecisions> bay1 = new ArrayList<DayByDayDecisions>(); + List<DayByDayDecisions> bay2 = new ArrayList<DayByDayDecisions>(); + List<DayByDayDecisions> bay3 = new ArrayList<DayByDayDecisions>(); + List<DayByDayDecisions> harbor = new ArrayList<DayByDayDecisions>(); + + for(int i = 0; i < studentDecisions.size(); i++) + { + studentDecision = studentDecisions.get(i); + if(studentDecision.getLocation().getLocationName().equalsIgnoreCase("Bay1")) + { + bay1.add(studentDecision); + } + else if(studentDecision.getLocation().getLocationName().equalsIgnoreCase("Bay2")) + { + bay2.add(studentDecision); + } + else if(studentDecision.getLocation().getLocationName().equalsIgnoreCase("Bay3")) + { + bay3.add(studentDecision); + } + else if(studentDecision.getLocation().getLocationName().equalsIgnoreCase("Harbor")) + { + harbor.add(studentDecision); + } + } + executeStrategy(bay1,"Bay1"); + executeStrategy(bay2,"Bay2"); + executeStrategy(bay3,"Bay3"); + executeStrategy(harbor,"Harbor"); } + public void executeStrategy(List<DayByDayDecisions> bay,String locationName) + { + Location location = locationService.getLocation(locationName); + + } + public LocationService getLocationService() { + return locationService; + } + + public void setLocationService(LocationService locationService) { + this.locationService = locationService; + } - } Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/LocationService.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/LocationService.java 2009-08-18 23:19:35 UTC (rev 262) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/LocationService.java 2009-08-19 01:26:13 UTC (rev 263) @@ -51,5 +51,21 @@ } return locations; } + + public Location getLocation(String locationName) + { + // TODO Auto-generated method stub + List<Location>locations = getAllLocations(); + Location location =new Location(); + + for(int i=0; i<locations.size(); i++) + { + if(locations.get(i).getLocationName().equalsIgnoreCase(locationName)) + { + location = locations.get(i); + } + } + return location; + } } Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/RoundService.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/RoundService.java 2009-08-18 23:19:35 UTC (rev 262) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/RoundService.java 2009-08-19 01:26:13 UTC (rev 263) @@ -60,18 +60,26 @@ currentGame = new Game(); currentGame = game; getGameDao().save(currentGame); - currentGame.setDescription(currentGame.getDescription()+currentGame.getId()); - getGameDao().save(currentGame); - setCurrentGame(currentGame); - initializeCurrentGame(); + String str = currentGame.getDescription()+currentGame.getId(); + if(getGameDao().findAllByProperty("description", str) !=null) + { + setCurrentGame(null); + } + else + { + currentGame.setDescription(str); + getGameDao().save(currentGame); + setCurrentGame(currentGame); + initializeGame(currentGame); + } return getCurrentGame(); } - private void initializeCurrentGame() { + private void initializeGame(Game game) { // TODO Auto-generated method stub - Hibernate.initialize(currentGame); - Hibernate.initialize(currentGame.getCurrentBlock()); - Hibernate.initialize(currentGame.getCurrentRound()); - Iterator<Round> rounds = currentGame.getRounds().iterator(); + Hibernate.initialize(game); + Hibernate.initialize(game.getCurrentBlock()); + Hibernate.initialize(game.getCurrentRound()); + Iterator<Round> rounds = game.getRounds().iterator(); while(rounds.hasNext()) { initializeRound(rounds.next()); @@ -83,7 +91,6 @@ return getModule(sequenceNo); } - public void test() { getLogger().debug("test to check if module service is working...." ); @@ -267,10 +274,6 @@ return false; } - - - - public HibernateModuleDao getModuleDao() { return moduleDao; } @@ -373,11 +376,11 @@ private int getCurrentRoundNo() { // TODO Auto-generated method stub //FIXME: Game id 1 is hard coded but needs to make it dynamic - Game game = gameDao.find(1L); - if(game.getCurrentRound() == null) + //Game game = gameDao.find(1L); + if(getCurrentGame().getCurrentRound() == null) return 0; else - return game.getCurrentRound().getRoundNo(); + return getCurrentGame().getCurrentRound().getRoundNo(); } @@ -418,7 +421,6 @@ private void saveGameState(Block currentBlock) { - //FIXME: Game id 1 is hard coded but needs to make it dynamic Game game = gameDao.find(1L); game.setCurrentBlock(currentBlock); @@ -426,14 +428,12 @@ gameDao.save(game); } - public Integer getTimerforBlock(Block block) { return block.getDuration(); } - private void initializeModule(Module module) { // TODO Auto-generated method stub @@ -514,8 +514,9 @@ Iterator <Game> games = currentRound.getGame().iterator(); while(games.hasNext()) { - Hibernate.initialize(games.next()); + initializeGame(games.next()); + } List<Location> roundlocations = currentRound.getLocations(); Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StartupService.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StartupService.java 2009-08-18 23:19:35 UTC (rev 262) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StartupService.java 2009-08-19 01:26:13 UTC (rev 263) @@ -38,7 +38,6 @@ public void assignGroups() { - MessageBroker msgBroker = MessageBroker.getMessageBroker(null); String clientID = UUIDUtils.createUUID(); AsyncMessage msg = new AsyncMessage(); @@ -52,7 +51,7 @@ msg.setBody(students); System.out.println("Message broker is: "+ msgBroker); System.out.println("Students size is: " + students.size()); - + msgBroker.routeMessageToService(msg, null); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: Kalin J. <kj...@as...> - 2009-08-18 23:21:46
|
I am leaving today at 16:00pm (2hr) (4hr total today) I committed my code, but it forced me to update first, which resulted in some "merges" I do not know what this implies, so some code that was supposed to be deleted may still be there, or code that was added might be removed. I will be coming in tomorrow early at 10am, and leaving early at around 14pm On Tue, Aug 18, 2009 at 2:13 PM, Kalin Jonas <kj...@as...> wrote: > I return from lunch at 14:00 > > > On Tue, Aug 18, 2009 at 1:03 PM, Kalin Jonas <kj...@as...> wrote: > >> I will be at lunch starting 13:00pm (2hr) >> >> >> On Tue, Aug 18, 2009 at 11:13 AM, Kalin Jonas <kj...@as...> wrote: >> >>> I come in today at 11:00am >>> I will test savestrategy and change the structure of my code in >>> anticipation of server-pushing, as opposed to firing queries. >>> >>> "9.If everything is finished, then create interface for seeing the >>> student responses for admin. I do not think admin would know how to fire >>> query to database and understand the data. " >>> I would gladly be working on this, if there were services or some way for >>> me to access the database through flex. >>> >> >> > |
From: <kj...@us...> - 2009-08-18 23:19:44
|
Revision: 262 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=262&view=rev Author: kjonas Date: 2009-08-18 23:19:35 +0000 (Tue, 18 Aug 2009) Log Message: ----------- StartGame.mxml should be working to start the game. FisheryExperimentCore.mxml does not work with the database properly - createStudent needs to be changed I do not know if it will all work - I do not understand what "Merged" implies, exactly, so something may or may not have been lost. Modified Paths: -------------- mentalmodels/trunk/flex/src/StartGame.mxml mentalmodels/trunk/src/main/webapp/FisheryExperimentShell.swf mentalmodels/trunk/src/main/webapp/InitialiseDatabase.swf mentalmodels/trunk/src/main/webapp/StartGame.swf Added Paths: ----------- mentalmodels/trunk/flex/src/test.mxml mentalmodels/trunk/src/main/webapp/playerProductInstall.swf mentalmodels/trunk/src/main/webapp/test.html mentalmodels/trunk/src/main/webapp/test.swf Modified: mentalmodels/trunk/flex/src/StartGame.mxml =================================================================== --- mentalmodels/trunk/flex/src/StartGame.mxml 2009-08-18 22:43:42 UTC (rev 261) +++ mentalmodels/trunk/flex/src/StartGame.mxml 2009-08-18 23:19:35 UTC (rev 262) @@ -4,14 +4,14 @@ <mx:VBox visible="{pageNum==0}" horizontalAlign="center"> <mx:HBox horizontalAlign="right" width="330" id="firstBox"> <mx:Label text="$USD per lb of fish:"/> - <mx:TextInput id="txtMoney"/> + <mx:NumericStepper id="stpMoney" stepSize="0.01" minimum="0.01" maximum="9999"/> </mx:HBox> <mx:HBox horizontalAlign="right" width="{firstBox.width}"> - <mx:Label text="Brief description of game:"/> - <mx:TextArea id="txtDescription"/> + <mx:Label text="Very brief description of game:"/> + <mx:TextInput id="txtDescription" maxChars="5"/> </mx:HBox> - <mx:Button label="Create Game" id="btnCreateGame" click="false"/> + <mx:Button label="Create Game" id="btnCreateGame" click="create()"/> <mx:HBox horizontalAlign="right" width="{firstBox.width}"> <mx:Label text="Game ID:"/> <mx:TextInput id="txtGameID" enabled="false"/> @@ -20,7 +20,7 @@ <mx:Spacer height="30"/> <mx:Text text="Click the Start Game button only after all students have connected using the above ID." width="300"/> - <mx:Button label="Start Game" id="btnStartGame" click="feed.start()"/> + <mx:Button label="Start Game" id="btnStartGame" click="start()" enabled="false"/> </mx:VBox> <mx:VBox visible="{pageNum==1}"> @@ -28,10 +28,14 @@ <mx:VBox id="responsesContent"/> </mx:VBox> - <mx:RemoteObject id="feed" destination="feed" fault="{faultHandler(event)}" /> + <mx:RemoteObject id="startupService" destination="startupService" fault="faultHandler(event)"> + <mx:method name="createGame" result="gameObjectResultHandler(event)"/> + <mx:method name="startGame" result="noResultHandler(event)"/> + </mx:RemoteObject> <mx:Script> <![CDATA[ + import actionscript.Game; import actionscript.Block; import mx.rpc.events.ResultEvent; import mx.rpc.events.FaultEvent; @@ -39,16 +43,52 @@ [Bindable]private var pageNum:int = 0; + // Universal Fault Handler public function faultHandler(event:FaultEvent):void { Alert.show(event.fault.getStackTrace()); } + // Button Click Events + public function create():void + { + stpMoney.enabled = txtDescription.enabled = btnCreateGame.enabled = false; + + var gameObject:Game = new Game(); + gameObject.money = stpMoney.value; + gameObject.description = txtDescription.text; + } + public function start():void + { + btnStartGame.enabled = false; + + startupService.startGame(); + } public function getResponses():void { } + + // Server Response Events + public function gameObjectResultHandler(event:ResultEvent):void + { + if(event.result != null) + { + txtGameID.text = (event.result as Game).description; + btnStartGame.enabled = true; + } + else + { + stpMoney.enabled = txtDescription.enabled = btnCreateGame.enabled = true; + } + } + public function noResultHandler(event:ResultEvent):void + { + + } + ]]> </mx:Script> </mx:Application> + Added: mentalmodels/trunk/flex/src/test.mxml =================================================================== --- mentalmodels/trunk/flex/src/test.mxml (rev 0) +++ mentalmodels/trunk/flex/src/test.mxml 2009-08-18 23:19:35 UTC (rev 262) @@ -0,0 +1,54 @@ +<?xml version="1.0" encoding="utf-8"?> +<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical"> + + <mx:HBox> + <mx:Button label="roundService.getBlock()" click="roundService.getBlock()"/> + <mx:Button label="roundService.getCurrentRound()" click="roundService.getCurrentRound()"/> + <mx:Button label="startupService.createStudent()" click="startupService.createStudent()"/> + <mx:Button label="answeringService.saveStrategy()" click="answeringService.saveStrategy()"/> + <mx:Button label="locationService.getAllLocations()" click="locationService.getAllLocations()"/> + </mx:HBox> + + <mx:RemoteObject id="roundService" destination="roundService" fault="faultHandler(event)"> + <mx:method name="getBlock" result="resultHandler(event)"/> + <mx:method name="getCurrentRound" result="resultHandler(event)"/> + </mx:RemoteObject> + <mx:RemoteObject id="startupService" destination="startupService" fault="faultHandler(event)"> + <mx:method name="createStudent" result="resultHandler(event)"/> + </mx:RemoteObject> + <mx:RemoteObject id="answeringService" destination="answeringService" fault="faultHandler(event)"> + <mx:method name="saveStrategy" result="resultHandler(event)"/> + </mx:RemoteObject> + <mx:RemoteObject id="locationService" destination="locationService" fault="faultHandler(event)"> + <mx:method name="getAllLocations" result="resultHandler(event)"/> + </mx:RemoteObject> + + <mx:Script> + <![CDATA[ + import mx.core.UIComponent; + import mx.controls.Alert; + import mx.rpc.events.FaultEvent; + import mx.rpc.events.ResultEvent; + + public function resultHandler(event:ResultEvent):void + { + var str:String = ""; + str += "event == null : " + (event == null) + "\n"; + str += "event.result == null : " + (event.result == null) + "\n"; + + Alert.show(str, "resultHandler()"); + } + + public function faultHandler(event:FaultEvent):void + { + var str:String = ""; + str += "event.fault.message:\n" + (event.fault.message) + "\n\n"; + str += "event.fault.getStackTrace():\n*START*\n" + (event.fault.getStackTrace()) + "\n*END*"; + + Alert.show(str, "faultHandler()"); + } + + ]]> + </mx:Script> + +</mx:Application> Modified: mentalmodels/trunk/src/main/webapp/FisheryExperimentShell.swf =================================================================== (Binary files differ) Modified: mentalmodels/trunk/src/main/webapp/InitialiseDatabase.swf =================================================================== (Binary files differ) Modified: mentalmodels/trunk/src/main/webapp/StartGame.swf =================================================================== (Binary files differ) Added: mentalmodels/trunk/src/main/webapp/playerProductInstall.swf =================================================================== (Binary files differ) Property changes on: mentalmodels/trunk/src/main/webapp/playerProductInstall.swf ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: mentalmodels/trunk/src/main/webapp/test.html =================================================================== --- mentalmodels/trunk/src/main/webapp/test.html (rev 0) +++ mentalmodels/trunk/src/main/webapp/test.html 2009-08-18 23:19:35 UTC (rev 262) @@ -0,0 +1,137 @@ +<!-- saved from url=(0014)about:internet --> +<html lang="en"> + +<!-- +Smart developers always View Source. + +This application was built using Adobe Flex, an open source framework +for building rich Internet applications that get delivered via the +Flash Player or to desktops via Adobe AIR. + +Learn more about Flex at http://flex.org +// --> + +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + +<!-- BEGIN Browser History required section --> +<link rel="stylesheet" type="text/css" href="history/history.css" /> +<!-- END Browser History required section --> + +<title></title> +<script src="AC_OETags.js" language="javascript"></script> + +<!-- BEGIN Browser History required section --> +<script src="history/history.js" language="javascript"></script> +<!-- END Browser History required section --> + +<style> +body { margin: 0px; overflow:hidden } +</style> + +<script language="JavaScript"> + window.onbeforeunload = confirmExit; + function confirmExit() + { + return "If you are connected to the server, you will be disconnected if the page closes. Students in the experiment will be removed if the window closes."; + } +</script> + +<script language="JavaScript" type="text/javascript"> +<!-- +// ----------------------------------------------------------------------------- +// Globals +// Major version of Flash required +var requiredMajorVersion = 9; +// Minor version of Flash required +var requiredMinorVersion = 0; +// Minor version of Flash required +var requiredRevision = 124; +// ----------------------------------------------------------------------------- +// --> +</script> +</head> + +<body scroll="no"> + +<script language="JavaScript" type="text/javascript"> +<!-- + +var clientIP = '<!--#echo var="REMOTE_ADDR"-->'; + +// Version check for the Flash Player that has the ability to start Player Product Install (6.0r65) +var hasProductInstall = DetectFlashVer(6, 0, 65); + +// Version check based upon the values defined in globals +var hasRequestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision); + +if ( hasProductInstall && !hasRequestedVersion ) { + // DO NOT MODIFY THE FOLLOWING FOUR LINES + // Location visited after installation is complete if installation is required + var MMPlayerType = (isIE == true) ? "ActiveX" : "PlugIn"; + var MMredirectURL = window.location; + document.title = document.title.slice(0, 47) + " - Flash Player Installation"; + var MMdoctitle = document.title; + + AC_FL_RunContent( + "src", "playerProductInstall", + "FlashVars", "MMredirectURL="+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle+'&ip=test'+clientIP+"", + "width", "100%", + "height", "100%", + "align", "middle", + "id", "test", + "quality", "high", + "bgcolor", "#869ca7", + "name", "test", + "allowScriptAccess","sameDomain", + "type", "application/x-shockwave-flash", + "pluginspage", "http://www.adobe.com/go/getflashplayer" + ); +} else if (hasRequestedVersion) { + // if we've detected an acceptable version + // embed the Flash Content SWF when all tests are passed + AC_FL_RunContent( + "src", "test", + "width", "100%", + "height", "100%", + "align", "middle", + "valign", "middle", + "id", "test", + "quality", "high", + "bgcolor", "#869ca7", + "name", "test", + "allowScriptAccess","sameDomain", + "type", "application/x-shockwave-flash", + "pluginspage", "http://www.adobe.com/go/getflashplayer", + "FlashVars", "ip=test"+clientIP+"" + ); +} else { // flash is too old or we can't detect the plugin + var alternateContent = 'Alternate HTML content should be placed here. ' + + 'This content requires the Adobe Flash Player. ' + + '<a href=http://www.adobe.com/go/getflash/>Get Flash</a>'; + document.write(alternateContent); // insert non-flash content + } +// --> +</script> +<noscript> + <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" + id="test" width="100%" height="100%" + codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab"> + <param name="movie" value="test.swf" /> + <PARAM NAME=FlashVars VALUE="ip=test${clientIP}"> + <param name="quality" value="high" /> + <param name="bgcolor" value="#869ca7" /> + <param name="allowScriptAccess" value="sameDomain" /> + <embed src="test.swf" quality="high" bgcolor="#869ca7" + width="100%" height="100%" name="test" align="middle" + play="true" + loop="false" + quality="high" + allowScriptAccess="sameDomain" + type="application/x-shockwave-flash" + pluginspage="http://www.adobe.com/go/getflashplayer"> + </embed> + </object> +</noscript> +</body> +</html> Added: mentalmodels/trunk/src/main/webapp/test.swf =================================================================== (Binary files differ) Property changes on: mentalmodels/trunk/src/main/webapp/test.swf ___________________________________________________________________ Added: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |