virtualcommons-svn Mailing List for Virtual Commons Experiment Software (Page 67)
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: <kj...@us...> - 2009-08-12 22:36:05
|
Revision: 248 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=248&view=rev Author: kjonas Date: 2009-08-12 22:35:58 +0000 (Wed, 12 Aug 2009) Log Message: ----------- added some code to submit strategy design updated swf files new compiled files show no difference on kalin's machine for some reason. Modified Paths: -------------- mentalmodels/trunk/flex/src/FisheryExperimentShell.mxml mentalmodels/trunk/flex/src/custom/FisheryExperimentCore.mxml mentalmodels/trunk/src/main/webapp/FisheryExperimentShell.swf mentalmodels/trunk/src/main/webapp/InitialiseDatabase.swf mentalmodels/trunk/src/main/webapp/StartGame.swf Modified: mentalmodels/trunk/flex/src/FisheryExperimentShell.mxml =================================================================== --- mentalmodels/trunk/flex/src/FisheryExperimentShell.mxml 2009-08-11 22:08:09 UTC (rev 247) +++ mentalmodels/trunk/flex/src/FisheryExperimentShell.mxml 2009-08-12 22:35:58 UTC (rev 248) @@ -17,7 +17,6 @@ } public function progressBarInit():void { - progressTimer = new Timer(100, repetitions); // 21600 * 1000 = 6hrs progressTimer.addEventListener(TimerEvent.TIMER, timerTick); progressTimer.start(); Modified: mentalmodels/trunk/flex/src/custom/FisheryExperimentCore.mxml =================================================================== --- mentalmodels/trunk/flex/src/custom/FisheryExperimentCore.mxml 2009-08-11 22:08:09 UTC (rev 247) +++ mentalmodels/trunk/flex/src/custom/FisheryExperimentCore.mxml 2009-08-12 22:35:58 UTC (rev 248) @@ -66,6 +66,7 @@ <mx:method name="getFirstModule" result="moduleResultHandler(event)"/> </mx:RemoteObject> <mx:RemoteObject id="answeringService" destination="answeringService" fault="faultHandler(event)"> + <mx:method name="saveStrategy" result="strategyResultHandler(event)"/> </mx:RemoteObject> <mx:RemoteObject id="locationService" destination="locationService" fault="faultHandler(event)"> <mx:method name="getAllLocations" result="locationResultHandler(event)"/> @@ -239,12 +240,14 @@ } else if(curr.getChildAt(j) is StrategyDesignQuestionC) { - studentResponse.question = (curr.getChildAt(j) as StrategyDesignQuestionC).question; + Alert.show("Strategy Saving"); studentResponse.response = null; + studentResponse.question = null; - //SKIP IT FOR NOW - studentResponse.question = null; + var strategy:StrategyDesignQuestionC = StrategyDesignQuestionC(curr.getChildAt(j)); + answeringService.saveStrategy(strategy.toDatabaseObject()); } + Alert.show(""+(curr.getChildAt(j) is StrategyDesignQuestionC)); if(studentResponse.question != null) { @@ -253,19 +256,19 @@ } } - var str:String = ""; - for(var q:int=0;q<responseList.length;q++) - { - str += "null:"; - str += (responseList.getItemAt(q) == null); - str += "\n"; - str += "response:"; - str += (responseList.getItemAt(q) as StudentResponse).response; - - str += "\n"; - str += "\n"; - } - Alert.show(str); +// var str:String = ""; +// for(var q:int=0;q<responseList.length;q++) +// { +// str += "null:"; +// str += (responseList.getItemAt(q) == null); +// str += "\n"; +// str += "response:"; +// str += (responseList.getItemAt(q) as StudentResponse).response; +// +// str += "\n"; +// str += "\n"; +// } +// Alert.show(str); answeringService.saveQuestion(responseList); } @@ -342,6 +345,10 @@ // Alert.show("locations received: "+locations.length); } } + private function strategyResultHandler(event:ResultEvent):void + { +// Alert.show("Strategy Saved"); + } private function studentResultHandler(event:ResultEvent):void { 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) 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-12 18:14:44
|
Today I work from home at 11:00am I will be testing the new code that Seema has committed, and ensuring that it is functional. After, I will either work on completing the database, or try to make sure the blocks are coming from the server. |
From: <see...@us...> - 2009-08-11 22:08:15
|
Revision: 247 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=247&view=rev Author: seematalele Date: 2009-08-11 22:08:09 +0000 (Tue, 11 Aug 2009) Log Message: ----------- Chnage the Student Strategy table Modified Paths: -------------- mentalmodels/trunk/src/main/db/init-mme.sql Modified: mentalmodels/trunk/src/main/db/init-mme.sql =================================================================== --- mentalmodels/trunk/src/main/db/init-mme.sql 2009-08-11 21:00:31 UTC (rev 246) +++ mentalmodels/trunk/src/main/db/init-mme.sql 2009-08-11 22:08:09 UTC (rev 247) @@ -1,8 +1,8 @@ --- MySQL dump 10.13 Distrib 5.1.36, for Win32 (ia32) +-- MySQL dump 10.13 Distrib 5.1.35, for Win32 (ia32) -- -- Host: localhost Database: mme -- ------------------------------------------------------ --- Server version 5.1.36-community +-- Server version 5.1.35-community /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -724,12 +724,9 @@ `day` int(11) NOT NULL, `earnings` double NOT NULL, `strategy_id` bigint(20) NOT NULL, - `dayOutput_id` bigint(20) NOT NULL, PRIMARY KEY (`id`), - KEY `FK7B993B8846861732` (`dayOutput_id`), KEY `FK7B993B888374539C` (`strategy_id`), - CONSTRAINT `FK7B993B888374539C` FOREIGN KEY (`strategy_id`) REFERENCES `student_strategy` (`id`), - CONSTRAINT `FK7B993B8846861732` FOREIGN KEY (`dayOutput_id`) REFERENCES `student_strategy` (`id`) + CONSTRAINT `FK7B993B888374539C` FOREIGN KEY (`strategy_id`) REFERENCES `student_strategy` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; @@ -875,4 +872,4 @@ /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2009-08-10 15:08:31 +-- Dump completed on 2009-08-11 22:07:03 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <see...@us...> - 2009-08-11 21:00:39
|
Revision: 246 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=246&view=rev Author: seematalele Date: 2009-08-11 21:00:31 +0000 (Tue, 11 Aug 2009) Log Message: ----------- Written method for saving strategy in answering Service Written HibernateStudentStrategyDao.java and put into the applicationContext.xml Removed Dayoutput from StudentStrategy.java Modified Paths: -------------- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Block.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Location.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/StartGame.java mentalmodels/trunk/src/main/webapp/StartGame.swf mentalmodels/trunk/src/main/webapp/WEB-INF/applicationContext.xml Added Paths: ----------- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/dao/HibernateStudentStrategyDao.java Added: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/dao/HibernateStudentStrategyDao.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/dao/HibernateStudentStrategyDao.java (rev 0) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/dao/HibernateStudentStrategyDao.java 2009-08-11 21:00:31 UTC (rev 246) @@ -0,0 +1,12 @@ +package edu.asu.commons.mme.dao; + +import edu.asu.commons.mme.entity.StudentStrategy; + +public class HibernateStudentStrategyDao extends HibernateDao<StudentStrategy> { + + public HibernateStudentStrategyDao() + { + super(StudentStrategy.class); + } + +} Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Block.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Block.java 2009-08-11 01:17:07 UTC (rev 245) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Block.java 2009-08-11 21:00:31 UTC (rev 246) @@ -49,7 +49,7 @@ @OrderBy("sequenceNo") private List<QuestionGroup> questionGroups; - @OneToMany(mappedBy="block") + @OneToMany(mappedBy="block",fetch = FetchType.EAGER) @OrderBy("sequenceNo") private List<InformationWindow> informationWindows; @@ -78,8 +78,6 @@ return description; } - - public void setModule(Module module) { this.module = module; } 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-11 01:17:07 UTC (rev 245) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Location.java 2009-08-11 21:00:31 UTC (rev 246) @@ -25,7 +25,7 @@ private Long id; @ManyToMany - @CollectionOfElements(fetch= FetchType.EAGER) + @CollectionOfElements private List<Round> rounds; @Column(nullable=false,name="location_name") 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-11 01:17:07 UTC (rev 245) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/StudentStrategy.java 2009-08-11 21:00:31 UTC (rev 246) @@ -51,11 +51,7 @@ public boolean repeatedDecisions; - @OneToMany(mappedBy="strategy") - @JoinColumn(nullable=false) - public List<DayOutput> dayOutput; - public void setId(Long id) { this.id = id; } @@ -112,14 +108,6 @@ return location; } - public void setDayOutput(List<DayOutput> dayOutput) { - this.dayOutput = dayOutput; - } - - public List<DayOutput> getDayOutput() { - return dayOutput; - } - public void setStudent(Student student) { this.student = student; } 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-11 01:17:07 UTC (rev 245) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/AnsweringService.java 2009-08-11 21:00:31 UTC (rev 246) @@ -7,23 +7,27 @@ 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; @Transactional public class AnsweringService extends Service.Base<StudentResponse, HibernateStudentResponseDao> { - private HibernateStudentDao studentDao; + //private HibernateStudentDao studentDao; + private HibernateStudentStrategyDao studentStrategyDao; //private HibernateDayByDayDecisionsDao dayByDayDecisionsDao; private DayByDayDecisionsService dayByDayDecisionsService; private ModuleService moduleService; StudentResponse studentResponse; + StudentStrategy studentStrategy; Student student; public void saveQuestion(List<StudentResponse> studentResponses) @@ -46,15 +50,31 @@ //return moduleService.getBlock(); } + public void saveStrategy(List<StudentStrategy> studentStrategies) + { + StudentStrategy clientStudentStrategy = new StudentStrategy(); + for(int i = 0; i < studentStrategies.size(); i++ ) + { + + clientStudentStrategy = (StudentStrategy) studentStrategies.get(i); + + studentStrategy = new StudentStrategy(); + studentStrategy.setLocation(clientStudentStrategy.getLocation()); + studentStrategy.setAllocationSeqNo(clientStudentStrategy.getAllocationSeqNo()); + studentStrategy.setDays(clientStudentStrategy.getDays()); + studentStrategy.setRepeatedDecisions(clientStudentStrategy.isRepeatedDecisions()); + studentStrategy.setRoundConfig(clientStudentStrategy.getRoundConfig()); + studentStrategy.setStudent(clientStudentStrategy.getStudent()); + getStudentStrategyDao().save(studentStrategy); + } + } + public void daybydayOutput(DayByDayDecisions studentDecision) { dayByDayDecisionsService.saveStudentDecision(studentDecision); } - public void setStudentDao(HibernateStudentDao studentDao) { - this.studentDao = studentDao; - } - + /*public void setDayByDayDecisionsDao(HibernateDayByDayDecisionsDao dayByDayDecisionsDao) { this.dayByDayDecisionsDao = dayByDayDecisionsDao; }*/ @@ -75,5 +95,13 @@ return moduleService; } + public void setStudentStrategyDao(HibernateStudentStrategyDao studentStrategyDao) { + this.studentStrategyDao = studentStrategyDao; + } + public HibernateStudentStrategyDao getStudentStrategyDao() { + return studentStrategyDao; + } + + } 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-11 01:17:07 UTC (rev 245) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StartGame.java 2009-08-11 21:00:31 UTC (rev 246) @@ -10,6 +10,9 @@ private boolean running; private RoundService roundService; + private LocationService locationService; + + private ModuleRoundConfig currentModuleRoundConfig; public StartGame() @@ -37,55 +40,46 @@ MessageBroker msgBroker = MessageBroker.getMessageBroker(null); String clientID = UUIDUtils.createUUID(); int i=0; - while (i<3) { - i++; - 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("DataPush"); - //msg.setHeader("DSSubtopic", "hello"); - 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 "); - if(block != null) - { - msg.setBody("Here is a block!!!" + block); - System.out.println("Message broker is: "+ msgBroker); - System.out.println("Message is: "+ block.getDescription()); - msgBroker.routeMessageToService(msg, null); + while (i<15) { - //get the timer for the block - Integer timer = roundService.getTimerforBlock(block); + i++; + /*if(getCurrentModuleRoundConfig() == null) + { + setCurrentModuleRoundConfig(new ModuleRoundConfig()); + System.out.println("new currentmoduleroundconfig is created."); + }*/ - //start the timer for the block sent - try { - Thread.sleep(5000); - running = false; - } catch (InterruptedException e) { - } - } - else - { - running = false; - break; - } + //Push the first block to the clients + AsyncMessage msg = new AsyncMessage(); + msg.setDestination("DataPush"); + //msg.setHeader("DSSubtopic", "hello"); + 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("Here is a block!!!" + block); + System.out.println("Message broker is: "+ msgBroker); + System.out.println("Message is: "+ block.getDescription()); + msgBroker.routeMessageToService(msg, null); + //get the timer for the block + Integer timer = roundService.getTimerforBlock(block); + //start the timer for the block sent + try { + Thread.sleep(5000); + running = false; + } catch (InterruptedException e) { + } - } } - + } + private boolean isGameOver() { // TODO Auto-generated method stub - + return false; } @@ -110,7 +104,13 @@ return currentModuleRoundConfig; } + public LocationService getLocationService() { + return locationService; + } + public void setLocationService(LocationService locationService) { + this.locationService = locationService; + } } 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-11 01:17:07 UTC (rev 245) +++ mentalmodels/trunk/src/main/webapp/WEB-INF/applicationContext.xml 2009-08-11 21:00:31 UTC (rev 246) @@ -68,6 +68,11 @@ <property name='sessionFactory' ref='sessionFactory'/> </bean> + <bean id='studentStrategyDao' class='edu.asu.commons.mme.dao.HibernateStudentStrategyDao'> + <property name='sessionFactory' ref='sessionFactory'/> + </bean> + + <bean id='dayByDayDecisionsDao' class='edu.asu.commons.mme.dao.HibernateDayByDayDecisionsDao'> <property name='sessionFactory' ref='sessionFactory'/> </bean> @@ -102,7 +107,7 @@ <bean id='answeringService' class='edu.asu.commons.mme.service.AnsweringService'> <property name='dao' ref='studentResponseDao'/> - <property name='studentDao' ref='studentDao'/> + <property name='studentStrategyDao' ref='studentStrategyDao'/> <property name='dayByDayDecisionsService' ref='dayByDayDecisionsService'/> </bean> @@ -144,6 +149,7 @@ <bean id="startGame" class="edu.asu.commons.mme.service.StartGame"> <property name='roundService' ref='roundService'/> + <property name='locationService' ref='locationService'/> </bean> <bean id="feed" class="edu.asu.commons.mme.service.Feed"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <see...@us...> - 2009-08-11 01:17:15
|
Revision: 245 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=245&view=rev Author: seematalele Date: 2009-08-11 01:17:07 +0000 (Tue, 11 Aug 2009) Log Message: ----------- All blocks are getting transmitted to the client successfully. Tested with temporary 5 sec timer. But needs to test with Flex GUI. Modified Paths: -------------- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/RoundService.java 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-10 22:40:15 UTC (rev 244) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/RoundService.java 2009-08-11 01:17:07 UTC (rev 245) @@ -57,92 +57,88 @@ public Block getBlock() { /* - *1) Find out the current round number - *2) Find out the current module number + *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 */ //getLogger().debug("in getBlock "); //setCurrentModuleRoundConfig(currentModuleRoundConfig); - //getLogger().debug("currentmodule is " + currentModule); - if(currentModule == null || isCurrentModuleFinished()) - { - setGameState(); - if(currentBlock == null) + + //find out the current module number + if(currentModuleRoundConfig == null){ + currentModuleRoundConfig = new ModuleRoundConfig(); + if(currentRound == null) { - setCurrentBlock(new Block()); - currentBlock = getBlock(1); - // getLogger().debug(currentBlock.getDescription()); - //get the current game and set the current round and current block ids - saveGameState(currentBlock); + setNextRound(); + setModuleForCurrentRound(0); + if(currentBlock == null) + { + setCurrentBlock(new Block()); + currentBlock = getBlock(1); + } } } else { - //get the next block in the module - // getLogger().debug("current module is not finished. " + currentModule.getId()); - setNextBlock(); - getLogger().debug(currentBlock.getDescription()); - //get the current game and set the current round and current block ids - saveGameState(currentBlock); - } - getLogger().debug("question group sizes is : " + currentBlock.getQuestionGroups().size()); - initializeCurrentBlock(currentBlock); - getLogger().debug("Block sent to the server is: " + getCurrentBlock().getDescription()); - return getCurrentBlock(); - } + if(isCurrentModuleFinished()) + { + getLogger().debug("current module is finished"); - // FIXME: think of a good name to the following function - private void setGameState() { - // TODO Auto-generated method stub - int prevSeqNo = 0; - List<ModuleRoundConfig> moduleRoundConfigs = new ArrayList<ModuleRoundConfig> (); - - /* - *1)get the currentModuleRoundConfig - *2)get the current round - *3)get the next sequence number if any, else get the next round - *4)get module - * - */ - try - { - if(currentModuleRoundConfig == null) - { - currentModuleRoundConfig = new ModuleRoundConfig(); - //getLogger().debug("new currentmoduleroundconfig is created."); - if(currentRound == null) + if(isCurrentRoundFinished()) { - setNextRound(); - prevSeqNo = 0; - } - } - else - { - /**check if game is not finished, check if round is finished - * if round is finished then get the next round - */ - //getLogger().debug("currentModuleRoundConfig is : " + currentModuleRoundConfig.getId()); - if(!isGameFinished()) - { - //getLogger().debug("game is not finished."); - if(isRoundFinished()) + getLogger().debug("current round is finished"); + if(isGameFinished()) { - setNextRound(); - prevSeqNo = 0; + return null; } else { - prevSeqNo = currentModuleRoundConfig.getSequenceNo(); + //set the next round + setNextRound(); + setModuleForCurrentRound(0); + if(currentBlock == null) + { + setCurrentBlock(new Block()); + currentBlock = getBlock(1); + } + + } } else { - getLogger().debug(getCurrentGame().getDescription() + "Game is finsihed."); - return; + getLogger().debug("current round is not finished"); + setModuleForCurrentRound(getCurrentModuleRoundConfig().getSequenceNo()); + if(currentBlock == null) + { + setCurrentBlock(new Block()); + currentBlock = getBlock(1); + } } } - // getLogger().debug("current round id is " + getCurrentRound().getId()); + else + { + //get the next block in the module + getLogger().debug("currentmodule is " + currentModule.getId()); + setNextBlock(); + getLogger().debug(currentBlock.getDescription()); + } + } + + saveGameState(currentBlock); + getLogger().debug("question group sizes is : " + currentBlock.getQuestionGroups().size()); + initializeCurrentBlock(currentBlock); + getLogger().debug("Module is " + currentModule.getId() + "Block sent to the server is: " + getCurrentBlock().getDescription()); + return getCurrentBlock(); + } + + private void setModuleForCurrentRound(int prevSeqNo) { + // TODO Auto-generated method stub + //int prevSeqNo = 0; + List<ModuleRoundConfig> moduleRoundConfigs = new ArrayList<ModuleRoundConfig> (); + try + { moduleRoundConfigs = moduleRoundDao.findAllByProperty("round",currentRound); for(int i = 0; i < moduleRoundConfigs.size(); i++) { @@ -151,7 +147,7 @@ currentModuleRoundConfig = moduleRoundConfigs.get(i); setCurrentModuleRoundConfig(currentModuleRoundConfig); setCurrentModule(moduleRoundConfigs.get(i).getModule()); - // getLogger().debug("current module is: " + getCurrentModule().getDescription()); + getLogger().debug("current module is: " + getCurrentModule().getDescription()); setCurrentBlock(null); break; } @@ -185,12 +181,12 @@ } } } -// getLogger().debug("currentround object is "+ currentRound.getId()); + getLogger().debug("currentround object is "+ currentRound.getId()); } - private boolean isRoundFinished() { + private boolean isCurrentRoundFinished() { // TODO Auto-generated method stub List<ModuleRoundConfig> moduleRoundConfigs = new ArrayList<ModuleRoundConfig> (); moduleRoundConfigs = moduleRoundDao.findAllByProperty("round",currentRound); @@ -198,6 +194,7 @@ if(currentModuleRoundConfig == null) { getLogger().debug("currentModuleRoundConfig is null"); + return true; } else { @@ -208,14 +205,25 @@ } else { - for(int i = 1; i < moduleRoundConfigs.size(); i++) + getLogger().debug("check condition is "+ moduleRoundConfigs.get(moduleRoundConfigs.size() - 1).getSequenceNo()); + int seqNo = moduleRoundConfigs.get(moduleRoundConfigs.size() - 1).getSequenceNo(); + if((currentModuleRoundConfig.getSequenceNo()) == seqNo) { - // getLogger().debug("moduleroundconfig seq no is" + moduleRoundConfigs.get(i).getSequenceNo()); - // getLogger().debug("Current seq no is" + currentModuleRoundConfig.getSequenceNo()); + getLogger().debug("flag return is true"); + return true; - if(moduleRoundConfigs.get(i).getSequenceNo() > currentModuleRoundConfig.getSequenceNo()) + } + else + { + for(int i = 0; i < moduleRoundConfigs.size(); i++) { - return true; + // getLogger().debug("moduleroundconfig seq no is" + moduleRoundConfigs.get(i).getSequenceNo()); + getLogger().debug("Current seq no is" + currentModuleRoundConfig.getSequenceNo() +"and the moduleroundconfig is "+ moduleRoundConfigs.get(i).getSequenceNo()); + + if(currentModuleRoundConfig.getSequenceNo() < moduleRoundConfigs.get(i).getSequenceNo()) + { + return false; + } } } } @@ -246,7 +254,7 @@ private void initializeCurrentBlock(Block block) { - + Hibernate.initialize(block); Iterator<QuestionGroup> iteratorquestionGrp = block.getQuestionGroups().iterator(); { @@ -254,9 +262,9 @@ { QuestionGroup questionGroup = iteratorquestionGrp.next(); Hibernate.initialize(questionGroup); -// getLogger().debug(questionGroup.getDescription()); + // getLogger().debug(questionGroup.getDescription()); List<Question> questions = questionGroup.getQuestions(); - + for(int j = 0; j < questions.size(); j++) { Hibernate.initialize(questions.get(j)); @@ -269,14 +277,14 @@ } } } - + Module module = block.getModule(); Hibernate.initialize(module); initializeModule(currentModule); } - - + + private void setNextBlock() { // TODO Auto-generated method stub List<Block> blocks = new ArrayList<Block>(); @@ -358,17 +366,22 @@ blocks = getCurrentModule().getBlocks(); //select max(b.sequence_no) from block b where b.module_id=2; getLogger().debug("no of blocks " + blocks.size() +"for module id: " + getCurrentModule().getId()); - + if(blocks.size() == 1) return true; - for(int i = 0; i < blocks.size(); i++) + else { - - if(currentBlock.getSequenceNo() > blocks.get(i).getSequenceNo()) + for(int i = 0; i < blocks.size(); i++) { - return true; + + if(currentBlock.getSequenceNo() == blocks.get(blocks.size() - 1).getSequenceNo()) + return true; + if(currentBlock.getSequenceNo() < blocks.get(i).getSequenceNo()) + { + return false; + } + } - } } return false; 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-10 23:35:06
|
I finish today at 16:30pm (3.5hr) (5.75 hr today) - this should finish the hours I said I'd work on the weekend, with 0.75 extra. I spoke with Seema about her code, and she and I worked together to fix the major errors. Now the program will fetch the first three blocks fine. It does skip a few blocks, we are not sure why. On Mon, Aug 10, 2009 at 1:04 PM, Kalin Jonas <kj...@as...> wrote: > I am returning at 13:00pm > > > On Mon, Aug 10, 2009 at 12:36 PM, Kalin Jonas <kj...@as...> wrote: > >> I go for lunch at 12:30pm. (2.25hr) >> >> >> On Mon, Aug 10, 2009 at 10:22 AM, Kalin Jonas <kj...@as...> wrote: >> >>> Today I work from home at 10:15am. >>> If I am needed at the office today, I will come, but in the interests of >>> saving time and money, I'll be eating lunch at home. >>> >>> I will try to work with Seema on fixing the errors with sending blocks, >>> and work forward from there. >>> >> >> > |
From: <see...@us...> - 2009-08-10 22:40:21
|
Revision: 244 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=244&view=rev Author: seematalele Date: 2009-08-10 22:40:15 +0000 (Mon, 10 Aug 2009) Log Message: ----------- committed LocationService.java Modified Paths: -------------- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/LocationService.java 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-10 22:22:55 UTC (rev 243) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/LocationService.java 2009-08-10 22:40:15 UTC (rev 244) @@ -39,6 +39,12 @@ Hibernate.initialize(games.next()); } + + List<Location> roundlocations = round.getLocations(); + for(int k=0;k<roundlocations.size();k++) + { + Hibernate.initialize(roundlocations.get(k)); + } //round.getLocations() } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kj...@us...> - 2009-08-10 22:24:33
|
Revision: 243 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=243&view=rev Author: kjonas Date: 2009-08-10 22:22:55 +0000 (Mon, 10 Aug 2009) Log Message: ----------- Property Changed: ---------------- mentalmodels/trunk/ Property changes on: mentalmodels/trunk ___________________________________________________________________ Modified: svn:ignore - target + .classpath .project .settings backup.bat batchFiles.7z mme_backup.sql run.bat run_client.bat run_client_changed.bat target This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kj...@us...> - 2009-08-10 22:21:20
|
Revision: 242 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=242&view=rev Author: kjonas Date: 2009-08-10 22:20:59 +0000 (Mon, 10 Aug 2009) Log Message: ----------- Latest compiled files Modified Paths: -------------- 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/src/main/webapp/StartGame.html 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.html =================================================================== --- mentalmodels/trunk/src/main/webapp/StartGame.html (rev 0) +++ mentalmodels/trunk/src/main/webapp/StartGame.html 2009-08-10 22:20:59 UTC (rev 242) @@ -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", "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", "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="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) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kj...@us...> - 2009-08-10 22:14:20
|
Revision: 241 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=241&view=rev Author: kjonas Date: 2009-08-10 22:14:12 +0000 (Mon, 10 Aug 2009) Log Message: ----------- Core receiving first two blocks with no problems. not receiving locations at all. made sure the code would work for any number of bays. Modified Paths: -------------- mentalmodels/trunk/flex/src/FisheryExperimentShell.mxml mentalmodels/trunk/flex/src/actionscript/PageDisplay.as mentalmodels/trunk/flex/src/custom/FisheryExperimentCore.mxml mentalmodels/trunk/flex/src/custom/questions/strategyDesign/Planner.mxml mentalmodels/trunk/flex/src/custom/questions/strategyDesign/PlannerRow.mxml mentalmodels/trunk/flex/src/custom/questions/strategyDesign/StrategyDesignQuestionC.mxml Modified: mentalmodels/trunk/flex/src/FisheryExperimentShell.mxml =================================================================== --- mentalmodels/trunk/flex/src/FisheryExperimentShell.mxml 2009-08-10 22:12:04 UTC (rev 240) +++ mentalmodels/trunk/flex/src/FisheryExperimentShell.mxml 2009-08-10 22:14:12 UTC (rev 241) @@ -7,19 +7,27 @@ <mx:Script><![CDATA[ public var progressTimer:Timer; [Bindable] public var progressBarWidth:Number = 600; + private var repetitions:int = 100; + + public function setProgressBarTime(hours:int,minutes:int,seconds:int):void + { + repetitions = seconds * 10; + repetitions += minutes * 600; + repetitions += hours * 36000; + } public function progressBarInit():void { - progressTimer = new Timer(100, 100); // 21600 * 1000 = 6hrs + + progressTimer = new Timer(100, repetitions); // 21600 * 1000 = 6hrs progressTimer.addEventListener(TimerEvent.TIMER, timerTick); progressTimer.start(); } public function timerTick(event:TimerEvent):void { - tick(progressTimer.currentCount/2/progressTimer.repeatCount, progressTimer.currentCount/progressTimer.repeatCount); + tick(progressTimer.currentCount/progressTimer.repeatCount); } - private function tick(percentModule:Number,percentBlock:Number):void + private function tick(percentBlock:Number):void { - progressBarModule.width = progressBarWidth*percentModule; progressBarBlock.width = progressBarWidth*percentBlock; } ]]></mx:Script> @@ -49,13 +57,13 @@ </mx:VBox> <mx:VBox id="vbxContent" horizontalAlign="center" verticalAlign="middle"> - <mx:VBox id="progressBars" x="0" y="0" verticalGap="0" initialize="progressBarInit()"> - <mx:HBox> + <mx:VBox id="progressBars" x="0" y="0" verticalGap="0"> + <!--<mx:HBox> <mx:Label text="Time for Module:" width="130" textAlign="right"/> <mx:HBox width="{progressBarWidth+2}" borderStyle="solid"> <mx:HBox id="progressBarModule" height="10" backgroundColor="#00FF00"/> </mx:HBox> - </mx:HBox> + </mx:HBox>--> <mx:HBox> <mx:Label text="Time for Block:" width="130" textAlign="right"/> <mx:HBox width="{progressBarWidth+2}" borderStyle="solid"> @@ -63,7 +71,7 @@ </mx:HBox> </mx:HBox> </mx:VBox> - <custom:FisheryExperimentCore id="fisheryContent" blockLoader="loadBlock"/> + <custom:FisheryExperimentCore id="fisheryContent" blockLoader="loadBlock" shell="{this}"/> </mx:VBox> </mx:HBox> Modified: mentalmodels/trunk/flex/src/actionscript/PageDisplay.as =================================================================== --- mentalmodels/trunk/flex/src/actionscript/PageDisplay.as 2009-08-10 22:12:04 UTC (rev 240) +++ mentalmodels/trunk/flex/src/actionscript/PageDisplay.as 2009-08-10 22:14:12 UTC (rev 241) @@ -123,7 +123,6 @@ { var ddq:DayByDayDecisionsQuestionC = new DayByDayDecisionsQuestionC(); ddq.locations = locations; - Alert.show(locations.length+""); ddq.loadFromQuestion(Question(tempQuestion)); ddq.id = "q"+question; Modified: mentalmodels/trunk/flex/src/custom/FisheryExperimentCore.mxml =================================================================== --- mentalmodels/trunk/flex/src/custom/FisheryExperimentCore.mxml 2009-08-10 22:12:04 UTC (rev 240) +++ mentalmodels/trunk/flex/src/custom/FisheryExperimentCore.mxml 2009-08-10 22:14:12 UTC (rev 241) @@ -59,7 +59,7 @@ <mx:RemoteObject id="roundService" destination="roundService" fault="faultHandler(event)"> - <mx:method name="getNextModule" result="moduleResultHandler(event)"/> + <mx:method name="getBlock" result="blockResultHandler(event)"/> </mx:RemoteObject> <mx:RemoteObject id="startupService" destination="startupService" fault="faultHandler(event)"> <mx:method name="createStudent" result="studentResultHandler(event)"/> @@ -67,7 +67,12 @@ </mx:RemoteObject> <mx:RemoteObject id="answeringService" destination="answeringService" fault="faultHandler(event)"> </mx:RemoteObject> + <mx:RemoteObject id="locationService" destination="locationService" fault="faultHandler(event)"> + <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)" /> @@ -105,6 +110,7 @@ [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; public var updateObjectB:InformationWindowCreator = null; @@ -132,7 +138,8 @@ public function init():void { - + getLocations(); +// Alert.show("initialized"); } private function gotoInstructions():void @@ -181,8 +188,8 @@ } else if(curr.getChildAt(j) is DayByDayDecisionsQuestionC) { - studentResponse.question = (curr.getChildAt(j) as DayByDayDecisionsQuestionC).question; - studentResponse.response = null; + //SKIP IT + studentResponse.question = null; } else if(curr.getChildAt(j) is ForecastingPeopleQuestionC) { @@ -192,7 +199,7 @@ studentResponse = new StudentResponse(); studentResponse.student = studentObject; studentResponse.question = forecast1.question; - studentResponse.response = forecast1.peopleEntry.labels.getChildAt(row+1) + " "; + studentResponse.response = (forecast1.peopleEntry.labels.getChildAt(row+1) as Label).text + " "; for(col=0; col<forecast1.peopleEntry.dataGrid.columnCount; col++) { studentResponse.response += (col+1) + ":" + forecast1.peopleEntry.getItem(row,col); @@ -215,7 +222,7 @@ studentResponse = new StudentResponse(); studentResponse.student = studentObject; studentResponse.question = forecast2.question; - studentResponse.response = forecast2.fishEntry.labels.getChildAt(row+1) + " "; + studentResponse.response = (forecast2.fishEntry.labels.getChildAt(row+1) as Label).text + " "; for(col=0; col<forecast2.fishEntry.dataGrid.columnCount; col++) { studentResponse.response += (col+1) + ":" + forecast2.fishEntry.getItem(row,col); @@ -234,6 +241,9 @@ { studentResponse.question = (curr.getChildAt(j) as StrategyDesignQuestionC).question; studentResponse.response = null; + + //SKIP IT FOR NOW + studentResponse.question = null; } if(studentResponse.question != null) @@ -243,21 +253,26 @@ } } + var str:String = ""; + for(var q:int=0;q<responseList.length;q++) + { + str += "null:"; + str += (responseList.getItemAt(q) == null); + str += "\n"; + str += "response:"; + str += (responseList.getItemAt(q) as StudentResponse).response; + + str += "\n"; + str += "\n"; + } + Alert.show(str); answeringService.saveQuestion(responseList); } private function getLocations():void { - locationResultHandler(null); //TK + locationService.getAllLocations(); } - private function getNextModule():void - { - if(instructionsLoaded) sendBlockQuestions(); - currentModule = null; - currentModuleNumber++; - - roundService.getNextModule(currentModuleNumber); - } private function getNextBlock():void { if(currentBlock != null) sendBlockQuestions(); @@ -265,7 +280,8 @@ currentBlockNumber++; //server request - blockResultHandler(new ResultEvent("",false,true,makeBlock())); + roundService.getBlock(); +// blockResultHandler(new ResultEvent("",false,true,makeBlock())); } private function blockResultHandler(event:ResultEvent):void { @@ -285,6 +301,9 @@ { gotoInstructions(); } + + shell.setProgressBarTime(0,0,currentBlock.duration); + shell.progressBarInit(); } private function moduleResultHandler(event:ResultEvent):void { @@ -317,11 +336,11 @@ } private function locationResultHandler(event:ResultEvent):void { - locations = new ArrayCollection(); - locations.addItem(newLocation(0, 0)); - locations.addItem(newLocation(10, 0.50)); - locations.addItem(newLocation(20, 0.15)); - locations.addItem(newLocation(30, 0.05)); + if(event.result is ArrayCollection) + { + locations = event.result as ArrayCollection; +// Alert.show("locations received: "+locations.length); + } } private function studentResultHandler(event:ResultEvent):void @@ -331,14 +350,14 @@ } private function faultHandler(event:FaultEvent):void { - Alert.show(event.fault.message + "\n" + event.fault.getStackTrace()); + Alert.show("Fault:\n"+event.fault.message + "\n" + event.fault.getStackTrace()); } private function messageHandler(message:IMessage):void { randomNumbers = message.body as String; -// Alert.show( ""+randomNumbers); +// Alert.show( ""+randomNumbers); } public function back():Boolean @@ -397,7 +416,6 @@ currentState = "wait"; btnBack.enabled = btnForward.enabled = btnReset.enabled = true; - getLocations(); getNextBlock(); returnValue = true; } @@ -407,14 +425,14 @@ try { var instructionPageAcceptValue:Boolean = (InstructionPage)(obj).accept(); - if( (InstructionPage)(obj).accept() ) + if( instructionPageAcceptValue ) { obj.visible = false; expiredContent.addChild(obj); currentState = "wait"; //consumer.subscribe(); - getNextBlock(); //TK + getNextBlock(); returnValue = true; } } Modified: mentalmodels/trunk/flex/src/custom/questions/strategyDesign/Planner.mxml =================================================================== --- mentalmodels/trunk/flex/src/custom/questions/strategyDesign/Planner.mxml 2009-08-10 22:12:04 UTC (rev 240) +++ mentalmodels/trunk/flex/src/custom/questions/strategyDesign/Planner.mxml 2009-08-10 22:14:12 UTC (rev 241) @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:comp="custom.*" initialize="init()" +<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:comp="custom.*" width="350" height="200" borderStyle="solid" verticalScrollPolicy="off" horizontalScrollPolicy="off"> @@ -22,9 +22,9 @@ return newLoc; } - private function init():void + public function init():void { - if(valueRequired) + if(valueRequired && grid.numChildren == 0) { addRow(); } @@ -42,6 +42,7 @@ newRow.valueRequired = this.valueRequired; newRow.locations = locations; newRow.initialize(); + newRow.init(); var newNumber:Label = new Label(); newNumber.text = "" + (numbers.numChildren+1); newNumber.height = 22; Modified: mentalmodels/trunk/flex/src/custom/questions/strategyDesign/PlannerRow.mxml =================================================================== --- mentalmodels/trunk/flex/src/custom/questions/strategyDesign/PlannerRow.mxml 2009-08-10 22:12:04 UTC (rev 240) +++ mentalmodels/trunk/flex/src/custom/questions/strategyDesign/PlannerRow.mxml 2009-08-10 22:14:12 UTC (rev 241) @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml" initialize="init()"> +<mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml"> <mx:Script> <![CDATA[ Modified: mentalmodels/trunk/flex/src/custom/questions/strategyDesign/StrategyDesignQuestionC.mxml =================================================================== --- mentalmodels/trunk/flex/src/custom/questions/strategyDesign/StrategyDesignQuestionC.mxml 2009-08-10 22:12:04 UTC (rev 240) +++ mentalmodels/trunk/flex/src/custom/questions/strategyDesign/StrategyDesignQuestionC.mxml 2009-08-10 22:14:12 UTC (rev 241) @@ -53,8 +53,6 @@ public function init():void { - notRepeated.locations=this.locations; - repeated.locations=this.locations; } public function getNotRepeated():ArrayCollection @@ -92,6 +90,11 @@ initialize(); init(); + + notRepeated.locations = locations; + repeated.locations = locations; + notRepeated.init(); + repeated.init(); } public function toDatabaseObject():ArrayCollection This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kj...@us...> - 2009-08-10 22:12:13
|
Revision: 240 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=240&view=rev Author: kjonas Date: 2009-08-10 22:12:04 +0000 (Mon, 10 Aug 2009) Log Message: ----------- Module 2B - Game Round 2 is being filled. the only remaining portion is to add questions to the second block. Modified Paths: -------------- mentalmodels/trunk/src/main/db/init-mme.sql Modified: mentalmodels/trunk/src/main/db/init-mme.sql =================================================================== --- mentalmodels/trunk/src/main/db/init-mme.sql 2009-08-10 21:27:12 UTC (rev 239) +++ mentalmodels/trunk/src/main/db/init-mme.sql 2009-08-10 22:12:04 UTC (rev 240) @@ -262,17 +262,68 @@ -- Table structure for table `game` -- +DROP TABLE IF EXISTS `game`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `game` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `description` longtext, + `image_location` varchar(255) DEFAULT NULL, + `max_days` int(11) NOT NULL, + `max_fish_harvest` int(11) NOT NULL, + `money` double DEFAULT NULL, + `no_of_locations` int(11) NOT NULL, + `no_of_rounds` int(11) NOT NULL, + `timestamp` datetime NOT NULL, + `title` varchar(255) NOT NULL, + `current_block_id` bigint(20) DEFAULT NULL, + `current_round_id` bigint(20) DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `FK304BF2F1265AC7` (`current_block_id`), + 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; +/*!40101 SET character_set_client = @saved_cs_client */; + -- -- Dumping data for table `game` -- 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',null,null); +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); /*!40000 ALTER TABLE `game` ENABLE KEYS */; UNLOCK TABLES; -- +-- Table structure for table `game_round_config` +-- + +DROP TABLE IF EXISTS `game_round_config`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `game_round_config` ( + `game_id` bigint(20) NOT NULL, + `rounds_id` bigint(20) NOT NULL, + UNIQUE KEY `rounds_id` (`rounds_id`), + KEY `FKA0C2A407AC42F73` (`game_id`), + KEY `FKA0C2A40479268AA` (`rounds_id`), + CONSTRAINT `FKA0C2A40479268AA` FOREIGN KEY (`rounds_id`) REFERENCES `round_config` (`id`), + CONSTRAINT `FKA0C2A407AC42F73` FOREIGN KEY (`game_id`) REFERENCES `game` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `game_round_config` +-- + +LOCK TABLES `game_round_config` WRITE; +/*!40000 ALTER TABLE `game_round_config` DISABLE KEYS */; +/*!40000 ALTER TABLE `game_round_config` ENABLE KEYS */; +UNLOCK TABLES; + +-- -- Table structure for table `grp` -- @@ -329,6 +380,19 @@ -- Table structure for table `location` -- +DROP TABLE IF EXISTS `location`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `location` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `current_population` int(11) DEFAULT NULL, + `growth_rate` double NOT NULL, + `initial_population` int(11) NOT NULL, + `location_name` varchar(255) NOT NULL, + `max_capacity` int(11) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `location` @@ -336,7 +400,7 @@ LOCK TABLES `location` WRITE; /*!40000 ALTER TABLE `location` DISABLE KEYS */; -INSERT INTO `location` VALUES (1,null,0.5,5,'Bay1',10),(2,null,0.15,10,'Bay2',20),(3,null,0.05,15,'Bay3',30),(4,null,0,0,'Harbor',0); +INSERT INTO `location` VALUES (1,NULL,0.5,5,'Bay1',10),(2,NULL,0.15,10,'Bay2',20),(3,NULL,0.05,15,'Bay3',30),(4,NULL,0,0,'Harbor',0); /*!40000 ALTER TABLE `location` ENABLE KEYS */; UNLOCK TABLES; @@ -411,7 +475,7 @@ KEY `FK2A65260647CF2321` (`round_id`), CONSTRAINT `FK2A65260647CF2321` FOREIGN KEY (`round_id`) REFERENCES `round_config` (`id`), CONSTRAINT `FK2A6526064D4A8AF3` FOREIGN KEY (`module_id`) REFERENCES `module` (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -447,7 +511,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); +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); /*!40000 ALTER TABLE `psychometric_question` ENABLE KEYS */; UNLOCK TABLES; @@ -472,7 +536,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'); +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'); /*!40000 ALTER TABLE `psychometric_question_choices` ENABLE KEYS */; UNLOCK TABLES; @@ -493,7 +557,7 @@ PRIMARY KEY (`id`), KEY `FKBA823BE6CA626674` (`question_group_id`), CONSTRAINT `FKBA823BE6CA626674` FOREIGN KEY (`question_group_id`) REFERENCES `question_group` (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=75 DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=79 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -502,7 +566,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),(52,0,'Did the communication have any form of reference to how to fish or design the strategy?',1,'categorical',31),(53,0,'test',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); +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),(52,0,'Did the communication have any form of reference to how to fish or design the strategy?',1,'categorical',31),(53,0,'test',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); /*!40000 ALTER TABLE `question` ENABLE KEYS */; UNLOCK TABLES; @@ -523,7 +587,7 @@ PRIMARY KEY (`id`), KEY `FK8F8090E61F51CEC1` (`block_id`), CONSTRAINT `FK8F8090E61F51CEC1` FOREIGN KEY (`block_id`) REFERENCES `block` (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=38 DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=59 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -532,7 +596,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>',180,'<b>What are you expecting the others will do?</b>',9,3),(19,'<p>Please enter in the table below your expectations of how the fish population develops within the first six days. Note that by clicking on “Update” the earnings and fish remaining in the bays is calculated, using your expecta-tions of the other’s actions and your strategy. Thus, you only have to think about how the fish population changes from one day to the next due to growth and movement of the fish. These estimations can be really rough. We do not expect you do perform detailed calculations.</p>\r<b>Note: You can only change the entries of one day at a time. To calculate the values and activate the next day for entries click on “Update”. You cannot return to previous days!</b>\r',180,'<b>What are you expecting how the fish population will develop?</b>',10,3),(20,'By clicking on “Accept” you will leave this part of the questionnaire and return to the strategy design. <b>You can-not return to this or previous pages!</b> However, important information for the design of your strategy will be available in information windows.',30,'<b>Leaving questionnaire on your strategy</b>',11,3),(21,'<p>The previous questions may have lead to some reflections on your strategy and you may wish to change some elements of it. Among the information windows you will find your previous strategy, your goals and your fore-cast.</p>\r<p>The time for editing your strategy depends on how fast you finished the questionnaire. For the next simulation we have to synchronize the group again. If you have been rather fast, you can think now more deeply about your strategy. If you are rather behind the time suggestion, you have to make your changes quickly.</p>\r<p>The interface for designing your strategy will not be explained again. If you are not sure about some elements, please refer to the information window “Help on strategy design”.</p>\r',30,'<b>Edit your strategy</b>',1,4),(22,'<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>',240,'<b>Design your strategy</b>',2,4),(23,'<p>Before we present the results of your strategy, we would like to see again how you make your decisions day-by-day. On the next page you will find the same interface as you already used to decide on how to fish the modeled fishing grounds.</p>',15,'<b>Applying your strategy in day-by-day decisions</b>',1,5),(24,'',345,'<b>Day-by-day-decisions</b>',2,5),(25,'<p>We will now present you the results of your strategy. By clicking on “Accept” you cannot return to this or any previous page, but the results of your day-by-day decisions (and also of your strategy) will be available in an information window.</p>',15,'<b>Leaving day-bay-day decisions</b>',3,5),(26,'',60,'<b>Your strategy resulted in the following actions</b>',1,6),(27,'<p>First we want to know your emotional reactions to the results:</p>',30,'<b>What are your emotional reactions to the outcome?</b>',2,6),(28,'You can now chat for 5 minutes with the other fishermen in your group. You can talk about whatever you want as long as you…\r<ul><li>…do not reveal your identity.</li>\r<li>…do not threaten others with any consequence after the experiment is finished.</li>\r<li>…do not promise others side-payments after the experiment is completed.</li></ul>\rThe interface works like a text messenger. In the text box at the bottom you write your text and by clicking on “Send” you send this text to all other group members. In the large box in the center of the window you see all messages that have been sent during the communication.<br>\rAfter five minutes the “Send” button will be deactivated and the “Next” button activated. Please click then on “Next” to answer some questions about the communication. You can return to this page to see the communication protocol again.\r',360,'<b>Chat with the other fishermen in your group</b>',1,7),(29,'Due to the conversation, I now…',30,'<b>Did the communication have any effect on you?</b>',1,15),(30,'Due to the conversation, the other fishermen in my group…',30,'<b>What do you think were the effects of the communication on the others?</b>',2,15),(31,'',60,'<b>Did the communication lead to some sort of coordination of the fishing?</b>',3,15),(32,'The rule, agreement, or coordination attempt is… ',30,'<b>What is your opinion about the rule(s) that emerged from communication?</b>',4,15),(33,'',30,'<b>What will be the effects of the rule?</b>',5,15),(34,'In the fields below note what you have learned from the communication to improve your strategy.<br>\rThink about your understanding of the dynamics of the fish population, your expectations about the behavior of the other fishermen in your group and possibilities to improve your strategy. For each of these aspects a separate field is offered. This information will be available in the next round of designing your strategy.<br>\rIf you have no entry for one of the fields below, write “none” in the respective field.<br>\rThe information you write into these fields will be available the next time you edit your strategy.',300,'<b>Lessons learned<b>',6,15),(35,'Congratulations! You finished the actual experiment. We want to ask you some final questions.',30,'<b>Some final questions about the experiment</b>',1,13),(36,'',90,'<b>Some final questions about you</b>',2,13),(37,'Thank you for participating in this experiment. Your contribution will help to better understand the effects of communication on the performance of groups. We tested whether the communication led to…\r<ul>\r<li>…a different understanding of the dynamics of the fish population.</li>\r<li>…different expectations of how the others in your group will act.</li>\r<li>…changes in the goals you follow or you expect the others to follow.</li>\r<li>…a form of ‘group feeling’ or ‘team spirit’.</li>\r<li>…the emergence of rules, agreements or other forms of coordination attempts.</li>\r<li>…the emergence of some kind of social pressure or commitment.</li>\r</ul>\rBesides advancing science, the experiment also allowed you to earn the following money:<br>\rFor participating in the game: US$<br>\rFrom fish you caught: US$<br>\rTotal: US$<br>\rThe money will be paid to you in private. Wait till your computer number is called and then proceed to the conference room where you have signed up.<br>\rWe hope the experiment was satisfying to you.<br>\rWhen you are ready you can click on “Accept” to leave the experiment.<br>\r',120,'<b>The end</b>',1,14); +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,... [truncated message content] |
From: <see...@us...> - 2009-08-10 21:27:19
|
Revision: 239 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=239&view=rev Author: seematalele Date: 2009-08-10 21:27:12 +0000 (Mon, 10 Aug 2009) Log Message: ----------- module was not getting initialized when sending the block to the client so added code to do that Modified Paths: -------------- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/RoundService.java 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-10 20:38:39 UTC (rev 238) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/RoundService.java 2009-08-10 21:27:12 UTC (rev 239) @@ -62,9 +62,9 @@ *3) Find out the current block number *4) Return the next block */ - getLogger().debug("in getBlock "); + //getLogger().debug("in getBlock "); //setCurrentModuleRoundConfig(currentModuleRoundConfig); - getLogger().debug("currentmodule is " + currentModule); + //getLogger().debug("currentmodule is " + currentModule); if(currentModule == null || isCurrentModuleFinished()) { setGameState(); @@ -72,7 +72,7 @@ { setCurrentBlock(new Block()); currentBlock = getBlock(1); - getLogger().debug(currentBlock.getDescription()); + // getLogger().debug(currentBlock.getDescription()); //get the current game and set the current round and current block ids saveGameState(currentBlock); } @@ -80,12 +80,13 @@ else { //get the next block in the module - getLogger().debug("current module is not finished. " + currentModule.getId()); + // getLogger().debug("current module is not finished. " + currentModule.getId()); setNextBlock(); getLogger().debug(currentBlock.getDescription()); //get the current game and set the current round and current block ids saveGameState(currentBlock); } + getLogger().debug("question group sizes is : " + currentBlock.getQuestionGroups().size()); initializeCurrentBlock(currentBlock); getLogger().debug("Block sent to the server is: " + getCurrentBlock().getDescription()); return getCurrentBlock(); @@ -141,7 +142,7 @@ return; } } - getLogger().debug("current round id is " + getCurrentRound().getId()); + // getLogger().debug("current round id is " + getCurrentRound().getId()); moduleRoundConfigs = moduleRoundDao.findAllByProperty("round",currentRound); for(int i = 0; i < moduleRoundConfigs.size(); i++) { @@ -150,7 +151,7 @@ currentModuleRoundConfig = moduleRoundConfigs.get(i); setCurrentModuleRoundConfig(currentModuleRoundConfig); setCurrentModule(moduleRoundConfigs.get(i).getModule()); - getLogger().debug("current module is: " + getCurrentModule().getDescription()); + // getLogger().debug("current module is: " + getCurrentModule().getDescription()); setCurrentBlock(null); break; } @@ -184,7 +185,7 @@ } } } - getLogger().debug("currentround object is "+ currentRound.getId()); +// getLogger().debug("currentround object is "+ currentRound.getId()); } @@ -209,8 +210,8 @@ { for(int i = 1; i < moduleRoundConfigs.size(); i++) { - getLogger().debug("moduleroundconfig seq no is" + moduleRoundConfigs.get(i).getSequenceNo()); - getLogger().debug("Current seq no is" + currentModuleRoundConfig.getSequenceNo()); + // getLogger().debug("moduleroundconfig seq no is" + moduleRoundConfigs.get(i).getSequenceNo()); + // getLogger().debug("Current seq no is" + currentModuleRoundConfig.getSequenceNo()); if(moduleRoundConfigs.get(i).getSequenceNo() > currentModuleRoundConfig.getSequenceNo()) { @@ -228,7 +229,7 @@ // TODO Auto-generated method stub Game game = gameDao.find(1L); //Hibernate.initialize(game); - getLogger().debug("round size is: " + game.getRounds().size()); + //getLogger().debug("round size is: " + game.getRounds().size()); return game; } @@ -244,20 +245,18 @@ } - private void initializeCurrentBlock(Block currentBlock) { - // TODO Auto-generated method stub - - Hibernate.initialize(currentBlock); - Iterator<QuestionGroup> iteratorquestionGrp = currentBlock.getQuestionGroups().iterator(); - + private void initializeCurrentBlock(Block block) { + + Hibernate.initialize(block); + Iterator<QuestionGroup> iteratorquestionGrp = block.getQuestionGroups().iterator(); + { while(iteratorquestionGrp.hasNext()) { - QuestionGroup questionGroup = iteratorquestionGrp.next(); - getLogger().debug("questionGroup for block " + currentBlock.getId() + "is initilized"); + QuestionGroup questionGroup = iteratorquestionGrp.next(); Hibernate.initialize(questionGroup); - // getLogger().debug(questionGroup.getDescription()); +// getLogger().debug(questionGroup.getDescription()); List<Question> questions = questionGroup.getQuestions(); - + for(int j = 0; j < questions.size(); j++) { Hibernate.initialize(questions.get(j)); @@ -269,15 +268,15 @@ } } } - - - Iterator<InformationWindow> iteratorInfoWindows = currentBlock.getInformationWindows().iterator(); - while(iteratorInfoWindows.hasNext()) - { - Hibernate.initialize(iteratorInfoWindows.next()); } + + Module module = block.getModule(); + Hibernate.initialize(module); + initializeModule(currentModule); } + + private void setNextBlock() { // TODO Auto-generated method stub List<Block> blocks = new ArrayList<Block>(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <see...@us...> - 2009-08-10 20:38:50
|
Revision: 238 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=238&view=rev Author: seematalele Date: 2009-08-10 20:38:39 +0000 (Mon, 10 Aug 2009) Log Message: ----------- added code to initialize games list in LocationService.java Modified Paths: -------------- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/LocationService.java 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-10 20:19:48 UTC (rev 237) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/LocationService.java 2009-08-10 20:38:39 UTC (rev 238) @@ -10,6 +10,7 @@ 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; @@ -29,7 +30,16 @@ List<Round> rounds = initLocation.getRounds(); for(int j = 0; j < rounds.size(); j++) { - Hibernate.initialize(rounds.get(j)); + Round round = rounds.get(j); + Hibernate.initialize(round); + + Iterator <Game> games = round.getGame().iterator(); + while(games.hasNext()) + { + Hibernate.initialize(games.next()); + + } + //round.getLocations() } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <see...@us...> - 2009-08-10 20:19:55
|
Revision: 237 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=237&view=rev Author: seematalele Date: 2009-08-10 20:19:48 +0000 (Mon, 10 Aug 2009) Log Message: ----------- Chnage the initializeCurrentBlock in the RoundService.java Modified Paths: -------------- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/RoundService.java 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-09 21:21:19 UTC (rev 236) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/RoundService.java 2009-08-10 20:19:48 UTC (rev 237) @@ -249,10 +249,11 @@ Hibernate.initialize(currentBlock); Iterator<QuestionGroup> iteratorquestionGrp = currentBlock.getQuestionGroups().iterator(); - { + while(iteratorquestionGrp.hasNext()) { - QuestionGroup questionGroup = iteratorquestionGrp.next(); + QuestionGroup questionGroup = iteratorquestionGrp.next(); + getLogger().debug("questionGroup for block " + currentBlock.getId() + "is initilized"); Hibernate.initialize(questionGroup); // getLogger().debug(questionGroup.getDescription()); List<Question> questions = questionGroup.getQuestions(); @@ -268,6 +269,12 @@ } } } + + + Iterator<InformationWindow> iteratorInfoWindows = currentBlock.getInformationWindows().iterator(); + while(iteratorInfoWindows.hasNext()) + { + Hibernate.initialize(iteratorInfoWindows.next()); } } 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-10 20:04:40
|
I am returning at 13:00pm On Mon, Aug 10, 2009 at 12:36 PM, Kalin Jonas <kj...@as...> wrote: > I go for lunch at 12:30pm. (2.25hr) > > > On Mon, Aug 10, 2009 at 10:22 AM, Kalin Jonas <kj...@as...> wrote: > >> Today I work from home at 10:15am. >> If I am needed at the office today, I will come, but in the interests of >> saving time and money, I'll be eating lunch at home. >> >> I will try to work with Seema on fixing the errors with sending blocks, >> and work forward from there. >> > > |
From: Kalin J. <kj...@as...> - 2009-08-10 19:36:46
|
I go for lunch at 12:30pm. (2.25hr) On Mon, Aug 10, 2009 at 10:22 AM, Kalin Jonas <kj...@as...> wrote: > Today I work from home at 10:15am. > If I am needed at the office today, I will come, but in the interests of > saving time and money, I'll be eating lunch at home. > > I will try to work with Seema on fixing the errors with sending blocks, and > work forward from there. > |
From: Kalin J. <kj...@as...> - 2009-08-10 17:29:00
|
Today I work from home at 10:15am. If I am needed at the office today, I will come, but in the interests of saving time and money, I'll be eating lunch at home. I will try to work with Seema on fixing the errors with sending blocks, and work forward from there. |
From: Kalin J. <kj...@as...> - 2009-08-09 21:46:04
|
I am checking out today at 14:45pm (1.25 hr) I cannot test the timers, but the code has been written in a similar way to previous code which worked. I fixed one minor error, but as usual items are not being initialized before they are sent, so I cannot finish testing my code. On Sun, Aug 9, 2009 at 1:27 PM, Kalin Jonas <kj...@as...> wrote: > I continue working today at 13:30pm > I will be working on making the timers scroll based on the time in the > block and how long it has been. > Then I will see if I can fix the errors with the server myself. > > > On Sat, Aug 8, 2009 at 3:40 PM, Kalin Jonas <kj...@as...> wrote: > >> at 15:00 (2hrs) I begin experiencing errors that stem from communicating >> with server. >> These appear to be with the new code that Seema has created, but I am not >> familiar enough with her code to repair the errors. >> Seema is not available anymore, and the asu email system is also giving me >> many errors saying that it cannot connect. >> I will resume working later today, if the system permits communication. >> >> >> On Sat, Aug 8, 2009 at 1:12 PM, Kalin Jonas <kj...@as...> wrote: >> >>> Today I work from home at 13:00pm >>> I will be looking over Seema's new code for sending blocks, and implement >>> it with my code. I will work on getting the blocks to display, and sending >>> answers back. >>> >> >> > |
From: <kj...@us...> - 2009-08-09 21:21:26
|
Revision: 236 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=236&view=rev Author: kjonas Date: 2009-08-09 21:21:19 +0000 (Sun, 09 Aug 2009) Log Message: ----------- fixing use of looping variables (replaced i with j where necessary) Modified Paths: -------------- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/LocationService.java 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-08 01:11:36 UTC (rev 235) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/LocationService.java 2009-08-09 21:21:19 UTC (rev 236) @@ -29,7 +29,7 @@ List<Round> rounds = initLocation.getRounds(); for(int j = 0; j < rounds.size(); j++) { - Hibernate.initialize(rounds.get(i)); + Hibernate.initialize(rounds.get(j)); } } 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-09 20:27:49
|
I continue working today at 13:30pm I will be working on making the timers scroll based on the time in the block and how long it has been. Then I will see if I can fix the errors with the server myself. On Sat, Aug 8, 2009 at 3:40 PM, Kalin Jonas <kj...@as...> wrote: > at 15:00 (2hrs) I begin experiencing errors that stem from communicating > with server. > These appear to be with the new code that Seema has created, but I am not > familiar enough with her code to repair the errors. > Seema is not available anymore, and the asu email system is also giving me > many errors saying that it cannot connect. > I will resume working later today, if the system permits communication. > > > On Sat, Aug 8, 2009 at 1:12 PM, Kalin Jonas <kj...@as...> wrote: > >> Today I work from home at 13:00pm >> I will be looking over Seema's new code for sending blocks, and implement >> it with my code. I will work on getting the blocks to display, and sending >> answers back. >> > > |
From: Kalin J. <kj...@as...> - 2009-08-08 22:40:53
|
at 15:00 (2hrs) I begin experiencing errors that stem from communicating with server. These appear to be with the new code that Seema has created, but I am not familiar enough with her code to repair the errors. Seema is not available anymore, and the asu email system is also giving me many errors saying that it cannot connect. I will resume working later today, if the system permits communication. On Sat, Aug 8, 2009 at 1:12 PM, Kalin Jonas <kj...@as...> wrote: > Today I work from home at 13:00pm > I will be looking over Seema's new code for sending blocks, and implement > it with my code. I will work on getting the blocks to display, and sending > answers back. > |
From: Kalin J. <kj...@as...> - 2009-08-08 20:12:18
|
Today I work from home at 13:00pm I will be looking over Seema's new code for sending blocks, and implement it with my code. I will work on getting the blocks to display, and sending answers back. |
From: <see...@us...> - 2009-08-08 01:11:44
|
Revision: 235 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=235&view=rev Author: seematalele Date: 2009-08-08 01:11:36 +0000 (Sat, 08 Aug 2009) Log Message: ----------- Written code for sending blocks to the client. Some errors occurred while testing - While sending the third block it gets error for lazy initialization Modified Paths: -------------- mentalmodels/trunk/src/main/db/init-mme.sql mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Game.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Location.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Round.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/ModuleService.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 Modified: mentalmodels/trunk/src/main/db/init-mme.sql =================================================================== --- mentalmodels/trunk/src/main/db/init-mme.sql 2009-08-07 23:09:09 UTC (rev 234) +++ mentalmodels/trunk/src/main/db/init-mme.sql 2009-08-08 01:11:36 UTC (rev 235) @@ -268,7 +268,7 @@ LOCK TABLES `game` WRITE; /*!40000 ALTER TABLE `game` DISABLE KEYS */; -INSERT INTO `game` VALUES (1,'First game','island.jpg',30,5,0,4,3,'2009-07-19 17:30:35','Mental Model Experiment',null,null); +INSERT INTO `game` VALUES (1,'First game','island.jpg',30,5,0,4,4,'2009-07-19 17:30:35','Mental Model Experiment',null,null); /*!40000 ALTER TABLE `game` ENABLE KEYS */; UNLOCK TABLES; @@ -540,22 +540,6 @@ -- Table structure for table `round_config` -- -DROP TABLE IF EXISTS `round_config`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `round_config` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `communication_flag` tinyint(1) NOT NULL DEFAULT '0', - `round_no` int(11) NOT NULL, - `game_id` bigint(20) DEFAULT NULL, - `rounds_id` bigint(20) DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `FK3BE293137AC42F73` (`game_id`), - KEY `FK3BE29313862DD9E0` (`rounds_id`), - CONSTRAINT `FK3BE29313862DD9E0` FOREIGN KEY (`rounds_id`) REFERENCES `game` (`id`), - CONSTRAINT `FK3BE293137AC42F73` FOREIGN KEY (`game_id`) REFERENCES `game` (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `round_config` @@ -563,7 +547,7 @@ LOCK TABLES `round_config` WRITE; /*!40000 ALTER TABLE `round_config` DISABLE KEYS */; -INSERT INTO `round_config` VALUES (1,0,1,1,NULL),(2,0,2,1,NULL),(3,1,3,1,NULL),(4,0,4,1,NULL); +INSERT INTO `round_config` VALUES (1,0,1),(2,0,2),(3,1,3),(4,0,4); /*!40000 ALTER TABLE `round_config` ENABLE KEYS */; UNLOCK TABLES; 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-07 23:09:09 UTC (rev 234) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Game.java 2009-08-08 01:11:36 UTC (rev 235) @@ -6,14 +6,18 @@ 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.Lob; +import javax.persistence.ManyToMany; import javax.persistence.ManyToOne; import javax.persistence.OneToMany; import javax.persistence.Table; +import org.hibernate.annotations.CollectionOfElements; + @Entity @Table(name="game") public class Game implements Serializable { @@ -52,8 +56,8 @@ private String imageLocation; // FIXME: should this be many-to-many instead? - @OneToMany - @JoinColumn(name="rounds_id") + @ManyToMany + @CollectionOfElements(fetch=FetchType.EAGER) private List<Round> rounds; @ManyToOne 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-07 23:09:09 UTC (rev 234) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Location.java 2009-08-08 01:11:36 UTC (rev 235) @@ -25,7 +25,6 @@ private Long id; @ManyToMany - @JoinColumn(name="rounds_id") @CollectionOfElements(fetch= FetchType.EAGER) private List<Round> rounds; 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-07 23:09:09 UTC (rev 234) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Round.java 2009-08-08 01:11:36 UTC (rev 235) @@ -2,10 +2,12 @@ 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; @@ -13,6 +15,8 @@ import javax.persistence.ManyToOne; import javax.persistence.Table; +import org.hibernate.annotations.CollectionOfElements; + @Entity @Table(name="round_config") public class Round implements Serializable { @@ -26,8 +30,9 @@ @Column(name="round_no",nullable=false) private Integer roundNo; - @ManyToOne - private Game game; + @ManyToMany + @CollectionOfElements(fetch=FetchType.EAGER) + private List<Game> game; @Column(name="communication_flag",nullable=false,columnDefinition="Boolean default false") private boolean communicationFlag; @@ -37,7 +42,8 @@ @ManyToMany - private Set<Location> locations; + @CollectionOfElements(fetch=FetchType.EAGER) + private List<Location> locations; public void setId(Long id) { this.id = id; @@ -58,17 +64,11 @@ public boolean getCommunicationFlag() { return communicationFlag; } - public void setGame(Game game) { - this.game = game; - } - public Game getGame() { - return game; - } - - public Set<Location> getLocations() { + + public List<Location> getLocations() { return locations; } - public void setLocations(Set<Location> locations) { + public void setLocations(List<Location> locations) { this.locations = locations; } /*public void setRound_config(ModuleRoundConfig round_config) { @@ -77,5 +77,11 @@ public ModuleRoundConfig getRound_config() { return round_config; }*/ + public void setGame(List<Game> game) { + this.game = game; + } + public List<Game> getGame() { + return game; + } } 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-07 23:09:09 UTC (rev 234) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/AnsweringService.java 2009-08-08 01:11:36 UTC (rev 235) @@ -16,7 +16,7 @@ @Transactional public class AnsweringService extends Service.Base<StudentResponse, HibernateStudentResponseDao> { - private HibernateStudentResponseDao studentResponseDao; + private HibernateStudentDao studentDao; //private HibernateDayByDayDecisionsDao dayByDayDecisionsDao; private DayByDayDecisionsService dayByDayDecisionsService; @@ -28,16 +28,19 @@ public void saveQuestion(List<StudentResponse> studentResponses) { + StudentResponse clientStudentResponse = new StudentResponse(); for(int i = 0; i < studentResponses.size(); i++ ) { - StudentResponse clientStudentResponse = new StudentResponse(); + clientStudentResponse = (StudentResponse) studentResponses.get(i); - + getLogger().debug("Question is: " + clientStudentResponse.getQuestion()); + getLogger().debug("Response is: " + clientStudentResponse.getResponse()); + getLogger().debug("Student is: " + clientStudentResponse.getStudent()); studentResponse = new StudentResponse(); studentResponse.setQuestion(clientStudentResponse.getQuestion()); studentResponse.setResponse(clientStudentResponse.getResponse()); studentResponse.setStudent(clientStudentResponse.getStudent()); - save(studentResponse); + getDao().save(studentResponse); } //return moduleService.getBlock(); @@ -64,4 +67,13 @@ return dayByDayDecisionsService; } + public void setModuleService(ModuleService moduleService) { + this.moduleService = moduleService; + } + + public ModuleService getModuleService() { + return moduleService; + } + + } 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-07 23:09:09 UTC (rev 234) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/DayByDayDecisionsService.java 2009-08-08 01:11:36 UTC (rev 235) @@ -3,11 +3,14 @@ import java.util.ArrayList; import java.util.List; +import org.springframework.transaction.annotation.Transactional; + import edu.asu.commons.mme.dao.HibernateDayByDayDecisionsDao; import edu.asu.commons.mme.entity.DayByDayDecisions; import edu.asu.commons.mme.entity.Question; import edu.asu.commons.mme.entity.Student; +@Transactional public class DayByDayDecisionsService extends Service.Base<DayByDayDecisions, HibernateDayByDayDecisionsDao> { private List<DayByDayDecisions> studentdecisions = new ArrayList<DayByDayDecisions>(); Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/ModuleService.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/ModuleService.java 2009-08-07 23:09:09 UTC (rev 234) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/ModuleService.java 2009-08-08 01:11:36 UTC (rev 235) @@ -156,7 +156,7 @@ } - public Module getModule(Round round, int moduleNumber) + public Module getModule(int moduleNumber) { // Enter the sequence number in new Integer(Sequence number of module u want to fetch) 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-07 23:09:09 UTC (rev 234) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/RoundService.java 2009-08-08 01:11:36 UTC (rev 235) @@ -1,13 +1,10 @@ package edu.asu.commons.mme.service; import java.util.ArrayList; -import java.util.HashMap; import java.util.Iterator; import java.util.List; -import java.util.Map; import org.hibernate.Hibernate; -import org.hibernate.criterion.MatchMode; import org.springframework.transaction.annotation.Transactional; import edu.asu.commons.mme.dao.HibernateBlockDao; @@ -33,20 +30,25 @@ private HibernateBlockDao blockDao; private HibernateGameDao gameDao; private HibernateModuleRoundConfigDao moduleRoundDao; - - private Module currentModule; + + private Module currentModule=null; private boolean startGame = true; - private Round currentRound; - private int blockSeqNo; - //private Block currentBlock; - - + private Round currentRound=null; + private Block currentBlock=null; + + private int blockSeqNo=0; + private ModuleRoundConfig currentModuleRoundConfig; + + + private boolean gameFinished = false; + + public Module getNextModule(int sequenceNo) { return getModule(sequenceNo); } - - + + public void test() { getLogger().debug("test to check if module service is working...." ); @@ -60,75 +62,175 @@ *3) Find out the current block number *4) Return the next block */ - currentRound = new Round(); - int currentRoundNo = getCurrentRoundNo(); - getLogger().debug("current round number is: " + currentRoundNo); - Block currentBlock = null; - if(currentRoundNo == 0) + getLogger().debug("in getBlock "); + //setCurrentModuleRoundConfig(currentModuleRoundConfig); + getLogger().debug("currentmodule is " + currentModule); + if(currentModule == null || isCurrentModuleFinished()) { - //get first round no - getLogger().debug("in if loop"); - setRound(1); - - currentModule = new Module(); - setModule(); - - //get the first block in the first module - currentBlock = new Block(); - currentBlock = getBlock(1); + setGameState(); + if(currentBlock == null) + { + setCurrentBlock(new Block()); + currentBlock = getBlock(1); + getLogger().debug(currentBlock.getDescription()); + //get the current game and set the current round and current block ids + saveGameState(currentBlock); + } + } + else + { + //get the next block in the module + getLogger().debug("current module is not finished. " + currentModule.getId()); + setNextBlock(); getLogger().debug(currentBlock.getDescription()); - //get the current game and set the current round and current block ids saveGameState(currentBlock); } - - else + initializeCurrentBlock(currentBlock); + getLogger().debug("Block sent to the server is: " + getCurrentBlock().getDescription()); + return getCurrentBlock(); + } + + // FIXME: think of a good name to the following function + private void setGameState() { + // TODO Auto-generated method stub + int prevSeqNo = 0; + List<ModuleRoundConfig> moduleRoundConfigs = new ArrayList<ModuleRoundConfig> (); + + /* + *1)get the currentModuleRoundConfig + *2)get the current round + *3)get the next sequence number if any, else get the next round + *4)get module + * + */ + try { - /**Check if the current module is finished , if yes then get next module - * if no then get next block - */ - if(isCurrentModuleFinished(currentBlock)) + if(currentModuleRoundConfig == null) { - //get next module if any, else get next round - - getNextModule(); + currentModuleRoundConfig = new ModuleRoundConfig(); + //getLogger().debug("new currentmoduleroundconfig is created."); + if(currentRound == null) + { + setNextRound(); + prevSeqNo = 0; + } } else { - //get next block - getNextBlock(getCurrentBlock()); + /**check if game is not finished, check if round is finished + * if round is finished then get the next round + */ + //getLogger().debug("currentModuleRoundConfig is : " + currentModuleRoundConfig.getId()); + if(!isGameFinished()) + { + //getLogger().debug("game is not finished."); + if(isRoundFinished()) + { + setNextRound(); + prevSeqNo = 0; + } + else + { + prevSeqNo = currentModuleRoundConfig.getSequenceNo(); + } + } + else + { + getLogger().debug(getCurrentGame().getDescription() + "Game is finsihed."); + return; + } } + getLogger().debug("current round id is " + getCurrentRound().getId()); + moduleRoundConfigs = moduleRoundDao.findAllByProperty("round",currentRound); + for(int i = 0; i < moduleRoundConfigs.size(); i++) + { + if(moduleRoundConfigs.get(i).getSequenceNo() > prevSeqNo) + { + currentModuleRoundConfig = moduleRoundConfigs.get(i); + setCurrentModuleRoundConfig(currentModuleRoundConfig); + setCurrentModule(moduleRoundConfigs.get(i).getModule()); + getLogger().debug("current module is: " + getCurrentModule().getDescription()); + setCurrentBlock(null); + break; + } + } + }catch(Exception e) + { + e.printStackTrace(); } - initializeCurrentBlock(currentBlock); - return currentBlock; } - - private void setModule() { + + + private void setNextRound() { // TODO Auto-generated method stub - - ModuleRoundConfig moduleRoundconfig = new ModuleRoundConfig(); - - moduleRoundconfig.setRound(currentRound); - getLogger().debug("currentround id is "+ currentRound.getId()); - moduleRoundconfig.setSequenceNo(1); + + if(currentRound == null) + { + currentRound = new Round(); + currentRound = getDao().findByProperty("roundNo", 1); + setCurrentRound(currentRound); + } + else + { + List<Round> rounds = getDao().findAll(); + for(int i = 0; i < rounds.size(); i++) + { + if(currentRound.getRoundNo() < rounds.get(i).getRoundNo()) + { + setCurrentRound(rounds.get(i)); + break; + } + } + } + getLogger().debug("currentround object is "+ currentRound.getId()); + + } + + + private boolean isRoundFinished() { + // TODO Auto-generated method stub List<ModuleRoundConfig> moduleRoundConfigs = new ArrayList<ModuleRoundConfig> (); - - moduleRoundConfigs = moduleRoundDao.findByExampleLike(moduleRoundconfig, MatchMode.EXACT); - getLogger().debug("module size is " + moduleRoundConfigs.size()); - if(moduleRoundConfigs.size() == 1) + moduleRoundConfigs = moduleRoundDao.findAllByProperty("round",currentRound); + + if(currentModuleRoundConfig == null) { - setCurrentModule(moduleRoundConfigs.get(0).getModule()); - getLogger().debug("module is set " + currentModule.getDescription()); + getLogger().debug("currentModuleRoundConfig is null"); } - //return moduleRoundConfig; + else + { + if(moduleRoundConfigs.size() == 1) + { + return true; + + } + else + { + for(int i = 1; i < moduleRoundConfigs.size(); i++) + { + getLogger().debug("moduleroundconfig seq no is" + moduleRoundConfigs.get(i).getSequenceNo()); + getLogger().debug("Current seq no is" + currentModuleRoundConfig.getSequenceNo()); + + if(moduleRoundConfigs.get(i).getSequenceNo() > currentModuleRoundConfig.getSequenceNo()) + { + return true; + } + } + } + } + + return false; } - private void getNextModule() { + private Game getCurrentGame() { // TODO Auto-generated method stub - //moduleRoundDao.findAllByProperty("", propertyValue) - + Game game = gameDao.find(1L); + //Hibernate.initialize(game); + getLogger().debug("round size is: " + game.getRounds().size()); + return game; + } @@ -144,7 +246,7 @@ private void initializeCurrentBlock(Block currentBlock) { // TODO Auto-generated method stub - + Hibernate.initialize(currentBlock); Iterator<QuestionGroup> iteratorquestionGrp = currentBlock.getQuestionGroups().iterator(); { @@ -152,9 +254,9 @@ { QuestionGroup questionGroup = iteratorquestionGrp.next(); Hibernate.initialize(questionGroup); -// getLogger().debug(questionGroup.getDescription()); + // getLogger().debug(questionGroup.getDescription()); List<Question> questions = questionGroup.getQuestions(); - + for(int j = 0; j < questions.size(); j++) { Hibernate.initialize(questions.get(j)); @@ -167,30 +269,30 @@ } } } - + } - private void getNextBlock(Block currentBlock) { + private void setNextBlock() { // TODO Auto-generated method stub List<Block> blocks = new ArrayList<Block>(); - blocks = currentModule.getBlocks(); - + blocks = getCurrentModule().getBlocks(); + for(int i = 0; i < blocks.size(); i++) { if(currentBlock.getSequenceNo() < blocks.get(i).getSequenceNo()) { - currentBlock = blocks.get(i); + setCurrentBlock(blocks.get(i)); + break; } - + } - + } public Module getModule(int moduleNumber) { // Enter the sequence number in new Integer(Sequence number of module u want to fetch) - + Module module = moduleDao.findByProperty("sequenceNo", moduleNumber); - Hibernate.initialize(module); getLogger().debug("Module object is " + module.getDescription()); initializeModule(module); @@ -218,12 +320,12 @@ private void setRound(int roundNo) { // TODO Auto-generated method stub currentRound = new Round(); - + currentRound = getDao().findByProperty("roundNo", roundNo); //Hibernate.initialize(currentRound); - //getLogger().debug("currentround object is "+ currentRound.getId()); + getLogger().debug("currentround object is "+ currentRound.getId()); setCurrentRound(currentRound); - + } private int getCurrentRoundNo() { @@ -234,28 +336,39 @@ return 0; else return game.getCurrentRound().getRoundNo(); - + } - private boolean isCurrentModuleFinished(Block currentBlock) { + private boolean isCurrentModuleFinished() { // TODO Auto-generated method stub List<Block> blocks = new ArrayList<Block>(); - blocks = currentModule.getBlocks(); - //select max(b.sequence_no) from block b where b.module_id=2; - - for(int i = 0; i < blocks.size(); i++) + getLogger().debug("in iscurrentmodulefinished"); + if(currentModule == null) { - if(currentBlock.getSequenceNo() < blocks.get(i).getSequenceNo()) + return true; + } + else + { + blocks = getCurrentModule().getBlocks(); + //select max(b.sequence_no) from block b where b.module_id=2; + getLogger().debug("no of blocks " + blocks.size() +"for module id: " + getCurrentModule().getId()); + + if(blocks.size() == 1) + return true; + for(int i = 0; i < blocks.size(); i++) { - return false; + + if(currentBlock.getSequenceNo() > blocks.get(i).getSequenceNo()) + { + return true; + } + } - else - return true; } return false; } - + private void saveGameState(Block currentBlock) { @@ -266,7 +379,7 @@ gameDao.save(game); } - + public Integer getTimerforBlock(Block block) { return block.getDuration(); @@ -314,14 +427,14 @@ } - + public Block getCurrentBlock() { //FIXEME: game id 1 is hard coded, it should be dynamic Game game = gameDao.find(1L); Block block = new Block(); block = game.getCurrentBlock(); -// Hibernate.initialize(block); - + // Hibernate.initialize(block); + return block; } @@ -385,6 +498,44 @@ } - - + public void setModuleRoundConfig(ModuleRoundConfig moduleRoundConfig) { + this.currentModuleRoundConfig = moduleRoundConfig; + } + + + public ModuleRoundConfig getModuleRoundConfig() { + return currentModuleRoundConfig; + } + + + public void setGameFinished(boolean gameFinished) { + this.gameFinished = gameFinished; + } + + + public boolean isGameFinished() { + if(getCurrentGame().getCurrentRound().getRoundNo() < currentRound.getRoundNo()) + { + gameFinished = true; + } + return false; + } + + + public void setCurrentBlock(Block currentBlock) { + this.currentBlock = currentBlock; + } + + public ModuleRoundConfig getCurrentModuleRoundConfig() { + return currentModuleRoundConfig; + } + + + public void setCurrentModuleRoundConfig( + ModuleRoundConfig currentModuleRoundConfig) { + this.currentModuleRoundConfig = currentModuleRoundConfig; + } + + + } 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-07 23:09:09 UTC (rev 234) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StartGame.java 2009-08-08 01:11:36 UTC (rev 235) @@ -1,6 +1,7 @@ package edu.asu.commons.mme.service; import edu.asu.commons.mme.entity.Block; +import edu.asu.commons.mme.entity.ModuleRoundConfig; import flex.messaging.MessageBroker; import flex.messaging.messages.AsyncMessage; import flex.messaging.util.UUIDUtils; @@ -9,6 +10,7 @@ private boolean running; private RoundService roundService; + private ModuleRoundConfig currentModuleRoundConfig; public StartGame() { @@ -34,15 +36,15 @@ MessageBroker msgBroker = MessageBroker.getMessageBroker(null); String clientID = UUIDUtils.createUUID(); - - if(isGameOver()) - { - - } - else - { - while (running) { - + int i=0; + while (i<3) { + i++; + 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("DataPush"); @@ -50,8 +52,9 @@ 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 "); if(block != null) { msg.setBody("Here is a block!!!" + block); @@ -65,7 +68,7 @@ //start the timer for the block sent try { Thread.sleep(5000); - //running = false; + running = false; } catch (InterruptedException e) { } } @@ -77,7 +80,7 @@ } } - } + private boolean isGameOver() { @@ -99,7 +102,15 @@ this.running = running; } + public void setCurrentModuleRoundConfig(ModuleRoundConfig currentModuleRoundConfig) { + this.currentModuleRoundConfig = currentModuleRoundConfig; + } + public ModuleRoundConfig getCurrentModuleRoundConfig() { + return currentModuleRoundConfig; + } + + } 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-07 23:09:09 UTC (rev 234) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StartupService.java 2009-08-08 01:11:36 UTC (rev 235) @@ -3,10 +3,11 @@ import org.springframework.context.ApplicationEvent; import org.springframework.context.ApplicationListener; import org.springframework.context.event.ContextRefreshedEvent; +import org.springframework.transaction.annotation.Transactional; -import edu.asu.commons.mme.entity.Module; import edu.asu.commons.mme.entity.Student; +@Transactional public class StartupService implements ApplicationListener { private QuestionCreatorService questionCreatorService; 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-07 23:48:05
|
I leave today at 16:45 (3hr) (5hr total today (one make-up from thursday)) I have been working on answering service. Seema helped me realize that the problem was because i was using hard-coded questions, and so I will need to change them to have id's of real questions in the database. I will do this soon, so that I can test it again. On Fri, Aug 7, 2009 at 1:41 PM, Kalin Jonas <kj...@as...> wrote: > Back from lunch 13:45 > > > On Fri, Aug 7, 2009 at 1:24 PM, Kalin Jonas <kj...@as...> wrote: > >> 13:30 I go for lunch (2hr) >> I have finished the assignGroups function, and finished up testing the >> integration with the locationService. I will be doing more testing with >> answeringservice when i return >> >> >> On Fri, Aug 7, 2009 at 12:21 PM, Kalin Jonas <kj...@as...> wrote: >> >>> Friday I come in at 11:30am >>> I will be working on forming groups, and answeringservice >>> >> >> > |
From: <see...@us...> - 2009-08-07 23:09:15
|
Revision: 234 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=234&view=rev Author: seematalele Date: 2009-08-07 23:09:09 +0000 (Fri, 07 Aug 2009) Log Message: ----------- made AnsweringService.java Transactional Modified Paths: -------------- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/AnsweringService.java 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-07 21:42:05 UTC (rev 233) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/AnsweringService.java 2009-08-07 23:09:09 UTC (rev 234) @@ -2,6 +2,8 @@ import java.util.List; +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; @@ -11,6 +13,7 @@ import edu.asu.commons.mme.entity.Student; import edu.asu.commons.mme.entity.StudentResponse; +@Transactional public class AnsweringService extends Service.Base<StudentResponse, HibernateStudentResponseDao> { private HibernateStudentResponseDao studentResponseDao; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |