virtualcommons-svn Mailing List for Virtual Commons Experiment Software (Page 74)
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: <al...@us...> - 2009-05-04 20:30:06
|
Revision: 138 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=138&view=rev Author: alllee Date: 2009-05-04 20:29:59 +0000 (Mon, 04 May 2009) Log Message: ----------- renaming categorical + psychometric question tables Modified Paths: -------------- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/CategoricalQuestion.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/PsychometricQuestion.java Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/CategoricalQuestion.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/CategoricalQuestion.java 2009-05-01 23:16:52 UTC (rev 137) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/CategoricalQuestion.java 2009-05-04 20:29:59 UTC (rev 138) @@ -12,7 +12,7 @@ @Entity -@Table(name="categorical") +@Table(name="categorical_question") public class CategoricalQuestion extends Question { private static final long serialVersionUID = 5399081841291536902L; Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/PsychometricQuestion.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/PsychometricQuestion.java 2009-05-01 23:16:52 UTC (rev 137) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/PsychometricQuestion.java 2009-05-04 20:29:59 UTC (rev 138) @@ -1,7 +1,5 @@ package edu.asu.commons.mme.entity; - - import java.util.List; import javax.persistence.Column; @@ -19,7 +17,7 @@ // FIXME: should be an enum, can be unipolar or bipolar @Column(nullable=false) private String scale; - + @Column(name="no_of_intervals",nullable=false) private Integer numberOfIntervals; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <al...@us...> - 2009-05-01 23:16:54
|
Revision: 137 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=137&view=rev Author: alllee Date: 2009-05-01 23:16:52 +0000 (Fri, 01 May 2009) Log Message: ----------- renaming various questions to *Question, fixed in hibernate mapping as well. Modified Paths: -------------- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/QuestionCreatorService.java mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.cfg.xml Added Paths: ----------- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/CategoricalQuestion.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/ForecastingQuestion.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/PsychometricQuestion.java Removed Paths: ------------- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Categorical.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Forecasting.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Psychometric.java Property Changed: ---------------- mentalmodels/trunk/src/main/db/ Property changes on: mentalmodels/trunk/src/main/db ___________________________________________________________________ Added: svn:ignore + generated Deleted: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Categorical.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Categorical.java 2009-04-29 21:35:43 UTC (rev 136) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Categorical.java 2009-05-01 23:16:52 UTC (rev 137) @@ -1,33 +0,0 @@ -package edu.asu.commons.mme.entity; - - -import java.util.List; - -import javax.persistence.CascadeType; -import javax.persistence.Entity; -import javax.persistence.JoinColumn; -import javax.persistence.JoinTable; -import javax.persistence.ManyToMany; -import javax.persistence.Table; - - -@Entity -@Table(name="categorical") -public class Categorical extends Question { - - private static final long serialVersionUID = 5399081841291536902L; - - @ManyToMany(cascade=CascadeType.ALL) - @JoinTable(name="categorical_options_pivot", - inverseJoinColumns={@JoinColumn(name="categorical_option_id")}) - private List<CategoricalOption> categoricalOptions; - - public void setCategoricalOptions(List<CategoricalOption> categoricalOptions) { - this.categoricalOptions = categoricalOptions; - } - - public List<CategoricalOption> getCategoricalOptions() { - return categoricalOptions; - } - -} Copied: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/CategoricalQuestion.java (from rev 133, mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Categorical.java) =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/CategoricalQuestion.java (rev 0) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/CategoricalQuestion.java 2009-05-01 23:16:52 UTC (rev 137) @@ -0,0 +1,33 @@ +package edu.asu.commons.mme.entity; + + +import java.util.List; + +import javax.persistence.CascadeType; +import javax.persistence.Entity; +import javax.persistence.JoinColumn; +import javax.persistence.JoinTable; +import javax.persistence.ManyToMany; +import javax.persistence.Table; + + +@Entity +@Table(name="categorical") +public class CategoricalQuestion extends Question { + + private static final long serialVersionUID = 5399081841291536902L; + + @ManyToMany(cascade=CascadeType.ALL) + @JoinTable(name="categorical_options_pivot", + inverseJoinColumns={@JoinColumn(name="categorical_option_id")}) + private List<CategoricalOption> categoricalOptions; + + public void setCategoricalOptions(List<CategoricalOption> categoricalOptions) { + this.categoricalOptions = categoricalOptions; + } + + public List<CategoricalOption> getCategoricalOptions() { + return categoricalOptions; + } + +} Deleted: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Forecasting.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Forecasting.java 2009-04-29 21:35:43 UTC (rev 136) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Forecasting.java 2009-05-01 23:16:52 UTC (rev 137) @@ -1,26 +0,0 @@ -package edu.asu.commons.mme.entity; - - - -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.Table; - -@Entity -@Table(name="forecasting") -public class Forecasting extends Question { - - private static final long serialVersionUID = -1130445773406872694L; - - @Column(name="day_no",nullable=false) - private Integer dayNo; - - public void setDayNo(Integer dayNo) { - this.dayNo = dayNo; - } - - public Integer getDayNo() { - return dayNo; - } - -} Copied: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/ForecastingQuestion.java (from rev 133, mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Forecasting.java) =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/ForecastingQuestion.java (rev 0) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/ForecastingQuestion.java 2009-05-01 23:16:52 UTC (rev 137) @@ -0,0 +1,24 @@ +package edu.asu.commons.mme.entity; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Table; + +@Entity +@Table(name="forecasting_question") +public class ForecastingQuestion extends Question { + + private static final long serialVersionUID = -1130445773406872694L; + + @Column(name="day_no",nullable=false) + private Integer dayNo; + + public void setDayNo(Integer dayNo) { + this.dayNo = dayNo; + } + + public Integer getDayNo() { + return dayNo; + } + +} Deleted: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Psychometric.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Psychometric.java 2009-04-29 21:35:43 UTC (rev 136) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Psychometric.java 2009-05-01 23:16:52 UTC (rev 137) @@ -1,53 +0,0 @@ -package edu.asu.commons.mme.entity; - - - -import java.util.List; - -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.Table; - -import org.hibernate.annotations.CollectionOfElements; - -@Entity -@Table(name="psychometric") -public class Psychometric extends Question { - - private static final long serialVersionUID = -6604568936880631100L; - - // FIXME: should be an enum, can be unipolar or bipolar - @Column(nullable=false) - private String scale; - - @Column(name="no_of_intervals",nullable=false) - private Integer numberOfIntervals; - - @CollectionOfElements - private List<String> choices; - - public void setChoices(List<String> choices) { - this.choices = choices; - } - - public List<String> getChoices() { - return choices; - } - - public Integer getNumberOfIntervals() { - return numberOfIntervals; - } - - public void setNumberOfIntervals(Integer numberOfIntervals) { - this.numberOfIntervals = numberOfIntervals; - } - - public void setScale(String scale) { - this.scale = scale; - } - - public String getScale() { - return scale; - } - -} Copied: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/PsychometricQuestion.java (from rev 133, mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Psychometric.java) =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/PsychometricQuestion.java (rev 0) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/PsychometricQuestion.java 2009-05-01 23:16:52 UTC (rev 137) @@ -0,0 +1,53 @@ +package edu.asu.commons.mme.entity; + + + +import java.util.List; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Table; + +import org.hibernate.annotations.CollectionOfElements; + +@Entity +@Table(name="psychometric_question") +public class PsychometricQuestion extends Question { + + private static final long serialVersionUID = -6604568936880631100L; + + // FIXME: should be an enum, can be unipolar or bipolar + @Column(nullable=false) + private String scale; + + @Column(name="no_of_intervals",nullable=false) + private Integer numberOfIntervals; + + @CollectionOfElements + private List<String> choices; + + public void setChoices(List<String> choices) { + this.choices = choices; + } + + public List<String> getChoices() { + return choices; + } + + public Integer getNumberOfIntervals() { + return numberOfIntervals; + } + + public void setNumberOfIntervals(Integer numberOfIntervals) { + this.numberOfIntervals = numberOfIntervals; + } + + public void setScale(String scale) { + this.scale = scale; + } + + public String getScale() { + return scale; + } + +} Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/QuestionCreatorService.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/QuestionCreatorService.java 2009-04-29 21:35:43 UTC (rev 136) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/QuestionCreatorService.java 2009-05-01 23:16:52 UTC (rev 137) @@ -9,7 +9,7 @@ import edu.asu.commons.mme.dao.HibernateBlockDao; import edu.asu.commons.mme.dao.HibernateQuestionDao; import edu.asu.commons.mme.entity.Block; -import edu.asu.commons.mme.entity.Categorical; +import edu.asu.commons.mme.entity.CategoricalQuestion; import edu.asu.commons.mme.entity.CategoricalOption; import edu.asu.commons.mme.entity.Question; import edu.asu.commons.mme.entity.QuestionGroup; @@ -81,14 +81,14 @@ )); categoricalOptions.add(othersOption); - Categorical mostImportantGoal = new Categorical(); + CategoricalQuestion mostImportantGoal = new CategoricalQuestion(); mostImportantGoal.setCategoricalOptions(categoricalOptions); mostImportantGoal.setQuestion("Most important goal:"); mostImportantGoal.setSequenceNo(1); subjectGoalQuestionGroup.add(mostImportantGoal); - Categorical secondMostImportantGoal = new Categorical(); + CategoricalQuestion secondMostImportantGoal = new CategoricalQuestion(); secondMostImportantGoal.setCategoricalOptions(categoricalOptions); secondMostImportantGoal.setQuestion("Second most important goal:"); secondMostImportantGoal.setSequenceNo(2); @@ -96,7 +96,7 @@ // secondMostImportantGoal.setQuestionGroup(subjectGoalQuestionGroup); - Categorical thirdMostImportantGoal = new Categorical(); + CategoricalQuestion thirdMostImportantGoal = new CategoricalQuestion(); thirdMostImportantGoal.setCategoricalOptions(categoricalOptions); thirdMostImportantGoal.setQuestion("Third most important goal:"); thirdMostImportantGoal.setSequenceNo(3); Modified: mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.cfg.xml =================================================================== --- mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.cfg.xml 2009-04-29 21:35:43 UTC (rev 136) +++ mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.cfg.xml 2009-05-01 23:16:52 UTC (rev 137) @@ -24,9 +24,10 @@ - <mapping class='edu.asu.commons.mme.entity.Categorical'/> + <mapping class='edu.asu.commons.mme.entity.CategoricalQuestion'/> <mapping class='edu.asu.commons.mme.entity.CategoricalOption'/> - <mapping class='edu.asu.commons.mme.entity.Psychometric'/> + <mapping class='edu.asu.commons.mme.entity.ForecastingQuestion'/> + <mapping class='edu.asu.commons.mme.entity.PsychometricQuestion'/> <mapping class='edu.asu.commons.mme.entity.StudentResponse'/> <mapping class='edu.asu.commons.mme.entity.Module'/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <al...@us...> - 2009-04-29 21:35:47
|
Revision: 136 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=136&view=rev Author: alllee Date: 2009-04-29 21:35:43 +0000 (Wed, 29 Apr 2009) Log Message: ----------- initial commit of irrigation experiment slightly modified from sanket's old version. Still needs a lot of work to convert to new Maven 2 build framework and to use csidex instead of old csidnet jars. Added Paths: ----------- irrigation/trunk/build.xml irrigation/trunk/conf/ irrigation/trunk/conf/irrigation.xml irrigation/trunk/conf/round0.xml irrigation/trunk/conf/round1.xml irrigation/trunk/conf/round10.xml irrigation/trunk/conf/round11.xml irrigation/trunk/conf/round12.xml irrigation/trunk/conf/round13.xml irrigation/trunk/conf/round14.xml irrigation/trunk/conf/round15.xml irrigation/trunk/conf/round16.xml irrigation/trunk/conf/round17.xml irrigation/trunk/conf/round18.xml irrigation/trunk/conf/round19.xml irrigation/trunk/conf/round2.xml irrigation/trunk/conf/round20.xml irrigation/trunk/conf/round21.xml irrigation/trunk/conf/round3.xml irrigation/trunk/conf/round4.xml irrigation/trunk/conf/round5.xml irrigation/trunk/conf/round6.xml irrigation/trunk/conf/round7.xml irrigation/trunk/conf/round8.xml irrigation/trunk/conf/round9.xml irrigation/trunk/images/ irrigation/trunk/images/file.gif irrigation/trunk/images/screenShotDownStream.JPG irrigation/trunk/images/screenShotUpStream.JPG irrigation/trunk/images/tokenBandwidthImage.jpg irrigation/trunk/lib/ irrigation/trunk/lib/csidnet.jar irrigation/trunk/lib/jcommon-1.0.8.jar irrigation/trunk/lib/jfreechart-1.0.4.jar irrigation/trunk/src/ irrigation/trunk/src/edu/ irrigation/trunk/src/edu/asu/ irrigation/trunk/src/edu/asu/csid/ irrigation/trunk/src/edu/asu/csid/irrigation/ irrigation/trunk/src/edu/asu/csid/irrigation/client/ irrigation/trunk/src/edu/asu/csid/irrigation/client/ActivitySummaryPanel.java irrigation/trunk/src/edu/asu/csid/irrigation/client/ActivitySummaryPanelNew.java irrigation/trunk/src/edu/asu/csid/irrigation/client/Ball.java irrigation/trunk/src/edu/asu/csid/irrigation/client/CanalPanel.java irrigation/trunk/src/edu/asu/csid/irrigation/client/CanalPanelAnimation.java irrigation/trunk/src/edu/asu/csid/irrigation/client/CanalPanelAnimationNew.java irrigation/trunk/src/edu/asu/csid/irrigation/client/ChartWindowPanel.java irrigation/trunk/src/edu/asu/csid/irrigation/client/ChartWindowPanelTokenBandwidth.java irrigation/trunk/src/edu/asu/csid/irrigation/client/ChatPanel.java irrigation/trunk/src/edu/asu/csid/irrigation/client/ExperimentGameWindow.java irrigation/trunk/src/edu/asu/csid/irrigation/client/Gate.java irrigation/trunk/src/edu/asu/csid/irrigation/client/IrrigationClient.java irrigation/trunk/src/edu/asu/csid/irrigation/client/IrrigationClientGameState.java irrigation/trunk/src/edu/asu/csid/irrigation/client/IrrigationGameWindow.java irrigation/trunk/src/edu/asu/csid/irrigation/client/MainIrrigationGameWindow.java irrigation/trunk/src/edu/asu/csid/irrigation/client/MiddleScorePanel.java irrigation/trunk/src/edu/asu/csid/irrigation/client/MiddleWindowPanel.java irrigation/trunk/src/edu/asu/csid/irrigation/client/PieChart.java irrigation/trunk/src/edu/asu/csid/irrigation/client/ScoreBoxPanel.java irrigation/trunk/src/edu/asu/csid/irrigation/conf/ irrigation/trunk/src/edu/asu/csid/irrigation/conf/RoundConfiguration.java irrigation/trunk/src/edu/asu/csid/irrigation/conf/ServerConfiguration.java irrigation/trunk/src/edu/asu/csid/irrigation/events/ irrigation/trunk/src/edu/asu/csid/irrigation/events/BeginCommunicationRequest.java irrigation/trunk/src/edu/asu/csid/irrigation/events/ClientUpdateEvent.java irrigation/trunk/src/edu/asu/csid/irrigation/events/DisplaySubmitTokenRequest.java irrigation/trunk/src/edu/asu/csid/irrigation/events/EndRoundEvent.java irrigation/trunk/src/edu/asu/csid/irrigation/events/ExperimentDurationEvent.java irrigation/trunk/src/edu/asu/csid/irrigation/events/FacilitatorEndRoundEvent.java irrigation/trunk/src/edu/asu/csid/irrigation/events/FileDownloadCompleteEvent.java irrigation/trunk/src/edu/asu/csid/irrigation/events/FileDownloadedEvent.java irrigation/trunk/src/edu/asu/csid/irrigation/events/GateOpenedEvent.java irrigation/trunk/src/edu/asu/csid/irrigation/events/InstructionEnableRequest.java irrigation/trunk/src/edu/asu/csid/irrigation/events/InvestedTokensEvent.java irrigation/trunk/src/edu/asu/csid/irrigation/events/QuizCompletedEvent.java irrigation/trunk/src/edu/asu/csid/irrigation/events/RegistrationEvent.java irrigation/trunk/src/edu/asu/csid/irrigation/events/RoundStartedEvent.java irrigation/trunk/src/edu/asu/csid/irrigation/events/SendContributionStatusEvent.java irrigation/trunk/src/edu/asu/csid/irrigation/events/SendFileProgressEvent.java irrigation/trunk/src/edu/asu/csid/irrigation/events/ServerGameStateEvent.java irrigation/trunk/src/edu/asu/csid/irrigation/events/StartDownload.java irrigation/trunk/src/edu/asu/csid/irrigation/events/StartPausedEvent.java irrigation/trunk/src/edu/asu/csid/irrigation/events/StopDownloadEvent.java irrigation/trunk/src/edu/asu/csid/irrigation/events/TransferFileInformationEvent.java irrigation/trunk/src/edu/asu/csid/irrigation/facilitator/ irrigation/trunk/src/edu/asu/csid/irrigation/facilitator/IrrigationFacilitator.java irrigation/trunk/src/edu/asu/csid/irrigation/facilitator/IrrigationFacilitatorWindow.java irrigation/trunk/src/edu/asu/csid/irrigation/server/ irrigation/trunk/src/edu/asu/csid/irrigation/server/ClientData.java irrigation/trunk/src/edu/asu/csid/irrigation/server/GroupDataModel.java irrigation/trunk/src/edu/asu/csid/irrigation/server/IrrigationPersister.java irrigation/trunk/src/edu/asu/csid/irrigation/server/IrrigationServer.java irrigation/trunk/src/edu/asu/csid/irrigation/server/ServerDataModel.java irrigation/trunk/test/ irrigation/trunk/test/edu/ irrigation/trunk/test/edu/asu/ irrigation/trunk/test/edu/asu/csid/ irrigation/trunk/test/edu/asu/csid/irrigation/ irrigation/trunk/test/edu/asu/csid/irrigation/conf/ irrigation/trunk/test/edu/asu/csid/irrigation/conf/ServerConfigurationTester.java irrigation/trunk/test/edu/asu/csid/irrigation/server/ irrigation/trunk/test/edu/asu/csid/irrigation/server/IrrigationPersisterTestCase.java irrigation/trunk/test/edu/asu/csid/irrigation/server/TestGroupModel.java irrigation/trunk/test/edu/asu/csid/irrigation/server/TestModel.java irrigation/trunk/webstart/ irrigation/trunk/webstart/client.jnlp irrigation/trunk/webstart/facilitator.jnlp irrigation/trunk/webstart/index.html Added: irrigation/trunk/build.xml =================================================================== --- irrigation/trunk/build.xml (rev 0) +++ irrigation/trunk/build.xml 2009-04-29 21:35:43 UTC (rev 136) @@ -0,0 +1,206 @@ +<!-- $Id: build.xml,v 1.55 2005/12/27 01:09:42 wayward_bruce Exp $ + vim:sts=2:sw=2: + --> +<project name="irrigation" default="build-all" basedir="."> + <!-- Load all properties from the build.properties file, + then try to define defaults for all the properties. + The property definitions in the build.properties file + will have precedence. + --> + <property file="build.properties" /> + <!-- default properties --> + <property name="src.dir" value="src"/> + <property name="build.dir" value="build"/> + <property name="lib.dir" value="lib"/> + <property name='dist.dir' value='target'/> + +<!-- Defaults: [Tools and external scripts Configuration] --> + <property name='tools' value='tools' /> + + <!-- test repository properties --> + <property name="test.src.dir" value="test"/> + <property name="test.build.dir" value="build/test"/> + <property name="test.results.dir" value="test-results" /> + + <property name="javadoc.dir" value="docs/javadoc"/> + <property name="javadoc.private.dir" value="docs/private"/> + <property name="dist.jarfile" value="${ant.project.name}.jar"/> + <property name="client.dist.jarfile" value="client.jar"/> + <!-- Set up the CLASSPATH, includes all jars in the lib + directory and all built files for both the main project + and the tests --> + <path id="project.classpath"> + <pathelement location="." /> + <fileset dir="${lib.dir}"> + <include name="**/*.jar" /> + </fileset> + <pathelement location="${build.dir}" /> + <pathelement location="${test.build.dir}" /> + </path> + + <target name='build-all' depends='clean, client-jar, facilitator-jar, server-jar'/> + <!-- deploys the client jar to the appropriate webapps directory. --> + + <target name='deploy' depends='build-all'> + <copy file='client.jar' todir='/var/www/html/irrigation'/> + <copy file='facilitator.jar' todir='/var/www/html/irrigation'/> + <chmod file='/var/www/html/irrigation/client.jar' perm='664'/> + <chmod file='/var/www/html/irrigation/facilitator.jar' perm='664'/> + </target> + + <target name='jar' depends='clean, compile'> + <chmod dir='${build.dir}' perm='a+rx' type='dir' includes='**'/> + <chmod dir='${build.dir}' perm='a+r' type='file' includes='**'/> + <jar destfile='${dist.jarfile}'> + <fileset dir='${build.dir}'> + <exclude name='test/**'/> + </fileset> + </jar> + <chmod file='${dist.jarfile}' perm='664'/> + </target> + + <target name='client-jar' depends='server-jar'> + <antcall target='build-jar'> + <param name='main.class' value='${client.class}'/> + <param name='jar.name' value='client.jar'/> + </antcall> + </target> + + <target name='facilitator-jar' depends='client-jar'> + <antcall target='build-jar'> + <param name='main.class' value='${facilitator.class}'/> + <param name='jar.name' value='facilitator.jar'/> + </antcall> + </target> + + + <target name='server-jar' depends='compile'> + <antcall target='build-jar'> + <param name='main.class' value='${server.class}'/> + <param name='jar.name' value='server.jar'/> + </antcall> + </target> + + <target name='build-jar'> + <manifestclasspath property='manifest.classpath' jarfile='${jar.name}'> + <classpath refid='project.classpath'/> + </manifestclasspath> + <chmod dir='${build.dir}' perm='a+rx' type='dir' includes='**'/> + <chmod dir='${build.dir}' perm='a+r' type='file' includes='**'/> + <manifest file='manifest.mf'> + <attribute name="Main-Class" value="${main.class}"/> + <attribute name='Class-Path' value='${manifest.classpath}'/> + </manifest> + <jar destfile='${jar.name}' manifest='manifest.mf'> + <fileset dir='${build.dir}'> + <exclude name='test/**'/> + </fileset> + </jar> + <chmod file='${jar.name}' perm='664'/> + </target> + + + <property name='client.class' value='edu.asu.csid.irrigation.client.IrrigationClient'/> + <property name='facilitator.class' value='edu.asu.csid.irrigation.facilitator.IrrigationFacilitator'/> + <property name='server.class' value='edu.asu.csid.irrigation.server.IrrigationServer'/> + + <!-- Prepare for a build by creating appropriate directories --> + <target name="prepare"> + <mkdir dir="${build.dir}"/> + <mkdir dir="${test.build.dir}"/> + </target> + + <!-- Clean up build by deleting directories --> + <target name="clean"> + <delete dir="${build.dir}" includes='**/*' includeemptydirs='true'/> + <delete dir="${test.build.dir}"/> + <delete file='${dist.jarfile}'/> + </target> + + <!-- Compile project source files --> + <target name='compile' depends="prepare"> + <javac srcdir="${src.dir}" + destdir="${build.dir}" + debug="on" + optimize="off" + deprecation="on" + source="1.5" + > + <compilerarg value='-Xlint:unchecked'/> + <classpath refid="project.classpath" /> + </javac> + <copy todir='${build.dir}/conf'> + <fileset dir='conf'/> + </copy> + <copy todir='${build.dir}/images'> + <fileset dir='images'/> + </copy> + </target> + + <target name='profile' depends='test'> + <java jar='${project.profiler}' classpathref='project.classpath' fork='true'> + <arg value='${hprof.file}'/> + </java> + <!-- do something like java -jar PerfAnal.jar <hprof.txt> --> + </target> + + <!-- Build project documentation --> + <target name="docs"> + <echo level='error' message='running docs website.deploy.dir="${website.deploy.dir}"' /> + <javadoc sourcepath="${src.dir}" + destdir="${javadoc.dir}" + packagenames="*" + source="1.5" + link="http://java.sun.com/j2se/1.5.0/docs/api/" + overview="${src.dir}/overview.html" /> + </target> + + <!-- Build private-level documentation --> + <target name="private-docs"> + <javadoc sourcepath="${src.dir}" + destdir="${javadoc.private.dir}" + packagenames="*" + link="http://java.sun.com/j2se/1.4/docs/api/" + source="1.4" + access="private"/> + </target> + + <!-- Compile Tests --> + <target name="compile-tests" depends="compile"> + <javac srcdir="${test.src.dir}" + destdir="${test.build.dir}" + source="1.5" + debug="on"> + <!-- <compilerarg value='-Xlint:unchecked'/> --> + <classpath refid="project.classpath" /> + </javac> + </target> + + <!-- Run Tests --> + <target name="test" depends="compile-tests"> + <delete dir="${test.results.dir}"/> + <mkdir dir="${test.results.dir}"/> + <junit fork="yes" haltonfailure="yes" printsummary="yes"> + <classpath refid="project.classpath" /> + <batchtest todir="${test.results.dir}" > + <formatter usefile="no" type="plain" /> + <formatter type="xml" /> + <fileset dir="${test.build.dir}"> + <include name="**/*Tester.class" /> + </fileset> + </batchtest> + </junit> + </target> + + <!-- Run Test on GUI --> + <target name="guitest" depends="compile-tests"> + <java fork="yes" classname="junit.swingui.TestRunner" taskname="JUnit" failonerror="true" dir="${basedir}"> + <jvmarg value="-Djunit.test.path=${test.build.dir}" /> + <sysproperty key="basedir" value="${basedir}" /> + <classpath> + <path refid="project.classpath" /> + </classpath> + </java> + </target> + +</project> Added: irrigation/trunk/conf/irrigation.xml =================================================================== --- irrigation/trunk/conf/irrigation.xml (rev 0) +++ irrigation/trunk/conf/irrigation.xml 2009-04-29 21:35:43 UTC (rev 136) @@ -0,0 +1,612 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"> +<properties> +<comment>Irrigation XML-ized experiment round configuration</comment> + +<!--<entry key="hostname">localhost</entry>--> +<entry key="hostname">sod19.asu.edu</entry> +<entry key="port">16001</entry> +<entry key="round0">round0.xml</entry> +<entry key="round1">round1.xml</entry> +<entry key="round2">round2.xml</entry> +<entry key="round3">round3.xml</entry> +<entry key="round4">round4.xml</entry> +<entry key="round5">round5.xml</entry> +<entry key="round6">round6.xml</entry> +<entry key="round7">round7.xml</entry> +<entry key="round8">round8.xml</entry> +<entry key="round9">round9.xml</entry> +<entry key="round10">round10.xml</entry> +<entry key="round11">round11.xml</entry> +<entry key="round12">round12.xml</entry> +<entry key="round13">round13.xml</entry> +<entry key="round14">round14.xml</entry> +<entry key="round15">round15.xml</entry> +<entry key="round16">round16.xml</entry> +<entry key="round17">round17.xml</entry> +<entry key="round18">round18.xml</entry> +<entry key="round19">round19.xml</entry> +<entry key="round20">round20.xml</entry> +<entry key="round21">round21.xml</entry> + + +<entry key="wait-for-participants">true</entry> +<entry key="number-of-rounds">22</entry> + +<entry key="undisrupted-bandwidth">true</entry> + +<entry key="q1">4</entry> +<entry key="q2">identity</entry> +<entry key="q3">5</entry> +<entry key="q4">35</entry> +<entry key="q5">4</entry> +<entry key="q6">5</entry> +<entry key="q7">25</entry> +<entry key="q8">4</entry> +<entry key="q9">25</entry> +<entry key="q10">30</entry> +<entry key="q11">1.50</entry> + + +<entry key="facilitator-instructions"> +<![CDATA[ +<h3>Facilitator Instructions</h3> +<p> +Welcome to the facilitator interface. This interface allows you to control +the experiment. You may only modify configuration parameters <b>before</b> +you start the experiment by selecting the Configuration menu. When all the +participants are ready to begin the experiment, you can start the experiment +by selecting Experiment -> Start. After a round has been completed you +will be able to view the statistics for all of the participants. You can +begin the next round by selecting Round -> Start. +</p> +]]> +</entry> + + + +<entry key="general-instructions0"> +<![CDATA[ +<center><h3>Welcome to the Computer Assisted Research Laboratory. Please do not close this window or open any other applications.</h3></center> +]]> +</entry> + +<entry key="general-instructions1"> +<![CDATA[ +<h3>General Instructions</h3> +<p>Welcome. You have already earned 5 dollars by showing up for this exercise. +You can earn more, up to an extra 25 dollars, by participating in the exercise +which will last for about one hour. You will participate in this exercise as a +part of a group. Each group has five participants. Your group has been formed +by randomly assigning you to FOUR other participants in the room. The amount +of money you earn will depend on the decisions made by you and the rest of the +group. That is, your earnings will depend on your decisions as well as the +other members of your group. +</p> +<p> +This exercise mimics decisions people make in irrigation systems. In each round you +will receive 10 tokens which you can choose to keep or invest in the irrigation +infrastructure (for example canals and water diversion structures). Depending on the +state of repair of the irrigation infrastructure, it will be capable of directing +water to your field when you use your water diversion structure (called an +irrigation gate). Depending on the amount of water you can get to your field, you +can grow crops. Depending on the number of crops you grow you earn tokens. Each +token is worth 10 cents and you will be paid cash in private at the end of the +experiment based on the number of tokens you earned. +</p> +<p> +The experiment consists of a number of rounds. In each round you will first make a +decision as to how much to invest in the irrigation infrastructure. Without periodic +investment, the irrigation infrastructure will break down over time. Based on the +combined contributions of all 5 participants in your group in each round, as +explained below, your group can maintain the performance of the irrigation +infrastructure. The condition of the irrigation infrastructure determines +its capacity to deliver water which you can use to grow crops. +</p> +]]> +</entry> + +<entry key="general-instructionsq1"> +<![CDATA[ +<br><br> +To go to the next page, please answer the following question:<br> +<form> +How many OTHER people in the room will be in your group?<br> +<input type="radio" name="q1" value="0">0<br> +<input type="radio" name="q1" value="1">1<br> +<input type="radio" name="q1" value="4">4<br> +<input type="radio" name="q1" value="Everybody">Everybody<br> +<br><br> +<input type="submit" name="submit" value="Submit"> +</form> +]]> +</entry> + +<entry key="general-instructions2"> +<![CDATA[ +<h3>Chat</h3> +<p>Each round will start with a chat period of 40 seconds. During this chat with the other participants, +you can send text messages. You may communicate about any aspect of the exercise. However, you are not +allowed to promise the other participants side-payments or threaten them with any consequence after the +experiment is finished. You are also not allowed to reveal your real identity. We are monitoring the chat +traffic while you chat. If we notice that a group is in violation of the rules, we +will remove that group from the room until the exercise with the other groups is +finished.<br><br> + +You will see a text box appear on your screen when a chat period starts. The time +left in the chat period will be shown at the top left of the screen.<br> +]]> +</entry> + +<entry key="general-instructionsq2"> +<![CDATA[ +<br><br> +To go to the next page, please answer the following question:<br> +<form> +What topic can you NOT chat about?<br> +<input type="radio" name="q2" value="weather">the weather<br> +<input type="radio" name="q2" value="identity">your real identity<br> +<input type="radio" name="q2" value="experiment">the experiment<br> +<input type="radio" name="q2" value="earnings">what we will do with our earnings from the experiment<br> +<br><br> +<input type="submit" name="submit" value="Submit"> +</form> +]]> +</entry> + +<entry key="general-instructions3"> +<![CDATA[ +<h3>Creating Irrigation Infrastructure</h3> +<p> +At the beginning of each round, each participant will be given 10 tokens. You must +then decide what to do with these tokens. You may decide to invest in the irrigation +infrastructure or to keep the tokens. For example, if you keep the tokens, you will +earn at a minimum of 10 tokens X 5 cents = $0.50 for each round or $10 for the +twenty rounds. Your total earnings for participating in the experiment would be $10 +plus your show-up fee of $5 which is $15. On the other hand, if you invest some +tokens in the irrigation infrastructure, you may be able to earn more than this +amount by growing crops. If the irrigation system has a capacity near the maximum +you can grow up to 5 crops and earn $1.5 in each round. Thus by growing crops you +can roughly triple your earnings compared to doing nothing. The actual earnings depend +on what you and the other participants in the experiment do. +</p> +<p> +In each round the condition of the irrigation system declines such that its water +delivery efficiency drops by 25%. Investment is necessary to keep the irrigation +infrastructure from deteriorating. If you decide to invest in irrigation +infrastructure, you must decide on the amount, as you will need a certain level of +irrigation infrastructure before you can grow crops. The investment of all five +participants is added together and will amount to between 0 and 50 tokens. Each +token invested will increase the efficiency of the system by one by one percentage +point up to a maximum of 100% (e.g. if the system efficiency is 80% it would not +make sense for the group to invest 50 tokens. It is only sensible for the group to +invest up to 20 tokens). In the table below you will see the water delivery capacity +measured in water units per second as a function of condition of the irrigation +infrastructure. When the infrastructure is at 100% efficiency, 40 cubic feet per +second will be available. If system efficiency falls below 45%, no capacity for +transporting water will be available. +</p> +<p> +For example, if the remaining efficiency from the previous round is 40% and all five +players invest 7 tokens each, the total efficiency increases to 75% (40% + 35%) and +the total capacity will be 35 cubic feet per second (second to last row in Table 1), +which will enable participants to grow between 3 and 5 crops, depending on the +actions of each participant which will yield between 22 and 30 tokens ($1.1 or $1.5) +in a round (which is higher than $0.5 if you do not invest at all in the +infrastructure). Before the growing crops part of the exercise starts, each +participant independently makes a decision as to how much to invest in bandwidth. +After everybody has made their decision, the condition of the infrastructure and the +associated total maximum capacity to distribute water that will be available during +the crop growing part of the exercise is announced. +</p> +<p> +Before the crop-growing phase of the exercise starts, each participant +independently makes a decision as to how much to invest in bandwidth. After +everybody has made their decision, the condition of the infrastructure and the +associated total maximum capacity to distribute water that will be available +during the crop-growing phase will be announced. +</p> + +<b>Table 1:</b> The water delivery capacity as a function of the irrigation +infrastructure condition +<table border="1" cellspacing="2" cellpadding="2"> +<thead> +<th>Infrastructure efficiency (percent)</th> +<th>Water delivery (cubic feet per second)</th> +</thead> +<tr> +<td> ≤ 45</td><td>0</td> +</tr> +<tr> +<td>46-51</td><td>5</td> +</tr> +<tr> +<td>52-55</td><td>10</td> +</tr> +<tr> +<td>56-58</td><td>15</td> +</tr> +<tr> +<td>59-61</td><td>20</td> +</tr> +<tr> +<td>62-65</td><td>25</td> +</tr> +<tr> +<td>66-70</td><td>30</td> +</tr> +<tr> +<td>71-80</td><td>35</td> +</tr> +<tr> +<td>81-100</td><td>40</td> +</tr> +</table> + +]]> +</entry> + +<entry key="general-instructionsq3"> +<![CDATA[ +<br><br> +To continue to the next page, please answer the following questions:<br> +<form> +Question 1:<br> +If the existing infrastructure is 20% and the 5 participants invest together an +additional 29 tokens, what is the available water delivery capacity of the +irrigation infrastructure? +<input type="text" name="q3" value = ""> +<br><br> + +Question 2:<br> +Suppose the existing infrastructure is 50% and two participants invest 10 tokens <b>each</b> +while the three other participants invest 2 tokens <b>each</b>. What is the +available water delivery capacity of the irrigation infrastructure? +<br> +<input type="text" name="q4" value = ""> +<br><br> +<input type="submit" name="submit" value="Submit"><br> +<br> +</form> +]]> +</entry> + +<entry key="general-instructions4"> +<![CDATA[ +<h3>Growing crops</h3> +<p>There are FIVE participants, each of which is randomly assigned to one of +the five positions, A, B, C, D or E. Below is a schematic representing the +irrigation system. Water comes from the large box at the left and the five players +are located from upstream (leftmost) to downstream (rightmost) accordingly. To +illustrate, assume you are in position A. The black lines represent "gates" +that you control (i.e, open and close). +<p> +<img src = "http://sod19.asu.edu/irrigation/images/canalScreenShotNew1.JPG"><br><br> +</p> +Each round will take 50 seconds and the amount of time left in the experiment +is indicated at the top of the screen. +<p> +<img src = "http://sod19.asu.edu/irrigation/images/timeRemainingScreenShot.JPG"><br> +</p> +<p> +During this round you can irrigate your field a maximum of 5 times. In order to +successfully irrigate your field your must utilize 100 cubic feet of water. How fast +you can grow a crop solely depends on the amount of water that is available to you. +The maximum flow capacity of the canal shared by A, B, C, D, and E is 40 cubic feet +per second. The maximum capacity that can flow through your gate when it is opened +is 25 cubic feet per second. Thus, if no one else is using the canal, it will take +at least 4 seconds to grow a crop (you are limited by the flow capacity of your +gate). If other people are using the canal, it may take longer (you are limited by +the flow capacity of the shared canal). +</p> +<p> +The water flow capacity available for your field is shown both as a number, and +as a percentage of the maximum available capacity for receiving water. When +less than 100% of your maximum capacity of 25 cfps is available (because others +are using the canal), growing a crop will take more than 4 seconds. For +example, if the available capacity in the canal is 20 cfps, your maximum available +capacity will be 80% of your maximum 25 cfps, and it will take 5 seconds to grow a +crop. +</p> +<p> +<img src = "http://sod19.asu.edu/irrigation/images/availableBandwidthScreenShot1.JPG"> +   +<img src = "http://sod19.asu.edu/irrigation/images/availableBandwidthScreenShot2.JPG"> +<br> +</p> +]]> +</entry> + +<entry key="general-instructionsq4"> +<![CDATA[ +<br><br> +To go to the next page, please answer the following question:<br> +<form> +What is the minimum time to grow a crop when maximum water flow capacity is available?<br> +<input type="radio" name="q5" value="4">4 seconds<br> +<input type="radio" name="q5" value="10">10 seconds<br> +<input type="radio" name="q5" value="25">25 seconds<br> +<input type="radio" name="q5" value="50">50 seconds<br> +<br><br> +<input type="submit" name="submit" value="Submit"> +</form> +]]> +</entry> + + +<entry key="general-instructions5"> +<![CDATA[ +<h3>Positions A,B,C,D and E</h3> +<p> The animation above illustrates how water flows to each player when their gates are opened and closed. When a player opens +their gate, the black line will rotate to a vertical position, allowing water (represented by white balls) to flow to them. +Note that the available bandwidth downstream of a player with an open port is reduced (illustrated by narrowing of the canal). +</p> +<p> +Access to water depends on your position as shown in the window. Water originates +in the box at the upper left part of the screen and travels to the right. Thus, +participant A will have first access to the available water. Water not used by +participant A is then available to be used by participant B. Water not used by +participants A and B is then available for C. Water not used by participants A, B +and C is available for D. Finally, water not used by participants A, B, C and D is +available for E. You can only start growing a crop if you have water available to +your position. If water runs out during the growing period of the crop, the partial +grown crop is lost, and you need to start from scratch again. Water can run out if, +for example, one or more people upstream from your position open their gates. <b>You +can only grow a crop successfully when you have access to water for a number of +seconds without disruptions.</b> +</p> +<p> +Assume that the total irrigation capacity available is 40 cfps. If player A opens +their gate, they will take 25 cfps from the canal, leaving 15 cfps for B and +everyone else downstream. If A does not open the gate however, then a total of 40 +cfps is left for B and everyone else downstream. +</p> +<p> +As another example, suppose that the canal system has been allowed to deteriorate so +that the total irrigation capacity available is 20 cfps. While player A's gate is +open, no water is available for B. If A is NOT using water, 20 cfps is available +for B. +</p> +]]> +</entry> + +<entry key="general-instructionsq5"> +<![CDATA[ +<br><br> +To go to the next page, please answer the following question:<br> +<form> +If the irrigation capacity is 30 cfps and A opens their gate (taking 25 cfps), how much water is available for B?<br> +<input type="radio" name="q6" value="30">30 cfps<br> +<input type="radio" name="q6" value="25">25 cfps<br> +<input type="radio" name="q6" value="15">15 cfps<br> +<input type="radio" name="q6" value="5">5 cfps<br> +<br><br> + +If the irrigation capacity is 25 cfps and A,B,C and D have not opened their gates, how much water is available for E?<br> +<input type="radio" name="q7" value="40">40 cfps<br> +<input type="radio" name="q7" value="25">25 cfps<br> +<input type="radio" name="q7" value="15">15 cfps<br> +<input type="radio" name="q7" value="0">0 cfps<br> +<br><br> +<input type="submit" name="submit" value="Submit"> +<br><br> + +</form> +]]> +</entry> + +<entry key="general-instructions6"> +<![CDATA[ +<h3>How to grow crops</h3> +<p>To start growing crops, click on one of the boxes labeled "Grow this crop".<br> +<p> +<img src = "http://sod19.asu.edu/irrigation/images/fileScreenShotNew.JPG"><br> +</p> +The crop receiving water will turn red. When the crop is successfully grown and +harvested it the box will turn green. If water becomes unavailable for a period of +5 seconds after starting to grow a crop, the crop will be lost and you will have to +click the button again to re-irrigate that crop. +<br> +The percentage of the water needed for the crop at any point in time is indicated by the progress bar <br> +<img src = "http://sod19.asu.edu/irrigation/images/fileProgressBarScreenShot.JPG"><br> +<p> +You cannot grow multiple crops at the same time. +<img src = "http://sod19.asu.edu/irrigation/images/pauseButtonScreenShot.JPG"><br> +</p> +]]> +</entry> + +<entry key="general-instructionsq6"> +<![CDATA[ +<br><br> +To go to the next page, please answer the following question:<br> +<form> +If there are 4 green boxes and one red box, how many crops have you grown and harvested successfully?<br> +<input type="radio" name="q8" value="1">1<br> +<input type="radio" name="q8" value="4">4<br> +<input type="radio" name="q8" value="5">5<br> +<input type="radio" name="q8" value="10">10<br> +<br><br> +<input type="submit" name="submit" value="Submit"> +</form> +]]> +</entry> + +<entry key="general-instructions7"> +<![CDATA[ +<h3>Earnings</h3> +<p>The number of tokens earned in each round depends on how many crops have been grown and harvested in that round. +The earnings reflect the net profit of growing crops, taking into account the costs +of fertilization, labor, and equipment. The first few crops you grow don't generate +any net profit in terms of tokens earned because your costs must be covered first. +You must have grown at last two crops before you cover your fixed costs and begin to +generate tokens as shown in the following graph. +</p> +<br> +<img src = "http://sod19.asu.edu/irrigation/images/fileTokenGraphScreenShot.JPG"><br> +<p> +The amount of tokens earned by growing crops files can also be represented as the following table. +</p> +<table border="1" cellspacing="2" cellpadding="2"> +<tr> + <td>Number of crops grown</td> + <td>0</td> + <td>1</td> + <td>2</td> + <td>3</td> + <td>4</td> + <td>5</td> +</tr> +<tr> + <td>Tokens earned</td> + <td>0</td> + <td>0</td> + <td>6</td> + <td>22</td> + <td>28</td> + <td>30</td> +</tr> +</table> +Your earnings at the end of the round depend on your investment and the number of crops grown. +Recall that you get 10 tokens to start with. Suppose you invest 6 tokens in the irrigation +infrastructure and you grow 4 crops. You would have earned 28 tokens from your +crops, added to your leftover tokens, i.e., 28 + (10-6) = 32 tokens. Each token is +worth 5 cents, translating to an actual dollar amount of $1.60.<br> +]]> +</entry> + + +<entry key="general-instructionsq7"> +<![CDATA[ +<br><br> +To go to the next page, please answer the following question:<br> +<form> +If you invest 7 tokens out of the 10 tokens you start with, and you grow 3 crops, how many total tokens would you have earned that round? +<br> +<input type="radio" name="q9" value="3">3<br> +<input type="radio" name="q9" value="7">7<br> +<input type="radio" name="q9" value="22">22<br> +<input type="radio" name="q9" value="25">25<br> +<br><br> + +If you invest 10 tokens out of the 10 tokens you start with, and you grow 5 crops, how many total tokens would you have earned that round? +<br> +<input type="radio" name="q10" value="10">10<br> +<input type="radio" name="q10" value="20">20<br> +<input type="radio" name="q10" value="25">25<br> +<input type="radio" name="q10" value="30">30<br> +<br><br> +<input type="submit" name="submit" value="Submit"> +<br><br> +</form> +]]> +</entry> + +<entry key="general-instructions8"> +<![CDATA[ +<h3>Scores</h3> +<p>The total number of tokens collected during the experiment is shown as:<br> +<p> +<img src = "http://sod19.asu.edu/irrigation/images/tokensCollectedScreenShot.JPG"><br> +</p> +This is the total of tokens not invested in irrigation infrastructure plus the +additional tokens you've earned by growing crops<br> +You can see the scores of the other participants summarized on the screen. You can +also see the percentage of each player's water being used at any given moment, +as illustrated in the figure below. +<p> +<img src = "http://sod19.asu.edu/irrigation/images/scoreScreenShotNew.JPG"><br> +</p> +]]> +</entry> + +<entry key="general-instructionsq8"> +<![CDATA[ +<br><br> +To go to the next page, please answer the following question:<br> +<form> +Each token is worth 5 cents. If you collected 30 tokens in a round you would have earned:<br> +<input type="radio" name="q11" value="0.15">0.15<br> +<input type="radio" name="q11" value="0.50">0.50<br> +<input type="radio" name="q11" value="1.50">1.50<br> +<input type="radio" name="q11" value="2.50">2.50<br> +<br><br> +<input type="submit" name="submit" value="Submit"> +</form> +]]> +</entry> + +<entry key="general-instructionsq9"> +<![CDATA[ +We will now start with two practice rounds. This practice round will not contribute to your earnings – +it is intended to acquaint you with the functioning of the exercise environment.<br><br> + +If you have any questions feel free to raise your hand and to ask your question. +<b>Do you have any questions so far?</b> +]]> +</entry> + +<entry key="general-instructions-undisruptedBandwidth"> +<![CDATA[ +<br> +You can only start downloading a file if you have bandwidth available at your position. If the bandwidth connection +is broken during the downloading of a file, the downloaded part of the file is lost, and you need to start from scratch +again to download this file. The bandwidth connection can be broken if, for example, one or more people to the left of +your position starts downloading files, using up the all available bandwidth. Only when you have continuous access to +bandwidth without disruptions for a length of time sufficient to download an entire file can you download a file +successfully. +]]> +</entry> + + +<entry key="general-instructions11"> +<![CDATA[ +<h3>Invest tokens in the irrigation infrastructure</h3> +<p> +You have 10 tokens to invest. You must make a decision about how much you wish to +invest [0,10] in the irrigation infrastructure. As a reminder we have included the +table relating irrigation infrastructure and the total available flow capacity in +the figure below. After you have entered the number of tokens you'd like to invest, +hit the enter key or click the submit button to confirm your investment. When +everybody has made their decision, the total investment will be calculated and the +overall irrigation infrastructure will be displayed. Each token you invest +corresponds to one percent of infrastructure efficiency, so if you invest 10 tokens +you are contributing 10% to the overall infrastructure efficiency. +</p> +<table border="1" cellspacing="2" cellpadding="2"> +<thead> +<th>Total Infrastructure Efficiency (percent)</th> +<th>Water delivery (cubic feet per second)</th> +</thead> +<tr> +<td> ≤ 45</td><td>0</td> +</tr> +<tr> +<td>46-51</td><td>5</td> +</tr> +<tr> +<td>52-55</td><td>10</td> +</tr> +<tr> +<td>56-58</td><td>15</td> +</tr> +<tr> +<td>59-61</td><td>20</td> +</tr> +<tr> +<td>62-65</td><td>25</td> +</tr> +<tr> +<td>66-70</td><td>30</td> +</tr> +<tr> +<td>71-80</td><td>35</td> +</tr> +<tr> +<td>81-100</td><td>40</td> +</tr> +</table> +]]> +</entry> + +</properties> Added: irrigation/trunk/conf/round0.xml =================================================================== --- irrigation/trunk/conf/round0.xml (rev 0) +++ irrigation/trunk/conf/round0.xml 2009-04-29 21:35:43 UTC (rev 136) @@ -0,0 +1,50 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"> +<properties> +<comment>Costly Sanctioning XML-ized experiment round configuration</comment> +<entry key="round-time">100</entry> +<entry key='max-canal-flow-capacity'>40</entry> +<entry key="Bs">60</entry> +<entry key="Bt">40</entry> +<entry key='max-client-flow-capacity'>25</entry> +<entry key="Btmax">50</entry> +<entry key="Token-Bandwidth-Mapping">2</entry> +<entry key="FilesDownload-Award-Conversion">2</entry> + +<entry key="max-total-token-contribution">50</entry> + +<entry key="TBM-alpha">40</entry> +<entry key="TBM-a">30</entry> +<entry key="TBM-b">10</entry> +<entry key="practice-round">true</entry> +<entry key="clients-per-group">5</entry> +<entry key="FAM-alpha">20</entry> +<entry key="FAM-a">5</entry> +<entry key="FAM-b">6</entry> + +<entry key="board-width">14</entry> +<entry key="board-height">14</entry> + +<entry key="F1">100</entry> +<entry key="F2">100</entry> +<entry key="F3">100</entry> +<entry key="F4">100</entry> +<entry key="F5">100</entry> +<entry key="F6">100</entry> +<entry key="F7">100</entry> +<entry key="F8">100</entry> +<entry key="F9">100</entry> +<entry key="F10">100</entry> + +<entry key="instructions"> +<![CDATA[ +<p> +We will now start with two practice rounds. This practice round will not contribute to your earnings – +it is intended to acquaint you with the functioning of the exercise environment.<br> +If you have any questions feel free to raise your hand and to ask your question.<br> +<b>Do you have any questions so far?</b> +</p> + +]]> +</entry> +</properties> Added: irrigation/trunk/conf/round1.xml =================================================================== --- irrigation/trunk/conf/round1.xml (rev 0) +++ irrigation/trunk/conf/round1.xml 2009-04-29 21:35:43 UTC (rev 136) @@ -0,0 +1,49 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"> +<properties> +<comment>Costly Sanctioning XML-ized experiment round configuration</comment> +<entry key="round-time">100</entry> +<entry key="Bs">60</entry> +<entry key="Bt">40</entry> +<entry key="Btmax">50</entry> +<entry key="Token-Bandwidth-Mapping">2</entry> +<entry key="FilesDownload-Award-Conversion">2</entry> +<entry key="TBM-alpha">40</entry> +<entry key="TBM-a">30</entry> +<entry key="TBM-b">10</entry> +<entry key="max-total-token-contribution">50</entry> +<entry key="practice-round">true</entry> +<entry key="clients-per-group">5</entry> +<entry key="second-practice-round">true</entry> + +<entry key="FAM-alpha">20</entry> +<entry key="FAM-a">5</entry> +<entry key="FAM-b">6</entry> + +<entry key="board-width">14</entry> +<entry key="board-height">14</entry> + +<entry key="F1">100</entry> +<entry key="F2">100</entry> +<entry key="F3">100</entry> +<entry key="F4">100</entry> +<entry key="F5">100</entry> +<entry key="F6">100</entry> +<entry key="F7">100</entry> +<entry key="F8">100</entry> +<entry key="F9">100</entry> +<entry key="F10">100</entry> + + + +<entry key="instructions"> +<![CDATA[ +<h3>Practice Round 2</h3> +<p> +This is the second practice round of the experiment. If you have any questions +after participating in the first round, please ask them now. +</p> +]]> +</entry> +</properties> + Added: irrigation/trunk/conf/round10.xml =================================================================== --- irrigation/trunk/conf/round10.xml (rev 0) +++ irrigation/trunk/conf/round10.xml 2009-04-29 21:35:43 UTC (rev 136) @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"> +<properties> +<comment>Costly Sanctioning XML-ized experiment round configuration</comment> +<entry key="round-time">100</entry> +<entry key="Bs">60</entry> +<entry key="Bt">40</entry> +<entry key="Btmax">50</entry> +<entry key="Token-Bandwidth-Mapping">2</entry> +<entry key="FilesDownload-Award-Conversion">2</entry> +<entry key="TBM-alpha">40</entry> +<entry key="TBM-a">30</entry> +<entry key="TBM-b">10</entry> +<entry key="max-total-token-contribution">50</entry> +<entry key="practice-round">false</entry> +<entry key="clients-per-group">5</entry> +<entry key="FAM-alpha">20</entry> +<entry key="FAM-a">5</entry> +<entry key="FAM-b">6</entry> + +<entry key="board-width">14</entry> +<entry key="board-height">14</entry> + +<entry key="F1">100</entry> +<entry key="F2">100</entry> +<entry key="F3">100</entry> +<entry key="F4">100</entry> +<entry key="F5">100</entry> +<entry key="F6">100</entry> +<entry key="F7">100</entry> +<entry key="F8">100</entry> +<entry key="F9">100</entry> +<entry key="F10">100</entry> + + + +<entry key="instructions"> +<![CDATA[ +<h3>Round 9 Instructions</h3> +<p> +This round is the same as the previous round, but the infrastructure irrigation has +been decreased by 25%. +</p> +]]> +</entry> +</properties> Added: irrigation/trunk/conf/round11.xml =================================================================== --- irrigation/trunk/conf/round11.xml (rev 0) +++ irrigation/trunk/conf/round11.xml 2009-04-29 21:35:43 UTC (rev 136) @@ -0,0 +1,47 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"> +<properties> +<comment>Costly Sanctioning XML-ized experiment round configuration</comment> +<entry key="round-time">100</entry> +<entry key="Bs">60</entry> +<entry key="Bt">40</entry> +<entry key="Btmax">50</entry> +<entry key="Token-Bandwidth-Mapping">2</entry> +<entry key="FilesDownload-Award-Conversion">2</entry> +<entry key="TBM-alpha">40</entry> +<entry key="TBM-a">30</entry> +<entry key="TBM-b">10</entry> +<entry key="max-total-token-contribution">50</entry> +<entry key="practice-round">false</entry> +<entry key="clients-per-group">5</entry> +<entry key="FAM-alpha">20</entry> +<entry key="FAM-a">5</entry> +<entry key="FAM-b">6</entry> + +<entry key="board-width">14</entry> +<entry key="board-height">14</entry> + +<entry key="F1">100</entry> +<entry key="F2">100</entry> +<entry key="F3">100</entry> +<entry key="F4">100</entry> +<entry key="F5">100</entry> +<entry key="F6">100</entry> +<entry key="F7">100</entry> +<entry key="F8">100</entry> +<entry key="F9">100</entry> +<entry key="F10">100</entry> + + + +<entry key="instructions"> +<![CDATA[ +<h3>Round 10 Instructions</h3> +<p> +This round is the same as the previous round, but the infrastructure irrigation has +been decreased by 25%. +</p> + +]]> +</entry> +</properties> Added: irrigation/trunk/conf/round12.xml =================================================================== --- irrigation/trunk/conf/round12.xml (rev 0) +++ irrigation/trunk/conf/round12.xml 2009-04-29 21:35:43 UTC (rev 136) @@ -0,0 +1,60 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"> +<properties> +<comment>Costly Sanctioning XML-ized experiment round configuration</comment> +<entry key="round-time">100</entry> +<entry key="Bs">60</entry> +<entry key="Bt">40</entry> +<entry key="Btmax">50</entry> +<entry key="Token-Bandwidth-Mapping">2</entry> +<entry key="FilesDownload-Award-Conversion">2</entry> +<entry key="TBM-alpha">40</entry> +<entry key="TBM-a">30</entry> +<entry key="TBM-b">10</entry> +<entry key='infrastructure-degradation-factor'>10</entry> +<entry key="practice-round">false</entry> +<entry key="clients-per-group">5</entry> +<entry key="FAM-alpha">20</entry> +<entry key="FAM-a">5</entry> +<entry key="FAM-b">6</entry> + +<entry key="board-width">14</entry> +<entry key="board-height">14</entry> + +<entry key="F1">100</entry> +<entry key="F2">100</entry> +<entry key="F3">100</entry> +<entry key="F4">100</entry> +<entry key="F5">100</entry> +<entry key="F6">100</entry> +<entry key="F7">100</entry> +<entry key="F8">100</entry> +<entry key="F9">100</entry> +<entry key="F10">100</entry> + + + +<entry key="instructions"> +<![CDATA[ +<h3>Round 11 Instructions</h3> +<p> +This is round 11/20. +</p> +<p> +In the past 10 rounds the infrastructure efficiency declined from one round to the +next at a constant rate of 25%. In the following 10 rounds the average decline of +the infrastructure efficiency remains the same, but the amount of decline can vary +from round to round. This means that in some rounds the decline will be larger than 25% +and some rounds the decline will be smaller than 25%. Before each round begins you +will continue to make a decision on how much to invest in the irrigation +infrastructure. After all of your investment contributions have been submitted the +resulting level of infrastructure efficiency will be displayed and then the round +will begin. If you have any questions, please ask them now. +</p> + +The infrastructure has been degraded by 10%. +</p> + +]]> +</entry> +</properties> Added: irrigation/trunk/conf/round13.xml =================================================================== --- irrigation/trunk/conf/round13.xml (rev 0) +++ irrigation/trunk/conf/round13.xml 2009-04-29 21:35:43 UTC (rev 136) @@ -0,0 +1,47 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"> +<properties> +<comment>Costly Sanctioning XML-ized experiment round configuration</comment> +<entry key="round-time">100</entry> +<entry key="Bs">60</entry> +<entry key="Bt">40</entry> +<entry key="Btmax">50</entry> +<entry key="Token-Bandwidth-Mapping">2</entry> +<entry key="FilesDownload-Award-Conversion">2</entry> +<entry key="TBM-alpha">40</entry> +<entry key="TBM-a">30</entry> +<entry key="TBM-b">10</entry> +<entry key="max-total-token-contribution">50</entry> +<entry key='infrastructure-degradation-factor'>10</entry> +<entry key="practice-round">false</entry> +<entry key="clients-per-group">5</entry> +<entry key="FAM-alpha">20</entry> +<entry key="FAM-a">5</entry> +<entry key="FAM-b">6</entry> + +<entry key="board-width">14</entry> +<entry key="board-height">14</entry> + +<entry key="F1">100</entry> +<entry key="F2">100</entry> +<entry key="F3">100</entry> +<entry key="F4">100</entry> +<entry key="F5">100</entry> +<entry key="F6">100</entry> +<entry key="F7">100</entry> +<entry key="F8">100</entry> +<entry key="F9">100</entry> +<entry key="F10">100</entry> + + + +<entry key="instructions"> +<![CDATA[ +<h3>Round 12 Instructions</h3> +<p> +This is round 12/20. The infrastructure has been degraded by 10%. +</p> + +]]> +</entry> +</properties> Added: irrigation/trunk/conf/round14.xml =================================================================== --- irrigation/trunk/conf/round14.xml (rev 0) +++ irrigation/trunk/conf/round14.xml 2009-04-29 21:35:43 UTC (rev 136) @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"> +<properties> +<comment>Costly Sanctioning XML-ized experiment round configuration</comment> +<entry key="round-time">100</entry> +<entry key="Bs">60</entry> +<entry key="Bt">40</entry> +<entry key="Btmax">50</entry> +<entry key="Token-Bandwidth-Mapping">2</entry> +<entry key="FilesDownload-Award-Conversion">2</entry> +<entry key="TBM-alpha">40</entry> +<entry key="TBM-a">30</entry> +<entry key="TBM-b">10</entry> +<entry key='infrastructure-degradation-factor'>85</entry> +<entry key="practice-round">false</entry> +<entry key="clients-per-group">5</entry> +<entry key="FAM-alpha">20</entry> +<entry key="FAM-a">5</entry> +<entry key="FAM-b">6</entry> + +<entry key="board-width">14</entry> +<entry key="board-height">14</entry> + +<entry key="F1">100</entry> +<entry key="F2">100</entry> +<entry key="F3">100</entry> +<entry key="F4">100</entry> +<entry key="F5">100</entry> +<entry key="F6">100</entry> +<entry key="F7">100</entry> +<entry key="F8">100</entry> +<entry key="F9">100</entry> +<entry key="F10">100</entry> + + + +<entry key="instructions"> +<![CDATA[ +<h3>Round 13 Instructions</h3> +<p> +This is round 13/20. The infrastructure has suffered a severe shock and has been degraded by 85%. +</p> + +]]> +</entry> +</properties> Added: irrigation/trunk/conf/round15.xml =================================================================== --- irrigation/trunk/conf/round15.xml (rev 0) +++ irrigation/trunk/conf/round15.xml 2009-04-29 21:35:43 UTC (rev 136) @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"> +<properties> +<comment>Costly Sanctioning XML-ized experiment round configuration</comment> +<entry key="round-time">100</entry> +<entry key="Bs">60</entry> +<entry key="Bt">40</entry> +<entry key="Btmax">50</entry> +<entry key="Token-Bandwidth-Mapping">2</entry> +<entry key="FilesDownload-Award-Conversion">2</entry> +<entry key="TBM-alpha">40</entry> +<entry key="TBM-a">30</entry> +<entry key="TBM-b">10</entry> +<entry key='infrastructure-degradation-factor'>10</entry> +<entry key="practice-round">false</entry> +<entry key="clients-per-group">5</entry> +<entry key="FAM-alpha">20</entry> +<entry key="FAM-a">5</entry> +<entry key="FAM-b">6</entry> + +<entry key="board-width">14</entry> +<entry key="board-height">14</entry> + +<entry key="F1">100</entry> +<entry key="F2">100</entry> +<entry key="F3">100</entry> +<entry key="F4">100</entry> +<entry key="F5">100</entry> +<entry key="F6">100</entry> +<entry key="F7">100</entry> +<entry key="F8">100</entry> +<entry key="F9">100</entry> +<entry key="F10">100</entry> + + + +<entry key="instructions"> +<![CDATA[ +<h3>Round 14 Instructions</h3> +<p> +This is round 14/20. The infrastructure has been degraded by 10%. +</p> + +]]> +</entry> +</properties> Added: irrigation/trunk/conf/round16.xml =================================================================== --- irrigation/trunk/conf/round16.xml (rev 0) +++ irrigation/trunk/conf/round16.xml 2009-04-29 21:35:43 UTC (rev 136) @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"> +<properties> +<comment>Costly Sanctioning XML-ized experiment round configuration</comment> +<entry key="round-time">100</entry> +<entry key="Bs">60</entry> +<entry key="Bt">40</entry> +<entry key="Btmax">50</entry> +<entry key="Token-Bandwidth-Mapping">2</entry> +<entry key="FilesDownload-Award-Conversion">2</entry> +<entry key="TBM-alpha">40</entry> +<entry key="TBM-a">30</entry> +<entry key="TBM-b">10</entry> +<entry key='infrastructure-degradation-factor'>10</entry> +<entry key="practice-round">false</entry> +<entry key="clients-per-group">5</entry> +<entry key="FAM-alpha">20</entry> +<entry key="FAM-a">5</entry> +<entry key="FAM-b">6</entry> + +<entry key="board-width">14</entry> +<entry key="board-height">14</entry> + +<entry key="F1">100</entry> +<entry key="F2">100</entry> +<entry key="F3">100</entry> +<entry key="F4">100</entry> +<entry key="F5">100</entry> +<entry key="F6">100</entry> +<entry key="F7">100</entry> +<entry key="F8">100</entry> +<entry key="F9">100</entry> +<entry key="F10">100</entry> + + + +<entry key="instructions"> +<![CDATA[ +<h3>Round 15 Instructions</h3> +<p> +This is round 15/20. The infrastructure has been degraded by 10%. +</p> + +]]> +</entry> +</properties> Added: irrigation/trunk/conf/round17.xml =================================================================== --- irrigation/trunk/conf/round17.xml (rev 0) +++ irrigation/trunk/conf/round17.xml 2009-04-29 21:35:43 UTC (rev 136) @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"> +<properties> +<comment>Costly Sanctioning XML-ized experiment round configuration</comment> +<entry key="round-time">100</entry> +<entry key="Bs">60</entry> +<entry key="Bt">40</entry> +<entry key="Btmax">50</entry> +<entry key="Token-Bandwidth-Mapping">2</entry> +<entry key="FilesDownload-Award-Conversion">2</entry> +<entry key="TBM-alpha">40</entry> +<entry key="TBM-a">30</entry> +<entry key="TBM-b">10</entry> +<entry key='infrastructure-degradation-factor'>10</entry> +<entry key="practice-round">false</entry> +<entry key="clients-per-group">5</entry> +<entry key="FAM-alpha">20</entry> +<entry key="FAM-a">5</entry> +<entry key="FAM-b">6</entry> + +<entry key="board-width">14</entry> +<entry key="board-height">14</entry> + +<entry key="F1">100</entry> +<entry key="F2">100</entry> +<entry key="F3">100</entry> +<entry key="F4">100</entry> +<entry key="F5">100</entry> +<entry key="F6">100</entry> +<entry key="F7">100</entry> +<entry key="F8">100</entry> +<entry key="F9">100</entry> +<entry key="F10">100</entry> + + + +<entry key="instructions"> +<![CDATA[ +<h3>Round 16 Instructions</h3> +<p> +This is round 16/20. The infrastructure has been degraded by 10%. +</p> + +]]> +</entry> +</properties> Added: irrigation/trunk/conf/round18.xml =================================================================== --- irrigation/trunk/conf/round18.xml (rev 0) +++ irrigation/trunk/conf/round18.xml 2009-04-29 21:35:43 UTC (rev 136) @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"> +<properties> +<comment>Costly Sanctioning XML-ized experiment round configuration</comment> +<entry key="round-time">100</entry> +<entry key="Bs">60</entry> +<entry key="Bt">40</entry> +<entry key="Btmax">50</entry> +<entry key="Token-Bandwidth-Mapping">2</entry> +<entry key="FilesDownload-Award-Conversion">2</entry> +<entry key="TBM-alpha">40</entry> +<entry key="TBM-a">30</entry> +<entry key="TBM-b">10</entry> +<entry key='infrastructure-degradation-factor'>85</entry> +<entry key="practice-round">false</entry> +<entry key="clients-per-group">5</entry> +<entry key="FAM-alpha">20</entry> +<entry key="FAM-a">5</entry> +<entry key="FAM-b">6</entry> + +<entry key="board-width">14</entry> +<entry key="board-height">14</entry> + +<entry key="F1">100</entry> +<entry key="F2">100</entry> +<entry key="F3">100</entry> +<entry key="F4">100</entry> +<entry key="F5">100</entry> +<entry key="F6">100</entry> +<entry key="F7">100</entry> +<entry key="F8">100</entry> +<entry key="F9">100</entry> +<entry key="F10">100</entry> + + + +<entry key="instructions"> +<![CDATA[ +<h3>Round 17 Instructions</h3> +<p> +This is round 17/20. The infrastructure has suffered a severe shock and has been degraded by 85%. +</p> + +]]> +</entry> +</properties> Added: irrigation/trunk/conf/round19.xml =================================================================== --- irrigation/trunk/conf/round19.xml (rev 0) +++ irrigation/trunk/conf/round19.xml 2009-04-29 21:35:43 UTC (rev 136) @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"> +<properties> +<comment>Costly Sanctioning XML-ized experiment round configuration</comment> +<entry key="round-time">100</entry> +<entry key="Bs">60</entry> +<entry key="Bt">40</entry> +<entry key="Btmax">50</entry> +<entry key="Token-Bandwidth-Mapping">2</entry> +<entry key="FilesDownload-Award-Conversion">2</entry> +<entry key="TBM-alpha">40</entry> +<entry key="TBM-a">30</entry> +<entry key="TBM-b">10</entry> +<entry key='infrastructure-degradation-factor'>10</entry> +<entry key="practice-round">false</entry> +<entry key="clients-per-group">5</entry> +<entry key="FAM-alpha">20</entry> +<entry key="FAM-a">5</entry> +<entry key="FAM-b">6</entry> + +<entry key="board-width">14</entry> +<entry key="board-height">14</entry> + +<entry key="F1">100</entry> +<entry key="F2">100</entry> +<entry key="F3">100</entry> +<entry key="F4">100</entry> +<entry key="F5">100</entry> +<entry key="F6">100</entry> +<entry key="F7">100</entry> +<entry key="F8">100</entry> +<entry key="F9">100</entry> +<entry key="F10">100</entry> + + + +<entry key="instructions"> +<![CDATA[ +<h3>Round 18 Instructions</h3> +<p> +This is round 18/20. The infrastructure has been degraded by 10%. +</p> + +]]> +</entry> +</properties> Added: irrigation/trunk/conf/round2.xml =================================================================== --- irrigation/trunk/conf/round2.xml (rev 0) +++ irrigation/trunk/conf/round2.xml 2009-04-29 21:35:43 UTC (rev 136) @@ -0,0 +1,50 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"> +<properties> +<comment>Costly Sanctioning XML-ized experiment round configuration</comment> +<entry key="round-time">100</entry> +<entry key="Bs">60</entry> +<entry key="Bt">40</entry> +<entry key="Btmax">50<... [truncated message content] |
From: <al...@us...> - 2009-04-29 21:11:52
|
Revision: 135 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=135&view=rev Author: alllee Date: 2009-04-29 21:11:50 +0000 (Wed, 29 Apr 2009) Log Message: ----------- Adding some more question groups for module 1 block 1. Modified Paths: -------------- mentalmodels/trunk/src/main/db/init-mme.sql mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StudentService.java Modified: mentalmodels/trunk/src/main/db/init-mme.sql =================================================================== --- mentalmodels/trunk/src/main/db/init-mme.sql 2009-04-29 18:23:06 UTC (rev 134) +++ mentalmodels/trunk/src/main/db/init-mme.sql 2009-04-29 21:11:50 UTC (rev 135) @@ -48,7 +48,7 @@ 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 -2.00 US$, you might be interested in finding a strategy that fits your goals well. +$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."); @@ -59,7 +59,7 @@ <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 \xBFfeeling\xBF for the dynamics of the fish population. +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 @@ -87,6 +87,118 @@ experiment you are in, your progress and how you are doing with the time. </p>"); +-- socio demographic data is currently hard-coded +-- insert into question_group(block_id, sequence_no, header, description) values (1, 3, "Personal data", "Please fill out the following fields."); + +insert into question_group(block_id, sequence_no, header, description) +values (1, 5, "How the dynamics of the fish population are modeled", +"<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> +"); + +insert into question_group(block_id, sequence_no, header, description) +values (1, 6, "Differences of bays and effects of fishing", +"<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> +"); + +insert into question_group(block_id, sequence_no, header, description) +values (1, 7, "A warm-up", +"<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> +"); + + insert into question_group(block_id,sequence_no,header,description)values(2,1,"Designing your Strategy", "<p>In what we refer to as a 'strategy' you predefine your decisions of where to go each day of the simulation.\n Al-though only 30 days will be simulated, your Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StudentService.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StudentService.java 2009-04-29 18:23:06 UTC (rev 134) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StudentService.java 2009-04-29 21:11:50 UTC (rev 135) @@ -35,7 +35,7 @@ student.setGender(Gender.valueOf(gender)); student.setMajor(major); save(student); - System.err.println("Student id is: " + student.getId()); + getLogger().debug("Student id is: " + student.getId()); students.add(student); return student.getId(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <al...@us...> - 2009-04-29 18:23:15
|
Revision: 134 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=134&view=rev Author: alllee Date: 2009-04-29 18:23:06 +0000 (Wed, 29 Apr 2009) Log Message: ----------- consecutive mvn jetty:run's will no longer add duplicate entries to the question group table. Modified Paths: -------------- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Block.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/ModuleService.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/QuestionCreatorService.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StudentService.java 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-04-29 03:20:48 UTC (rev 133) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Block.java 2009-04-29 18:23:06 UTC (rev 134) @@ -86,7 +86,7 @@ this.questionGroup = questionGroup; } - public List<QuestionGroup> getQuestionGroup() { + public List<QuestionGroup> getQuestionGroups() { return questionGroup; } 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-04-29 03:20:48 UTC (rev 133) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/ModuleService.java 2009-04-29 18:23:06 UTC (rev 134) @@ -28,7 +28,7 @@ { Block block = iterateBlock.next(); Hibernate.initialize(block); - List<QuestionGroup> questionGroup = block.getQuestionGroup(); + List<QuestionGroup> questionGroup = block.getQuestionGroups(); Iterator<QuestionGroup> iteratorquestion = questionGroup.iterator(); { while(iteratorquestion.hasNext()) Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/QuestionCreatorService.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/QuestionCreatorService.java 2009-04-29 03:20:48 UTC (rev 133) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/QuestionCreatorService.java 2009-04-29 18:23:06 UTC (rev 134) @@ -8,6 +8,7 @@ import edu.asu.commons.mme.dao.HibernateBlockDao; import edu.asu.commons.mme.dao.HibernateQuestionDao; +import edu.asu.commons.mme.entity.Block; import edu.asu.commons.mme.entity.Categorical; import edu.asu.commons.mme.entity.CategoricalOption; import edu.asu.commons.mme.entity.Question; @@ -29,10 +30,18 @@ private HibernateBlockDao blockDao; public void createQuestions() { + // check if we need to recreate these questions. + Block block = blockDao.find(3L); + for (QuestionGroup questionGroup: block.getQuestionGroups()) { + if (questionGroup.getSequenceNo().equals(3)) { + // no need to recreate subject goal question groups. + return; + } + } createSubjectGoalQuestionGroup(); } - - public void createSubjectGoalQuestionGroup() { + + private void createSubjectGoalQuestionGroup() { QuestionGroup subjectGoalQuestionGroup = new QuestionGroup(); subjectGoalQuestionGroup.setHeader("<b>What goals did you follow when designing your strategy?</b>"); subjectGoalQuestionGroup.setDescription("<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>" + Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StudentService.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StudentService.java 2009-04-29 03:20:48 UTC (rev 133) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StudentService.java 2009-04-29 18:23:06 UTC (rev 134) @@ -7,7 +7,6 @@ import edu.asu.commons.mme.dao.HibernateStudentDao; import edu.asu.commons.mme.entity.Gender; -import edu.asu.commons.mme.entity.Group; import edu.asu.commons.mme.entity.Student; /** @@ -23,39 +22,22 @@ public class StudentService extends Service.Base<Student, HibernateStudentDao> { private List<Student> students = new ArrayList<Student>(); - Group newgroup; - - private static Integer groupNo; - private static Integer studentNo; - - public Long createStudent(Integer birthYear, String semester,String gender,String major) - { - - System.out.println("Birthyear " + birthYear); - System.out.println("Ethnicity " + semester); - System.out.println("Gender " + gender); - System.out.println("Major " + major); - + public Long createStudent(Integer birthYear, String semester,String gender,String major) { +// System.out.println("Birthyear " + birthYear); +// System.out.println("Ethnicity " + semester); +// System.out.println("Gender " + gender); +// System.out.println("Major " + major); Student student = new Student(); student.setBirthYear(birthYear); student.setSemester(semester); student.setGender(Gender.valueOf(gender)); student.setMajor(major); - save(student); - System.err.println("Student id is: " + student.getId()); - students.add(student); - return student.getId(); - } - - - - } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <al...@us...> - 2009-04-29 03:20:58
|
Revision: 133 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=133&view=rev Author: alllee Date: 2009-04-29 03:20:48 +0000 (Wed, 29 Apr 2009) Log Message: ----------- Adding StartupService hook service that can be utilized to initialize database entities. This is needed because the entire ApplicationContext must be initialized before we can start using the Transactional methods in the service layer. QuestionCreatorService is the first cut at programmatically creating questions / blocks / etc. The basic process is as follows: 1. Run mvn -P ant -D target=initialize-data to initialize the DB 2. Running mvn jetty:run will then invoke the QuestionCreatorService each time. Note that running mvn jetty:run multiple times will generate duplicate entries.. I'll commit a patch soon to address this. Modified Paths: -------------- mentalmodels/trunk/src/main/db/init-mme.sql mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Categorical.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/CategoricalOption.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Question.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/QuestionGroup.java mentalmodels/trunk/src/main/webapp/WEB-INF/applicationContext.xml Added Paths: ----------- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/dao/HibernateBlockDao.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/dao/HibernateQuestionDao.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/BlockService.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/QuestionCreatorService.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-04-29 02:33:55 UTC (rev 132) +++ mentalmodels/trunk/src/main/db/init-mme.sql 2009-04-29 03:20:48 UTC (rev 133) @@ -42,46 +42,90 @@ insert into block(description, sequence_no, duration,module_id) values("Final data gathering",1,2,4); insert into block(description, sequence_no, duration,module_id) values("Debriefing",2,2,4); - - insert into question_group(block_id,sequence_no,header,description)values(1,1,"Welcome to the E-Fishery Experiment", -"In this experiment you will design a strategy to fish an abstract fishing ground together with three other persons. As we are mainly interested in the reasons why you choose a certain strategy, we will ask you a number of questions. For the same reason, there are no \x91correct\x92 or \x91wrong\x92 strategies and no \x91correct\x92 or \x91wrong\x92 answers. However, since for each pound of fish you get during the experiment you will receive #.### US$, you might be interested in finding a strategy that fits your goals well. For this, you have to understand the dynamics of the (simulated) fish population and anticipate well the behavior of the other persons of your group."); +"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 +2.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."); -insert into question_group(block_id,sequence_no,header,description)values(1,2,"Starting the Experiment", -"Now, you should understand your task and its problems and thus be ready to start the actual experiment.\n Click on 'Accept' to begin with the design of your strategy."); +insert into question_group(block_id, sequence_no, header, description) values (1, 2, +"Experimental procedure", +"<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 \xBFfeeling\xBF 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>"); insert into question_group(block_id,sequence_no,header,description)values(2,1,"Designing your Strategy", -"<p>In what we refer to as a 'strategy' you predefine your decisions of where to go each day of the simulation.\n -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.\n - 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> -"); +"<p>In what we refer to as a 'strategy' you predefine your decisions of where to go +each day of the simulation.\n 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.\n 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> "); insert into question_group(block_id,sequence_no,header,description)values(2,2,"Some special features of the strategy design", -"<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>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. +<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> -"); +You have to think about what would be the best solution for you and express it with +the options explained above.</p> "); insert into question_group(block_id,sequence_no,header,description)values(2,3,"Design your strategy", @@ -90,3 +134,4 @@ refer to the information window 'Help for strategy design'. When you are done, click on <b>'Next'</b>. Your strategy will then be checked for some common or logical errors. </p>"); + Added: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/dao/HibernateBlockDao.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/dao/HibernateBlockDao.java (rev 0) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/dao/HibernateBlockDao.java 2009-04-29 03:20:48 UTC (rev 133) @@ -0,0 +1,21 @@ +package edu.asu.commons.mme.dao; + + +import edu.asu.commons.mme.entity.Block; + +/** + * $Id$ + * + * Provides hibernate DAO functionality for persistent Questions. + * + * + * @author <a href='mailto:All...@as...'>Allen Lee</a> + * @version $Rev$ + */ +public class HibernateBlockDao extends HibernateDao<Block> { + + public HibernateBlockDao() { + super(Block.class); + } + +} Added: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/dao/HibernateQuestionDao.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/dao/HibernateQuestionDao.java (rev 0) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/dao/HibernateQuestionDao.java 2009-04-29 03:20:48 UTC (rev 133) @@ -0,0 +1,21 @@ +package edu.asu.commons.mme.dao; + + +import edu.asu.commons.mme.entity.Question; + +/** + * $Id$ + * + * Provides hibernate DAO functionality for persistent Questions. + * + * + * @author <a href='mailto:All...@as...'>Allen Lee</a> + * @version $Rev$ + */ +public class HibernateQuestionDao extends HibernateDao<Question> { + + public HibernateQuestionDao() { + super(Question.class); + } + +} Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Categorical.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Categorical.java 2009-04-29 02:33:55 UTC (rev 132) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Categorical.java 2009-04-29 03:20:48 UTC (rev 133) @@ -3,8 +3,11 @@ import java.util.List; +import javax.persistence.CascadeType; import javax.persistence.Entity; -import javax.persistence.OneToMany; +import javax.persistence.JoinColumn; +import javax.persistence.JoinTable; +import javax.persistence.ManyToMany; import javax.persistence.Table; @@ -14,15 +17,17 @@ private static final long serialVersionUID = 5399081841291536902L; - @OneToMany(mappedBy="categorical") - private List<CategoricalOption> choices; + @ManyToMany(cascade=CascadeType.ALL) + @JoinTable(name="categorical_options_pivot", + inverseJoinColumns={@JoinColumn(name="categorical_option_id")}) + private List<CategoricalOption> categoricalOptions; - public void setChoices(List<CategoricalOption> choices) { - this.choices = choices; + public void setCategoricalOptions(List<CategoricalOption> categoricalOptions) { + this.categoricalOptions = categoricalOptions; } - public List<CategoricalOption> getChoices() { - return choices; + public List<CategoricalOption> getCategoricalOptions() { + return categoricalOptions; } } Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/CategoricalOption.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/CategoricalOption.java 2009-04-29 02:33:55 UTC (rev 132) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/CategoricalOption.java 2009-04-29 03:20:48 UTC (rev 133) @@ -5,7 +5,6 @@ import javax.persistence.Column; import javax.persistence.Entity; -import javax.persistence.ManyToOne; import javax.persistence.Table; import org.hibernate.annotations.CollectionOfElements; @@ -20,10 +19,6 @@ @CollectionOfElements private List<String> choices = new ArrayList<String>(); - @ManyToOne - private Categorical categorical; - - public String getOptionKey() { return optionKey; } @@ -40,12 +35,4 @@ this.choices = choices; } - public Categorical getCategorical() { - return categorical; - } - - public void setCategorical(Categorical categorical) { - this.categorical = categorical; - } - } Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Question.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Question.java 2009-04-29 02:33:55 UTC (rev 132) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Question.java 2009-04-29 03:20:48 UTC (rev 133) @@ -35,7 +35,7 @@ @Column(name = "sequence_no",nullable=false) private Integer sequenceNo; - + public void setId(Long id) { this.id = id; } Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/QuestionGroup.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/QuestionGroup.java 2009-04-29 02:33:55 UTC (rev 132) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/QuestionGroup.java 2009-04-29 03:20:48 UTC (rev 133) @@ -2,16 +2,16 @@ import java.io.Serializable; +import java.util.ArrayList; import java.util.List; -import java.util.Set; +import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; 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.OrderBy; @@ -32,14 +32,10 @@ @GeneratedValue private Long id; - @OneToMany(mappedBy="questionGroup") + @OneToMany(mappedBy="questionGroup", cascade={CascadeType.ALL}) @OrderBy("sequenceNo") private List<Question> questions; - @ManyToMany(mappedBy = "questionGroup") - @JoinColumn(nullable=false) - private Set<RoundConfig>roundConfig; - @Column(name = "sequence_no",nullable=false) private Integer sequenceNo; @@ -63,6 +59,14 @@ return id; } + public void add(Question question) { + if (questions == null) { + questions = new ArrayList<Question>(); + } + questions.add(question); + question.setQuestionGroup(this); + } + public void setSequenceNo(Integer sequenceNo) { this.sequenceNo = sequenceNo; } @@ -75,12 +79,7 @@ public String getHeader() { return header; } - public void setRoundconfig(Set<RoundConfig> roundconfig) { - this.roundConfig = roundconfig; - } - public Set<RoundConfig> getRoundconfig() { - return roundConfig; - } + public void setDescription(String description) { this.description = description; } Added: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/BlockService.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/BlockService.java (rev 0) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/BlockService.java 2009-04-29 03:20:48 UTC (rev 133) @@ -0,0 +1,13 @@ +package edu.asu.commons.mme.service; + +import org.springframework.transaction.annotation.Transactional; + +import edu.asu.commons.mme.dao.HibernateBlockDao; +import edu.asu.commons.mme.entity.Block; + +@Transactional +public class BlockService extends Service.Base<Block, HibernateBlockDao>{ + + + +} Added: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/QuestionCreatorService.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/QuestionCreatorService.java (rev 0) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/QuestionCreatorService.java 2009-04-29 03:20:48 UTC (rev 133) @@ -0,0 +1,106 @@ +package edu.asu.commons.mme.service; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import org.springframework.transaction.annotation.Transactional; + +import edu.asu.commons.mme.dao.HibernateBlockDao; +import edu.asu.commons.mme.dao.HibernateQuestionDao; +import edu.asu.commons.mme.entity.Categorical; +import edu.asu.commons.mme.entity.CategoricalOption; +import edu.asu.commons.mme.entity.Question; +import edu.asu.commons.mme.entity.QuestionGroup; + + +/** + * + * $Id$ + * + * + * @author <a href='mailto:All...@as...'>Allen Lee</a> + * @version $Rev$ + */ + +@Transactional +public class QuestionCreatorService extends Service.Base<Question, HibernateQuestionDao> { + + private HibernateBlockDao blockDao; + + public void createQuestions() { + createSubjectGoalQuestionGroup(); + } + + public void createSubjectGoalQuestionGroup() { + QuestionGroup subjectGoalQuestionGroup = new QuestionGroup(); + subjectGoalQuestionGroup.setHeader("<b>What goals did you follow when designing your strategy?</b>"); + subjectGoalQuestionGroup.setDescription("<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"); + + subjectGoalQuestionGroup.setBlock(blockDao.find(3L)); + subjectGoalQuestionGroup.setSequenceNo(3); + + List<CategoricalOption> categoricalOptions = new ArrayList<CategoricalOption>(); + // focus on own earnings option + CategoricalOption ownEarningsOption = new CategoricalOption(); + ownEarningsOption.setOptionKey("Focus on own earnings"); + ownEarningsOption.setChoices(Arrays.asList("Earn as much as possible", "Earn more than the others", "Earn about the same as the others", "Earn less than the others", "Earn a fair amount but much less than would be possible", "Earn nothing")); + categoricalOptions.add(ownEarningsOption); + // focus on fish population option + CategoricalOption fishPopulationOption = new CategoricalOption(); + fishPopulationOption.setOptionKey("Focus on fish population"); + fishPopulationOption.setChoices( + Arrays.asList("Let the fish population grow as much as possible", + "Keep the fish population at a high stable level", + "Keep the fish population at a medium stable level", + "Keep the fish population at a low stable level", + "Not to completely destroy the fish population", + "To completely destroy the fish population")); + categoricalOptions.add(fishPopulationOption); + // focus on others option + CategoricalOption othersOption = new CategoricalOption(); + othersOption.setOptionKey("Focus on what the others might do or think"); + othersOption.setChoices( + Arrays.asList("Act similarly to the others", + "Act differently than the others", + "Allow the others to have good earnings", + "Avoid that the others get good earnings", + "Act according to rules I expect the others to know", + "Act against rules I expect the others to know" + )); + categoricalOptions.add(othersOption); + + Categorical mostImportantGoal = new Categorical(); + mostImportantGoal.setCategoricalOptions(categoricalOptions); + mostImportantGoal.setQuestion("Most important goal:"); + mostImportantGoal.setSequenceNo(1); + subjectGoalQuestionGroup.add(mostImportantGoal); + + + Categorical secondMostImportantGoal = new Categorical(); + secondMostImportantGoal.setCategoricalOptions(categoricalOptions); + secondMostImportantGoal.setQuestion("Second most important goal:"); + secondMostImportantGoal.setSequenceNo(2); + subjectGoalQuestionGroup.add(secondMostImportantGoal); +// secondMostImportantGoal.setQuestionGroup(subjectGoalQuestionGroup); + + + Categorical thirdMostImportantGoal = new Categorical(); + thirdMostImportantGoal.setCategoricalOptions(categoricalOptions); + thirdMostImportantGoal.setQuestion("Third most important goal:"); + thirdMostImportantGoal.setSequenceNo(3); + subjectGoalQuestionGroup.add(thirdMostImportantGoal); +// thirdMostImportantGoal.setQuestionGroup(subjectGoalQuestionGroup); +// save(thirdMostImportantGoal); + save(subjectGoalQuestionGroup); + } + + public void setBlockDao(HibernateBlockDao blockDao) { + this.blockDao = blockDao; + } + + + +} Added: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StartupService.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StartupService.java (rev 0) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StartupService.java 2009-04-29 03:20:48 UTC (rev 133) @@ -0,0 +1,28 @@ +package edu.asu.commons.mme.service; + +import org.springframework.context.ApplicationEvent; +import org.springframework.context.ApplicationListener; +import org.springframework.context.event.ContextRefreshedEvent; + +public class StartupService implements ApplicationListener { + + private QuestionCreatorService questionCreatorService; + + private volatile boolean alreadyInitialized; + + @Override + public void onApplicationEvent(ApplicationEvent event) { + if (event instanceof ContextRefreshedEvent && ! alreadyInitialized) { + questionCreatorService.createQuestions(); + alreadyInitialized = true; + } + + } + + public void setQuestionCreatorService(QuestionCreatorService questionCreatorService) { + this.questionCreatorService = questionCreatorService; + } + + + +} Modified: mentalmodels/trunk/src/main/webapp/WEB-INF/applicationContext.xml =================================================================== --- mentalmodels/trunk/src/main/webapp/WEB-INF/applicationContext.xml 2009-04-29 02:33:55 UTC (rev 132) +++ mentalmodels/trunk/src/main/webapp/WEB-INF/applicationContext.xml 2009-04-29 03:20:48 UTC (rev 133) @@ -34,26 +34,40 @@ <property name='sessionFactory' ref='sessionFactory'/> </bean> -<!-- spring managed service layer --> - <bean id='studentService' class='edu.asu.commons.mme.service.StudentService'> - <property name='dao' ref='studentDao'/> + <bean id='moduleDao' class="edu.asu.commons.mme.dao.HibernateModuleDao"> + <property name='sessionFactory' ref='sessionFactory'/> </bean> - -<!-- Expose services for BlazeDS remoting --> - <flex:remote-service ref="studentService" /> + <bean id='blockDao' class='edu.asu.commons.mme.dao.HibernateBlockDao'> + <property name='sessionFactory' ref='sessionFactory'/> + </bean> -<bean id='moduleDao' class="edu.asu.commons.mme.dao.HibernateModuleDao"> + <bean id='questionDao' class='edu.asu.commons.mme.dao.HibernateQuestionDao'> <property name='sessionFactory' ref='sessionFactory'/> </bean> <!-- spring managed service layer --> + <bean id='questionCreatorService' class='edu.asu.commons.mme.service.QuestionCreatorService'> + <property name='dao' ref='questionDao'/> + <property name='blockDao' ref='blockDao'/> + </bean> + + <bean id='startupService' class='edu.asu.commons.mme.service.StartupService'> + <property name='questionCreatorService' ref='questionCreatorService'/> + </bean> + + <bean id='studentService' class='edu.asu.commons.mme.service.StudentService'> + <property name='dao' ref='studentDao'/> + </bean> + +<!-- spring managed service layer --> <bean id='moduleService' class="edu.asu.commons.mme.service.ModuleService"> <property name='dao' ref='moduleDao'/> </bean> <!-- Expose services for BlazeDS remoting --> + <flex:remote-service ref="studentService" /> <flex:remote-service ref="moduleService" /> <!-- Flex related information ended--> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kj...@us...> - 2009-04-29 02:34:00
|
Revision: 132 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=132&view=rev Author: kjonas Date: 2009-04-29 02:33:55 +0000 (Wed, 29 Apr 2009) Log Message: ----------- PageDisplay and InstructionPage should be working, but don't seem to be. Modified Paths: -------------- mentalmodels/trunk/flex/src/FisheryExperiment.mxml mentalmodels/trunk/flex/src/actionscript/Block.as mentalmodels/trunk/flex/src/actionscript/Categorical.as mentalmodels/trunk/flex/src/actionscript/Forecasting.as mentalmodels/trunk/flex/src/actionscript/PageDisplay.as mentalmodels/trunk/flex/src/actionscript/Psychometric.as mentalmodels/trunk/flex/src/actionscript/QuestionGroup.as mentalmodels/trunk/flex/src/customComponents/InstructionPage.mxml mentalmodels/trunk/flex/src/customComponents/PsychometricQuestion.mxml Added Paths: ----------- mentalmodels/trunk/flex/src/_InstructionsTest.mxml mentalmodels/trunk/flex/src/customComponents/InstructionPage_TEMP.mxml mentalmodels/trunk/flex/src/customComponents/QuestionPage_TEMP.mxml Modified: mentalmodels/trunk/flex/src/FisheryExperiment.mxml =================================================================== --- mentalmodels/trunk/flex/src/FisheryExperiment.mxml 2009-04-29 01:13:56 UTC (rev 131) +++ mentalmodels/trunk/flex/src/FisheryExperiment.mxml 2009-04-29 02:33:55 UTC (rev 132) @@ -85,7 +85,7 @@ { module = Module(event.result); - var block:Block = module.block.getItemAt(0) as Block + var block:Block = module.blocks.getItemAt(0) as Block Alert.show("block is " + block.description); } Added: mentalmodels/trunk/flex/src/_InstructionsTest.mxml =================================================================== --- mentalmodels/trunk/flex/src/_InstructionsTest.mxml (rev 0) +++ mentalmodels/trunk/flex/src/_InstructionsTest.mxml 2009-04-29 02:33:55 UTC (rev 132) @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="utf-8"?> +<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:comp="customComponents.*" layout="vertical" xmlns:actionscript="actionscript.*"> + + <!--this is a test file, don't hardcode everything like this, it's terrible practice--> + + <mx:ArrayCollection id="ch1"> + <mx:String>blah1</mx:String> + <mx:String>blah1</mx:String> + </mx:ArrayCollection> + <mx:ArrayCollection id="ch2"> + <mx:String>blah2</mx:String> + <mx:String>blah2</mx:String> + <mx:String>blah2</mx:String> + </mx:ArrayCollection> + <mx:ArrayCollection id="ch3"> + <mx:String>blah3</mx:String> + <mx:String>blah3</mx:String> + </mx:ArrayCollection> + + <mx:ArrayCollection id="q1"> + <actionscript:Psychometric choices="{ch1}" numberOfIntervals="5" question="Question1"/> + </mx:ArrayCollection> + + <mx:ArrayCollection id="q2"> + <actionscript:Psychometric choices="{ch2}" numberOfIntervals="5" question="Question2"/> + </mx:ArrayCollection> + + <mx:ArrayCollection id="q3"> + <actionscript:Psychometric choices="{ch3}" numberOfIntervals="5" question="Question3"/> + </mx:ArrayCollection> + + <mx:ArrayCollection id="qgrs"> + <actionscript:QuestionGroup questions="{q1}" description="desc" header="HEADER"/> + <actionscript:QuestionGroup questions="{q2}" description="desc" header="HEADER"/> + <actionscript:QuestionGroup questions="{q3}" description="desc" header="HEADER"/> + </mx:ArrayCollection> + + <actionscript:Block id="blk" questionGroups="{qgrs}"/> + + + + <comp:InstructionPage id="iPage" block="{blk}"/> + +</mx:Application> Modified: mentalmodels/trunk/flex/src/actionscript/Block.as =================================================================== --- mentalmodels/trunk/flex/src/actionscript/Block.as 2009-04-29 01:13:56 UTC (rev 131) +++ mentalmodels/trunk/flex/src/actionscript/Block.as 2009-04-29 02:33:55 UTC (rev 132) @@ -10,6 +10,6 @@ public var sequenceNo:int; public var description:String; public var duration:int; - public var questionGroup:ArrayCollection; + public var questionGroups:ArrayCollection; } } \ No newline at end of file Modified: mentalmodels/trunk/flex/src/actionscript/Categorical.as =================================================================== --- mentalmodels/trunk/flex/src/actionscript/Categorical.as 2009-04-29 01:13:56 UTC (rev 131) +++ mentalmodels/trunk/flex/src/actionscript/Categorical.as 2009-04-29 02:33:55 UTC (rev 132) @@ -4,7 +4,7 @@ [Bindable] [RemoteClass(alias="edu.asu.commons.mme.entity.Categorical")] - public class Categorical + public class Categorical extends Question { public var choices:Object; } Modified: mentalmodels/trunk/flex/src/actionscript/Forecasting.as =================================================================== --- mentalmodels/trunk/flex/src/actionscript/Forecasting.as 2009-04-29 01:13:56 UTC (rev 131) +++ mentalmodels/trunk/flex/src/actionscript/Forecasting.as 2009-04-29 02:33:55 UTC (rev 132) @@ -4,7 +4,7 @@ [Bindable] [RemoteClass(alias="edu.asu.commons.mme.entity.Forecasting")] - public class Forecasting + public class Forecasting extends Question { public var dayNo:int; } Modified: mentalmodels/trunk/flex/src/actionscript/PageDisplay.as =================================================================== --- mentalmodels/trunk/flex/src/actionscript/PageDisplay.as 2009-04-29 01:13:56 UTC (rev 131) +++ mentalmodels/trunk/flex/src/actionscript/PageDisplay.as 2009-04-29 02:33:55 UTC (rev 132) @@ -1,104 +1,163 @@ // ActionScript file package actionscript { - import mx.collections.ArrayCollection; + import customComponents.PsychometricQuestion; + import flash.display.DisplayObject; + import mx.collections.ArrayCollection; + import mx.containers.VBox; + import mx.controls.ComboBox; + import mx.controls.Label; + import mx.controls.Text; + import mx.controls.TextArea; + + [Bindable] public class PageDisplay { - private var _pages:ArrayCollection; - private var _minPagesRead:Number; - private var _currentPage; - private var _highestPageReached; + /* + pages:ArrayCollection should be a bunch of VBoxes. + The structure of an element of the pages:ArrayCollection is as follows: + (element / type / description) - public function PageDisplay(pages:ArrayCollection, minPagesRead:Number=1) + 0 / Label / this is the header + 1 / Text / description (USE THIS FOR INSTRUCTION PAGES) + + 2+2*N / Label / question description for N'th question + 3+2*N / TextArea,ComboBox,PsychometricQuestion,Forecasting / the question itself + + */ + + public var pages:ArrayCollection; + public var minPagesRead:Number; + public var currentPageNumber:Number; + public var highestPageReached:Number; + + public var currBlock:Block; + + public function PageDisplay(currBlock:Block, minPagesRead:Number=1) { - if(pages == null) this.pages = new ArrayCollection(); - _minPagesRead = minPagesRead; + this.currBlock = currBlock; + this.pages = new ArrayCollection(); + this.minPagesRead = minPagesRead; + this.currentPageNumber = 0; + this.highestPageReached = currentPageNumber; + + loadPages(); } - public function get pages():ArrayCollection - { return _pages; } - public function set pages(newValue:ArrayCollection):void + public function loadPages():void { - setPages(newValue); - } - public function setPages(newValue:ArrayCollection, adding:Boolean=false):void - { - if(adding) + for(var group:int=0; group<currBlock.questionGroups.length; group++) { - // concatenate the newValue ArrayCollection onto the end of _pages - for(var index:Number = 0; index < newValue.length; index++) + var questionGroup:QuestionGroup = QuestionGroup(currBlock.questionGroups.getItemAt(group)); + var tempBox:VBox = new VBox(); + + if(questionGroup.questions != null && questionGroup.questions.length != 0) { - addPage( newValue.getItemAt(index) ); + for(var question:int=0; question<questionGroup.questions.length; question++) + { + var tempQuestion:Question = Question(questionGroup.questions.getItemAt(question)); + + var txt:Text = new Text(); + txt.width = 300; + txt.htmlText = tempQuestion.question; + tempBox.addChild(txt); + + if(tempQuestion is actionscript.Forecasting) + { + // ??? how is this going to be worked in ??? + //tempBox.addChild(new mx.containers.HBox()); + } + else if(tempQuestion is Categorical) + { + var tempCat:Categorical = Categorical(tempQuestion); + var cq:ComboBox = new ComboBox(); + cq.id = "q"+question; + cq.dataProvider = tempCat.choices; + cq.initialize(); + tempBox.addChild(cq); + } + else if(tempQuestion is Psychometric) + { + var tempPsych:Psychometric = Psychometric(tempQuestion); + var pq:PsychometricQuestion = new PsychometricQuestion(); + pq.id = "q"+question; + pq.labels = tempPsych.choices; + pq.slider.maxValue = 3; + pq.init(); + tempBox.addChild(pq); + } + else + { + var tq:TextArea = new TextArea(); + tq.id = "q"+question; + tq.width = 150; + tq.height = 14; + tq.initialize(); + tempBox.addChild(tq); + } + } + var head:Label = new Label(); + var desc:Text = new Text(); + head.text = questionGroup.header; + desc.htmlText = questionGroup.description; + tempBox.addChildAt(head,0); + tempBox.addChildAt(desc,1); + pages.addItem(tempBox); } } - else - { - // replace _pages with newValue - _pages = newValue; - - // totally new list, reset to 0 - currentPageNumber = 0; - highestPageReached = currentPageNumber + 1; - } + } - public function addPage(newValue):void - { - if(newValue != null) - { - _pages.addItem(newValue); - } - } - public function get currentPageNumber():Number - { return _currentPage; } - public function set currentPageNumber(newValue:Number):void - { _currentPage = newValue; } - - public function get minPagesRead():Number - { return _minPagesRead; } - public function set minPagesRead(newValue:Number):void - { _minPagesRead = newValue; } - - public function get highestPageReached():Number - { return _highestPageReached; } - public function set highestPageReached(newValue:Number):void - { _highestPageReached = newValue; } - public function finished():Boolean - { return highestPageReached <= minPagesRead; } + { return highestPageReached >= minPagesRead - 1; } public function get length():Number - { return _pages.length; } + { return pages.length; } public function get currentPage():DisplayObject { - if(_pages != null && _pages.length > 0) // pages? + if(pages != null && pages.length > 0) // pages? { - if(_currentPage >= 0) // how low? + if(currentPageNumber >= 0) // how low? { - if(_currentPage < _pages.length) // how high? + if(currentPageNumber < pages.length) // how high? { - return (DisplayObject)(_pages.getItemAt(_currentPage)); // VALID_RESULT + return (DisplayObject)(pages.getItemAt(currentPageNumber)); // VALID_RESULT } - return (DisplayObject)(_pages.getItemAt(pages.length - 1)); // too high + return (DisplayObject)(pages.getItemAt(pages.length - 1)); // too high } - return (DisplayObject)(_pages.getItemAt(0)); // too low + return (DisplayObject)(pages.getItemAt(0)); // too low } return null; // no pages } - public function nextPage():void + public function nextPage():Boolean { currentPageNumber++; + if(currentPageNumber >= pages.length) + { + currentPageNumber = pages.length - 1; + return false; + } + if( currentPageNumber > highestPageReached ) { - highestPageReached = currentPageNumber + 1; + highestPageReached = currentPageNumber; } + return true; } - public function prevPage():void - { currentPageNumber--; } + public function prevPage():Boolean + { + currentPageNumber--; + if(currentPageNumber < 0) + { + currentPageNumber = 0; + return false; + } + return true; + } } } \ No newline at end of file Modified: mentalmodels/trunk/flex/src/actionscript/Psychometric.as =================================================================== --- mentalmodels/trunk/flex/src/actionscript/Psychometric.as 2009-04-29 01:13:56 UTC (rev 131) +++ mentalmodels/trunk/flex/src/actionscript/Psychometric.as 2009-04-29 02:33:55 UTC (rev 132) @@ -4,7 +4,7 @@ [Bindable] [RemoteClass(alias="edu.asu.commons.mme.entity.Psychometric")] - public class Psychometric + public class Psychometric extends Question { public var scale:String; public var numberOfIntervals:int; Modified: mentalmodels/trunk/flex/src/actionscript/QuestionGroup.as =================================================================== --- mentalmodels/trunk/flex/src/actionscript/QuestionGroup.as 2009-04-29 01:13:56 UTC (rev 131) +++ mentalmodels/trunk/flex/src/actionscript/QuestionGroup.as 2009-04-29 02:33:55 UTC (rev 132) @@ -4,7 +4,6 @@ [Bindable] [RemoteClass(alias="edu.asu.commons.mme.entity.QuestionGroup")] - public class QuestionGroup { public var id:Number; Modified: mentalmodels/trunk/flex/src/customComponents/InstructionPage.mxml =================================================================== --- mentalmodels/trunk/flex/src/customComponents/InstructionPage.mxml 2009-04-29 01:13:56 UTC (rev 131) +++ mentalmodels/trunk/flex/src/customComponents/InstructionPage.mxml 2009-04-29 02:33:55 UTC (rev 132) @@ -1,23 +1,58 @@ <?xml version="1.0" encoding="utf-8"?> -<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:comp="customComponents.*" initialize="init()"> +<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:comp="customComponents.*" xmlns:as="actionscript.*" initialize="init()"> <mx:Script> <![CDATA[ + import actionscript.Block; + import actionscript.PageDisplay; import mx.collections.ArrayCollection; - [Bindable] - public var numPages:Number; //temporary hard-coded value *fix this* + public var block:Block; + public var pageDisplay:PageDisplay; + [Bindable] public var numPages:Number; + [Bindable] public var currPage:Number; - // Contains ArrayCollections filled with DisplayObjects - // *see: getDisp(pageNum, index) - private var allPageList:ArrayCollection; + public function init():void + { + pageDisplay = new PageDisplay(block, block.questionGroups.length); + currPage = pageDisplay.currentPageNumber; + numPages = pageDisplay.pages.length; + content.addChild(pageDisplay.currentPage); + } + public function back():Boolean + { + return pageDisplay.prevPage(); + } + + public function forward():Boolean + { + return pageDisplay.nextPage(); + } + + public function accept():Boolean + { + if(pageDisplay.finished()) + { + //do stuff + + + //and finish + return true; + } + return false; + } + + // Mutilate the following code: + + /* private var allPageList:ArrayCollection; + // Variables with default settings [Bindable] public var currPageNumber:Number = 0; public var pagesRead:Number = 1; - public function init():void + public function init_obsolete():void { numPages = loadAllPages(); showPage(); @@ -100,29 +135,12 @@ return false; } return showPage(); - } + } */ - public function back():Boolean - { - currPageNumber--; - return fixNum(); - } - - public function forward():Boolean - { - currPageNumber++; - return fixNum(); - } - - public function accept():Boolean - { - return pagesRead >= numPages; - } - ]]> </mx:Script> - <mx:Label text="{currPageNumber+1} / {numPages}"/> + <mx:Label text="{currPage+1} / {numPages}"/> <mx:VBox id="content"/> Added: mentalmodels/trunk/flex/src/customComponents/InstructionPage_TEMP.mxml =================================================================== --- mentalmodels/trunk/flex/src/customComponents/InstructionPage_TEMP.mxml (rev 0) +++ mentalmodels/trunk/flex/src/customComponents/InstructionPage_TEMP.mxml 2009-04-29 02:33:55 UTC (rev 132) @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="utf-8"?> +<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:comp="customComponents.*" xmlns:as="actionscript.*"> + + <mx:ArrayCollection id="pageSet1"> + + </mx:ArrayCollection> + + <mx:VBox id="p1"> + <mx:Text text="This is an information window." width="300"/> + <mx:Text text="What is presented in an information window can be selected from the drop-down list above each window!" width="300"/> + <mx:Text text="Please check the options of the drop-down list when entering a new module of the experiment (i.e. after leaving a module by clicking on “Accept”)." width="300"/> + </mx:VBox> + <mx:VBox id="p2"> + <mx:Text text="num2" width="300"/> + </mx:VBox> + <mx:VBox id="p3"> + <mx:Text text="Welcome to the E-Fishery experiment" width="300"/> + <mx:Text text="In this experiment you will design a strategy to fish an abstract fishing ground together with three other persons. As we are mainly interested in the reasons why 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 #.### US$, you might be interested in finding a strategy that fits your goals well. For this, you have to understand the dynamics of the (simulated) fish population and anticipate well the behavior of the other persons of your group." width="300"/> + </mx:VBox> + + <!--<as:PageDisplay pages="{pageSet1}"/>--> + +</mx:Canvas> Modified: mentalmodels/trunk/flex/src/customComponents/PsychometricQuestion.mxml =================================================================== --- mentalmodels/trunk/flex/src/customComponents/PsychometricQuestion.mxml 2009-04-29 01:13:56 UTC (rev 131) +++ mentalmodels/trunk/flex/src/customComponents/PsychometricQuestion.mxml 2009-04-29 02:33:55 UTC (rev 132) @@ -7,7 +7,7 @@ public var labels:ArrayCollection; - private function init():void + public function init():void { if(labels != null) { Added: mentalmodels/trunk/flex/src/customComponents/QuestionPage_TEMP.mxml =================================================================== --- mentalmodels/trunk/flex/src/customComponents/QuestionPage_TEMP.mxml (rev 0) +++ mentalmodels/trunk/flex/src/customComponents/QuestionPage_TEMP.mxml 2009-04-29 02:33:55 UTC (rev 132) @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:comp="customComponents.*"> + +</mx:Canvas> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <al...@us...> - 2009-04-29 01:14:00
|
Revision: 131 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=131&view=rev Author: alllee Date: 2009-04-29 01:13:56 +0000 (Wed, 29 Apr 2009) Log Message: ----------- adding insert statements Modified Paths: -------------- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Categorical.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Forecasting.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Psychometric.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Question.java mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.cfg.xml Added Paths: ----------- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/CategoricalOption.java Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Categorical.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Categorical.java 2009-04-28 23:57:14 UTC (rev 130) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Categorical.java 2009-04-29 01:13:56 UTC (rev 131) @@ -1,32 +1,28 @@ package edu.asu.commons.mme.entity; -import java.util.Map; +import java.util.List; import javax.persistence.Entity; +import javax.persistence.OneToMany; import javax.persistence.Table; -import org.hibernate.annotations.CollectionOfElements; - @Entity @Table(name="categorical") public class Categorical extends Question { - private static final long serialVersionUID = 5399081841291536902L; - - @CollectionOfElements - @org.hibernate.annotations.MapKey - private Map<String,java.util.ArrayList<String>> choices; - public void setChoices(Map<String,java.util.ArrayList<String>> choices) { + @OneToMany(mappedBy="categorical") + private List<CategoricalOption> choices; + + public void setChoices(List<CategoricalOption> choices) { this.choices = choices; } - public Map<String,java.util.ArrayList<String>> getChoices() { + public List<CategoricalOption> getChoices() { return choices; } - } Added: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/CategoricalOption.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/CategoricalOption.java (rev 0) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/CategoricalOption.java 2009-04-29 01:13:56 UTC (rev 131) @@ -0,0 +1,51 @@ +package edu.asu.commons.mme.entity; + +import java.util.ArrayList; +import java.util.List; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +import org.hibernate.annotations.CollectionOfElements; + +@Entity +@Table(name="categorical_option") +public class CategoricalOption extends Persistable.Base<Long> { + + @Column(nullable=false) + private String optionKey; + + @CollectionOfElements + private List<String> choices = new ArrayList<String>(); + + @ManyToOne + private Categorical categorical; + + + public String getOptionKey() { + return optionKey; + } + + public void setOptionKey(String optionKey) { + this.optionKey = optionKey; + } + + public List<String> getChoices() { + return choices; + } + + public void setChoices(List<String> choices) { + this.choices = choices; + } + + public Categorical getCategorical() { + return categorical; + } + + public void setCategorical(Categorical categorical) { + this.categorical = categorical; + } + +} Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Forecasting.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Forecasting.java 2009-04-28 23:57:14 UTC (rev 130) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Forecasting.java 2009-04-29 01:13:56 UTC (rev 131) @@ -22,7 +22,5 @@ public Integer getDayNo() { return dayNo; } - - } Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Psychometric.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Psychometric.java 2009-04-28 23:57:14 UTC (rev 130) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Psychometric.java 2009-04-29 01:13:56 UTC (rev 131) @@ -16,6 +16,7 @@ private static final long serialVersionUID = -6604568936880631100L; + // FIXME: should be an enum, can be unipolar or bipolar @Column(nullable=false) private String scale; Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Question.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Question.java 2009-04-28 23:57:14 UTC (rev 130) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Question.java 2009-04-29 01:13:56 UTC (rev 131) @@ -36,7 +36,6 @@ @Column(name = "sequence_no",nullable=false) private Integer sequenceNo; - public void setId(Long id) { this.id = id; } Modified: mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.cfg.xml =================================================================== --- mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.cfg.xml 2009-04-28 23:57:14 UTC (rev 130) +++ mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.cfg.xml 2009-04-29 01:13:56 UTC (rev 131) @@ -25,6 +25,7 @@ <mapping class='edu.asu.commons.mme.entity.Categorical'/> + <mapping class='edu.asu.commons.mme.entity.CategoricalOption'/> <mapping class='edu.asu.commons.mme.entity.Psychometric'/> <mapping class='edu.asu.commons.mme.entity.StudentResponse'/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <al...@us...> - 2009-04-28 23:57:20
|
Revision: 130 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=130&view=rev Author: alllee Date: 2009-04-28 23:57:14 +0000 (Tue, 28 Apr 2009) Log Message: ----------- more serializable fixes, getting rid of single/multi/misc location booleans in Question Modified Paths: -------------- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Categorical.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Forecasting.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Gender.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Psychometric.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Question.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/RoundConfig.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Student.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/SuspendRepetition.java Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Categorical.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Categorical.java 2009-04-28 23:04:00 UTC (rev 129) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Categorical.java 2009-04-28 23:57:14 UTC (rev 130) @@ -1,7 +1,6 @@ package edu.asu.commons.mme.entity; -import java.io.Serializable; import java.util.Map; import javax.persistence.Entity; @@ -12,7 +11,7 @@ @Entity @Table(name="categorical") -public class Categorical extends Question implements Serializable { +public class Categorical extends Question { private static final long serialVersionUID = 5399081841291536902L; Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Forecasting.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Forecasting.java 2009-04-28 23:04:00 UTC (rev 129) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Forecasting.java 2009-04-28 23:57:14 UTC (rev 130) @@ -2,17 +2,14 @@ -import java.io.Serializable; - import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Table; @Entity @Table(name="forecasting") +public class Forecasting extends Question { -public class Forecasting extends Question implements Serializable { - private static final long serialVersionUID = -1130445773406872694L; @Column(name="day_no",nullable=false) Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Gender.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Gender.java 2009-04-28 23:04:00 UTC (rev 129) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Gender.java 2009-04-28 23:57:14 UTC (rev 130) @@ -1,5 +1,5 @@ package edu.asu.commons.mme.entity; public enum Gender { -F, M + F, M } Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Psychometric.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Psychometric.java 2009-04-28 23:04:00 UTC (rev 129) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Psychometric.java 2009-04-28 23:57:14 UTC (rev 130) @@ -2,7 +2,6 @@ -import java.io.Serializable; import java.util.List; import javax.persistence.Column; @@ -13,13 +12,9 @@ @Entity @Table(name="psychometric") -public class Psychometric extends Question implements Serializable{ +public class Psychometric extends Question { - - /** - * - */ - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = -6604568936880631100L; @Column(nullable=false) private String scale; Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Question.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Question.java 2009-04-28 23:04:00 UTC (rev 129) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Question.java 2009-04-28 23:57:14 UTC (rev 130) @@ -20,7 +20,7 @@ public class Question implements Serializable, Comparable<Question> { private static final long serialVersionUID = -6745280629134903292L; - + @Id @GeneratedValue private Long id; @@ -32,16 +32,7 @@ @Lob @Column(nullable=false) private String question; - - @Column (name="single_location",nullable=false,columnDefinition="Boolean") - private boolean singleLocation; - - @Column (name="multi_location",nullable=false,columnDefinition="Boolean") - private boolean multiLocation; - - @Column (name="misc_location",nullable=false,columnDefinition="Boolean") - private boolean miscLocation; - + @Column(name = "sequence_no",nullable=false) private Integer sequenceNo; @@ -62,30 +53,6 @@ return question; } - public void setSingleLocation(boolean singleLocation) { - this.singleLocation = singleLocation; - } - - public boolean isSingleLocation() { - return singleLocation; - } - - public void setMultiLocation(boolean multiLocation) { - this.multiLocation = multiLocation; - } - - public boolean isMultiLocation() { - return multiLocation; - } - - public void setMiscLocation(boolean miscLocation) { - this.miscLocation = miscLocation; - } - - public boolean isMiscLocation() { - return miscLocation; - } - public void setSequenceNo(Integer sequenceNo) { this.sequenceNo = sequenceNo; } Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/RoundConfig.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/RoundConfig.java 2009-04-28 23:04:00 UTC (rev 129) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/RoundConfig.java 2009-04-28 23:57:14 UTC (rev 130) @@ -43,8 +43,8 @@ public Long getId() { return id; } - public void setRoundNo(Integer round_no) { - this.roundNo = round_no; + public void setRoundNo(Integer roundNo) { + this.roundNo = roundNo; } public Integer getRoundNo() { return roundNo; @@ -74,8 +74,4 @@ public void setLocations(Set<Location> locations) { this.locations = locations; } - - - - } Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Student.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Student.java 2009-04-28 23:04:00 UTC (rev 129) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Student.java 2009-04-28 23:57:14 UTC (rev 130) @@ -18,12 +18,9 @@ @Entity @Table(name="student") -public class Student implements Serializable{ +public class Student implements Serializable { - /** - * - */ - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = -8470518757386068187L; @Id @GeneratedValue Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/SuspendRepetition.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/SuspendRepetition.java 2009-04-28 23:04:00 UTC (rev 129) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/SuspendRepetition.java 2009-04-28 23:57:14 UTC (rev 130) @@ -30,8 +30,8 @@ @JoinColumn(nullable=false) private Student student; - @Column(name="harbor_days",nullable=false) - private Integer harborDays; + @Column(name="days_in_harbor",nullable=false) + private Integer daysInHarbor; @Column(name="fishing_threshold",nullable=false) private Float fishingThreshold; @@ -44,12 +44,12 @@ return id; } - public void setHarborDays(Integer harborDays) { - this.harborDays = harborDays; + public void setDaysInHarbor(Integer harborDays) { + this.daysInHarbor = harborDays; } - public Integer getHarborDays() { - return harborDays; + public Integer getDaysInHarbor() { + return daysInHarbor; } public void setFishingThreshold(Float fishingThreshold) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kj...@us...> - 2009-04-28 23:04:10
|
Revision: 129 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=129&view=rev Author: kjonas Date: 2009-04-28 23:04:00 +0000 (Tue, 28 Apr 2009) Log Message: ----------- Created *.as mirrors for the following *.java files: Block Categorical Forecasting Location Module Psychometric QuestionGroup Question Modified Paths: -------------- mentalmodels/trunk/flex/src/actionscript/Block.as mentalmodels/trunk/flex/src/actionscript/Module.as mentalmodels/trunk/flex/src/actionscript/QuestionGroup.as mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Psychometric.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/QuestionGroup.java Added Paths: ----------- mentalmodels/trunk/flex/src/actionscript/Categorical.as mentalmodels/trunk/flex/src/actionscript/Forecasting.as mentalmodels/trunk/flex/src/actionscript/Location.as mentalmodels/trunk/flex/src/actionscript/Psychometric.as mentalmodels/trunk/flex/src/actionscript/Question.as Modified: mentalmodels/trunk/flex/src/actionscript/Block.as =================================================================== --- mentalmodels/trunk/flex/src/actionscript/Block.as 2009-04-28 23:01:55 UTC (rev 128) +++ mentalmodels/trunk/flex/src/actionscript/Block.as 2009-04-28 23:04:00 UTC (rev 129) @@ -6,19 +6,10 @@ [RemoteClass(alias="edu.asu.commons.mme.entity.Block")] public class Block { - public var id:int; - - - public var sequenceNo:int; - - - public var description:String; - - - public var duration:int; - - - public var questionGroup:ArrayCollection; - + public var id:int; + public var sequenceNo:int; + public var description:String; + public var duration:int; + public var questionGroup:ArrayCollection; } } \ No newline at end of file Added: mentalmodels/trunk/flex/src/actionscript/Categorical.as =================================================================== --- mentalmodels/trunk/flex/src/actionscript/Categorical.as (rev 0) +++ mentalmodels/trunk/flex/src/actionscript/Categorical.as 2009-04-28 23:04:00 UTC (rev 129) @@ -0,0 +1,11 @@ +package actionscript +{ + import mx.collections.ArrayCollection; + + [Bindable] + [RemoteClass(alias="edu.asu.commons.mme.entity.Categorical")] + public class Categorical + { + public var choices:Object; + } +} \ No newline at end of file Added: mentalmodels/trunk/flex/src/actionscript/Forecasting.as =================================================================== --- mentalmodels/trunk/flex/src/actionscript/Forecasting.as (rev 0) +++ mentalmodels/trunk/flex/src/actionscript/Forecasting.as 2009-04-28 23:04:00 UTC (rev 129) @@ -0,0 +1,11 @@ +package actionscript +{ + import mx.collections.ArrayCollection; + + [Bindable] + [RemoteClass(alias="edu.asu.commons.mme.entity.Forecasting")] + public class Forecasting + { + public var dayNo:int; + } +} \ No newline at end of file Added: mentalmodels/trunk/flex/src/actionscript/Location.as =================================================================== --- mentalmodels/trunk/flex/src/actionscript/Location.as (rev 0) +++ mentalmodels/trunk/flex/src/actionscript/Location.as 2009-04-28 23:04:00 UTC (rev 129) @@ -0,0 +1,15 @@ +package actionscript +{ + import mx.collections.ArrayCollection; + + [Bindable] + [RemoteClass(alias="edu.asu.commons.mme.entity.Location")] + public class Location + { + public var id:Number; + public var locationName:String; + public var maxCapacity:int; + public var growthRate:Number; + public var initialPopulation:int; + } +} \ No newline at end of file Modified: mentalmodels/trunk/flex/src/actionscript/Module.as =================================================================== --- mentalmodels/trunk/flex/src/actionscript/Module.as 2009-04-28 23:01:55 UTC (rev 128) +++ mentalmodels/trunk/flex/src/actionscript/Module.as 2009-04-28 23:04:00 UTC (rev 129) @@ -6,11 +6,11 @@ [RemoteClass(alias="edu.asu.commons.mme.entity.Module")] public class Module { - public var id:int; + public var id:Number; public var sequenceNo:int; public var description:String; public var duration:int; - public var block:ArrayCollection; //if arraycollection didnt work try list + public var blocks:ArrayCollection; //if arraycollection didnt work try list Added: mentalmodels/trunk/flex/src/actionscript/Psychometric.as =================================================================== --- mentalmodels/trunk/flex/src/actionscript/Psychometric.as (rev 0) +++ mentalmodels/trunk/flex/src/actionscript/Psychometric.as 2009-04-28 23:04:00 UTC (rev 129) @@ -0,0 +1,13 @@ +package actionscript +{ + import mx.collections.ArrayCollection; + + [Bindable] + [RemoteClass(alias="edu.asu.commons.mme.entity.Psychometric")] + public class Psychometric + { + public var scale:String; + public var numberOfIntervals:int; + public var choices:ArrayCollection; + } +} \ No newline at end of file Added: mentalmodels/trunk/flex/src/actionscript/Question.as =================================================================== --- mentalmodels/trunk/flex/src/actionscript/Question.as (rev 0) +++ mentalmodels/trunk/flex/src/actionscript/Question.as 2009-04-28 23:04:00 UTC (rev 129) @@ -0,0 +1,16 @@ +package actionscript +{ + import mx.collections.ArrayCollection; + + [Bindable] + [RemoteClass(alias="edu.asu.commons.mme.entity.Question")] + public class Question + { + public var id:Number; + public var question:String; + public var singleLocation:Boolean; + public var multiLocation:Boolean; + public var miscLocation:Boolean; + public var sequenceNo:int; + } +} \ No newline at end of file Modified: mentalmodels/trunk/flex/src/actionscript/QuestionGroup.as =================================================================== --- mentalmodels/trunk/flex/src/actionscript/QuestionGroup.as 2009-04-28 23:01:55 UTC (rev 128) +++ mentalmodels/trunk/flex/src/actionscript/QuestionGroup.as 2009-04-28 23:04:00 UTC (rev 129) @@ -7,30 +7,12 @@ public class QuestionGroup { - public var id:int; - - - private var roundConfig:ArrayCollection; - - - public var sequenceNo:int; - - //header can be question or just a label - - public var header:String; - - public var description:String; - - /*Since we have timings for module, - * we don't need to save timings for each item or question group - * - */ - /*@Column(nullable=false) - public var Float maxtime;*/ - - - public var block:Block; - - + public var id:Number; + public var questions:ArrayCollection; + public var sequenceNo:int; + public var header:String; + public var description:String; + + private var roundConfig:ArrayCollection; // fix me? } } \ No newline at end of file Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Psychometric.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Psychometric.java 2009-04-28 23:01:55 UTC (rev 128) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Psychometric.java 2009-04-28 23:04:00 UTC (rev 129) @@ -25,7 +25,7 @@ private String scale; @Column(name="no_of_intervals",nullable=false) - private String intervals; + private Integer numberOfIntervals; @CollectionOfElements private List<String> choices; @@ -38,12 +38,12 @@ return choices; } - public void setIntervals(String intervals) { - this.intervals = intervals; + public Integer getNumberOfIntervals() { + return numberOfIntervals; } - public String getIntervals() { - return intervals; + public void setNumberOfIntervals(Integer numberOfIntervals) { + this.numberOfIntervals = numberOfIntervals; } public void setScale(String scale) { Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/QuestionGroup.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/QuestionGroup.java 2009-04-28 23:01:55 UTC (rev 128) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/QuestionGroup.java 2009-04-28 23:04:00 UTC (rev 129) @@ -43,7 +43,7 @@ @Column(name = "sequence_no",nullable=false) private Integer sequenceNo; - //header can be question or just a label + //header can be question or just a Text @Lob private String header; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <al...@us...> - 2009-04-28 23:02:05
|
Revision: 128 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=128&view=rev Author: alllee Date: 2009-04-28 23:01:55 +0000 (Tue, 28 Apr 2009) Log Message: ----------- fixing init db script again. Please be more careful when you merge. 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-04-28 21:48:04 UTC (rev 127) +++ mentalmodels/trunk/src/main/db/init-mme.sql 2009-04-28 23:01:55 UTC (rev 128) @@ -1,93 +1,92 @@ -insert into game (description,img_address,max_days,max_fish_harvest,money,no_of_location,no_of_rounds,timestamp,title) -values("First game","island.jpg",30,5,0.0,4,3,NOW(),"Mental Model Experiment"); - -insert into round_config (communication_flag,round_no,game_id) values(false,1,1); -insert into round_config (communication_flag,round_no,game_id) values(true,2,1); - -insert into game_round_config(game_id,roundconfig_id) values(1,1); -insert into game_round_config(game_id,roundconfig_id) values(1,2); - -insert into location_config(growth_rate,location_name,max_capacity,start_population) values(0.5,"Bay1",10,5); -insert into location_config(growth_rate,location_name,max_capacity,start_population) values(0.15,"Bay2",20,10); -insert into location_config(growth_rate,location_name,max_capacity,start_population) values(0.05,"Bay3",30,15); -insert into location_config(growth_rate,location_name,max_capacity,start_population) values(0.0,"Harbor",0,0); - -insert into round_config_location_config(roundconfig_id,locationconfig_id) values(1,1); -insert into round_config_location_config(roundconfig_id,locationconfig_id) values(1,2); -insert into round_config_location_config(roundconfig_id,locationconfig_id) values(1,3); -insert into round_config_location_config(roundconfig_id,locationconfig_id) values(1,4); -insert into round_config_location_config(roundconfig_id,locationconfig_id) values(2,1); -insert into round_config_location_config(roundconfig_id,locationconfig_id) values(2,2); -insert into round_config_location_config(roundconfig_id,locationconfig_id) values(2,3); -insert into round_config_location_config(roundconfig_id,locationconfig_id) values(2,4); +insert into game (description,image_location,max_days,max_fish_harvest,money,no_of_locations,no_of_rounds,timestamp,title) +values("First game","island.jpg",30,5,0.0,4,3,NOW(),"Mental Model Experiment"); +insert into round_config (communication_flag,round_no,game_id) values(false,1,1); +insert into round_config (communication_flag,round_no,game_id) values(true,2,1); -insert into module(description, sequence_no, duration) values("Pre-Experiment",1,18); -insert into module(description, sequence_no, duration) values("Game Round 1",2,57.0); -insert into module(description, sequence_no, duration) values("Communication Round",3,14); -insert into module(description, sequence_no, duration) values("Game Round 2",4,29); -insert into module(description, sequence_no, duration) values("Post-Experiment",5,4); - -insert into block(description, sequence_no, duration,module_id) values("Introduction",1,18,1); -insert into block(description, sequence_no, duration,module_id) values("Design Strategy",1,18,2); -insert into block(description, sequence_no, duration,module_id) values("Characterizing own strategy",2,17,2); -insert into block(description, sequence_no, duration,module_id) values("Editing strategy",3,5,2); -insert into block(description, sequence_no, duration,module_id) values("Day-by-day decisions game",4,6,2); -insert into block(description, sequence_no, duration,module_id) values("Evaluation of Outcomes",5,11,2); -insert into block(description, sequence_no, duration,module_id) values("Communication",1,14,3); -insert into block(description, sequence_no, duration,module_id) values("Design Strategy",1,5,4); -insert into block(description, sequence_no, duration,module_id) values("Characterizing own strategy",2,9,4); -insert into block(description, sequence_no, duration,module_id) values("Editing strategy",3,3,4); -insert into block(description, sequence_no, duration,module_id) values("Day-by-day decisions game",4,6,4); -insert into block(description, sequence_no, duration,module_id) values("Evaluation of Outcomes",5,6,4); -insert into block(description, sequence_no, duration,module_id) values("Final data gathering",1,2,4); -insert into block(description, sequence_no, duration,module_id) values("Debriefing",2,2,4); - - - -insert into question_group(block_id,sequence_no,header,description)values(1,1,"Welcome to the E-Fishery Experiment", -"In this experiment you will design a strategy to fish an abstract fishing ground together with three other persons. As we are mainly interested in the reasons why you choose a certain strategy, we will ask you a number of questions. For the same reason, there are no \x91correct\x92 or \x91wrong\x92 strategies and no \x91correct\x92 or \x91wrong\x92 answers. However, since for each pound of fish you get during the experiment you will receive #.### US$, you might be interested in finding a strategy that fits your goals well. For this, you have to understand the dynamics of the (simulated) fish population and anticipate well the behavior of the other persons of your group."); - -insert into question_group(block_id,sequence_no,header,description)values(1,2,"Starting the Experiment", -"Now, you should understand your task and its problems and thus be ready to start the actual experiment.\n Click on 'Accept' to begin with the design of your strategy."); - -insert into question_group(block_id,sequence_no,header,description)values(2,1,"Designing your Strategy", -"<p>In what we refer to as a 'strategy' you predefine your decisions of where to go each day of the simulation.\n -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.\n - 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> -"); - -insert into question_group(block_id,sequence_no,header,description)values(2,2,"Some special features of the strategy design", -"<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> -"); - - -insert into question_group(block_id,sequence_no,header,description)values(2,3,"Design your strategy", -"<p>Design your strategy by clicking on <b>'New'</b>, <b>'Edit'</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'. -When you are done, click on <b>'Next'</b>. Your strategy will then be checked for some common or logical errors. -</p>"); \ No newline at end of file +-- insert into game_round_config(game_id,roundconfig_id) values(1,1); +-- insert into game_round_config(game_id,roundconfig_id) values(1,2); + +insert into location(growth_rate,location_name,max_capacity,initial_population) values(0.5,"Bay1",10,5); +insert into location(growth_rate,location_name,max_capacity,initial_population) values(0.15,"Bay2",20,10); +insert into location(growth_rate,location_name,max_capacity,initial_population) values(0.05,"Bay3",30,15); +insert into location(growth_rate,location_name,max_capacity,initial_population) values(0.0,"Harbor",0,0); + +insert into location_round_config(roundConfigs_id,location_id) values(1,1); +insert into location_round_config(roundConfigs_id,location_id) values(1,2); +insert into location_round_config(roundConfigs_id,location_id) values(1,3); +insert into location_round_config(roundConfigs_id,location_id) values(1,4); +insert into location_round_config(roundConfigs_id,location_id) values(2,1); +insert into location_round_config(roundConfigs_id,location_id) values(2,2); +insert into location_round_config(roundConfigs_id,location_id) values(2,3); +insert into location_round_config(roundConfigs_id,location_id) values(2,4); + +insert into module(description, sequence_no, duration) values("Pre-Experiment",1,18); +insert into module(description, sequence_no, duration) values("Game Round 1",2,57.0); +insert into module(description, sequence_no, duration) values("Communication Round",3,14); +insert into module(description, sequence_no, duration) values("Game Round 2",4,29); +insert into module(description, sequence_no, duration) values("Post-Experiment",5,4); + +insert into block(description, sequence_no, duration,module_id) values("Introduction",1,18,1); +insert into block(description, sequence_no, duration,module_id) values("Design Strategy",1,18,2); +insert into block(description, sequence_no, duration,module_id) values("Characterizing own strategy",2,17,2); +insert into block(description, sequence_no, duration,module_id) values("Editing strategy",3,5,2); +insert into block(description, sequence_no, duration,module_id) values("Day-by-day decisions game",4,6,2); +insert into block(description, sequence_no, duration,module_id) values("Evaluation of Outcomes",5,11,2); +insert into block(description, sequence_no, duration,module_id) values("Communication",1,14,3); +insert into block(description, sequence_no, duration,module_id) values("Design Strategy",1,5,4); +insert into block(description, sequence_no, duration,module_id) values("Characterizing own strategy",2,9,4); +insert into block(description, sequence_no, duration,module_id) values("Editing strategy",3,3,4); +insert into block(description, sequence_no, duration,module_id) values("Day-by-day decisions game",4,6,4); +insert into block(description, sequence_no, duration,module_id) values("Evaluation of Outcomes",5,6,4); +insert into block(description, sequence_no, duration,module_id) values("Final data gathering",1,2,4); +insert into block(description, sequence_no, duration,module_id) values("Debriefing",2,2,4); + + + +insert into question_group(block_id,sequence_no,header,description)values(1,1,"Welcome to the E-Fishery Experiment", +"In this experiment you will design a strategy to fish an abstract fishing ground together with three other persons. As we are mainly interested in the reasons why you choose a certain strategy, we will ask you a number of questions. For the same reason, there are no \x91correct\x92 or \x91wrong\x92 strategies and no \x91correct\x92 or \x91wrong\x92 answers. However, since for each pound of fish you get during the experiment you will receive #.### US$, you might be interested in finding a strategy that fits your goals well. For this, you have to understand the dynamics of the (simulated) fish population and anticipate well the behavior of the other persons of your group."); + +insert into question_group(block_id,sequence_no,header,description)values(1,2,"Starting the Experiment", +"Now, you should understand your task and its problems and thus be ready to start the actual experiment.\n Click on 'Accept' to begin with the design of your strategy."); + +insert into question_group(block_id,sequence_no,header,description)values(2,1,"Designing your Strategy", +"<p>In what we refer to as a 'strategy' you predefine your decisions of where to go each day of the simulation.\n +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.\n + 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> +"); + +insert into question_group(block_id,sequence_no,header,description)values(2,2,"Some special features of the strategy design", +"<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> +"); + + +insert into question_group(block_id,sequence_no,header,description)values(2,3,"Design your strategy", +"<p>Design your strategy by clicking on <b>'New'</b>, <b>'Edit'</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'. +When you are done, click on <b>'Next'</b>. Your strategy will then be checked for some common or logical errors. +</p>"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <al...@us...> - 2009-04-28 21:48:10
|
Revision: 127 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=127&view=rev Author: alllee Date: 2009-04-28 21:48:04 +0000 (Tue, 28 Apr 2009) Log Message: ----------- getting rid of generated files from SVN (should add to svn ignore later) Removed Paths: ------------- mentalmodels/trunk/.classpath mentalmodels/trunk/.project mentalmodels/trunk/src/main/db/generated/ mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.properties mentalmodels/trunk/target/ Deleted: mentalmodels/trunk/.classpath =================================================================== --- mentalmodels/trunk/.classpath 2009-04-28 21:44:53 UTC (rev 126) +++ mentalmodels/trunk/.classpath 2009-04-28 21:48:04 UTC (rev 127) @@ -1,31 +0,0 @@ -<classpath> - <classpathentry kind="src" path="src/main/webapp" output="target/test-classes" excluding="**/*.java"/> - <classpathentry kind="src" path="src/main/java" including="**/*.java"/> - <classpathentry kind="src" path="src/main/resources" excluding="**/*.java"/> - <classpathentry kind="output" path="target/classes"/> - <classpathentry kind="var" path="M2_REPO/javax/transaction/jta/1.1/jta-1.1.jar"/> - <classpathentry kind="var" path="M2_REPO/javax/persistence/persistence-api/1.0/persistence-api-1.0.jar"/> - <classpathentry kind="var" path="M2_REPO/antlr/antlr/2.7.6/antlr-2.7.6.jar"/> - <classpathentry kind="var" path="M2_REPO/org/beanshell/bsh/2.0b4/bsh-2.0b4.jar"/> - <classpathentry kind="var" path="M2_REPO/commons-collections/commons-collections/3.1/commons-collections-3.1.jar"/> - <classpathentry kind="var" path="M2_REPO/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar"/> - <classpathentry kind="var" path="M2_REPO/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar"/> - <classpathentry kind="var" path="M2_REPO/net/sf/ehcache/ehcache/1.2.3/ehcache-1.2.3.jar"/> - <classpathentry kind="var" path="M2_REPO/org/hibernate/ejb3-persistence/1.0.2.GA/ejb3-persistence-1.0.2.GA.jar"/> - <classpathentry kind="var" path="M2_REPO/freemarker/freemarker/2.3.8/freemarker-2.3.8.jar"/> - <classpathentry kind="var" path="M2_REPO/org/hibernate/hibernate-annotations/3.4.0.GA/hibernate-annotations-3.4.0.GA.jar"/> - <classpathentry kind="var" path="M2_REPO/org/hibernate/hibernate-commons-annotations/3.1.0.GA/hibernate-commons-annotations-3.1.0.GA.jar"/> - <classpathentry kind="var" path="M2_REPO/org/hibernate/hibernate-core/3.3.0.SP1/hibernate-core-3.3.0.SP1.jar"/> - <classpathentry kind="var" path="M2_REPO/org/hibernate/hibernate-ehcache/3.3.1.GA/hibernate-ehcache-3.3.1.GA.jar"/> - <classpathentry kind="var" path="M2_REPO/org/hibernate/hibernate-tools/3.2.3.GA/hibernate-tools-3.2.3.GA.jar"/> - <classpathentry kind="var" path="M2_REPO/org/hibernate/jtidy/r8-20060801/jtidy-r8-20060801.jar"/> - <classpathentry kind="var" path="M2_REPO/log4j/log4j/1.2.14/log4j-1.2.14.jar"/> - <classpathentry kind="var" path="M2_REPO/mysql/mysql-connector-java/5.1.6/mysql-connector-java-5.1.6.jar"/> - <classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-api/1.4.2/slf4j-api-1.4.2.jar"/> - <classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-log4j12/1.5.2/slf4j-log4j12-1.5.2.jar"/> - <classpathentry kind="var" path="M2_REPO/org/springframework/spring/2.5.5/spring-2.5.5.jar"/> - <classpathentry kind="var" path="M2_REPO/org/springframework/spring-flex/1.0.0.M2/spring-flex-1.0.0.M2.jar"/> - <classpathentry kind="var" path="M2_REPO/org/springframework/spring-hibernate3/2.0-m3/spring-hibernate3-2.0-m3.jar"/> - <classpathentry kind="var" path="M2_REPO/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar"/> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> -</classpath> \ No newline at end of file Deleted: mentalmodels/trunk/.project =================================================================== --- mentalmodels/trunk/.project 2009-04-28 21:44:53 UTC (rev 126) +++ mentalmodels/trunk/.project 2009-04-28 21:48:04 UTC (rev 127) @@ -1,13 +0,0 @@ -<projectDescription> - <name>mme</name> - <comment/> - <projects/> - <buildSpec> - <buildCommand> - <name>org.eclipse.jdt.core.javabuilder</name> - </buildCommand> - </buildSpec> - <natures> - <nature>org.eclipse.jdt.core.javanature</nature> - </natures> -</projectDescription> \ No newline at end of file Deleted: mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.properties =================================================================== --- mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.properties 2009-04-28 21:44:53 UTC (rev 126) +++ mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.properties 2009-04-28 21:48:04 UTC (rev 127) @@ -1,5 +0,0 @@ -hibernate.connection.user=mme -hibernate.connection.password=mmepassword -hibernate.connection.url=jdbc:mysql://localhost/MME -hibernate.connection.driver_class=com.mysql.jdbc.Driver -hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kj...@us...> - 2009-04-28 21:45:07
|
Revision: 126 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=126&view=rev Author: kjonas Date: 2009-04-28 21:44:53 +0000 (Tue, 28 Apr 2009) Log Message: ----------- Synchronizing Modified Paths: -------------- mentalmodels/trunk/flex/src/customComponents/Slider.mxml Added Paths: ----------- mentalmodels/trunk/.classpath mentalmodels/trunk/.project mentalmodels/trunk/flex/.actionScriptProperties mentalmodels/trunk/flex/.flexProperties mentalmodels/trunk/flex/.project mentalmodels/trunk/flex/src/actionscript/PageDisplay.as mentalmodels/trunk/flex/src/images/ mentalmodels/trunk/flex/src/images/SliderImage.png mentalmodels/trunk/src/main/db/generated/ mentalmodels/trunk/src/main/db/generated/mme.sql mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.properties mentalmodels/trunk/target/ Added: mentalmodels/trunk/.classpath =================================================================== --- mentalmodels/trunk/.classpath (rev 0) +++ mentalmodels/trunk/.classpath 2009-04-28 21:44:53 UTC (rev 126) @@ -0,0 +1,31 @@ +<classpath> + <classpathentry kind="src" path="src/main/webapp" output="target/test-classes" excluding="**/*.java"/> + <classpathentry kind="src" path="src/main/java" including="**/*.java"/> + <classpathentry kind="src" path="src/main/resources" excluding="**/*.java"/> + <classpathentry kind="output" path="target/classes"/> + <classpathentry kind="var" path="M2_REPO/javax/transaction/jta/1.1/jta-1.1.jar"/> + <classpathentry kind="var" path="M2_REPO/javax/persistence/persistence-api/1.0/persistence-api-1.0.jar"/> + <classpathentry kind="var" path="M2_REPO/antlr/antlr/2.7.6/antlr-2.7.6.jar"/> + <classpathentry kind="var" path="M2_REPO/org/beanshell/bsh/2.0b4/bsh-2.0b4.jar"/> + <classpathentry kind="var" path="M2_REPO/commons-collections/commons-collections/3.1/commons-collections-3.1.jar"/> + <classpathentry kind="var" path="M2_REPO/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar"/> + <classpathentry kind="var" path="M2_REPO/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar"/> + <classpathentry kind="var" path="M2_REPO/net/sf/ehcache/ehcache/1.2.3/ehcache-1.2.3.jar"/> + <classpathentry kind="var" path="M2_REPO/org/hibernate/ejb3-persistence/1.0.2.GA/ejb3-persistence-1.0.2.GA.jar"/> + <classpathentry kind="var" path="M2_REPO/freemarker/freemarker/2.3.8/freemarker-2.3.8.jar"/> + <classpathentry kind="var" path="M2_REPO/org/hibernate/hibernate-annotations/3.4.0.GA/hibernate-annotations-3.4.0.GA.jar"/> + <classpathentry kind="var" path="M2_REPO/org/hibernate/hibernate-commons-annotations/3.1.0.GA/hibernate-commons-annotations-3.1.0.GA.jar"/> + <classpathentry kind="var" path="M2_REPO/org/hibernate/hibernate-core/3.3.0.SP1/hibernate-core-3.3.0.SP1.jar"/> + <classpathentry kind="var" path="M2_REPO/org/hibernate/hibernate-ehcache/3.3.1.GA/hibernate-ehcache-3.3.1.GA.jar"/> + <classpathentry kind="var" path="M2_REPO/org/hibernate/hibernate-tools/3.2.3.GA/hibernate-tools-3.2.3.GA.jar"/> + <classpathentry kind="var" path="M2_REPO/org/hibernate/jtidy/r8-20060801/jtidy-r8-20060801.jar"/> + <classpathentry kind="var" path="M2_REPO/log4j/log4j/1.2.14/log4j-1.2.14.jar"/> + <classpathentry kind="var" path="M2_REPO/mysql/mysql-connector-java/5.1.6/mysql-connector-java-5.1.6.jar"/> + <classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-api/1.4.2/slf4j-api-1.4.2.jar"/> + <classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-log4j12/1.5.2/slf4j-log4j12-1.5.2.jar"/> + <classpathentry kind="var" path="M2_REPO/org/springframework/spring/2.5.5/spring-2.5.5.jar"/> + <classpathentry kind="var" path="M2_REPO/org/springframework/spring-flex/1.0.0.M2/spring-flex-1.0.0.M2.jar"/> + <classpathentry kind="var" path="M2_REPO/org/springframework/spring-hibernate3/2.0-m3/spring-hibernate3-2.0-m3.jar"/> + <classpathentry kind="var" path="M2_REPO/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> +</classpath> \ No newline at end of file Added: mentalmodels/trunk/.project =================================================================== --- mentalmodels/trunk/.project (rev 0) +++ mentalmodels/trunk/.project 2009-04-28 21:44:53 UTC (rev 126) @@ -0,0 +1,13 @@ +<projectDescription> + <name>mme</name> + <comment/> + <projects/> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> \ No newline at end of file Added: mentalmodels/trunk/flex/.actionScriptProperties =================================================================== --- mentalmodels/trunk/flex/.actionScriptProperties (rev 0) +++ mentalmodels/trunk/flex/.actionScriptProperties 2009-04-28 21:44:53 UTC (rev 126) @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<actionScriptProperties mainApplicationPath="FisheryExperiment.mxml" version="3"> + <compiler additionalCompilerArguments="-locale en_US" copyDependentFiles="true" enableModuleDebug="true" generateAccessible="false" htmlExpressInstall="true" htmlGenerate="true" htmlHistoryManagement="true" htmlPlayerVersion="9.0.28" htmlPlayerVersionCheck="true" outputFolderPath="bin-debug" sourceFolderPath="src" strict="true" useApolloConfig="false" verifyDigests="true" warn="true"> + <compilerSourcePath/> + <libraryPath defaultLinkType="1"> + <libraryPathEntry kind="4" path=""/> + <libraryPathEntry kind="1" linkType="1" path="libs"/> + </libraryPath> + <sourceAttachmentPath/> + </compiler> + <applications> + <application path="Socio_demographic.mxml"/> + <application path="TestApp.mxml"/> + <application path="display.mxml"/> + <application path="TableTest.mxml"/> + <application path="MME.mxml"/> + <application path="Mental.mxml"/> + <application path="FisheryExperiment.mxml"/> + </applications> + <modules/> + <buildCSSFiles/> +</actionScriptProperties> Added: mentalmodels/trunk/flex/.flexProperties =================================================================== --- mentalmodels/trunk/flex/.flexProperties (rev 0) +++ mentalmodels/trunk/flex/.flexProperties 2009-04-28 21:44:53 UTC (rev 126) @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<flexProperties flexServerType="0" toolCompile="true" useServerFlexSDK="false" version="1"/> Added: mentalmodels/trunk/flex/.project =================================================================== --- mentalmodels/trunk/flex/.project (rev 0) +++ mentalmodels/trunk/flex/.project 2009-04-28 21:44:53 UTC (rev 126) @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>Fishery</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>com.adobe.flexbuilder.project.flexbuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>com.adobe.flexbuilder.project.flexnature</nature> + <nature>com.adobe.flexbuilder.project.actionscriptnature</nature> + </natures> +</projectDescription> Added: mentalmodels/trunk/flex/src/actionscript/PageDisplay.as =================================================================== --- mentalmodels/trunk/flex/src/actionscript/PageDisplay.as (rev 0) +++ mentalmodels/trunk/flex/src/actionscript/PageDisplay.as 2009-04-28 21:44:53 UTC (rev 126) @@ -0,0 +1,104 @@ +// ActionScript file +package actionscript +{ + import mx.collections.ArrayCollection; + import flash.display.DisplayObject; + + [Bindable] + public class PageDisplay + { + private var _pages:ArrayCollection; + private var _minPagesRead:Number; + private var _currentPage; + private var _highestPageReached; + + public function PageDisplay(pages:ArrayCollection, minPagesRead:Number=1) + { + if(pages == null) this.pages = new ArrayCollection(); + _minPagesRead = minPagesRead; + } + + public function get pages():ArrayCollection + { return _pages; } + public function set pages(newValue:ArrayCollection):void + { + setPages(newValue); + } + public function setPages(newValue:ArrayCollection, adding:Boolean=false):void + { + if(adding) + { + // concatenate the newValue ArrayCollection onto the end of _pages + for(var index:Number = 0; index < newValue.length; index++) + { + addPage( newValue.getItemAt(index) ); + } + + } + else + { + // replace _pages with newValue + _pages = newValue; + + // totally new list, reset to 0 + currentPageNumber = 0; + highestPageReached = currentPageNumber + 1; + } + } + public function addPage(newValue):void + { + if(newValue != null) + { + _pages.addItem(newValue); + } + } + + public function get currentPageNumber():Number + { return _currentPage; } + public function set currentPageNumber(newValue:Number):void + { _currentPage = newValue; } + + public function get minPagesRead():Number + { return _minPagesRead; } + public function set minPagesRead(newValue:Number):void + { _minPagesRead = newValue; } + + public function get highestPageReached():Number + { return _highestPageReached; } + public function set highestPageReached(newValue:Number):void + { _highestPageReached = newValue; } + + public function finished():Boolean + { return highestPageReached <= minPagesRead; } + public function get length():Number + { return _pages.length; } + + public function get currentPage():DisplayObject + { + if(_pages != null && _pages.length > 0) // pages? + { + if(_currentPage >= 0) // how low? + { + if(_currentPage < _pages.length) // how high? + { + return (DisplayObject)(_pages.getItemAt(_currentPage)); // VALID_RESULT + } + return (DisplayObject)(_pages.getItemAt(pages.length - 1)); // too high + } + return (DisplayObject)(_pages.getItemAt(0)); // too low + } + + return null; // no pages + } + public function nextPage():void + { + currentPageNumber++; + if( currentPageNumber > highestPageReached ) + { + highestPageReached = currentPageNumber + 1; + } + } + public function prevPage():void + { currentPageNumber--; } + } +} \ No newline at end of file Modified: mentalmodels/trunk/flex/src/customComponents/Slider.mxml =================================================================== --- mentalmodels/trunk/flex/src/customComponents/Slider.mxml 2009-04-28 21:40:22 UTC (rev 125) +++ mentalmodels/trunk/flex/src/customComponents/Slider.mxml 2009-04-28 21:44:53 UTC (rev 126) @@ -4,7 +4,12 @@ <mx:Script> <![CDATA[ import mx.controls.Label; - + + [Bindable] + [Embed(source="../images/SliderImage.png")] + private var sliderImage:Class; + + // Psychometric Variables - (Left = Positive, Right = Negative) public var maxValue:Number = 10; // Leftmost value public static var abstainValue:Number = -999; // Refusal to answer @@ -83,6 +88,10 @@ var index:Number = Math.round((mouseX-imageWidth/2) / separation); // snap to nearest valid position value = maxValue - index; // flips scale so positive numbers on left + if(value > maxValue) value = maxValue; + if(value < minValue) value = minValue; + index = maxValue - value; + getValue(); // updates the bindable "getVal" variable var xPos:Number = index * separation; @@ -105,9 +114,6 @@ borderStyle="solid" borderColor="#F0F0F0" borderThickness="2" /> - <mx:Image id="sliderButton" - x="0" y="0" - source="../libs/SliderImage.png" - /> + <mx:Image id="sliderButton" x="0" y="0" source="{sliderImage}"/> </mx:Canvas> Added: mentalmodels/trunk/flex/src/images/SliderImage.png =================================================================== (Binary files differ) Property changes on: mentalmodels/trunk/flex/src/images/SliderImage.png ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Added: mentalmodels/trunk/src/main/db/generated/mme.sql =================================================================== --- mentalmodels/trunk/src/main/db/generated/mme.sql (rev 0) +++ mentalmodels/trunk/src/main/db/generated/mme.sql 2009-04-28 21:44:53 UTC (rev 126) @@ -0,0 +1,92 @@ +alter table categorical drop foreign key FK5BA174204A96BF7A; +alter table categorical_choices drop foreign key FK6ED951D3427248A1; +alter table communication drop foreign key FKC24ACFD63A5846C1; +alter table communication drop foreign key FKC24ACFD6992B5A41; +alter table game_round_config drop foreign key FKA0C2A40DAFC8295; +alter table game_round_config drop foreign key FKA0C2A403A5846C1; +alter table grp drop foreign key FK190E5DAFC8295; +alter table psychometric drop foreign key FKF0B5ECC44A96BF7A; +alter table psychometric_choices drop foreign key FKBFCCE6779F159D33; +alter table question drop foreign key FKBA823BE6CA626674; +alter table round_config drop foreign key FK3BE29313DAFC8295; +alter table round_config_location_config drop foreign key FK59AD1DE03A5846C1; +alter table round_config_location_config drop foreign key FK59AD1DE0E64BF633; +alter table round_config_question_group drop foreign key FKAC05839279C46421; +alter table round_config_question_group drop foreign key FKAC0583923A5846C1; +alter table student drop foreign key FK8FFE823B65663181; +alter table student_day_output drop foreign key FK7B993B8846861732; +alter table student_day_output drop foreign key FK7B993B888374539C; +alter table student_response drop foreign key FK173D15C5992B5A41; +alter table student_response drop foreign key FK173D15C584109673; +alter table student_round_config drop foreign key FK49C432973A5846C1; +alter table student_round_config drop foreign key FK49C43297992B5A41; +alter table student_strategy drop foreign key FK9615A4F73A5846C1; +alter table student_strategy drop foreign key FK9615A4F74A6A64F5; +alter table suspend_repetition drop foreign key FKFBDC4543A5846C1; +alter table suspend_repetition drop foreign key FKFBDC454992B5A41; +drop table if exists categorical; +drop table if exists categorical_choices; +drop table if exists communication; +drop table if exists game; +drop table if exists game_round_config; +drop table if exists grp; +drop table if exists location_config; +drop table if exists psychometric; +drop table if exists psychometric_choices; +drop table if exists question; +drop table if exists question_group; +drop table if exists round_config; +drop table if exists round_config_location_config; +drop table if exists round_config_question_group; +drop table if exists student; +drop table if exists student_day_output; +drop table if exists student_response; +drop table if exists student_round_config; +drop table if exists student_strategy; +drop table if exists suspend_repetition; +create table categorical (id bigint not null, primary key (id)) type=InnoDB; +create table categorical_choices (categorical_id bigint not null, element tinyblob, mapkey varchar(255), primary key (categorical_id, mapkey)) type=InnoDB; +create table communication (id bigint not null auto_increment, message longtext, timestamp datetime, roundconfig_id bigint not null, student_id bigint not null, primary key (id)) type=InnoDB; +create table game (id bigint not null auto_increment, description longtext, img_address varchar(255), max_days integer not null, max_fish_harvest integer not null, money float, no_of_location integer not null, no_of_rounds integer not null, timestamp datetime not null, title varchar(255) not null, primary key (id)) type=InnoDB; +create table game_round_config (game_id bigint not null, roundconfig_id bigint not null, unique (roundconfig_id)) type=InnoDB; +create table grp (id bigint not null auto_increment, grp_no integer not null, game_id bigint not null, primary key (id)) type=InnoDB; +create table location_config (id bigint not null auto_increment, growth_Rate float not null, location_name varchar(255) not null, max_capacity integer not null, start_population integer not null, primary key (id)) type=InnoDB; +create table psychometric (no_of_intervals varchar(255) not null, scale varchar(255) not null, id bigint not null, primary key (id)) type=InnoDB; +create table psychometric_choices (psychometric_id bigint not null, element varchar(255)) type=InnoDB; +create table question (id bigint not null auto_increment, misc_location Boolean not null, multi_location Boolean not null, question longtext not null, sequence_no integer not null, single_location Boolean not null, question_group_id bigint not null, primary key (id)) type=InnoDB; +create table question_group (id bigint not null auto_increment, header_question longtext, sequence_no integer not null, primary key (id)) type=InnoDB; +create table round_config (id bigint not null auto_increment, communication_flag Boolean not null, round_no integer not null, game_id bigint not null, primary key (id)) type=InnoDB; +create table round_config_location_config (roundconfig_id bigint not null, locationconfig_id bigint not null, primary key (roundconfig_id, locationconfig_id)) type=InnoDB; +create table round_config_question_group (roundConfig_id bigint not null, questionGroup_id bigint not null, primary key (roundConfig_id, questionGroup_id)) type=InnoDB; +create table student (id bigint not null auto_increment, year_birth integer, ethnicity varchar(255), gender varchar(255), major varchar(255), student_no integer not null, group_id bigint not null, primary key (id)) type=InnoDB; +create table student_day_output (id bigint not null auto_increment, day integer not null, earnings float not null, strategy_id bigint not null, dayOutput_id bigint not null, primary key (id)) type=InnoDB; +create table student_response (id bigint not null auto_increment, response longtext, question_id bigint not null, student_id bigint not null, primary key (id)) type=InnoDB; +create table student_round_config (id bigint not null auto_increment, current_allocation_no integer not null, current_day_no integer not null, roundconfig_id bigint not null, student_id bigint not null, primary key (id)) type=InnoDB; +create table student_strategy (id bigint not null auto_increment, allocation_sequence_no integer not null, days integer not null, repeated_decisions Boolean not null, threshold float not null, location_id bigint not null, roundconfig_id bigint not null, primary key (id)) type=InnoDB; +create table suspend_repetition (id bigint not null auto_increment, fishing_threshold float not null, harbor_days integer not null, roundconfig_id bigint not null, student_id bigint not null, primary key (id)) type=InnoDB; +alter table categorical add index FK5BA174204A96BF7A (id), add constraint FK5BA174204A96BF7A foreign key (id) references question (id); +alter table categorical_choices add index FK6ED951D3427248A1 (categorical_id), add constraint FK6ED951D3427248A1 foreign key (categorical_id) references categorical (id); +alter table communication add index FKC24ACFD63A5846C1 (roundconfig_id), add constraint FKC24ACFD63A5846C1 foreign key (roundconfig_id) references round_config (id); +alter table communication add index FKC24ACFD6992B5A41 (student_id), add constraint FKC24ACFD6992B5A41 foreign key (student_id) references student (id); +alter table game_round_config add index FKA0C2A40DAFC8295 (game_id), add constraint FKA0C2A40DAFC8295 foreign key (game_id) references game (id); +alter table game_round_config add index FKA0C2A403A5846C1 (roundconfig_id), add constraint FKA0C2A403A5846C1 foreign key (roundconfig_id) references round_config (id); +alter table grp add index FK190E5DAFC8295 (game_id), add constraint FK190E5DAFC8295 foreign key (game_id) references game (id); +alter table psychometric add index FKF0B5ECC44A96BF7A (id), add constraint FKF0B5ECC44A96BF7A foreign key (id) references question (id); +alter table psychometric_choices add index FKBFCCE6779F159D33 (psychometric_id), add constraint FKBFCCE6779F159D33 foreign key (psychometric_id) references psychometric (id); +alter table question add index FKBA823BE6CA626674 (question_group_id), add constraint FKBA823BE6CA626674 foreign key (question_group_id) references question_group (id); +alter table round_config add index FK3BE29313DAFC8295 (game_id), add constraint FK3BE29313DAFC8295 foreign key (game_id) references game (id); +alter table round_config_location_config add index FK59AD1DE03A5846C1 (roundconfig_id), add constraint FK59AD1DE03A5846C1 foreign key (roundconfig_id) references round_config (id); +alter table round_config_location_config add index FK59AD1DE0E64BF633 (locationconfig_id), add constraint FK59AD1DE0E64BF633 foreign key (locationconfig_id) references location_config (id); +alter table round_config_question_group add index FKAC05839279C46421 (questionGroup_id), add constraint FKAC05839279C46421 foreign key (questionGroup_id) references question_group (id); +alter table round_config_question_group add index FKAC0583923A5846C1 (roundConfig_id), add constraint FKAC0583923A5846C1 foreign key (roundConfig_id) references round_config (id); +alter table student add index FK8FFE823B65663181 (group_id), add constraint FK8FFE823B65663181 foreign key (group_id) references grp (id); +alter table student_day_output add index FK7B993B8846861732 (dayOutput_id), add constraint FK7B993B8846861732 foreign key (dayOutput_id) references student_strategy (id); +alter table student_day_output add index FK7B993B888374539C (strategy_id), add constraint FK7B993B888374539C foreign key (strategy_id) references student_strategy (id); +alter table student_response add index FK173D15C5992B5A41 (student_id), add constraint FK173D15C5992B5A41 foreign key (student_id) references student (id); +alter table student_response add index FK173D15C584109673 (question_id), add constraint FK173D15C584109673 foreign key (question_id) references question (id); +alter table student_round_config add index FK49C432973A5846C1 (roundconfig_id), add constraint FK49C432973A5846C1 foreign key (roundconfig_id) references round_config (id); +alter table student_round_config add index FK49C43297992B5A41 (student_id), add constraint FK49C43297992B5A41 foreign key (student_id) references student (id); +alter table student_strategy add index FK9615A4F73A5846C1 (roundconfig_id), add constraint FK9615A4F73A5846C1 foreign key (roundconfig_id) references round_config (id); +alter table student_strategy add index FK9615A4F74A6A64F5 (location_id), add constraint FK9615A4F74A6A64F5 foreign key (location_id) references location_config (id); +alter table suspend_repetition add index FKFBDC4543A5846C1 (roundconfig_id), add constraint FKFBDC4543A5846C1 foreign key (roundconfig_id) references round_config (id); +alter table suspend_repetition add index FKFBDC454992B5A41 (student_id), add constraint FKFBDC454992B5A41 foreign key (student_id) references student (id); Added: mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.properties =================================================================== --- mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.properties (rev 0) +++ mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.properties 2009-04-28 21:44:53 UTC (rev 126) @@ -0,0 +1,5 @@ +hibernate.connection.user=mme +hibernate.connection.password=mmepassword +hibernate.connection.url=jdbc:mysql://localhost/MME +hibernate.connection.driver_class=com.mysql.jdbc.Driver +hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <al...@us...> - 2009-04-28 21:40:30
|
Revision: 125 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=125&view=rev Author: alllee Date: 2009-04-28 21:40:22 +0000 (Tue, 28 Apr 2009) Log Message: ----------- Modified Paths: -------------- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Block.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Communication.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Module.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/QuestionGroup.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/RoundConfig.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Student.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/StudentResponse.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/StudentRoundConfig.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/StudentStrategy.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/SuspendRepetition.java 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-04-28 21:30:58 UTC (rev 124) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Block.java 2009-04-28 21:40:22 UTC (rev 125) @@ -13,7 +13,14 @@ import javax.persistence.OrderBy; import javax.persistence.Table; - +/** + * $Id$ + * + * + * + * @author <a href='mailto:All...@as...'>Allen Lee</a> + * @version $Rev$ + */ @Entity @Table(name="block") public class Block implements Serializable { @@ -33,11 +40,11 @@ @Column(nullable=false) private Integer duration; - @ManyToOne() + @ManyToOne @JoinColumn(nullable=false) private Module module; - @OneToMany(mappedBy ="block") + @OneToMany(mappedBy="block") @OrderBy("sequenceNo") private List<QuestionGroup> questionGroup; Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Communication.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Communication.java 2009-04-28 21:30:58 UTC (rev 124) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Communication.java 2009-04-28 21:40:22 UTC (rev 125) @@ -36,7 +36,7 @@ @ManyToOne @JoinColumn(nullable = false) - private RoundConfig roundconfig; + private RoundConfig roundConfig; public void setId(Long id) { this.id = id; @@ -62,12 +62,12 @@ return timestamp; } - public void setRoundconfig(RoundConfig roundconfig) { - this.roundconfig = roundconfig; + public void setRoundConfig(RoundConfig roundconfig) { + this.roundConfig = roundconfig; } - public RoundConfig getRoundconfig() { - return roundconfig; + public RoundConfig getRoundConfig() { + return roundConfig; } public void setStudent(Student student) { Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Module.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Module.java 2009-04-28 21:30:58 UTC (rev 124) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Module.java 2009-04-28 21:40:22 UTC (rev 125) @@ -12,7 +12,16 @@ import javax.persistence.OrderBy; import javax.persistence.Table; - +/** + * $Id$ + * + * A game consists of several modules. + * + * + * + * @author <a href='mailto:All...@as...'>Allen Lee</a> + * @version $Rev$ + */ @Entity @Table(name="module") public class Module implements Serializable { Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/QuestionGroup.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/QuestionGroup.java 2009-04-28 21:30:58 UTC (rev 124) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/QuestionGroup.java 2009-04-28 21:40:22 UTC (rev 125) @@ -32,7 +32,7 @@ @GeneratedValue private Long id; - @OneToMany(mappedBy ="questionGroup") + @OneToMany(mappedBy="questionGroup") @OrderBy("sequenceNo") private List<Question> questions; @@ -51,14 +51,6 @@ @Column(name="description",nullable=false) private String description; - /*Since we have timings for module, - * we don't need to save timings for each item or question group - * - */ - /*@Column(nullable=false) - private Float maxtime;*/ - - @ManyToOne @JoinColumn(nullable=false) private Block block; Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/RoundConfig.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/RoundConfig.java 2009-04-28 21:30:58 UTC (rev 124) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/RoundConfig.java 2009-04-28 21:40:22 UTC (rev 125) @@ -8,7 +8,6 @@ import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; -import javax.persistence.JoinColumn; import javax.persistence.ManyToMany; import javax.persistence.ManyToOne; import javax.persistence.Table; Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Student.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Student.java 2009-04-28 21:30:58 UTC (rev 124) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Student.java 2009-04-28 21:40:22 UTC (rev 125) @@ -1,6 +1,7 @@ package edu.asu.commons.mme.entity; import java.io.Serializable; +import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; @@ -10,6 +11,8 @@ import javax.persistence.Id; import javax.persistence.ManyToOne; import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; @@ -39,6 +42,9 @@ private String semester; + @Temporal(TemporalType.TIMESTAMP) + private Date timestamp; + @Enumerated(EnumType.ORDINAL) private Gender gender; @@ -98,4 +104,12 @@ return gender; } + public Date getTimestamp() { + return timestamp; + } + + public void setTimestamp(Date timestamp) { + this.timestamp = timestamp; + } + } Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/StudentResponse.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/StudentResponse.java 2009-04-28 21:30:58 UTC (rev 124) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/StudentResponse.java 2009-04-28 21:40:22 UTC (rev 125) @@ -15,10 +15,7 @@ @Table(name="student_response") public class StudentResponse implements Serializable { - /** - * - */ - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 7206317495578110957L; @Id @GeneratedValue Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/StudentRoundConfig.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/StudentRoundConfig.java 2009-04-28 21:30:58 UTC (rev 124) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/StudentRoundConfig.java 2009-04-28 21:40:22 UTC (rev 125) @@ -17,11 +17,7 @@ public class StudentRoundConfig implements Serializable { - - /** - * - */ - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = -1084178532362411139L; @Id @GeneratedValue 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-04-28 21:30:58 UTC (rev 124) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/StudentStrategy.java 2009-04-28 21:40:22 UTC (rev 125) @@ -6,7 +6,6 @@ import javax.persistence.Column; import javax.persistence.Entity; -import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.JoinColumn; @@ -21,12 +20,8 @@ public class StudentStrategy implements Serializable{ - /** - * - */ - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = -7159061961616165928L; - @Id @GeneratedValue private Long id; @@ -34,7 +29,7 @@ @ManyToOne @JoinColumn(nullable=false) - private RoundConfig roundconfig; + private RoundConfig roundConfig; @Column(name = "allocation_sequence_no",nullable=false) private Integer allocationSeqNo; @@ -43,7 +38,7 @@ private Integer days; @Column(nullable=false) - private Float threshold; + private Double threshold; @ManyToOne @JoinColumn(nullable=false) @@ -53,7 +48,7 @@ private boolean repeatedDecisions; - @OneToMany(mappedBy = "strategy") + @OneToMany(mappedBy="strategy") @JoinColumn(nullable=false) private List<DayOutput> dayOutput; @@ -82,11 +77,11 @@ return days; } - public void setThreshold(Float threshold) { + public void setThreshold(Double threshold) { this.threshold = threshold; } - public Float getThreshold() { + public Double getThreshold() { return threshold; } @@ -99,11 +94,11 @@ } public void setRoundConfig(RoundConfig roundConfig) { - this.roundconfig = roundConfig; + this.roundConfig = roundConfig; } public RoundConfig getRoundConfig() { - return roundconfig; + return roundConfig; } public void setLocation(Location location) { Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/SuspendRepetition.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/SuspendRepetition.java 2009-04-28 21:30:58 UTC (rev 124) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/SuspendRepetition.java 2009-04-28 21:40:22 UTC (rev 125) @@ -15,12 +15,8 @@ @Table(name="suspend_repetition") public class SuspendRepetition implements Serializable { - /** - * - */ - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = -6058080502908139560L; - @Id @GeneratedValue private Long id; @@ -28,7 +24,7 @@ @ManyToOne @JoinColumn(nullable=false) - private RoundConfig roundconfig; + private RoundConfig roundConfig; @ManyToOne @JoinColumn(nullable=false) @@ -64,12 +60,12 @@ return fishingThreshold; } - public void setRoundconfig(RoundConfig roundconfig) { - this.roundconfig = roundconfig; + public void setRoundConfig(RoundConfig roundconfig) { + this.roundConfig = roundconfig; } - public RoundConfig getRoundconfig() { - return roundconfig; + public RoundConfig getRoundConfig() { + return roundConfig; } public void setStudent(Student student) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <see...@us...> - 2009-04-28 21:31:09
|
Revision: 124 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=124&view=rev Author: seematalele Date: 2009-04-28 21:30:58 +0000 (Tue, 28 Apr 2009) Log Message: ----------- Chnaged the Module.as, Block.as , FisheryExperiment.mxml Testing- tested if module object is tranfered from java to actionscript. mapping in java for list and in actionscript as a arraycollection fro block object is working correctly. Need to do testing - if you can retrive QuestionGroup from Module.Block Modified Paths: -------------- mentalmodels/trunk/flex/src/FisheryExperiment.mxml mentalmodels/trunk/src/main/db/init-mme.sql mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Block.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Module.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/QuestionGroup.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/StudentStrategy.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/ModuleService.java Added Paths: ----------- mentalmodels/trunk/flex/src/FisheryExperimentKalin.mxml mentalmodels/trunk/flex/src/Student.as mentalmodels/trunk/flex/src/actionscript/Block.as mentalmodels/trunk/flex/src/actionscript/Module.as mentalmodels/trunk/flex/src/actionscript/QuestionGroup.as Modified: mentalmodels/trunk/flex/src/FisheryExperiment.mxml =================================================================== --- mentalmodels/trunk/flex/src/FisheryExperiment.mxml 2009-04-28 20:39:01 UTC (rev 123) +++ mentalmodels/trunk/flex/src/FisheryExperiment.mxml 2009-04-28 21:30:58 UTC (rev 124) @@ -40,6 +40,8 @@ <mx:Consumer id="consumer" destination="DataPush" message="messageHandler(event.message)" /> <mx:Script> <![CDATA[ + import actionscript.Block; + import mx.collections.ArrayCollection; import actionscript.Module; import flash.sampler.getInvocationCount; import mx.controls.Label; @@ -83,7 +85,8 @@ { module = Module(event.result); - Alert.show("duration is " + module.duration ); + var block:Block = module.block.getItemAt(0) as Block + Alert.show("block is " + block.description); } private function faultHandler(event:FaultEvent):void @@ -226,7 +229,7 @@ Alert.show(info.getYear());*/ Id=ss.createStudent(info.getYear(), info.getSemester(), info.getGender(),info.getMajor()); Alert.show("Before invoking createstudent()"); - + // module = mod.getFirstPage(); return true; } } Added: mentalmodels/trunk/flex/src/FisheryExperimentKalin.mxml =================================================================== --- mentalmodels/trunk/flex/src/FisheryExperimentKalin.mxml (rev 0) +++ mentalmodels/trunk/flex/src/FisheryExperimentKalin.mxml 2009-04-28 21:30:58 UTC (rev 124) @@ -0,0 +1,237 @@ +<?xml version="1.0" encoding="utf-8"?> +<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:net="flash.net.*" xmlns:comp="customComponents.*" + backgroundGradientAlphas="[1.0, 1.0]" backgroundGradientColors="[#FFFFFF, #80FFAA]" + width="760" height="510" clipContent="false" layout="absolute" + currentState="instructions" initialize="init()"> + + <mx:states> + <mx:State name="instructions"> + <mx:AddChild relativeTo="{content}"> + <comp:InstructionPage id="instructions"/> + </mx:AddChild> + </mx:State> + + <mx:State name="socioDemographic"> + <mx:AddChild relativeTo="{content}"> + <comp:SocioDemographicPage id="socioDemographic" x="265" y="100"/> + </mx:AddChild> + </mx:State> + + <mx:State name="planner"> + <mx:AddChild relativeTo="{content}"> + <comp:PlannerPage id="planner"/> + </mx:AddChild> + </mx:State> + + <mx:State name="none"/> + </mx:states> + + + + <mx:Canvas id="content" x="5" y="5" width="750" height="470"/> + <mx:Canvas id="expiredContent" x="-100" y="-100" width="1" height="1" visible="false"/> + + <mx:Button id="btnBack" label="« Back" click="back()" left="8" bottom="8"/> + <mx:Button id="btnAccept" label="Accept" click="accept()" left="375" bottom="10"/> + <mx:Button id="btnForward" label="Forward »" click="forward()" right="8" bottom="8"/> + <mx:RemoteObject id="ss" destination="studentService" fault="faultHandler(event)" result="resultHandler(event)"/> + <mx:Producer id="producer" destination="DataPush" acknowledge="ack(event)"/> + <mx:Consumer id="consumer" destination="DataPush" message="messageHandler(event.message)" /> + <mx:Script> + <![CDATA[ + import flash.sampler.getInvocationCount; + import mx.controls.Label; + import customComponents.*; + import mx.controls.Alert; + import mx.rpc.events.ResultEvent; + import mx.rpc.events.FaultEvent; + import mx.messaging.messages.IMessage; + import mx.messaging.events.MessageAckEvent; + import mx.messaging.events.MessageFaultEvent; + import mx.messaging.FlexClient; + import mx.messaging.messages.AsyncMessage; + + + private var shared:SharedObject; + private var flushMessage:String; + [Bindable] + public var Id : uint; + + [Bindable] + public var randomNumbers:String; + private function ack(event:MessageAckEvent):void + { + //chart.setVisible(true); + randomNumbers = event.message.body as String; + //Alert.show("in ack method" + randomNumbers); + } + private function resultHandler(event:ResultEvent):void + { + Id = event.result as uint; + + Alert.show("Student id is " + Id ); + consumer.disconnect(); + } + + private function faultHandler(event:FaultEvent):void + { + Alert.show("event fault is " + event.fault.faultDetail); + } + + private function handleFault(event:MessageFaultEvent):void + { + Alert.show("Message event fault is " + event.faultString); + } + + + private function messageHandler(message:IMessage):void + { + randomNumbers = message.body as String; + Alert.show( ""+randomNumbers); + } + + public function init():void + { + /*var sharedObjTest:Boolean = false; + if(sharedObjTest) + { + var got:Boolean = getLocal(); + if(got) + { + getData().saved1 = "Hello, World!"; + getData().thisIsATest = 283; + + var testLabel:Label = new Label(); + testLabel.text = "This is a test"; + testLabel.x = getData().thisIsATest; + testLabel.y = getData().thisIsATest; + + testLabel.text += ", " +flushMessage+"x"+shared.toString()+"x"; + getData().testLabel = testLabel; + + if(getData().exists) testLabel.text += "SharedObject existed before initialization"; + else getData().exists = true; + + this.addChild(getData().testLabel); + + } + }*/ + + // var msg:AsyncMessage = new AsyncMessage(); + //var client:FlexClient = FlexClient.getInstance(); + //creating new msg with “New” to get current state. + //msg.body = "New"; + + //producer.send(msg); + //Alert.show("message send is " + msg.body); + + + //consumer.subscribe(); + + } + public function getData():Object + { + return shared.data; + } + public function getLocal():Boolean + { + try{ + shared = SharedObject.getLocal("thisIsForWork"); + }catch(err:Error){ + return false; + } + return true; + } + public function flush():Boolean + { + try{ + flushMessage = shared.flush(10000); + }catch(err:Error){ + return false; + } + return true; + } + + public function back():Boolean + { + if(content.numChildren == 0) + { return false; } + var obj:DisplayObject = content.getChildAt(0); + + if(obj is InstructionPage) + { + (InstructionPage)(obj).back(); + } + return false; + } + + public function forward():Boolean + { + if(content.numChildren == 0) + { return false; } + var obj:DisplayObject = content.getChildAt(0); + + if(obj is InstructionPage) + { + (InstructionPage)(obj).forward(); + } + return false; + } + + public function accept():Boolean + { + if(content.numChildren == 0) + { return false; } + var obj:DisplayObject = content.getChildAt(0); + + if(obj is InstructionPage) + { + if( (InstructionPage)(obj).accept() ) + { + obj.visible = false; + expiredContent.addChild(obj); + currentState = "socioDemographic"; + //consumer.subscribe(); + return true; + } + } + if(obj is SocioDemographicPage) + { + var Id:uint = 0; + if( (SocioDemographicPage)(obj).accept() ) + { + obj.visible = false; + expiredContent.addChild(obj); + currentState = "planner"; + var info:SocioDemographicPage = SocioDemographicPage(obj); + + /* Alert.show(info.getGender()); + Alert.show(info.getMajor()); + Alert.show(info.getSemester()); + Alert.show(info.getYear());*/ + Id=ss.createStudent(info.getYear(), info.getSemester(), info.getGender(),info.getMajor()); + Alert.show("Before invoking createstudent()"); + return true; + } + } + if(obj is PlannerPage) + { + if( (PlannerPage)(obj).accept() ) + { + obj.visible = false; + expiredContent.addChild(obj); + currentState = "none"; + + return true; + } + } + + return false; + } + + + + ]]> + </mx:Script> + +</mx:Application> Added: mentalmodels/trunk/flex/src/Student.as =================================================================== --- mentalmodels/trunk/flex/src/Student.as (rev 0) +++ mentalmodels/trunk/flex/src/Student.as 2009-04-28 21:30:58 UTC (rev 124) @@ -0,0 +1,11 @@ +package +{ + [Bindable] + [RemoteClass(alias="student.Student")] + public class Student + { + public var fname:String; + public var lname:String; + + } +} \ No newline at end of file Added: mentalmodels/trunk/flex/src/actionscript/Block.as =================================================================== --- mentalmodels/trunk/flex/src/actionscript/Block.as (rev 0) +++ mentalmodels/trunk/flex/src/actionscript/Block.as 2009-04-28 21:30:58 UTC (rev 124) @@ -0,0 +1,24 @@ +package actionscript +{ + import mx.collections.ArrayCollection; + + [Bindable] + [RemoteClass(alias="edu.asu.commons.mme.entity.Block")] + public class Block + { + public var id:int; + + + public var sequenceNo:int; + + + public var description:String; + + + public var duration:int; + + + public var questionGroup:ArrayCollection; + + } +} \ No newline at end of file Added: mentalmodels/trunk/flex/src/actionscript/Module.as =================================================================== --- mentalmodels/trunk/flex/src/actionscript/Module.as (rev 0) +++ mentalmodels/trunk/flex/src/actionscript/Module.as 2009-04-28 21:30:58 UTC (rev 124) @@ -0,0 +1,18 @@ +package actionscript +{ + import mx.collections.ArrayCollection; + + [Bindable] + [RemoteClass(alias="edu.asu.commons.mme.entity.Module")] + public class Module + { + public var id:int; + public var sequenceNo:int; + public var description:String; + public var duration:int; + public var block:ArrayCollection; //if arraycollection didnt work try list + + + + } +} \ No newline at end of file Added: mentalmodels/trunk/flex/src/actionscript/QuestionGroup.as =================================================================== --- mentalmodels/trunk/flex/src/actionscript/QuestionGroup.as (rev 0) +++ mentalmodels/trunk/flex/src/actionscript/QuestionGroup.as 2009-04-28 21:30:58 UTC (rev 124) @@ -0,0 +1,36 @@ +package actionscript +{ + import mx.collections.ArrayCollection; + + [Bindable] + [RemoteClass(alias="edu.asu.commons.mme.entity.QuestionGroup")] + + public class QuestionGroup + { + public var id:int; + + + private var roundConfig:ArrayCollection; + + + public var sequenceNo:int; + + //header can be question or just a label + + public var header:String; + + public var description:String; + + /*Since we have timings for module, + * we don't need to save timings for each item or question group + * + */ + /*@Column(nullable=false) + public var Float maxtime;*/ + + + public var block:Block; + + + } +} \ No newline at end of file Modified: mentalmodels/trunk/src/main/db/init-mme.sql =================================================================== --- mentalmodels/trunk/src/main/db/init-mme.sql 2009-04-28 20:39:01 UTC (rev 123) +++ mentalmodels/trunk/src/main/db/init-mme.sql 2009-04-28 21:30:58 UTC (rev 124) @@ -43,6 +43,8 @@ insert into block(description, sequence_no, duration,module_id) values("Final data gathering",1,2,4); insert into block(description, sequence_no, duration,module_id) values("Debriefing",2,2,4); + + insert into question_group(block_id,sequence_no,header,description)values(1,1,"Welcome to the E-Fishery Experiment", "In this experiment you will design a strategy to fish an abstract fishing ground together with three other persons. As we are mainly interested in the reasons why you choose a certain strategy, we will ask you a number of questions. For the same reason, there are no \x91correct\x92 or \x91wrong\x92 strategies and no \x91correct\x92 or \x91wrong\x92 answers. However, since for each pound of fish you get during the experiment you will receive #.### US$, you might be interested in finding a strategy that fits your goals well. For this, you have to understand the dynamics of the (simulated) fish population and anticipate well the behavior of the other persons of your group."); 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-04-28 20:39:01 UTC (rev 123) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Block.java 2009-04-28 21:30:58 UTC (rev 124) @@ -37,7 +37,7 @@ @JoinColumn(nullable=false) private Module module; - @OneToMany + @OneToMany(mappedBy ="block") @OrderBy("sequenceNo") private List<QuestionGroup> questionGroup; Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Module.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Module.java 2009-04-28 20:39:01 UTC (rev 123) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Module.java 2009-04-28 21:30:58 UTC (rev 124) @@ -32,10 +32,12 @@ @Column(nullable=false) private Integer duration; + @OneToMany(mappedBy="module") @OrderBy("sequenceNo") private List<Block> blocks; + public void setId(Long id) { this.id = id; } Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/QuestionGroup.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/QuestionGroup.java 2009-04-28 20:39:01 UTC (rev 123) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/QuestionGroup.java 2009-04-28 21:30:58 UTC (rev 124) @@ -32,7 +32,7 @@ @GeneratedValue private Long id; - @OneToMany + @OneToMany(mappedBy ="questionGroup") @OrderBy("sequenceNo") private List<Question> questions; 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-04-28 20:39:01 UTC (rev 123) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/StudentStrategy.java 2009-04-28 21:30:58 UTC (rev 124) @@ -53,7 +53,7 @@ private boolean repeatedDecisions; - @OneToMany(fetch=FetchType.EAGER) + @OneToMany(mappedBy = "strategy") @JoinColumn(nullable=false) private List<DayOutput> dayOutput; 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-04-28 20:39:01 UTC (rev 123) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/ModuleService.java 2009-04-28 21:30:58 UTC (rev 124) @@ -17,7 +17,7 @@ public Module getFirstPage() { // System.out.println("test is " + test); - Module module = getDao().findByProperty("sequenceNo", new Integer(1)); + Module module = getDao().findByProperty("sequenceNo", new Integer(2)); Hibernate.initialize(module); System.out.println("Module object is " + module.getDescription()); @@ -39,7 +39,8 @@ } - System.out.println("Block description iss " + module.getBlocks().get(0).getDescription()); + + System.out.println("Module block is " + module.getBlocks().size()); return module; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <al...@us...> - 2009-04-28 20:39:14
|
Revision: 123 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=123&view=rev Author: alllee Date: 2009-04-28 20:39:01 +0000 (Tue, 28 Apr 2009) Log Message: ----------- A whole lot of renaming, and fixing hibernate mappings to get rid of unneeded join tables, etc. Also fixing all serializable serialVersionUIDs. Modified Paths: -------------- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Block.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Communication.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/DayOutput.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Group.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Module.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/PersistableSequence.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/QuestionGroup.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/RoundConfig.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/StudentStrategy.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StudentService.java mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.cfg.xml Added Paths: ----------- 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/Persistable.java Removed Paths: ------------- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/GameConfig.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/LocationConfig.java 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-04-28 19:49:12 UTC (rev 122) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Block.java 2009-04-28 20:39:01 UTC (rev 123) @@ -5,7 +5,6 @@ import javax.persistence.Column; import javax.persistence.Entity; -import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.JoinColumn; @@ -19,10 +18,7 @@ @Table(name="block") public class Block implements Serializable { - /** - * - */ - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 8471073622543194049L; @Id @GeneratedValue @@ -36,17 +32,15 @@ @Column(nullable=false) private Integer duration; - - @ManyToOne + @ManyToOne() @JoinColumn(nullable=false) private Module module; - @OneToMany(fetch=FetchType.EAGER) + @OneToMany @OrderBy("sequenceNo") private List<QuestionGroup> questionGroup; - public void setId(Long id) { this.id = id; } Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Communication.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Communication.java 2009-04-28 19:49:12 UTC (rev 122) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Communication.java 2009-04-28 20:39:01 UTC (rev 123) @@ -18,10 +18,7 @@ @Table(name="communication") public class Communication implements Serializable{ - /** - * - */ - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = -5192191583107353478L; @Id @GeneratedValue Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/DayOutput.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/DayOutput.java 2009-04-28 19:49:12 UTC (rev 122) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/DayOutput.java 2009-04-28 20:39:01 UTC (rev 123) @@ -15,10 +15,7 @@ @Table(name="student_day_output") public class DayOutput implements Serializable { - /** - * - */ - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = -224776196384722725L; @Id @GeneratedValue @@ -32,7 +29,7 @@ private Integer day; @Column(nullable=false) - private Float earnings; + private Double earnings; public void setId(Long id) { this.id = id; @@ -50,11 +47,11 @@ return day; } - public void setEarnings(Float earnings) { + public void setEarnings(Double earnings) { this.earnings = earnings; } - public Float getEarnings() { + public Double getEarnings() { return earnings; } Copied: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Game.java (from rev 122, mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/GameConfig.java) =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Game.java (rev 0) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Game.java 2009-04-28 20:39:01 UTC (rev 123) @@ -0,0 +1,135 @@ +package edu.asu.commons.mme.entity; + +import java.io.Serializable; +import java.sql.Timestamp; +import java.util.List; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.Lob; +import javax.persistence.OneToMany; +import javax.persistence.Table; + +@Entity +@Table(name="game") +public class Game implements Serializable { + + private static final long serialVersionUID = 1060692155087738338L; + + @Id + @GeneratedValue + private Long id; + + @Column(name="no_of_rounds",nullable = false) + private Integer numberOfRounds; + + @Column(name="no_of_locations",nullable = false) + private Integer numberOfLocations; + + @Column(name="max_days",nullable = false) + private Integer maxDays; + + @Column(name="max_fish_harvest",nullable = false) + private Integer maxFishHarvest; + + @Column(nullable=false) + private Timestamp timestamp; + + @Column(nullable=false) + private String title; + + @Lob + private String description; + + @Column(scale=2) + private Double money; + @Column(name="image_location") + private String imageLocation; + + // FIXME: should this be many-to-many instead? + @OneToMany + @JoinColumn(name="round_configs_id") + private List<RoundConfig> roundConfigs; + + public void setId(Long id) { + this.id = id; + } + public Long getId() { + return id; + } + + + public void setTitle(String title) { + this.title = title; + } + public String getTitle() { + return title; + } + public void setDescription(String description) { + this.description = description; + } + public String getDescription() { + return description; + } + public void setMoney(Double money) { + this.money = money; + } + public Double getMoney() { + return money; + } + + public void setRoundconfig(List<RoundConfig> roundconfig) { + this.roundConfigs = roundconfig; + } + public List<RoundConfig> getRoundconfig() { + return roundConfigs; + } + public void setTimestamp(Timestamp timestamp) { + this.timestamp = timestamp; + } + public Timestamp getTimestamp() { + return timestamp; + } + public Integer getNumberOfRounds() { + return numberOfRounds; + } + public void setNumberOfRounds(Integer numberOfRounds) { + this.numberOfRounds = numberOfRounds; + } + public Integer getNumberOfLocations() { + return numberOfLocations; + } + public void setNumberOfLocations(Integer numberOfLocations) { + this.numberOfLocations = numberOfLocations; + } + public Integer getMaxDays() { + return maxDays; + } + public void setMaxDays(Integer maxDays) { + this.maxDays = maxDays; + } + public Integer getMaxFishHarvest() { + return maxFishHarvest; + } + public void setMaxFishHarvest(Integer maxFishHarvest) { + this.maxFishHarvest = maxFishHarvest; + } + public String getImageLocation() { + return imageLocation; + } + public void setImageLocation(String imageLocation) { + this.imageLocation = imageLocation; + } + public List<RoundConfig> getRoundConfigs() { + return roundConfigs; + } + public void setRoundConfigs(List<RoundConfig> roundConfig) { + this.roundConfigs = roundConfig; + } + + +} + Deleted: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/GameConfig.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/GameConfig.java 2009-04-28 19:49:12 UTC (rev 122) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/GameConfig.java 2009-04-28 20:39:01 UTC (rev 123) @@ -1,129 +0,0 @@ -package edu.asu.commons.mme.entity; - -import java.io.Serializable; -import java.sql.Timestamp; -import java.util.List; - -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; -import javax.persistence.Lob; -import javax.persistence.OneToMany; -import javax.persistence.Table; - -@Entity -@Table(name="game") -public class GameConfig implements Serializable { - - /** - * - */ - private static final long serialVersionUID = 1L; - - @Id - @GeneratedValue - private Long id; - - @Column(name="no_of_rounds",nullable = false) - private Integer noOfRounds; - - @Column(name="no_of_location",nullable = false) - private Integer noOfLocation; - - @Column(name="max_days",nullable = false) - private Integer maxDays; - - @Column(name="max_fish_harvest",nullable = false) - private Integer maxFishHarvest; - - - @Column(nullable=false) - private Timestamp timestamp; - - @Column(nullable=false) - private String title; - - @Lob - private String description; - - @Column(scale=2) - private Float money; - private String img_address; - - @OneToMany(fetch=FetchType.EAGER) - private List<RoundConfig> roundConfig; - - - public void setId(Long id) { - this.id = id; - } - public Long getId() { - return id; - } - public void setNo_of_rounds(Integer no_of_rounds) { - this.noOfRounds = no_of_rounds; - } - public Integer getNo_of_rounds() { - return noOfRounds; - } - public void setNo_of_location(Integer no_of_location) { - this.noOfLocation = no_of_location; - } - public Integer getNo_of_location() { - return noOfLocation; - } - public void setMax_fish_harvest(Integer max_fish_harvest) { - this.maxFishHarvest = max_fish_harvest; - } - public Integer getMax_fish_harvest() { - return maxFishHarvest; - } - public void setMax_no_of_days(Integer max_no_of_days) { - this.maxDays = max_no_of_days; - } - public Integer getMax_no_of_days() { - return maxDays; - } - - public void setTitle(String title) { - this.title = title; - } - public String getTitle() { - return title; - } - public void setDescription(String description) { - this.description = description; - } - public String getDescription() { - return description; - } - public void setMoney(Float money) { - this.money = money; - } - public Float getMoney() { - return money; - } - public void setImg_address(String img_address) { - this.img_address = img_address; - } - public String getImg_address() { - return img_address; - } - public void setRoundconfig(List<RoundConfig> roundconfig) { - this.roundConfig = roundconfig; - } - public List<RoundConfig> getRoundconfig() { - return roundConfig; - } - public void setTimestamp(Timestamp timestamp) { - this.timestamp = timestamp; - } - public Timestamp getTimestamp() { - return timestamp; - } - - -} - Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Group.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Group.java 2009-04-28 19:49:12 UTC (rev 122) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Group.java 2009-04-28 20:39:01 UTC (rev 123) @@ -19,44 +19,42 @@ */ @Entity @Table(name="grp") -public class Group implements Serializable{ +public class Group implements Serializable { - /** - * - */ - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 412048544130956282L; @Id @GeneratedValue private Long id; - @Column(name="grp_no",nullable=false) - private Integer no; + @Column(name="grp_number",nullable=false) + private Integer number; @ManyToOne @JoinColumn(nullable = false) - private GameConfig game; + private Game game; public Long getId() { - return this.id; + return id; } public void setId(Long id) { this.id = id; - } - public Integer getNo() { - return this.no; } + + public Integer getNumber() { + return this.number; + } - public void setNo(Integer no) { - this.no = no; + public void setNumber(Integer no) { + this.number = no; } - public void setGame(GameConfig game) { + public void setGame(Game game) { this.game = game; } - public GameConfig getGame() { + public Game getGame() { return game; } Copied: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Location.java (from rev 121, mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/LocationConfig.java) =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Location.java (rev 0) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Location.java 2009-04-28 20:39:01 UTC (rev 123) @@ -0,0 +1,78 @@ +package edu.asu.commons.mme.entity; + +import java.io.Serializable; +import java.util.Set; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToMany; +import javax.persistence.Table; + +@Entity +@Table(name = "location") +public class Location implements Serializable{ + + private static final long serialVersionUID = -4927839337623521766L; + + @Id + @GeneratedValue + private Long id; + + @ManyToMany + @JoinColumn(name="round_configs_id") + private Set<RoundConfig> roundConfigs; + + @Column(nullable=false,name="location_name") + private String locationName; + + @Column(nullable=false,name="max_capacity") + private Integer maxCapacity; + + @Column(nullable=false,name="growth_rate", scale=2) + private Double growthRate; + + @Column(nullable=false,name="initial_population") + private Integer initialPopulation; + + public void setId(Long id) { + this.id = id; + } + public Long getId() { + return id; + } + + public void setRoundConfigs(Set<RoundConfig> roundconfig) { + this.roundConfigs = roundconfig; + } + public Set<RoundConfig> getRoundConfigs() { + return roundConfigs; + } + public Double getGrowthRate() { + return growthRate; + } + public void setGrowthRate(Double growthRate) { + this.growthRate = growthRate; + } + public String getLocationName() { + return locationName; + } + public void setLocationName(String locationName) { + this.locationName = locationName; + } + public Integer getMaxCapacity() { + return maxCapacity; + } + public void setMaxCapacity(Integer maxCapacity) { + this.maxCapacity = maxCapacity; + } + public Integer getInitialPopulation() { + return initialPopulation; + } + public void setInitialPopulation(Integer initialPopulation) { + this.initialPopulation = initialPopulation; + } + +} Deleted: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/LocationConfig.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/LocationConfig.java 2009-04-28 19:49:12 UTC (rev 122) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/LocationConfig.java 2009-04-28 20:39:01 UTC (rev 123) @@ -1,82 +0,0 @@ -package edu.asu.commons.mme.entity; - -import java.io.Serializable; -import java.util.Set; - -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToMany; -import javax.persistence.Table; - -@Entity -@Table(name = "location_config") -public class LocationConfig implements Serializable{ - - /** - * - */ - private static final long serialVersionUID = 1L; - - @Id - @GeneratedValue - private Long id; - - @ManyToMany(mappedBy = "locationconfig") - @JoinColumn(nullable =false) - private Set<RoundConfig> roundconfig; - - - @Column(nullable =false,name="location_name") - private String locationName; - - @Column(nullable =false,name="max_capacity") - private Integer maxCapacity; - - @Column(nullable =false,name="growth_Rate", scale=2) - private Float growthRate; - - @Column(nullable =false,name="start_population") - private Integer startPopulation; - - public void setId(Long id) { - this.id = id; - } - public Long getId() { - return id; - } - - public void setLocation_name(String location_name) { - this.locationName = location_name; - } - public String getLocation_name() { - return locationName; - } - public void setMax_capacity(Integer max_capacity) { - this.maxCapacity = max_capacity; - } - public Integer getMax_capacity() { - return maxCapacity; - } - public void setGrowth_rate(Float growth_rate) { - this.growthRate = growth_rate; - } - public Float getGrowth_rate() { - return growthRate; - } - public void setStart_population(Integer start_population) { - this.startPopulation = start_population; - } - public Integer getStart_population() { - return startPopulation; - } - public void setRoundconfig(Set<RoundConfig> roundconfig) { - this.roundconfig = roundconfig; - } - public Set<RoundConfig> getRoundconfig() { - return roundconfig; - } - -} Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Module.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Module.java 2009-04-28 19:49:12 UTC (rev 122) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Module.java 2009-04-28 20:39:01 UTC (rev 123) @@ -32,7 +32,7 @@ @Column(nullable=false) private Integer duration; - @OneToMany() + @OneToMany(mappedBy="module") @OrderBy("sequenceNo") private List<Block> blocks; Added: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Persistable.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Persistable.java (rev 0) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Persistable.java 2009-04-28 20:39:01 UTC (rev 123) @@ -0,0 +1,56 @@ +package edu.asu.commons.mme.entity; + +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.MappedSuperclass; +import javax.persistence.Transient; + +import org.apache.log4j.Logger; + +/** + * $Id: Persistable.java 266 2009-04-16 01:30:51Z alllee $ + * + * Marker interface for all Persistable entities. + * + * + * @author <a href='All...@as...'>Allen Lee</a> + * @version $Revision: 266 $ + * @param <E> the ID type (Long, Short, Byte, etc.) + */ +public interface Persistable<E extends Number> { + + public E getId(); + public void setId(E number); + + @MappedSuperclass + public abstract static class Base<N extends Number> implements Persistable<N> { + @Transient + protected final transient Logger logger = Logger.getLogger( getClass() ); + + @Id @GeneratedValue + private N id; + + public N getId() { + return id; + } + + public void setId(N id) { + this.id = id; + } + + public boolean isNew() { + return id == null || id.equals(-1); + } + + @SuppressWarnings("unchecked") + public boolean equals(Object candidate) { + if (candidate == null || id == null) return false; + if (candidate == this) return true; + if (candidate instanceof Persistable && getClass().isInstance(candidate) ) { + Persistable persistable = (Persistable) candidate; + return persistable.getId().equals(id); + } + return false; + } + } +} Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/PersistableSequence.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/PersistableSequence.java 2009-04-28 19:49:12 UTC (rev 122) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/PersistableSequence.java 2009-04-28 20:39:01 UTC (rev 123) @@ -11,7 +11,7 @@ * @version $Rev$ */ @MappedSuperclass -public abstract class PersistableSequence implements Comparable<PersistableSequence> { +public abstract class PersistableSequence extends Persistable.Base<Long> implements Comparable<PersistableSequence> { @Column(name="sequence_number") private Integer sequenceNumber; Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/QuestionGroup.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/QuestionGroup.java 2009-04-28 19:49:12 UTC (rev 122) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/QuestionGroup.java 2009-04-28 20:39:01 UTC (rev 123) @@ -2,12 +2,11 @@ import java.io.Serializable; +import java.util.List; import java.util.Set; -import java.util.SortedSet; import javax.persistence.Column; import javax.persistence.Entity; -import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.JoinColumn; @@ -18,29 +17,24 @@ import javax.persistence.OrderBy; import javax.persistence.Table; -import org.hibernate.annotations.Sort; - /* - * QuestionGroup represents one single page within a Block. If there are no Questions + * QuestionGroup represents one single page within a Block. If there are no Questions then + * it is simply a page of instructions stored in the header field. */ @Entity @Table(name="question_group") -public class QuestionGroup implements Serializable{ - /** - * - */ - private static final long serialVersionUID = 1L; +public class QuestionGroup implements Serializable { + private static final long serialVersionUID = 1171426945687494094L; @Id @GeneratedValue private Long id; - @OneToMany(fetch=FetchType.EAGER) + @OneToMany @OrderBy("sequenceNo") - @Sort() - private SortedSet<Question> questions; + private List<Question> questions; @ManyToMany(mappedBy = "questionGroup") @JoinColumn(nullable=false) @@ -107,10 +101,10 @@ public Block getBlock() { return block; } - public SortedSet<Question> getQuestions() { + public List<Question> getQuestions() { return questions; } - public void setQuestions(SortedSet<Question> questions) { + public void setQuestions(List<Question> questions) { this.questions = questions; } Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/RoundConfig.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/RoundConfig.java 2009-04-28 19:49:12 UTC (rev 122) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/RoundConfig.java 2009-04-28 20:39:01 UTC (rev 123) @@ -4,11 +4,9 @@ import java.io.Serializable; import java.util.Set; -import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToMany; @@ -17,36 +15,28 @@ @Entity @Table(name="round_config") -public class RoundConfig implements Serializable{ - /** - * - */ - private static final long serialVersionUID = 1L; +public class RoundConfig implements Serializable { + private static final long serialVersionUID = 8112076402732581224L; + @Id - @GeneratedValue(strategy = GenerationType.AUTO) + @GeneratedValue private Long id; @Column(name="round_no",nullable=false) private Integer roundNo; - - @ManyToOne - @JoinColumn(nullable=false) - private GameConfig game; + private Game game; - - @Column(name="communication_flag",nullable=false,columnDefinition= "Boolean") + @Column(name="communication_flag",nullable=false) private boolean communicationFlag; - - - @ManyToMany(cascade = {CascadeType.PERSIST, CascadeType.MERGE}) + @ManyToMany private Set<QuestionGroup> questionGroup; - @ManyToMany(cascade = {CascadeType.PERSIST, CascadeType.MERGE}) - private Set<LocationConfig> locationconfig; + @ManyToMany + private Set<Location> locations; public void setId(Long id) { this.id = id; @@ -67,10 +57,10 @@ public Boolean getCommunicationFlag() { return communicationFlag; } - public void setGame(GameConfig game) { + public void setGame(Game game) { this.game = game; } - public GameConfig getGame() { + public Game getGame() { return game; } public void setQuestionGroup(Set<QuestionGroup> questiongroup) { @@ -79,12 +69,13 @@ public Set<QuestionGroup> getQuestionGroup() { return questionGroup; } - public void setLocationconfig(Set<LocationConfig> locationconfig) { - this.locationconfig = locationconfig; + public Set<Location> getLocations() { + return locations; } - public Set<LocationConfig> getLocationconfig() { - return locationconfig; + public void setLocations(Set<Location> locations) { + this.locations = locations; } + 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-04-28 19:49:12 UTC (rev 122) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/StudentStrategy.java 2009-04-28 20:39:01 UTC (rev 123) @@ -47,7 +47,7 @@ @ManyToOne @JoinColumn(nullable=false) - private LocationConfig location; + private Location location; @Column (name="repeated_decisions",columnDefinition="Boolean", nullable=false) private boolean repeatedDecisions; @@ -106,11 +106,11 @@ return roundconfig; } - public void setLocation(LocationConfig location) { + public void setLocation(Location location) { this.location = location; } - public LocationConfig getLocation() { + public Location getLocation() { return location; } Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StudentService.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StudentService.java 2009-04-28 19:49:12 UTC (rev 122) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StudentService.java 2009-04-28 20:39:01 UTC (rev 123) @@ -25,8 +25,8 @@ private List<Student> students = new ArrayList<Student>(); Group newgroup; - private volatile static Integer groupNo; - private volatile static Integer studentNo; + private static Integer groupNo; + private static Integer studentNo; public Long createStudent(Integer birthYear, String semester,String gender,String major) { Modified: mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.cfg.xml =================================================================== --- mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.cfg.xml 2009-04-28 19:49:12 UTC (rev 122) +++ mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.cfg.xml 2009-04-28 20:39:01 UTC (rev 123) @@ -7,37 +7,30 @@ "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> - <mapping class='edu.asu.commons.mme.entity.GameConfig'/> - <mapping class='edu.asu.commons.mme.entity.RoundConfig'/> - <mapping class='edu.asu.commons.mme.entity.LocationConfig'/> - <mapping class='edu.asu.commons.mme.entity.Communication'/> - <mapping class='edu.asu.commons.mme.entity.Group'/> - <mapping class='edu.asu.commons.mme.entity.Student'/> + <mapping class='edu.asu.commons.mme.entity.Game'/> + <mapping class='edu.asu.commons.mme.entity.RoundConfig'/> + <mapping class='edu.asu.commons.mme.entity.Location'/> + <mapping class='edu.asu.commons.mme.entity.Communication'/> + <mapping class='edu.asu.commons.mme.entity.Group'/> + <mapping class='edu.asu.commons.mme.entity.Student'/> - <mapping class='edu.asu.commons.mme.entity.StudentRoundConfig'/> + <mapping class='edu.asu.commons.mme.entity.StudentRoundConfig'/> <mapping class='edu.asu.commons.mme.entity.StudentStrategy'/> - <mapping class='edu.asu.commons.mme.entity.DayOutput'/> - <mapping class='edu.asu.commons.mme.entity.SuspendRepetition'/> - - <mapping class='edu.asu.commons.mme.entity.QuestionGroup'/> + <mapping class='edu.asu.commons.mme.entity.DayOutput'/> + <mapping class='edu.asu.commons.mme.entity.SuspendRepetition'/> + + <mapping class='edu.asu.commons.mme.entity.QuestionGroup'/> <mapping class='edu.asu.commons.mme.entity.Question'/> - <mapping class='edu.asu.commons.mme.entity.Categorical'/> - <mapping class='edu.asu.commons.mme.entity.Psychometric'/> - <mapping class='edu.asu.commons.mme.entity.StudentResponse'/> - - <mapping class='edu.asu.commons.mme.entity.Module'/> - <mapping class='edu.asu.commons.mme.entity.Block'/> - + <mapping class='edu.asu.commons.mme.entity.Categorical'/> + <mapping class='edu.asu.commons.mme.entity.Psychometric'/> + <mapping class='edu.asu.commons.mme.entity.StudentResponse'/> - - - + <mapping class='edu.asu.commons.mme.entity.Module'/> + <mapping class='edu.asu.commons.mme.entity.Block'/> - - </session-factory> </hibernate-configuration> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <al...@us...> - 2009-04-28 19:49:16
|
Revision: 122 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=122&view=rev Author: alllee Date: 2009-04-28 19:49:12 +0000 (Tue, 28 Apr 2009) Log Message: ----------- organized imports and other minor refactoring / renaming / xmllint / hygiene. Removing FisheryExperiment.swf from SVN since it's a generated file and doesn't belong in the repository. Modified Paths: -------------- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Block.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Categorical.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Communication.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Forecasting.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/GameConfig.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Module.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Question.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/QuestionGroup.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/RoundConfig.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Student.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/Feed.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/ModuleService.java mentalmodels/trunk/src/main/webapp/WEB-INF/flex/services-config.xml Added Paths: ----------- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/PersistableSequence.java Removed Paths: ------------- mentalmodels/trunk/src/main/webapp/FisheryExperiment.swf 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-04-28 19:36:09 UTC (rev 121) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Block.java 2009-04-28 19:49:12 UTC (rev 122) @@ -11,6 +11,7 @@ import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.OneToMany; +import javax.persistence.OrderBy; import javax.persistence.Table; @@ -41,7 +42,8 @@ @JoinColumn(nullable=false) private Module module; - @OneToMany + @OneToMany(fetch=FetchType.EAGER) + @OrderBy("sequenceNo") private List<QuestionGroup> questionGroup; Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Categorical.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Categorical.java 2009-04-28 19:36:09 UTC (rev 121) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Categorical.java 2009-04-28 19:49:12 UTC (rev 122) @@ -2,29 +2,21 @@ import java.io.Serializable; -import java.util.List; import java.util.Map; import javax.persistence.Entity; import javax.persistence.Table; import org.hibernate.annotations.CollectionOfElements; -import org.hibernate.annotations.IndexColumn; @Entity @Table(name="categorical") -public class Categorical extends Question implements Serializable{ +public class Categorical extends Question implements Serializable { -/** - * - */ - private static final long serialVersionUID = 1L; -/* @CollectionOfElements - @IndexColumn(name = "choices", base=1, nullable=false) -*/ - + private static final long serialVersionUID = 5399081841291536902L; + @CollectionOfElements @org.hibernate.annotations.MapKey private Map<String,java.util.ArrayList<String>> choices; @@ -37,16 +29,5 @@ return choices; } - /*public void setChoices(List<String> choices) { - this.choices = choices; - } - public List<String> getChoices() { - return choices; - } -*/ - - - - } Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Communication.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Communication.java 2009-04-28 19:36:09 UTC (rev 121) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Communication.java 2009-04-28 19:49:12 UTC (rev 122) @@ -3,8 +3,7 @@ import java.io.Serializable; import java.sql.Timestamp; -import java.util.Date; -import javax.persistence.Column; + import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; @@ -12,8 +11,6 @@ import javax.persistence.Lob; import javax.persistence.ManyToOne; import javax.persistence.Table; -import javax.persistence.Temporal; -import javax.persistence.TemporalType; Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Forecasting.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Forecasting.java 2009-04-28 19:36:09 UTC (rev 121) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Forecasting.java 2009-04-28 19:49:12 UTC (rev 122) @@ -1,20 +1,20 @@ package edu.asu.commons.mme.entity; + import java.io.Serializable; +import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Table; -import javax.persistence.Column; @Entity @Table(name="forecasting") -public class Forecasting extends Question implements Serializable{ - /** - * - */ - private static final long serialVersionUID = 1L; +public class Forecasting extends Question implements Serializable { + + private static final long serialVersionUID = -1130445773406872694L; + @Column(name="day_no",nullable=false) private Integer dayNo; Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/GameConfig.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/GameConfig.java 2009-04-28 19:36:09 UTC (rev 121) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/GameConfig.java 2009-04-28 19:49:12 UTC (rev 122) @@ -2,7 +2,6 @@ import java.io.Serializable; import java.sql.Timestamp; -import java.util.ArrayList; import java.util.List; import javax.persistence.Column; Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Module.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Module.java 2009-04-28 19:36:09 UTC (rev 121) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Module.java 2009-04-28 19:49:12 UTC (rev 122) @@ -1,28 +1,24 @@ package edu.asu.commons.mme.entity; + import java.io.Serializable; -import java.util.ArrayList; import java.util.List; import javax.persistence.Column; import javax.persistence.Entity; -import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.OneToMany; +import javax.persistence.OrderBy; import javax.persistence.Table; @Entity @Table(name="module") - public class Module implements Serializable { - - /** - * - */ - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = -1523640426012601246L; + @Id @GeneratedValue private Long id; @@ -36,8 +32,9 @@ @Column(nullable=false) private Integer duration; - @OneToMany - private List<Block> block= new ArrayList<Block>(); + @OneToMany() + @OrderBy("sequenceNo") + private List<Block> blocks; public void setId(Long id) { this.id = id; @@ -63,16 +60,15 @@ return description; } - - - public void setBlock(List<Block> block) { - this.block = block; + public void setBlocks(List<Block> blocks) { + this.blocks = blocks; } - public List<Block> getBlock() { - return block; + public List<Block> getBlocks() { + return blocks; } + public void setDuration(Integer duration) { this.duration = duration; } Added: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/PersistableSequence.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/PersistableSequence.java (rev 0) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/PersistableSequence.java 2009-04-28 19:49:12 UTC (rev 122) @@ -0,0 +1,35 @@ +package edu.asu.commons.mme.entity; + +import javax.persistence.Column; +import javax.persistence.MappedSuperclass; + +/** + * $Id$ + * + * + * @author <a href='mailto:All...@as...'>Allen Lee</a> + * @version $Rev$ + */ +@MappedSuperclass +public abstract class PersistableSequence implements Comparable<PersistableSequence> { + + @Column(name="sequence_number") + private Integer sequenceNumber; + + public Integer getSequenceNumber() { + return sequenceNumber; + } + + public void setSequenceNumber(Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + public int compareTo(PersistableSequence persistableSequence) { + if (persistableSequence == null) { + throw new NullPointerException("comparing to null persistable sequence"); + } + return sequenceNumber.compareTo(persistableSequence.sequenceNumber); + } + + +} Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Question.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Question.java 2009-04-28 19:36:09 UTC (rev 121) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Question.java 2009-04-28 19:49:12 UTC (rev 122) @@ -1,8 +1,7 @@ package edu.asu.commons.mme.entity; - + import java.io.Serializable; -import java.util.Set; import javax.persistence.Column; import javax.persistence.Entity; @@ -13,18 +12,15 @@ import javax.persistence.JoinColumn; import javax.persistence.Lob; import javax.persistence.ManyToOne; -import javax.persistence.OneToMany; import javax.persistence.Table; @Entity @Table(name="question") @Inheritance(strategy = InheritanceType.JOINED) -public class Question implements Serializable { - /** - * - */ - private static final long serialVersionUID = 1L; +public class Question implements Serializable, Comparable<Question> { + private static final long serialVersionUID = -6745280629134903292L; + @Id @GeneratedValue private Long id; @@ -57,7 +53,6 @@ public Long getId() { return id; } - public void setQuestion(String question) { this.question = question; @@ -106,6 +101,13 @@ public QuestionGroup getQuestionGroup() { return questionGroup; } + + public int compareTo(Question question) { + if (question == null) { + throw new NullPointerException("compareTo invoked on a null question."); + } + return sequenceNo.compareTo(question.sequenceNo); + } Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/QuestionGroup.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/QuestionGroup.java 2009-04-28 19:36:09 UTC (rev 121) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/QuestionGroup.java 2009-04-28 19:49:12 UTC (rev 122) @@ -3,20 +3,26 @@ import java.io.Serializable; import java.util.Set; +import java.util.SortedSet; 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.OrderBy; import javax.persistence.Table; +import org.hibernate.annotations.Sort; + /* - * QuestionGroup table stiores not only questions but also the other items and their corresponding description + * QuestionGroup represents one single page within a Block. If there are no Questions */ @Entity @Table(name="question_group") @@ -31,6 +37,10 @@ @GeneratedValue private Long id; + @OneToMany(fetch=FetchType.EAGER) + @OrderBy("sequenceNo") + @Sort() + private SortedSet<Question> questions; @ManyToMany(mappedBy = "questionGroup") @JoinColumn(nullable=false) @@ -91,17 +101,17 @@ public String getDescription() { return description; } -/* public void setTime(Float time) { - this.maxtime = time; - } - public Float getTime() { - return maxtime; - }*/ public void setBlock(Block block) { this.block = block; } public Block getBlock() { return block; } + public SortedSet<Question> getQuestions() { + return questions; + } + public void setQuestions(SortedSet<Question> questions) { + this.questions = questions; + } } Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/RoundConfig.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/RoundConfig.java 2009-04-28 19:36:09 UTC (rev 121) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/RoundConfig.java 2009-04-28 19:49:12 UTC (rev 122) @@ -6,15 +6,11 @@ import javax.persistence.CascadeType; import javax.persistence.Column; -import javax.persistence.JoinColumn; - -import javax.persistence.Column; - - import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; +import javax.persistence.JoinColumn; import javax.persistence.ManyToMany; import javax.persistence.ManyToOne; import javax.persistence.Table; Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Student.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Student.java 2009-04-28 19:36:09 UTC (rev 121) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Student.java 2009-04-28 19:49:12 UTC (rev 122) @@ -32,15 +32,15 @@ @Column(name="student_no") private Integer studentNo; - @Column(name="year_birth",length = 4) + @Column(name="birth_year") private Integer birthYear; private String major; private String semester; - @Enumerated(EnumType.STRING) - private Gender gender; + @Enumerated(EnumType.ORDINAL) + private Gender gender; public Long getId() { return id; Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/Feed.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/Feed.java 2009-04-28 19:36:09 UTC (rev 121) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/Feed.java 2009-04-28 19:49:12 UTC (rev 122) @@ -1,14 +1,9 @@ package edu.asu.commons.mme.service; //package edu.asu.commons.mme.service; -import java.util.*; - import flex.messaging.MessageBroker; import flex.messaging.messages.AsyncMessage; -import flex.messaging.messages.Message; import flex.messaging.util.UUIDUtils; -import flex.messaging.services.MessageService; -import flex.messaging.services.ServiceAdapter; public class Feed{ 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-04-28 19:36:09 UTC (rev 121) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/ModuleService.java 2009-04-28 19:49:12 UTC (rev 122) @@ -22,7 +22,7 @@ System.out.println("Module object is " + module.getDescription()); - List<Block> listBlock = module.getBlock(); + List<Block> listBlock = module.getBlocks(); Iterator<Block> iterateBlock = listBlock.iterator(); while(iterateBlock.hasNext()) { @@ -39,7 +39,7 @@ } - System.out.println("Block description iss " + module.getBlock().get(0).getDescription()); + System.out.println("Block description iss " + module.getBlocks().get(0).getDescription()); return module; Deleted: mentalmodels/trunk/src/main/webapp/FisheryExperiment.swf =================================================================== (Binary files differ) Modified: mentalmodels/trunk/src/main/webapp/WEB-INF/flex/services-config.xml =================================================================== --- mentalmodels/trunk/src/main/webapp/WEB-INF/flex/services-config.xml 2009-04-28 19:36:09 UTC (rev 121) +++ mentalmodels/trunk/src/main/webapp/WEB-INF/flex/services-config.xml 2009-04-28 19:49:12 UTC (rev 122) @@ -1,116 +1,103 @@ -<?xml version="1.0" encoding="UTF-8"?> -<services-config> - - <services> - <service-include file-path="remoting-config.xml" /> - <service-include file-path="proxy-config.xml" /> - <service-include file-path="messaging-config.xml" /> - - <default-channels> - <channel ref="my-amf"/> - </default-channels> - - </services> - - - <security> - <login-command class="flex.messaging.security.TomcatLoginCommand" server="Tomcat"/> - <!-- Uncomment the correct app server - <login-command class="flex.messaging.security.TomcatLoginCommand" server="JBoss"> - <login-command class="flex.messaging.security.JRunLoginCommand" server="JRun"/> - <login-command class="flex.messaging.security.WeblogicLoginCommand" server="Weblogic"/> - <login-command class="flex.messaging.security.WebSphereLoginCommand" server="WebSphere"/> - --> - - <!-- - <security-constraint id="basic-read-access"> - <auth-method>Basic</auth-method> - <roles> - <role>guests</role> - <role>accountants</role> - <role>employees</role> - <role>managers</role> - </roles> - </security-constraint> - --> - </security> - - <channels> - -<channel-definition id="my-streaming-amf" class="mx.messaging.channels.StreamingAMFChannel"> - <endpoint url="http://{server.name}:{server.port}/{context.root}/msgbroker/streamingamf" class="flex.messaging.endpoints.StreamingAMFEndpoint"/> - <properties> - <idle-timeout-minutes>0</idle-timeout-minutes> - <max-streaming-clients>10</max-streaming-clients> - <server-to-client-heartbeat-millis>5000</server-to-client-heartbeat-millis> - <user-agent-settings> <user-agent match-on="MSIE" kickstart-bytes="2048" max-streaming-connections-per-session="3"/> - <user-agent match-on="Firefox" kickstart-bytes="2048" max-streaming-connections-per-session="3"/> </user-agent-settings> - </properties> - </channel-definition> - - <channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel"> - <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint"/> - </channel-definition> - - <channel-definition id="my-secure-amf" class="mx.messaging.channels.SecureAMFChannel"> - <endpoint url="https://{server.name}:{server.port}/{context.root}/msgbroker/amfsecure" class="flex.messaging.endpoints.SecureAMFEndpoint"/> - <properties> - <add-no-cache-headers>false</add-no-cache-headers> - </properties> - </channel-definition> - - <channel-definition id="my-polling-amf" class="mx.messaging.channels.AMFChannel"> - <endpoint url="http://{server.name}:{server.port}/{context.root}/msgbroker/amfpolling" class="flex.messaging.endpoints.AMFEndpoint"/> - <properties> - <polling-enabled>true</polling-enabled> - <polling-interval-seconds>4</polling-interval-seconds> - </properties> - </channel-definition> - - <!-- - <channel-definition id="my-http" class="mx.messaging.channels.HTTPChannel"> - <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/http" class="flex.messaging.endpoints.HTTPEndpoint"/> - </channel-definition> - - <channel-definition id="my-secure-http" class="mx.messaging.channels.SecureHTTPChannel"> - <endpoint url="https://{server.name}:{server.port}/{context.root}/messagebroker/httpsecure" class="flex.messaging.endpoints.SecureHTTPEndpoint"/> - <properties> - <add-no-cache-headers>false</add-no-cache-headers> - </properties> - </channel-definition> - --> - </channels> - - <logging> - <target class="flex.messaging.log.ConsoleTarget" level="Error"> - <properties> - <prefix>[BlazeDS] </prefix> - <includeDate>false</includeDate> - <includeTime>false</includeTime> - <includeLevel>false</includeLevel> - <includeCategory>false</includeCategory> - </properties> - <filters> - <pattern>Endpoint.*</pattern> - <pattern>Service.*</pattern> - <pattern>Configuration</pattern> - </filters> - </target> - </logging> - - <system> - <redeploy> - <enabled>false</enabled> - <!-- - <watch-interval>20</watch-interval> - <watch-file>{context.root}/WEB-INF/flex/services-config.xml</watch-file> - <watch-file>{context.root}/WEB-INF/flex/proxy-config.xml</watch-file> - <watch-file>{context.root}/WEB-INF/flex/remoting-config.xml</watch-file> - <watch-file>{context.root}/WEB-INF/flex/messaging-config.xml</watch-file> - <watch-file>{context.root}/WEB-INF/flex/data-management-config.xml</watch-file> - <touch-file>{context.root}/WEB-INF/web.xml</touch-file> - --> - </redeploy> - </system> - -</services-config> +<?xml version="1.0" encoding="UTF-8"?> +<services-config> + <services> + <service-include file-path="remoting-config.xml"/> + <service-include file-path="proxy-config.xml"/> + <service-include file-path="messaging-config.xml"/> + <default-channels> + <channel ref="my-amf"/> + </default-channels> + </services> + <security> + <login-command class="flex.messaging.security.TomcatLoginCommand" server="Tomcat"/> + <!-- Uncomment the correct app server + <login-command class="flex.messaging.security.TomcatLoginCommand" server="JBoss"> + <login-command class="flex.messaging.security.JRunLoginCommand" server="JRun"/> + <login-command class="flex.messaging.security.WeblogicLoginCommand" server="Weblogic"/> + <login-command class="flex.messaging.security.WebSphereLoginCommand" server="WebSphere"/> + --> + <!-- + <security-constraint id="basic-read-access"> + <auth-method>Basic</auth-method> + <roles> + <role>guests</role> + <role>accountants</role> + <role>employees</role> + <role>managers</role> + </roles> + </security-constraint> + --> + </security> + <channels> + <channel-definition id="my-streaming-amf" class="mx.messaging.channels.StreamingAMFChannel"> + <endpoint url="http://{server.name}:{server.port}/{context.root}/msgbroker/streamingamf" class="flex.messaging.endpoints.StreamingAMFEndpoint"/> + <properties> + <idle-timeout-minutes>0</idle-timeout-minutes> + <max-streaming-clients>10</max-streaming-clients> + <server-to-client-heartbeat-millis>5000</server-to-client-heartbeat-millis> + <user-agent-settings> + <user-agent match-on="MSIE" kickstart-bytes="2048" max-streaming-connections-per-session="3"/> + <user-agent match-on="Firefox" kickstart-bytes="2048" max-streaming-connections-per-session="3"/> + </user-agent-settings> + </properties> + </channel-definition> + <channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel"> + <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint"/> + </channel-definition> + <channel-definition id="my-secure-amf" class="mx.messaging.channels.SecureAMFChannel"> + <endpoint url="https://{server.name}:{server.port}/{context.root}/msgbroker/amfsecure" class="flex.messaging.endpoints.SecureAMFEndpoint"/> + <properties> + <add-no-cache-headers>false</add-no-cache-headers> + </properties> + </channel-definition> + <channel-definition id="my-polling-amf" class="mx.messaging.channels.AMFChannel"> + <endpoint url="http://{server.name}:{server.port}/{context.root}/msgbroker/amfpolling" class="flex.messaging.endpoints.AMFEndpoint"/> + <properties> + <polling-enabled>true</polling-enabled> + <polling-interval-seconds>4</polling-interval-seconds> + </properties> + </channel-definition> + <!-- + <channel-definition id="my-http" class="mx.messaging.channels.HTTPChannel"> + <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/http" class="flex.messaging.endpoints.HTTPEndpoint"/> + </channel-definition> + + <channel-definition id="my-secure-http" class="mx.messaging.channels.SecureHTTPChannel"> + <endpoint url="https://{server.name}:{server.port}/{context.root}/messagebroker/httpsecure" class="flex.messaging.endpoints.SecureHTTPEndpoint"/> + <properties> + <add-no-cache-headers>false</add-no-cache-headers> + </properties> + </channel-definition> + --> + </channels> + <logging> + <target class="flex.messaging.log.ConsoleTarget" level="Error"> + <properties> + <prefix>[BlazeDS] </prefix> + <includeDate>false</includeDate> + <includeTime>false</includeTime> + <includeLevel>false</includeLevel> + <includeCategory>false</includeCategory> + </properties> + <filters> + <pattern>Endpoint.*</pattern> + <pattern>Service.*</pattern> + <pattern>Configuration</pattern> + </filters> + </target> + </logging> + <system> + <redeploy> + <enabled>false</enabled> + <!-- + <watch-interval>20</watch-interval> + <watch-file>{context.root}/WEB-INF/flex/services-config.xml</watch-file> + <watch-file>{context.root}/WEB-INF/flex/proxy-config.xml</watch-file> + <watch-file>{context.root}/WEB-INF/flex/remoting-config.xml</watch-file> + <watch-file>{context.root}/WEB-INF/flex/messaging-config.xml</watch-file> + <watch-file>{context.root}/WEB-INF/flex/data-management-config.xml</watch-file> + <touch-file>{context.root}/WEB-INF/web.xml</touch-file> + --> + </redeploy> + </system> +</services-config> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <see...@us...> - 2009-04-28 19:36:26
|
Revision: 121 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=121&view=rev Author: seematalele Date: 2009-04-28 19:36:09 +0000 (Tue, 28 Apr 2009) Log Message: ----------- Changed the ModuleService class. Added actionscript classes - Module.as, QuestionGroup.as, RoundConfig.as, Block.as. Chnaged the variable name from maxtime to duration in module and block enetities. Modified Paths: -------------- mentalmodels/trunk/flex/src/FisheryExperiment.mxml mentalmodels/trunk/src/main/db/init-mme.sql mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Block.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Categorical.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Communication.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/DayOutput.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Forecasting.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/GameConfig.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Group.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/LocationConfig.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Module.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Psychometric.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Question.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/QuestionGroup.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/RoundConfig.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Student.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/StudentResponse.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/StudentRoundConfig.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/StudentStrategy.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/SuspendRepetition.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/ModuleService.java mentalmodels/trunk/src/main/webapp/FisheryExperiment.swf Modified: mentalmodels/trunk/flex/src/FisheryExperiment.mxml =================================================================== --- mentalmodels/trunk/flex/src/FisheryExperiment.mxml 2009-04-24 17:05:53 UTC (rev 120) +++ mentalmodels/trunk/flex/src/FisheryExperiment.mxml 2009-04-28 19:36:09 UTC (rev 121) @@ -35,10 +35,12 @@ <mx:Button id="btnAccept" label="Accept" click="accept()" left="375" bottom="10"/> <mx:Button id="btnForward" label="Forward »" click="forward()" right="8" bottom="8"/> <mx:RemoteObject id="ss" destination="studentService" fault="faultHandler(event)" result="resultHandler(event)"/> + <mx:RemoteObject id="mod" destination="moduleService" fault="faultHandler(event)" result="resultHandlerModule(event)"/> <mx:Producer id="producer" destination="DataPush" acknowledge="ack(event)"/> <mx:Consumer id="consumer" destination="DataPush" message="messageHandler(event.message)" /> <mx:Script> <![CDATA[ + import actionscript.Module; import flash.sampler.getInvocationCount; import mx.controls.Label; import customComponents.*; @@ -58,7 +60,12 @@ public var Id : uint; [Bindable] + public var module:Module; + + [Bindable] public var randomNumbers:String; + + private function ack(event:MessageAckEvent):void { //chart.setVisible(true); @@ -70,9 +77,15 @@ Id = event.result as uint; Alert.show("Student id is " + Id ); - consumer.disconnect(); + //consumer.disconnect(); } - + private function resultHandlerModule(event:ResultEvent):void + { + module = Module(event.result); + + Alert.show("duration is " + module.duration ); + + } private function faultHandler(event:FaultEvent):void { Alert.show("event fault is " + event.fault.faultDetail); @@ -117,17 +130,19 @@ } }*/ - var msg:AsyncMessage = new AsyncMessage(); - var client:FlexClient = FlexClient.getInstance(); + // var msg:AsyncMessage = new AsyncMessage(); + //var client:FlexClient = FlexClient.getInstance(); //creating new msg with “New” to get current state. - msg.body = "New"; + //msg.body = "New"; //producer.send(msg); //Alert.show("message send is " + msg.body); - consumer.subscribe(); + //consumer.subscribe(); + module = mod.getFirstPage(); + } public function getData():Object { @@ -211,6 +226,7 @@ Alert.show(info.getYear());*/ Id=ss.createStudent(info.getYear(), info.getSemester(), info.getGender(),info.getMajor()); Alert.show("Before invoking createstudent()"); + return true; } } Modified: mentalmodels/trunk/src/main/db/init-mme.sql =================================================================== --- mentalmodels/trunk/src/main/db/init-mme.sql 2009-04-24 17:05:53 UTC (rev 120) +++ mentalmodels/trunk/src/main/db/init-mme.sql 2009-04-28 19:36:09 UTC (rev 121) @@ -22,26 +22,26 @@ insert into round_config_location_config(roundconfig_id,locationconfig_id) values(2,4); -insert into module(description, sequence_no, maxtime) values("Pre-Experiment",1,18); -insert into module(description, sequence_no, maxtime) values("Game Round 1",2,57.0); -insert into module(description, sequence_no, maxtime) values("Communication Round",3,14); -insert into module(description, sequence_no, maxtime) values("Game Round 2",4,29); -insert into module(description, sequence_no, maxtime) values("Post-Experiment",5,4); +insert into module(description, sequence_no, duration) values("Pre-Experiment",1,18); +insert into module(description, sequence_no, duration) values("Game Round 1",2,57.0); +insert into module(description, sequence_no, duration) values("Communication Round",3,14); +insert into module(description, sequence_no, duration) values("Game Round 2",4,29); +insert into module(description, sequence_no, duration) values("Post-Experiment",5,4); -insert into block(description, sequence_no, maxtime,module_id) values("Introduction",1,18,1); -insert into block(description, sequence_no, maxtime,module_id) values("Design Strategy",1,18,2); -insert into block(description, sequence_no, maxtime,module_id) values("Characterizing own strategy",2,17,2); -insert into block(description, sequence_no, maxtime,module_id) values("Editing strategy",3,5,2); -insert into block(description, sequence_no, maxtime,module_id) values("Day-by-day decisions game",4,6,2); -insert into block(description, sequence_no, maxtime,module_id) values("Evaluation of Outcomes",5,11,2); -insert into block(description, sequence_no, maxtime,module_id) values("Communication",1,14,3); -insert into block(description, sequence_no, maxtime,module_id) values("Design Strategy",1,5,4); -insert into block(description, sequence_no, maxtime,module_id) values("Characterizing own strategy",2,9,4); -insert into block(description, sequence_no, maxtime,module_id) values("Editing strategy",3,3,4); -insert into block(description, sequence_no, maxtime,module_id) values("Day-by-day decisions game",4,6,4); -insert into block(description, sequence_no, maxtime,module_id) values("Evaluation of Outcomes",5,6,4); -insert into block(description, sequence_no, maxtime,module_id) values("Final data gathering",1,2,4); -insert into block(description, sequence_no, maxtime,module_id) values("Debriefing",2,2,4); +insert into block(description, sequence_no, duration,module_id) values("Introduction",1,18,1); +insert into block(description, sequence_no, duration,module_id) values("Design Strategy",1,18,2); +insert into block(description, sequence_no, duration,module_id) values("Characterizing own strategy",2,17,2); +insert into block(description, sequence_no, duration,module_id) values("Editing strategy",3,5,2); +insert into block(description, sequence_no, duration,module_id) values("Day-by-day decisions game",4,6,2); +insert into block(description, sequence_no, duration,module_id) values("Evaluation of Outcomes",5,11,2); +insert into block(description, sequence_no, duration,module_id) values("Communication",1,14,3); +insert into block(description, sequence_no, duration,module_id) values("Design Strategy",1,5,4); +insert into block(description, sequence_no, duration,module_id) values("Characterizing own strategy",2,9,4); +insert into block(description, sequence_no, duration,module_id) values("Editing strategy",3,3,4); +insert into block(description, sequence_no, duration,module_id) values("Day-by-day decisions game",4,6,4); +insert into block(description, sequence_no, duration,module_id) values("Evaluation of Outcomes",5,6,4); +insert into block(description, sequence_no, duration,module_id) values("Final data gathering",1,2,4); +insert into block(description, sequence_no, duration,module_id) values("Debriefing",2,2,4); insert into question_group(block_id,sequence_no,header,description)values(1,1,"Welcome to the E-Fishery Experiment", "In this experiment you will design a strategy to fish an abstract fishing ground together with three other persons. As we are mainly interested in the reasons why you choose a certain strategy, we will ask you a number of questions. For the same reason, there are no \x91correct\x92 or \x91wrong\x92 strategies and no \x91correct\x92 or \x91wrong\x92 answers. However, since for each pound of fish you get during the experiment you will receive #.### US$, you might be interested in finding a strategy that fits your goals well. For this, you have to understand the dynamics of the (simulated) fish population and anticipate well the behavior of the other persons of your group."); 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-04-24 17:05:53 UTC (rev 120) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Block.java 2009-04-28 19:36:09 UTC (rev 121) @@ -1,9 +1,11 @@ package edu.asu.commons.mme.entity; +import java.io.Serializable; import java.util.List; import javax.persistence.Column; import javax.persistence.Entity; +import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.JoinColumn; @@ -14,8 +16,13 @@ @Entity @Table(name="block") -public class Block { +public class Block implements Serializable { + /** + * + */ + private static final long serialVersionUID = 1L; + @Id @GeneratedValue private Long id; @@ -27,7 +34,7 @@ private String description; @Column(nullable=false) - private Float maxtime; + private Integer duration; @ManyToOne @@ -62,14 +69,8 @@ return description; } - public void setTime(Float maxtime) { - this.maxtime = maxtime; - } + - public Float getTime() { - return maxtime; - } - public void setModule(Module module) { this.module = module; } @@ -86,4 +87,12 @@ return questionGroup; } + public void setDuration(Integer duration) { + this.duration = duration; + } + + public Integer getDuration() { + return duration; + } + } Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Categorical.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Categorical.java 2009-04-24 17:05:53 UTC (rev 120) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Categorical.java 2009-04-28 19:36:09 UTC (rev 121) @@ -1,6 +1,7 @@ package edu.asu.commons.mme.entity; +import java.io.Serializable; import java.util.List; import java.util.Map; @@ -13,9 +14,13 @@ @Entity @Table(name="categorical") -public class Categorical extends Question { +public class Categorical extends Question implements Serializable{ +/** + * + */ + private static final long serialVersionUID = 1L; /* @CollectionOfElements @IndexColumn(name = "choices", base=1, nullable=false) */ Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Communication.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Communication.java 2009-04-24 17:05:53 UTC (rev 120) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Communication.java 2009-04-28 19:36:09 UTC (rev 121) @@ -1,6 +1,7 @@ package edu.asu.commons.mme.entity; +import java.io.Serializable; import java.sql.Timestamp; import java.util.Date; import javax.persistence.Column; @@ -18,8 +19,13 @@ @Entity @Table(name="communication") -public class Communication { +public class Communication implements Serializable{ + /** + * + */ + private static final long serialVersionUID = 1L; + @Id @GeneratedValue private Long id; Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/DayOutput.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/DayOutput.java 2009-04-24 17:05:53 UTC (rev 120) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/DayOutput.java 2009-04-28 19:36:09 UTC (rev 121) @@ -1,6 +1,8 @@ package edu.asu.commons.mme.entity; +import java.io.Serializable; + import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; @@ -11,8 +13,13 @@ @Entity @Table(name="student_day_output") -public class DayOutput { +public class DayOutput implements Serializable { + /** + * + */ + private static final long serialVersionUID = 1L; + @Id @GeneratedValue private Long id; Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Forecasting.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Forecasting.java 2009-04-24 17:05:53 UTC (rev 120) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Forecasting.java 2009-04-28 19:36:09 UTC (rev 121) @@ -1,6 +1,8 @@ package edu.asu.commons.mme.entity; +import java.io.Serializable; + import javax.persistence.Entity; import javax.persistence.Table; import javax.persistence.Column; @@ -8,7 +10,11 @@ @Entity @Table(name="forecasting") -public class Forecasting extends Question { +public class Forecasting extends Question implements Serializable{ + /** + * + */ + private static final long serialVersionUID = 1L; @Column(name="day_no",nullable=false) private Integer dayNo; Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/GameConfig.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/GameConfig.java 2009-04-24 17:05:53 UTC (rev 120) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/GameConfig.java 2009-04-28 19:36:09 UTC (rev 121) @@ -1,11 +1,13 @@ package edu.asu.commons.mme.entity; +import java.io.Serializable; import java.sql.Timestamp; import java.util.ArrayList; import java.util.List; import javax.persistence.Column; import javax.persistence.Entity; +import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.Lob; @@ -14,8 +16,13 @@ @Entity @Table(name="game") -public class GameConfig { +public class GameConfig implements Serializable { + /** + * + */ + private static final long serialVersionUID = 1L; + @Id @GeneratedValue private Long id; @@ -46,7 +53,7 @@ private Float money; private String img_address; - @OneToMany + @OneToMany(fetch=FetchType.EAGER) private List<RoundConfig> roundConfig; Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Group.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Group.java 2009-04-24 17:05:53 UTC (rev 120) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Group.java 2009-04-28 19:36:09 UTC (rev 121) @@ -1,6 +1,8 @@ package edu.asu.commons.mme.entity; +import java.io.Serializable; + import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; @@ -17,8 +19,13 @@ */ @Entity @Table(name="grp") -public class Group { +public class Group implements Serializable{ + /** + * + */ + private static final long serialVersionUID = 1L; + @Id @GeneratedValue private Long id; Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/LocationConfig.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/LocationConfig.java 2009-04-24 17:05:53 UTC (rev 120) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/LocationConfig.java 2009-04-28 19:36:09 UTC (rev 121) @@ -1,5 +1,6 @@ package edu.asu.commons.mme.entity; +import java.io.Serializable; import java.util.Set; import javax.persistence.Column; @@ -12,8 +13,13 @@ @Entity @Table(name = "location_config") -public class LocationConfig { +public class LocationConfig implements Serializable{ + /** + * + */ + private static final long serialVersionUID = 1L; + @Id @GeneratedValue private Long id; Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Module.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Module.java 2009-04-24 17:05:53 UTC (rev 120) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Module.java 2009-04-28 19:36:09 UTC (rev 121) @@ -1,10 +1,12 @@ package edu.asu.commons.mme.entity; +import java.io.Serializable; import java.util.ArrayList; import java.util.List; import javax.persistence.Column; import javax.persistence.Entity; +import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.OneToMany; @@ -14,8 +16,13 @@ @Entity @Table(name="module") -public class Module { +public class Module implements Serializable { + /** + * + */ + private static final long serialVersionUID = 1L; + @Id @GeneratedValue private Long id; @@ -27,7 +34,7 @@ private String description; @Column(nullable=false) - private Float maxtime; + private Integer duration; @OneToMany private List<Block> block= new ArrayList<Block>(); @@ -56,14 +63,8 @@ return description; } - public void setTime(Float time) { - this.maxtime = time; - } + - public Float getTime() { - return maxtime; - } - public void setBlock(List<Block> block) { this.block = block; } @@ -71,6 +72,14 @@ public List<Block> getBlock() { return block; } + + public void setDuration(Integer duration) { + this.duration = duration; + } + + public Integer getDuration() { + return duration; + } } Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Psychometric.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Psychometric.java 2009-04-24 17:05:53 UTC (rev 120) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Psychometric.java 2009-04-28 19:36:09 UTC (rev 121) @@ -2,6 +2,7 @@ +import java.io.Serializable; import java.util.List; import javax.persistence.Column; @@ -12,9 +13,14 @@ @Entity @Table(name="psychometric") -public class Psychometric extends Question { +public class Psychometric extends Question implements Serializable{ + /** + * + */ + private static final long serialVersionUID = 1L; + @Column(nullable=false) private String scale; Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Question.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Question.java 2009-04-24 17:05:53 UTC (rev 120) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Question.java 2009-04-28 19:36:09 UTC (rev 121) @@ -1,6 +1,7 @@ package edu.asu.commons.mme.entity; +import java.io.Serializable; import java.util.Set; import javax.persistence.Column; @@ -18,7 +19,12 @@ @Entity @Table(name="question") @Inheritance(strategy = InheritanceType.JOINED) -public class Question { +public class Question implements Serializable { + /** + * + */ + private static final long serialVersionUID = 1L; + @Id @GeneratedValue private Long id; Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/QuestionGroup.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/QuestionGroup.java 2009-04-24 17:05:53 UTC (rev 120) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/QuestionGroup.java 2009-04-28 19:36:09 UTC (rev 121) @@ -1,6 +1,7 @@ package edu.asu.commons.mme.entity; +import java.io.Serializable; import java.util.Set; import javax.persistence.Column; @@ -19,7 +20,13 @@ */ @Entity @Table(name="question_group") -public class QuestionGroup { +public class QuestionGroup implements Serializable{ + /** + * + */ + private static final long serialVersionUID = 1L; + + @Id @GeneratedValue private Long id; Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/RoundConfig.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/RoundConfig.java 2009-04-24 17:05:53 UTC (rev 120) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/RoundConfig.java 2009-04-28 19:36:09 UTC (rev 121) @@ -1,6 +1,7 @@ package edu.asu.commons.mme.entity; +import java.io.Serializable; import java.util.Set; import javax.persistence.CascadeType; @@ -20,7 +21,12 @@ @Entity @Table(name="round_config") -public class RoundConfig { +public class RoundConfig implements Serializable{ + /** + * + */ + private static final long serialVersionUID = 1L; + @Id @GeneratedValue(strategy = GenerationType.AUTO) private Long id; Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Student.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Student.java 2009-04-24 17:05:53 UTC (rev 120) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Student.java 2009-04-28 19:36:09 UTC (rev 121) @@ -1,5 +1,7 @@ package edu.asu.commons.mme.entity; +import java.io.Serializable; + import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.EnumType; @@ -13,9 +15,14 @@ @Entity @Table(name="student") -public class Student { +public class Student implements Serializable{ - @Id + /** + * + */ + private static final long serialVersionUID = 1L; + + @Id @GeneratedValue private Long id; Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/StudentResponse.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/StudentResponse.java 2009-04-24 17:05:53 UTC (rev 120) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/StudentResponse.java 2009-04-28 19:36:09 UTC (rev 121) @@ -1,6 +1,8 @@ package edu.asu.commons.mme.entity; +import java.io.Serializable; + import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; @@ -11,8 +13,13 @@ @Entity @Table(name="student_response") -public class StudentResponse { +public class StudentResponse implements Serializable { + /** + * + */ + private static final long serialVersionUID = 1L; + @Id @GeneratedValue private Long id; Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/StudentRoundConfig.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/StudentRoundConfig.java 2009-04-24 17:05:53 UTC (rev 120) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/StudentRoundConfig.java 2009-04-28 19:36:09 UTC (rev 121) @@ -1,5 +1,7 @@ package edu.asu.commons.mme.entity; +import java.io.Serializable; + import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; @@ -13,10 +15,15 @@ @Entity @Table(name="student_round_config") -public class StudentRoundConfig { +public class StudentRoundConfig implements Serializable { - @Id + /** + * + */ + private static final long serialVersionUID = 1L; + + @Id @GeneratedValue private Long id; 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-04-24 17:05:53 UTC (rev 120) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/StudentStrategy.java 2009-04-28 19:36:09 UTC (rev 121) @@ -1,10 +1,12 @@ package edu.asu.commons.mme.entity; +import java.io.Serializable; import java.util.List; import javax.persistence.Column; import javax.persistence.Entity; +import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.JoinColumn; @@ -17,8 +19,14 @@ @Entity @Table(name="student_strategy") -public class StudentStrategy { +public class StudentStrategy implements Serializable{ + /** + * + */ + private static final long serialVersionUID = 1L; + + @Id @GeneratedValue private Long id; @@ -45,7 +53,7 @@ private boolean repeatedDecisions; - @OneToMany + @OneToMany(fetch=FetchType.EAGER) @JoinColumn(nullable=false) private List<DayOutput> dayOutput; Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/SuspendRepetition.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/SuspendRepetition.java 2009-04-24 17:05:53 UTC (rev 120) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/SuspendRepetition.java 2009-04-28 19:36:09 UTC (rev 121) @@ -1,6 +1,8 @@ package edu.asu.commons.mme.entity; +import java.io.Serializable; + import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; @@ -11,8 +13,14 @@ @Entity @Table(name="suspend_repetition") -public class SuspendRepetition { +public class SuspendRepetition implements Serializable { + /** + * + */ + private static final long serialVersionUID = 1L; + + @Id @GeneratedValue private Long id; 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-04-24 17:05:53 UTC (rev 120) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/ModuleService.java 2009-04-28 19:36:09 UTC (rev 121) @@ -1,21 +1,47 @@ package edu.asu.commons.mme.service; +import java.util.Iterator; +import java.util.List; + +import org.hibernate.Hibernate; import org.springframework.transaction.annotation.Transactional; import edu.asu.commons.mme.dao.HibernateModuleDao; +import edu.asu.commons.mme.entity.Block; import edu.asu.commons.mme.entity.Module; +import edu.asu.commons.mme.entity.QuestionGroup; @Transactional public class ModuleService extends Service.Base<Module, HibernateModuleDao>{ - public String getFirstPage() + public Module getFirstPage() { - Module module = getDao().findByProperty("sequenceNo", "1"); + // System.out.println("test is " + test); + Module module = getDao().findByProperty("sequenceNo", new Integer(1)); + Hibernate.initialize(module); + System.out.println("Module object is " + module.getDescription()); - System.out.println(module.getDescription()); + List<Block> listBlock = module.getBlock(); + Iterator<Block> iterateBlock = listBlock.iterator(); + while(iterateBlock.hasNext()) + { + Block block = iterateBlock.next(); + Hibernate.initialize(block); + List<QuestionGroup> questionGroup = block.getQuestionGroup(); + Iterator<QuestionGroup> iteratorquestion = questionGroup.iterator(); + { + while(iteratorquestion.hasNext()) + { + Hibernate.initialize(iteratorquestion.next()); + } + } + + } - return module.getDescription(); + System.out.println("Block description iss " + module.getBlock().get(0).getDescription()); + + return module; } Modified: mentalmodels/trunk/src/main/webapp/FisheryExperiment.swf =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: Allen L. <All...@as...> - 2009-04-26 18:26:50
|
Looks like Spring added flex messaging support to their spring-flex integration (only available via SVN trunk currently, will need to download it from their svn repository). Probably too late to incorporate for 4/30 but we should utilize it later. ---------- Forwarded message ---------- From: Jeremy Grelle (JIRA) <no...@sp...> Date: Sun, Apr 26, 2009 at 1:53 AM Subject: [Spring-JIRA] Resolved: (FLEX-20) Add messaging support based on Spring Integration To: all...@as... [ http://jira.springsource.org/browse/FLEX-20?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jeremy Grelle resolved FLEX-20. ------------------------------- Resolution: Fixed > Add messaging support based on Spring Integration > ------------------------------------------------- > > Key: FLEX-20 > URL: http://jira.springsource.org/browse/FLEX-20 > Project: Spring BlazeDS Integration > Issue Type: New Feature > Reporter: Mark Fisher > Assignee: Mark Fisher > Fix For: 1.0.0.RC1 > > Original Estimate: 4d > Remaining Estimate: 4d > > This will most likely take the form of a Flex MessagingAdapter implementation that simply connects to a Spring Integration MessageChannel on the server side. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.springsource.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira -- Allen Lee Center for the Study of Institutional Diversity [http://csid.asu.edu] School of Human Evolution and Social Change [http://shesc.asu.edu] The Virtual Commons [http://commons.asu.edu] The Digital Archaeological Record [http://www.tdar.org] The OpenABM Consortium [http://www.openabm.org] Arizona State University | P.O. Box 872402 | Tempe, Arizona 85287-2402 Office: 480.727.0401 | Fax: 480.965.7671 |
From: <see...@us...> - 2009-04-24 17:06:05
|
Revision: 120 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=120&view=rev Author: seematalele Date: 2009-04-24 17:05:53 +0000 (Fri, 24 Apr 2009) Log Message: ----------- Added ModuleService which will take care of showing the next page. Added FisheryExperiment.mxml and changed the previous FisheryExperiment.mxml to FisheryExperimentKalin.mxml Modified Paths: -------------- mentalmodels/trunk/src/main/db/init-mme.sql mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Group.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/QuestionGroup.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/Service.java mentalmodels/trunk/src/main/webapp/FisheryExperiment.swf mentalmodels/trunk/src/main/webapp/WEB-INF/applicationContext.xml mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.cfg.xml Added Paths: ----------- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/dao/HibernateModuleDao.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Block.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Module.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/ModuleService.java Modified: mentalmodels/trunk/src/main/db/init-mme.sql =================================================================== --- mentalmodels/trunk/src/main/db/init-mme.sql 2009-04-23 01:07:59 UTC (rev 119) +++ mentalmodels/trunk/src/main/db/init-mme.sql 2009-04-24 17:05:53 UTC (rev 120) @@ -21,66 +21,71 @@ insert into round_config_location_config(roundconfig_id,locationconfig_id) values(2,3); insert into round_config_location_config(roundconfig_id,locationconfig_id) values(2,4); -insert into question_group(sequence_no,header_question) values(1,"What goals did you follow when designing your strategy?"); -insert into question_group(sequence_no,header_question) values(2,"How do you perceive your group?"); -insert into question_group(sequence_no,header_question) values(3,"How much do you count on others and how much can they count on you?"); -insert into question_group(sequence_no,header_question) values(4,"How confident are you in reaching the outcomes you are expecting?"); -insert into question_group(sequence_no,header_question) values(5,"What might be the causes for the outcomes?"); -insert into question_group(sequence_no,header_question) values(6,"Comparing your day-by-day decisions with the strategy"); -insert into question_group(sequence_no,header_question) values(7,"Lessons learned"); -insert into question_group(sequence_no,header_question) values(8,"What is your opinion about the rule that emerged from communication?"); -insert into question_group(sequence_no,header_question) values(9,"What will be the effects of the rule?"); -insert into question_group(sequence_no,header_question) values(10,"The end"); - - - -insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 1, 1, "Most Important Goal:"); -insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 1, 2, "Second Most Important Goal:"); -insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 1, 3, "Third Most Important Goal:"); - -insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 2, 1, "Over all, how much do like your group?"); -insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 2, 2, "How important is it for you what the others think about you and your behavior?"); -insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 2, 3, "How important is it for you that the others can reach their goals?"); -insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 2, 4, "What do you think, how important is it for the others that you can reach your goals?"); -insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 2, 5, "Do you perceive the group as a team or as competing players?"); - -insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 3, 1, "How much do you trust the others in your group?"); -insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 3, 2, "How important is it for you that the others in your group can and do trust you?"); -insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 3, 3, "How much do you think your group trying to coordinate their actions to reach better outcomes for all?"); -insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 3, 4, "How much are you trying to follow rules or agreements that emerged from the communication?"); -insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 3, 5, "How much do you think the others are trying to follow rules or agreements that emerged from the communication?"); - -insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 4, 1, "How well did you understand the dynamics of the fish population?"); -insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 4, 2, "Did the others in your group understand the dynamics better or worse than you?"); -insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 4, 3, "How confident are you in having developed a strategy that leads to ‘good’ outcomes regarding your goals?"); -insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 4, 4, "How much does your strategy depend on how the others in the group will act to reach the desired outcomes?"); -insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 4, 5, "Would you classify your strategy as ‘safe’, or ‘risky’?"); - -insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 5, 1, "I did not understand well enough the dynamics of the fish population."); -insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 5, 2, "Some of the other fishermen did not understand well enough the dynamics of the fish population."); -insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 5, 3, "The others in my group acted differently then would have been necessary for my strategy to work out well."); -insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 5, 4, "Some of the other fishermen acted too reluctantly (harvested too few)."); -insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 5, 5, "Some of the other fishermen acted too aggressively (harvested too much)."); -insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 5, 6, "The group acted too uncoordinated."); -insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 5, 7, "The group did not follow enough the rules or agreements that emerged from the communication."); -insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 5, 8, "The rules or agreements that emerged from the communication did not work out well."); - -insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 6, 1, "If you open the results of the day-by-day decisions in one information window and your strategy in the other, you can compare the actions and developments.\nWhat were the most important reasons for you to deviate from your strategy during the day-by-day decisions?\nIf you did not deviate from your strategy then please write something like “No difference” in the text field below."); - -insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 7, 1, "In the fields below you can note what you have learned from the results of your strategy and the day-by-day decisions to improve your strategy.\nThink 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 we offer you a separate field. This information will be available in the next round of designing your strategy.\nIf you have no entry for one of the fields below, write “none” in the respective field."); - -insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 8, 1, "The rule, agreement or coordination attempt is..."); -insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 8, 2, ""); -insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 8, 3, ""); -insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 8, 4, ""); -insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 8, 5, ""); - -insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 9, 1, "How clear is it to you, that you have to fish conforming to this rule, agreement or coordination attempt?"); -insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 9, 2, "Do you think the other fishermen understood how they have to act according to this rule?\nI think the others..."); -insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 9, 3, "Will you follow the rule, agreement, or coordination attempt that emerged from communication?"); -insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 9, 4, "Do you think, the other fishermen in you group will follow the rule, agreement, or coordination attempt?\nI think, the others will..."); -insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 9, 5, "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?"); - -insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 10, 1, "If you wish to give us any comment or feedback on the experiment, you can use the following field."); - +insert into module(description, sequence_no, maxtime) values("Pre-Experiment",1,18); +insert into module(description, sequence_no, maxtime) values("Game Round 1",2,57.0); +insert into module(description, sequence_no, maxtime) values("Communication Round",3,14); +insert into module(description, sequence_no, maxtime) values("Game Round 2",4,29); +insert into module(description, sequence_no, maxtime) values("Post-Experiment",5,4); + +insert into block(description, sequence_no, maxtime,module_id) values("Introduction",1,18,1); +insert into block(description, sequence_no, maxtime,module_id) values("Design Strategy",1,18,2); +insert into block(description, sequence_no, maxtime,module_id) values("Characterizing own strategy",2,17,2); +insert into block(description, sequence_no, maxtime,module_id) values("Editing strategy",3,5,2); +insert into block(description, sequence_no, maxtime,module_id) values("Day-by-day decisions game",4,6,2); +insert into block(description, sequence_no, maxtime,module_id) values("Evaluation of Outcomes",5,11,2); +insert into block(description, sequence_no, maxtime,module_id) values("Communication",1,14,3); +insert into block(description, sequence_no, maxtime,module_id) values("Design Strategy",1,5,4); +insert into block(description, sequence_no, maxtime,module_id) values("Characterizing own strategy",2,9,4); +insert into block(description, sequence_no, maxtime,module_id) values("Editing strategy",3,3,4); +insert into block(description, sequence_no, maxtime,module_id) values("Day-by-day decisions game",4,6,4); +insert into block(description, sequence_no, maxtime,module_id) values("Evaluation of Outcomes",5,6,4); +insert into block(description, sequence_no, maxtime,module_id) values("Final data gathering",1,2,4); +insert into block(description, sequence_no, maxtime,module_id) values("Debriefing",2,2,4); + +insert into question_group(block_id,sequence_no,header,description)values(1,1,"Welcome to the E-Fishery Experiment", +"In this experiment you will design a strategy to fish an abstract fishing ground together with three other persons. As we are mainly interested in the reasons why you choose a certain strategy, we will ask you a number of questions. For the same reason, there are no \x91correct\x92 or \x91wrong\x92 strategies and no \x91correct\x92 or \x91wrong\x92 answers. However, since for each pound of fish you get during the experiment you will receive #.### US$, you might be interested in finding a strategy that fits your goals well. For this, you have to understand the dynamics of the (simulated) fish population and anticipate well the behavior of the other persons of your group."); + +insert into question_group(block_id,sequence_no,header,description)values(1,2,"Starting the Experiment", +"Now, you should understand your task and its problems and thus be ready to start the actual experiment.\n Click on 'Accept' to begin with the design of your strategy."); + +insert into question_group(block_id,sequence_no,header,description)values(2,1,"Designing your Strategy", +"<p>In what we refer to as a 'strategy' you predefine your decisions of where to go each day of the simulation.\n +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.\n + 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> +"); + +insert into question_group(block_id,sequence_no,header,description)values(2,2,"Some special features of the strategy design", +"<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> +"); + + +insert into question_group(block_id,sequence_no,header,description)values(2,3,"Design your strategy", +"<p>Design your strategy by clicking on <b>'New'</b>, <b>'Edit'</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'. +When you are done, click on <b>'Next'</b>. Your strategy will then be checked for some common or logical errors. +</p>"); \ No newline at end of file Added: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/dao/HibernateModuleDao.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/dao/HibernateModuleDao.java (rev 0) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/dao/HibernateModuleDao.java 2009-04-24 17:05:53 UTC (rev 120) @@ -0,0 +1,13 @@ +package edu.asu.commons.mme.dao; + +import edu.asu.commons.mme.entity.Module; + +public class HibernateModuleDao extends HibernateDao<Module> { + + public HibernateModuleDao() { + super(Module.class); + // TODO Auto-generated constructor stub + } + + +} Added: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Block.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Block.java (rev 0) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Block.java 2009-04-24 17:05:53 UTC (rev 120) @@ -0,0 +1,89 @@ +package edu.asu.commons.mme.entity; + +import java.util.List; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; + + +@Entity +@Table(name="block") +public class Block { + + @Id + @GeneratedValue + private Long id; + + @Column(name="sequence_no",nullable=false) + private Integer sequenceNo; + + @Column(name="description",nullable=false) + private String description; + + @Column(nullable=false) + private Float maxtime; + + + @ManyToOne + @JoinColumn(nullable=false) + private Module module; + + @OneToMany + private List<QuestionGroup> questionGroup; + + + public void setId(Long id) { + this.id = id; + } + + public Long getId() { + return id; + } + + public void setSequenceNo(Integer sequenceNo) { + this.sequenceNo = sequenceNo; + } + + public Integer getSequenceNo() { + return sequenceNo; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDescription() { + return description; + } + + public void setTime(Float maxtime) { + this.maxtime = maxtime; + } + + public Float getTime() { + return maxtime; + } + + public void setModule(Module module) { + this.module = module; + } + + public Module getModule() { + return module; + } + + public void setQuestionGroup(List<QuestionGroup> questionGroup) { + this.questionGroup = questionGroup; + } + + public List<QuestionGroup> getQuestionGroup() { + return questionGroup; + } + +} Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Group.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Group.java 2009-04-23 01:07:59 UTC (rev 119) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Group.java 2009-04-24 17:05:53 UTC (rev 120) @@ -45,7 +45,6 @@ this.no = no; } - public void setGame(GameConfig game) { this.game = game; } Added: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Module.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Module.java (rev 0) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Module.java 2009-04-24 17:05:53 UTC (rev 120) @@ -0,0 +1,76 @@ +package edu.asu.commons.mme.entity; + +import java.util.ArrayList; +import java.util.List; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.OneToMany; +import javax.persistence.Table; + + +@Entity +@Table(name="module") + +public class Module { + + @Id + @GeneratedValue + private Long id; + + @Column(name="sequence_no",nullable=false) + private Integer sequenceNo; + + @Column(name="description",nullable=false) + private String description; + + @Column(nullable=false) + private Float maxtime; + + @OneToMany + private List<Block> block= new ArrayList<Block>(); + + public void setId(Long id) { + this.id = id; + } + + public Long getId() { + return id; + } + + public void setSequenceNo(Integer sequenceNo) { + this.sequenceNo = sequenceNo; + } + + public Integer getSequenceNo() { + return sequenceNo; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDescription() { + return description; + } + + public void setTime(Float time) { + this.maxtime = time; + } + + public Float getTime() { + return maxtime; + } + + public void setBlock(List<Block> block) { + this.block = block; + } + + public List<Block> getBlock() { + return block; + } + + +} Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/QuestionGroup.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/QuestionGroup.java 2009-04-23 01:07:59 UTC (rev 119) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/QuestionGroup.java 2009-04-24 17:05:53 UTC (rev 120) @@ -10,8 +10,13 @@ import javax.persistence.JoinColumn; import javax.persistence.Lob; import javax.persistence.ManyToMany; +import javax.persistence.ManyToOne; import javax.persistence.Table; + +/* + * QuestionGroup table stiores not only questions but also the other items and their corresponding description + */ @Entity @Table(name="question_group") public class QuestionGroup { @@ -27,9 +32,27 @@ @Column(name = "sequence_no",nullable=false) private Integer sequenceNo; + //header can be question or just a label @Lob - private String header_question; + private String header; + @Lob + @Column(name="description",nullable=false) + private String description; + + /*Since we have timings for module, + * we don't need to save timings for each item or question group + * + */ + /*@Column(nullable=false) + private Float maxtime;*/ + + + @ManyToOne + @JoinColumn(nullable=false) + private Block block; + + public void setId(Long id) { this.id = id; } @@ -43,11 +66,11 @@ public Integer getSequenceNo() { return sequenceNo; } - public void setHeader_question(String header_question) { - this.header_question = header_question; + public void setHeader(String header) { + this.header = header; } - public String getHeader_question() { - return header_question; + public String getHeader() { + return header; } public void setRoundconfig(Set<RoundConfig> roundconfig) { this.roundConfig = roundconfig; @@ -55,5 +78,23 @@ public Set<RoundConfig> getRoundconfig() { return roundConfig; } + public void setDescription(String description) { + this.description = description; + } + public String getDescription() { + return description; + } +/* public void setTime(Float time) { + this.maxtime = time; + } + public Float getTime() { + return maxtime; + }*/ + public void setBlock(Block block) { + this.block = block; + } + public Block getBlock() { + return block; + } } Added: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/ModuleService.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/ModuleService.java (rev 0) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/ModuleService.java 2009-04-24 17:05:53 UTC (rev 120) @@ -0,0 +1,22 @@ +package edu.asu.commons.mme.service; + +import org.springframework.transaction.annotation.Transactional; + +import edu.asu.commons.mme.dao.HibernateModuleDao; +import edu.asu.commons.mme.entity.Module; + +@Transactional +public class ModuleService extends Service.Base<Module, HibernateModuleDao>{ + + public String getFirstPage() + { + Module module = getDao().findByProperty("sequenceNo", "1"); + + System.out.println(module.getDescription()); + + + return module.getDescription(); + + } + +} Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/Service.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/Service.java 2009-04-23 01:07:59 UTC (rev 119) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/Service.java 2009-04-24 17:05:53 UTC (rev 120) @@ -73,6 +73,7 @@ dao.save(persistentBean); } + public void merge(Object persistentBean) { dao.merge(persistentBean); } Modified: mentalmodels/trunk/src/main/webapp/FisheryExperiment.swf =================================================================== (Binary files differ) Modified: mentalmodels/trunk/src/main/webapp/WEB-INF/applicationContext.xml =================================================================== --- mentalmodels/trunk/src/main/webapp/WEB-INF/applicationContext.xml 2009-04-23 01:07:59 UTC (rev 119) +++ mentalmodels/trunk/src/main/webapp/WEB-INF/applicationContext.xml 2009-04-24 17:05:53 UTC (rev 120) @@ -38,10 +38,23 @@ <bean id='studentService' class='edu.asu.commons.mme.service.StudentService'> <property name='dao' ref='studentDao'/> </bean> - + <!-- Expose services for BlazeDS remoting --> <flex:remote-service ref="studentService" /> + + +<bean id='moduleDao' class="edu.asu.commons.mme.dao.HibernateModuleDao"> + <property name='sessionFactory' ref='sessionFactory'/> + </bean> + +<!-- spring managed service layer --> + <bean id='moduleService' class="edu.asu.commons.mme.service.ModuleService"> + <property name='dao' ref='moduleDao'/> + </bean> + +<!-- Expose services for BlazeDS remoting --> + <flex:remote-service ref="moduleService" /> <!-- Flex related information ended--> Modified: mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.cfg.xml =================================================================== --- mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.cfg.xml 2009-04-23 01:07:59 UTC (rev 119) +++ mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.cfg.xml 2009-04-24 17:05:53 UTC (rev 120) @@ -30,7 +30,7 @@ <mapping class='edu.asu.commons.mme.entity.Module'/> <mapping class='edu.asu.commons.mme.entity.Block'/> - <mapping class='edu.asu.commons.mme.entity.Item'/> + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <see...@us...> - 2009-04-23 01:08:09
|
Revision: 119 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=119&view=rev Author: seematalele Date: 2009-04-23 01:07:59 +0000 (Thu, 23 Apr 2009) Log Message: ----------- created module, block and item tables for storing the timing information. Changed the FisherExperiment.mxml so that it can communicate to the Spring. (Plz Note in the previous revision this file is not updated. But webapp/FisheryExperiment.swf is up to date according to the revision. This is because I forgot to copy the FisheryExperiment.mxml in the previous revisions.) Made the changes in the init-db.sql- Put new target drop-prev-schema. It drops the mme and create it also. Modified Paths: -------------- mentalmodels/trunk/flex/src/FisheryExperiment.mxml mentalmodels/trunk/flex/src/Socio_Demographic_Information.mxml mentalmodels/trunk/flex/src/Socio_demographic.mxml mentalmodels/trunk/flex/src/TableTest.mxml mentalmodels/trunk/flex/src/customComponents/InstructionPage.mxml mentalmodels/trunk/flex/src/customComponents/SocioDemographicPage.mxml mentalmodels/trunk/init-db.ant.xml mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/GameConfig.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/Feed.java mentalmodels/trunk/src/main/webapp/FisheryExperiment.swf mentalmodels/trunk/src/main/webapp/WEB-INF/flex/services-config.xml mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.cfg.xml mentalmodels/trunk/src/main/webapp/startfeed.jsp Added Paths: ----------- mentalmodels/trunk/src/main/db/drop-mme.sql Modified: mentalmodels/trunk/flex/src/FisheryExperiment.mxml =================================================================== --- mentalmodels/trunk/flex/src/FisheryExperiment.mxml 2009-04-21 23:59:22 UTC (rev 118) +++ mentalmodels/trunk/flex/src/FisheryExperiment.mxml 2009-04-23 01:07:59 UTC (rev 119) @@ -26,24 +26,73 @@ <mx:State name="none"/> </mx:states> + + <mx:Canvas id="content" x="5" y="5" width="750" height="470"/> <mx:Canvas id="expiredContent" x="-100" y="-100" width="1" height="1" visible="false"/> <mx:Button id="btnBack" label="« Back" click="back()" left="8" bottom="8"/> <mx:Button id="btnAccept" label="Accept" click="accept()" left="375" bottom="10"/> <mx:Button id="btnForward" label="Forward »" click="forward()" right="8" bottom="8"/> - + <mx:RemoteObject id="ss" destination="studentService" fault="faultHandler(event)" result="resultHandler(event)"/> + <mx:Producer id="producer" destination="DataPush" acknowledge="ack(event)"/> + <mx:Consumer id="consumer" destination="DataPush" message="messageHandler(event.message)" /> <mx:Script> <![CDATA[ + import flash.sampler.getInvocationCount; import mx.controls.Label; import customComponents.*; + import mx.controls.Alert; + import mx.rpc.events.ResultEvent; + import mx.rpc.events.FaultEvent; + import mx.messaging.messages.IMessage; + import mx.messaging.events.MessageAckEvent; + import mx.messaging.events.MessageFaultEvent; + import mx.messaging.FlexClient; + import mx.messaging.messages.AsyncMessage; + private var shared:SharedObject; private var flushMessage:String; + [Bindable] + public var Id : uint; + [Bindable] + public var randomNumbers:String; + private function ack(event:MessageAckEvent):void + { + //chart.setVisible(true); + randomNumbers = event.message.body as String; + //Alert.show("in ack method" + randomNumbers); + } + private function resultHandler(event:ResultEvent):void + { + Id = event.result as uint; + + Alert.show("Student id is " + Id ); + consumer.disconnect(); + } + + private function faultHandler(event:FaultEvent):void + { + Alert.show("event fault is " + event.fault.faultDetail); + } + + private function handleFault(event:MessageFaultEvent):void + { + Alert.show("Message event fault is " + event.faultString); + } + + + private function messageHandler(message:IMessage):void + { + randomNumbers = message.body as String; + Alert.show( ""+randomNumbers); + } + public function init():void { - var sharedObjTest:Boolean = false; + /*var sharedObjTest:Boolean = false; if(sharedObjTest) { var got:Boolean = getLocal(); @@ -64,8 +113,21 @@ else getData().exists = true; this.addChild(getData().testLabel); + } - } + }*/ + + var msg:AsyncMessage = new AsyncMessage(); + var client:FlexClient = FlexClient.getInstance(); + //creating new msg with “New” to get current state. + msg.body = "New"; + + //producer.send(msg); + //Alert.show("message send is " + msg.body); + + + consumer.subscribe(); + } public function getData():Object { @@ -129,16 +191,26 @@ obj.visible = false; expiredContent.addChild(obj); currentState = "socioDemographic"; + //consumer.subscribe(); return true; } } if(obj is SocioDemographicPage) { + var Id:uint = 0; if( (SocioDemographicPage)(obj).accept() ) { obj.visible = false; expiredContent.addChild(obj); currentState = "planner"; + var info:SocioDemographicPage = SocioDemographicPage(obj); + + /* Alert.show(info.getGender()); + Alert.show(info.getMajor()); + Alert.show(info.getSemester()); + Alert.show(info.getYear());*/ + Id=ss.createStudent(info.getYear(), info.getSemester(), info.getGender(),info.getMajor()); + Alert.show("Before invoking createstudent()"); return true; } } @@ -149,6 +221,7 @@ obj.visible = false; expiredContent.addChild(obj); currentState = "none"; + return true; } } @@ -156,6 +229,8 @@ return false; } + + ]]> </mx:Script> Modified: mentalmodels/trunk/flex/src/Socio_Demographic_Information.mxml =================================================================== --- mentalmodels/trunk/flex/src/Socio_Demographic_Information.mxml 2009-04-21 23:59:22 UTC (rev 118) +++ mentalmodels/trunk/flex/src/Socio_Demographic_Information.mxml 2009-04-23 01:07:59 UTC (rev 119) @@ -32,10 +32,10 @@ </mx:FormItem> <mx:FormItem label="Gender" id="frmitemGender" horizontalAlign="left" fontSize="14" required="true"> <mx:RadioButtonGroup id="gender"/> - <mx:RadioButton id="male" groupName="gender"> + <mx:RadioButton id="male" groupName="{gender}"> <mx:label>Male</mx:label> </mx:RadioButton> - <mx:RadioButton id="female" groupName="gender"> + <mx:RadioButton id="female" groupName="{gender}"> <mx:label>Female</mx:label> </mx:RadioButton> Modified: mentalmodels/trunk/flex/src/Socio_demographic.mxml =================================================================== --- mentalmodels/trunk/flex/src/Socio_demographic.mxml 2009-04-21 23:59:22 UTC (rev 118) +++ mentalmodels/trunk/flex/src/Socio_demographic.mxml 2009-04-23 01:07:59 UTC (rev 119) @@ -1,9 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="80%"> - - - <mx:VBox height="100%" id="vboxGatherInfo" width="100%"> <mx:HBox horizontalAlign="center" verticalAlign="middle" id="hboxSocio_demographic_info"> <mx:Label text="Socio-demographic Information" id="lblHeading" enabled="true" fontSize="16" color="#230869" textAlign="center" fontWeight="bold"/> Modified: mentalmodels/trunk/flex/src/TableTest.mxml =================================================================== --- mentalmodels/trunk/flex/src/TableTest.mxml 2009-04-21 23:59:22 UTC (rev 118) +++ mentalmodels/trunk/flex/src/TableTest.mxml 2009-04-23 01:07:59 UTC (rev 119) @@ -2,7 +2,6 @@ <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:comp="customComponents.*" layout="absolute"> <mx:VBox> - <comp:InstructionPage id="instructionPage"/> <mx:HBox id="cast"> <!--<comp:Forecast id="legacy" numColumns="10"/>--> <comp:Forecast1 id="forecastPeople" numColumns="15" minValue="0" maxValue="30" initialize="init()"/> @@ -19,8 +18,7 @@ public function init():void { -instructionPage.txt.htmlText = "this is a test <img src=\"http://www.google.com/intl/en_ALL/images/logo.gif\"><br>asdfghjkl;"; -//for(var x:Number=0;x<4;x++)for(var y:Number=0;y<15;y++)forecastPeople.setItem(x,y,7.5); + for(var x:Number=0;x<4;x++)for(var y:Number=0;y<15;y++)forecastPeople.setItem(x,y,7.5); } public function testNext(evt:Event=null):void Modified: mentalmodels/trunk/flex/src/customComponents/InstructionPage.mxml =================================================================== --- mentalmodels/trunk/flex/src/customComponents/InstructionPage.mxml 2009-04-21 23:59:22 UTC (rev 118) +++ mentalmodels/trunk/flex/src/customComponents/InstructionPage.mxml 2009-04-23 01:07:59 UTC (rev 119) @@ -1,10 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:comp="customComponents.*" initialize="init()"> - <mx:Text width="800" height="300" id="html"> - <mx:htmlText/> - </mx:Text> - <mx:Script> <![CDATA[ import mx.collections.ArrayCollection; Modified: mentalmodels/trunk/flex/src/customComponents/SocioDemographicPage.mxml =================================================================== --- mentalmodels/trunk/flex/src/customComponents/SocioDemographicPage.mxml 2009-04-21 23:59:22 UTC (rev 118) +++ mentalmodels/trunk/flex/src/customComponents/SocioDemographicPage.mxml 2009-04-23 01:07:59 UTC (rev 119) @@ -80,8 +80,9 @@ <mx:HBox> <mx:Label text="Gender:" fontWeight="bold" width="100" textAlign="right"/> <mx:HBox id="boxGender"> - <mx:RadioButton groupName="gender" label="M" id="radioMale"/> - <mx:RadioButton groupName="gender" label="F" id="radioFemale"/> + <mx:RadioButtonGroup id="gender"/> + <mx:RadioButton groupName="{gender}" label="M" id="radioMale"/> + <mx:RadioButton groupName="{gender}" label="F" id="radioFemale"/> </mx:HBox> </mx:HBox> Modified: mentalmodels/trunk/init-db.ant.xml =================================================================== --- mentalmodels/trunk/init-db.ant.xml 2009-04-21 23:59:22 UTC (rev 118) +++ mentalmodels/trunk/init-db.ant.xml 2009-04-23 01:07:59 UTC (rev 119) @@ -35,8 +35,9 @@ <echo message='compile classpath: ${compile.classpath}'/> <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpath="${compile.classpath}"/> - <target name="init-db" depends="create-db-schema"/> - <target name='create-db-schema'> + <target name="help"/> + <target name="init-db" depends="create-db-tables"/> + <target name='create-db-tables' depends="drop-prev-schema"> <mkdir dir='${db.generated.dir}'/> <echo message="You must have valid database connection information within hibernate.properties for this task to succeed."/> <hibernatetool destdir='${db.generated.dir}'> @@ -47,6 +48,16 @@ </hibernatetool> </target> + + <target name="drop-prev-schema"> + <sql driver="${hibernate.connection.driver_class}" + url="${hibernate.connection.url}" + userid="${hibernate.connection.username}" + password="${hibernate.connection.password}" + classpath="${compile.classpath}" + + src="${db.dir}/drop-mme.sql"/> + </target> <target name='create-indexes'> <sql onerror='continue' autocommit='true' driver="${hibernate.connection.driver_class}" url="${hibernate.connection.url}" userid="${hibernate.connection.username}" password="${hibernate.connection.password}" classpath="${compile.classpath}"> <transaction src="${db.dir}/create-indexes.sql"/> Added: mentalmodels/trunk/src/main/db/drop-mme.sql =================================================================== --- mentalmodels/trunk/src/main/db/drop-mme.sql (rev 0) +++ mentalmodels/trunk/src/main/db/drop-mme.sql 2009-04-23 01:07:59 UTC (rev 119) @@ -0,0 +1,2 @@ +drop schema mme; +create schema mme; \ No newline at end of file Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/GameConfig.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/GameConfig.java 2009-04-21 23:59:22 UTC (rev 118) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/GameConfig.java 2009-04-23 01:07:59 UTC (rev 119) @@ -47,7 +47,7 @@ private String img_address; @OneToMany - private List<RoundConfig> roundconfig= new ArrayList<RoundConfig>(); + private List<RoundConfig> roundConfig; public void setId(Long id) { @@ -106,10 +106,10 @@ return img_address; } public void setRoundconfig(List<RoundConfig> roundconfig) { - this.roundconfig = roundconfig; + this.roundConfig = roundconfig; } public List<RoundConfig> getRoundconfig() { - return roundconfig; + return roundConfig; } public void setTimestamp(Timestamp timestamp) { this.timestamp = timestamp; Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/Feed.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/Feed.java 2009-04-21 23:59:22 UTC (rev 118) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/Feed.java 2009-04-23 01:07:59 UTC (rev 119) @@ -46,21 +46,23 @@ while (running) { + try { + Thread.sleep(50000); + running = false; + } catch (InterruptedException e) { + } AsyncMessage msg = new AsyncMessage(); msg.setDestination("DataPush"); //msg.setHeader("DSSubtopic", "hello"); msg.setClientId(clientID); msg.setMessageId(UUIDUtils.createUUID()); msg.setTimestamp(System.currentTimeMillis()); - msg.setBody("this is a server push message"); + msg.setBody("Sorry time is expired!!! You can not Login."); System.out.println("Message broker is: "+ msgBroker); System.out.println("Message is: "+ msg); msgBroker.routeMessageToService(msg, null); - try { - Thread.sleep(2000); - } catch (InterruptedException e) { - } + } } Modified: mentalmodels/trunk/src/main/webapp/FisheryExperiment.swf =================================================================== (Binary files differ) Modified: mentalmodels/trunk/src/main/webapp/WEB-INF/flex/services-config.xml =================================================================== --- mentalmodels/trunk/src/main/webapp/WEB-INF/flex/services-config.xml 2009-04-21 23:59:22 UTC (rev 118) +++ mentalmodels/trunk/src/main/webapp/WEB-INF/flex/services-config.xml 2009-04-23 01:07:59 UTC (rev 119) @@ -49,7 +49,7 @@ </channel-definition> <channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel"> - <endpoint url="http://{server.name}:{server.port}/{context.root}/msgbroker/amf" class="flex.messaging.endpoints.AMFEndpoint"/> + <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint"/> </channel-definition> <channel-definition id="my-secure-amf" class="mx.messaging.channels.SecureAMFChannel"> Modified: mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.cfg.xml =================================================================== --- mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.cfg.xml 2009-04-21 23:59:22 UTC (rev 118) +++ mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.cfg.xml 2009-04-23 01:07:59 UTC (rev 119) @@ -24,9 +24,13 @@ - <mapping class='edu.asu.commons.mme.entity.Categorical'/> + <mapping class='edu.asu.commons.mme.entity.Categorical'/> <mapping class='edu.asu.commons.mme.entity.Psychometric'/> <mapping class='edu.asu.commons.mme.entity.StudentResponse'/> + + <mapping class='edu.asu.commons.mme.entity.Module'/> + <mapping class='edu.asu.commons.mme.entity.Block'/> + <mapping class='edu.asu.commons.mme.entity.Item'/> Modified: mentalmodels/trunk/src/main/webapp/startfeed.jsp =================================================================== --- mentalmodels/trunk/src/main/webapp/startfeed.jsp 2009-04-21 23:59:22 UTC (rev 118) +++ mentalmodels/trunk/src/main/webapp/startfeed.jsp 2009-04-23 01:07:59 UTC (rev 119) @@ -3,8 +3,8 @@ try { Feed feed = new Feed(); feed.start(); - out.println("Feed Started"); + out.println("Server started to accept the students."); } catch (Exception e) { - out.println("A problem occured while starting the feed: "+e.getMessage()); + out.println("A problem occured while starting the server: "+e.getMessage()); } %> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <see...@us...> - 2009-04-21 23:59:37
|
Revision: 118 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=118&view=rev Author: seematalele Date: 2009-04-21 23:59:22 +0000 (Tue, 21 Apr 2009) Log Message: ----------- Server push is working. Included Feed.java, startfeed.jsp, stopfeed.jsp Changed the web.xml Note: Plz make sure when you compile flex client, use same configuration file which are mentioned in the WEB-INF/flex directory Modified Paths: -------------- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/dao/HibernateStudentDao.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Student.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/Service.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StudentService.java mentalmodels/trunk/src/main/webapp/FisheryExperiment.swf mentalmodels/trunk/src/main/webapp/WEB-INF/applicationContext.xml mentalmodels/trunk/src/main/webapp/WEB-INF/classes/log4j.properties mentalmodels/trunk/src/main/webapp/WEB-INF/flex/messaging-config.xml mentalmodels/trunk/src/main/webapp/WEB-INF/flex/services-config.xml mentalmodels/trunk/src/main/webapp/WEB-INF/web.xml Added Paths: ----------- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/Feed.java mentalmodels/trunk/src/main/webapp/startfeed.jsp mentalmodels/trunk/src/main/webapp/stopfeed.jsp Removed Paths: ------------- mentalmodels/trunk/src/main/webapp/FisheryExperiment.html Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/dao/HibernateStudentDao.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/dao/HibernateStudentDao.java 2009-04-21 17:26:20 UTC (rev 117) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/dao/HibernateStudentDao.java 2009-04-21 23:59:22 UTC (rev 118) @@ -1,13 +1,6 @@ package edu.asu.commons.mme.dao; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.hibernate.Transaction; -import org.springframework.transaction.annotation.Transactional; -import edu.asu.commons.mme.entity.GameConfig; -import edu.asu.commons.mme.entity.Gender; -import edu.asu.commons.mme.entity.Group; import edu.asu.commons.mme.entity.Student; /** @@ -21,81 +14,8 @@ */ public class HibernateStudentDao extends HibernateDao<Student> { - - private static Integer groupNo=0; - private static Integer studentNo=0; - private SessionFactory sessionFactory; public HibernateStudentDao() { super(Student.class); } - public SessionFactory getSessionFactory() { - return super.getSessionFactory(); - } - public void setSessionFactory(SessionFactory sessionFactory) { - this.sessionFactory = sessionFactory; - } - - public static void setGroupNo(Integer groupNo) { - HibernateStudentDao.groupNo = groupNo; - } - - public static Integer getGroupNo() { - return groupNo; - } - - public static void setStudentNo(Integer studentNo) { - HibernateStudentDao.studentNo = studentNo; - } - - public static Integer getStudentNo() { - return studentNo; - } - - public Long createStudent(Integer birthyear, String ethnicity, String gender,String major) - { - Student newstudent = null; - try{ - sessionFactory = this.getSessionFactory(); - Session session = - sessionFactory.getCurrentSession(); - Transaction tx = session.beginTransaction(); - //generateGroups(); - studentNo = getStudentNo() + 1; - newstudent = new Student(); - //newstudent.setGroup(newgroup); - newstudent.setBirthYear(birthyear); - newstudent.setEthnicity(ethnicity); - if(gender.equals(Gender.F)) - newstudent.setGender(Gender.F); - else - newstudent.setGender(Gender.M); - newstudent.setMajor(major); - newstudent.setStudentNo(studentNo); - session.save(newstudent); - tx.commit(); - - } - catch(Exception e) - { - logger.error("Can not create student."); - - } - finally{ - sessionFactory.close(); - } - return newstudent.getId(); - - } - - - - - - - - - - - } Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Student.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Student.java 2009-04-21 17:26:20 UTC (rev 117) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Student.java 2009-04-21 23:59:22 UTC (rev 118) @@ -6,7 +6,6 @@ import javax.persistence.Enumerated; import javax.persistence.GeneratedValue; import javax.persistence.Id; -import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; @@ -23,7 +22,7 @@ @ManyToOne private Group group; - @Column(name="student_no",nullable = false) + @Column(name="student_no") private Integer studentNo; @Column(name="year_birth",length = 4) @@ -31,7 +30,7 @@ private String major; - private String ethnicity; + private String semester; @Enumerated(EnumType.STRING) private Gender gender; @@ -76,12 +75,12 @@ return major; } - public void setEthnicity(String enthnicity) { - this.ethnicity = enthnicity; + public void setSemester(String semester) { + this.semester = semester; } - public String getEthnicity() { - return ethnicity; + public String getSemester() { + return semester; } public void setGender(Gender gender) { Added: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/Feed.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/Feed.java (rev 0) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/Feed.java 2009-04-21 23:59:22 UTC (rev 118) @@ -0,0 +1,87 @@ +package edu.asu.commons.mme.service; +//package edu.asu.commons.mme.service; + +import java.util.*; + +import flex.messaging.MessageBroker; +import flex.messaging.messages.AsyncMessage; +import flex.messaging.messages.Message; +import flex.messaging.util.UUIDUtils; +import flex.messaging.services.MessageService; +import flex.messaging.services.ServiceAdapter; + +public class Feed{ + + public static void main(String args[]) { + Feed feed = new Feed(); + feed.start(); + } + + private static FeedThread thread; + + public Feed() { + } + + public void start() { + if (thread == null) { + thread = new FeedThread(); + thread.start(); + } + } + + public void stop() { + thread.running = false; + thread = null; + } + + public static class FeedThread extends Thread { + + public boolean running = true; + + public void run() { + + MessageBroker msgBroker = MessageBroker.getMessageBroker(null); + String clientID = UUIDUtils.createUUID(); + + + while (running) { + + AsyncMessage msg = new AsyncMessage(); + msg.setDestination("DataPush"); + //msg.setHeader("DSSubtopic", "hello"); + msg.setClientId(clientID); + msg.setMessageId(UUIDUtils.createUUID()); + msg.setTimestamp(System.currentTimeMillis()); + msg.setBody("this is a server push message"); + System.out.println("Message broker is: "+ msgBroker); + System.out.println("Message is: "+ msg); + msgBroker.routeMessageToService(msg, null); + + try { + Thread.sleep(2000); + } catch (InterruptedException e) { + } + + } + } + + + } + + /*@Override + public Object invoke(Message msg) { + // TODO Auto-generated method stub + if(msg.getBody().equals("New")){ + System.out.println("Adapter received new"); + return "This is a message from invoke method"; + }else{ + System.out.println("Adapter sending message"); + AsyncMessage newMessage = (AsyncMessage)msg; + MessageService msgService = (MessageService)getDestination().getService(); + msgService.pushMessageToClients(newMessage, true); + } + return null; + + }*/ + +} Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/Service.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/Service.java 2009-04-21 17:26:20 UTC (rev 117) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/Service.java 2009-04-21 23:59:22 UTC (rev 118) @@ -69,6 +69,7 @@ } public void save(Object persistentBean) { + System.err.println("saving persistent bean: " + persistentBean); dao.save(persistentBean); } Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StudentService.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StudentService.java 2009-04-21 17:26:20 UTC (rev 117) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StudentService.java 2009-04-21 23:59:22 UTC (rev 118) @@ -1,8 +1,12 @@ package edu.asu.commons.mme.service; +import java.util.ArrayList; +import java.util.List; + import org.springframework.transaction.annotation.Transactional; import edu.asu.commons.mme.dao.HibernateStudentDao; +import edu.asu.commons.mme.entity.Gender; import edu.asu.commons.mme.entity.Group; import edu.asu.commons.mme.entity.Student; @@ -18,29 +22,40 @@ @Transactional public class StudentService extends Service.Base<Student, HibernateStudentDao> { - Student newstudent; + private List<Student> students = new ArrayList<Student>(); Group newgroup; + private volatile static Integer groupNo; + private volatile static Integer studentNo; - private static Integer groupNo; - private static Integer studentNo; - - public boolean createGroup() + public Long createStudent(Integer birthYear, String semester,String gender,String major) { - return false; - } + - public Long createStudent(Integer birthYear, String ethnicity,String gender,String major) - { - //createGroup(); - System.out.println("Birthyear" + birthYear); - System.out.println("Ethnicity" + ethnicity); - System.out.println("Gender" + gender); - System.out.println("Major" + major); + System.out.println("Birthyear " + birthYear); + System.out.println("Ethnicity " + semester); + System.out.println("Gender " + gender); + System.out.println("Major " + major); - this.getDao().createStudent(birthYear, ethnicity, gender, major); - return newstudent.getId(); + Student student = new Student(); + + student.setBirthYear(birthYear); + student.setSemester(semester); + student.setGender(Gender.valueOf(gender)); + student.setMajor(major); + + save(student); + + System.err.println("Student id is: " + student.getId()); + + students.add(student); + + return student.getId(); } + + + + } Deleted: mentalmodels/trunk/src/main/webapp/FisheryExperiment.html =================================================================== --- mentalmodels/trunk/src/main/webapp/FisheryExperiment.html 2009-04-21 17:26:20 UTC (rev 117) +++ mentalmodels/trunk/src/main/webapp/FisheryExperiment.html 2009-04-21 23:59:22 UTC (rev 118) @@ -1,121 +0,0 @@ -<!-- 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" 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"> -<!-- -// 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+"", - "width", "760", - "height", "510", - "align", "middle", - "id", "FisheryExperiment", - "quality", "high", - "bgcolor", "#869ca7", - "name", "FisheryExperiment", - "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", "FisheryExperiment", - "width", "760", - "height", "510", - "align", "middle", - "id", "FisheryExperiment", - "quality", "high", - "bgcolor", "#869ca7", - "name", "FisheryExperiment", - "allowScriptAccess","sameDomain", - "type", "application/x-shockwave-flash", - "pluginspage", "http://www.adobe.com/go/getflashplayer" - ); - } else { // flash is too old or we can't detect the plugin - var alternateContent = 'Alternate HTML content should be placed here. ' - + 'This content requires the Adobe Flash Player. ' - + '<a href=http://www.adobe.com/go/getflash/>Get Flash</a>'; - document.write(alternateContent); // insert non-flash content - } -// --> -</script> -<noscript> - <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" - id="FisheryExperiment" width="760" height="510" - codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab"> - <param name="movie" value="FisheryExperiment.swf" /> - <param name="quality" value="high" /> - <param name="bgcolor" value="#869ca7" /> - <param name="allowScriptAccess" value="sameDomain" /> - <embed src="FisheryExperiment.swf" quality="high" bgcolor="#869ca7" - width="760" height="510" name="FisheryExperiment" 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/FisheryExperiment.swf =================================================================== (Binary files differ) Modified: mentalmodels/trunk/src/main/webapp/WEB-INF/applicationContext.xml =================================================================== --- mentalmodels/trunk/src/main/webapp/WEB-INF/applicationContext.xml 2009-04-21 17:26:20 UTC (rev 117) +++ mentalmodels/trunk/src/main/webapp/WEB-INF/applicationContext.xml 2009-04-21 23:59:22 UTC (rev 118) @@ -41,6 +41,7 @@ <!-- Expose services for BlazeDS remoting --> <flex:remote-service ref="studentService" /> + <!-- Flex related information ended--> Modified: mentalmodels/trunk/src/main/webapp/WEB-INF/classes/log4j.properties =================================================================== --- mentalmodels/trunk/src/main/webapp/WEB-INF/classes/log4j.properties 2009-04-21 17:26:20 UTC (rev 117) +++ mentalmodels/trunk/src/main/webapp/WEB-INF/classes/log4j.properties 2009-04-21 23:59:22 UTC (rev 118) @@ -11,5 +11,5 @@ # Add packages to log log4j.logger.edu.asu.commons=DEBUG -#log4j.logger.org.springframework=DEBUG -#log4j.logger.org.hibernate=DEBUG +log4j.logger.org.springframework=ERROR +log4j.logger.org.hibernate=ERROR Modified: mentalmodels/trunk/src/main/webapp/WEB-INF/flex/messaging-config.xml =================================================================== --- mentalmodels/trunk/src/main/webapp/WEB-INF/flex/messaging-config.xml 2009-04-21 17:26:20 UTC (rev 117) +++ mentalmodels/trunk/src/main/webapp/WEB-INF/flex/messaging-config.xml 2009-04-21 23:59:22 UTC (rev 118) @@ -1,14 +1,28 @@ <?xml version="1.0" encoding="UTF-8"?> <service id="message-service" - class="flex.messaging.services.MessageService"> + class="flex.messaging.services.MessageService" + messageTypes="flex.messaging.messages.AsyncMessage" > <adapters> - <adapter-definition id="actionscript" class="flex.messaging.services.messaging.adapters.ActionScriptAdapter" default="true" /> + <adapter-definition id="actionscript" class="flex.messaging.services.messaging.adapters.ActionScriptAdapter" default ="true"/> <!-- <adapter-definition id="jms" class="flex.messaging.services.messaging.adapters.JMSAdapter"/> --> + <adapter-definition id="DataPushAdapter" class="Feed"/> </adapters> <default-channels> <channel ref="my-polling-amf"/> + <channel ref="my-streaming-amf"/> </default-channels> + + <destination id="DataPush"> +<channels> +<channel ref="my-polling-amf"/> +</channels> +<!--<adapter ref="DataPushAdapter"/> + +--></destination> + + + </service> Modified: mentalmodels/trunk/src/main/webapp/WEB-INF/flex/services-config.xml =================================================================== --- mentalmodels/trunk/src/main/webapp/WEB-INF/flex/services-config.xml 2009-04-21 17:26:20 UTC (rev 117) +++ mentalmodels/trunk/src/main/webapp/WEB-INF/flex/services-config.xml 2009-04-21 23:59:22 UTC (rev 118) @@ -37,19 +37,30 @@ <channels> +<channel-definition id="my-streaming-amf" class="mx.messaging.channels.StreamingAMFChannel"> + <endpoint url="http://{server.name}:{server.port}/{context.root}/msgbroker/streamingamf" class="flex.messaging.endpoints.StreamingAMFEndpoint"/> + <properties> + <idle-timeout-minutes>0</idle-timeout-minutes> + <max-streaming-clients>10</max-streaming-clients> + <server-to-client-heartbeat-millis>5000</server-to-client-heartbeat-millis> + <user-agent-settings> <user-agent match-on="MSIE" kickstart-bytes="2048" max-streaming-connections-per-session="3"/> + <user-agent match-on="Firefox" kickstart-bytes="2048" max-streaming-connections-per-session="3"/> </user-agent-settings> + </properties> + </channel-definition> + <channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel"> - <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint"/> + <endpoint url="http://{server.name}:{server.port}/{context.root}/msgbroker/amf" class="flex.messaging.endpoints.AMFEndpoint"/> </channel-definition> <channel-definition id="my-secure-amf" class="mx.messaging.channels.SecureAMFChannel"> - <endpoint url="https://{server.name}:{server.port}/{context.root}/messagebroker/amfsecure" class="flex.messaging.endpoints.SecureAMFEndpoint"/> + <endpoint url="https://{server.name}:{server.port}/{context.root}/msgbroker/amfsecure" class="flex.messaging.endpoints.SecureAMFEndpoint"/> <properties> <add-no-cache-headers>false</add-no-cache-headers> </properties> </channel-definition> <channel-definition id="my-polling-amf" class="mx.messaging.channels.AMFChannel"> - <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amfpolling" class="flex.messaging.endpoints.AMFEndpoint"/> + <endpoint url="http://{server.name}:{server.port}/{context.root}/msgbroker/amfpolling" class="flex.messaging.endpoints.AMFEndpoint"/> <properties> <polling-enabled>true</polling-enabled> <polling-interval-seconds>4</polling-interval-seconds> Modified: mentalmodels/trunk/src/main/webapp/WEB-INF/web.xml =================================================================== --- mentalmodels/trunk/src/main/webapp/WEB-INF/web.xml 2009-04-21 17:26:20 UTC (rev 117) +++ mentalmodels/trunk/src/main/webapp/WEB-INF/web.xml 2009-04-21 23:59:22 UTC (rev 118) @@ -18,6 +18,25 @@ <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> + <listener> + <listener-class>flex.messaging.HttpFlexSession</listener-class> + </listener> + <!-- MessageBroker Servlet --> + <servlet> + <servlet-name>MessageBrokerServlet</servlet-name> + + <servlet-class>flex.messaging.MessageBrokerServlet</servlet-class> + <init-param> + <param-name>services.configuration.file</param-name> + <param-value>/WEB-INF/flex/services-config.xml</param-value> + </init-param> + <load-on-startup>2</load-on-startup> + </servlet> + <servlet-mapping> + <servlet-name>MessageBrokerServlet</servlet-name> + <url-pattern>/msgbroker/*</url-pattern> + </servlet-mapping> + <servlet> <servlet-name>mme</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> Added: mentalmodels/trunk/src/main/webapp/startfeed.jsp =================================================================== --- mentalmodels/trunk/src/main/webapp/startfeed.jsp (rev 0) +++ mentalmodels/trunk/src/main/webapp/startfeed.jsp 2009-04-21 23:59:22 UTC (rev 118) @@ -0,0 +1,10 @@ +<%@page import="edu.asu.commons.mme.service.Feed"%> +<% + try { + Feed feed = new Feed(); + feed.start(); + out.println("Feed Started"); + } catch (Exception e) { + out.println("A problem occured while starting the feed: "+e.getMessage()); + } +%> \ No newline at end of file Added: mentalmodels/trunk/src/main/webapp/stopfeed.jsp =================================================================== --- mentalmodels/trunk/src/main/webapp/stopfeed.jsp (rev 0) +++ mentalmodels/trunk/src/main/webapp/stopfeed.jsp 2009-04-21 23:59:22 UTC (rev 118) @@ -0,0 +1,10 @@ +<%@page import="edu.asu.commons.mme.service.Feed"%> +<% + try { + Feed feed = new Feed(); + feed.stop(); + out.println("Feed Stopped"); + } catch (Exception e) { + out.println("A problem occured while stopping the feed: "+e.getMessage()); + } +%> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <al...@us...> - 2009-04-21 17:26:36
|
Revision: 117 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=117&view=rev Author: alllee Date: 2009-04-21 17:26:20 +0000 (Tue, 21 Apr 2009) Log Message: ----------- round configuration is not dynamically accessible from the client (since the GroupDataModel's ServerDataModel is transient). Should rectify this later by injecting the RoundConfiguration into the ClientData object, in the meantime caching the field of vision booleans + radius in the ClientData object and injecting them in when ClientData's position is initialized on the server side. Modified Paths: -------------- foraging/trunk/src/main/java/edu/asu/commons/foraging/model/ClientData.java foraging/trunk/src/main/resources/configuration/asu-experiments/mobile-fov-oa-chat-sanction/round0.xml Modified: foraging/trunk/src/main/java/edu/asu/commons/foraging/model/ClientData.java =================================================================== --- foraging/trunk/src/main/java/edu/asu/commons/foraging/model/ClientData.java 2009-04-21 16:59:21 UTC (rev 116) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/model/ClientData.java 2009-04-21 17:26:20 UTC (rev 117) @@ -44,6 +44,8 @@ private LinkedList<RealTimeSanctionRequest> latestSanctions; private AnimationData animationData; + private boolean subjectsFieldOfVisionEnabled; + private boolean tokensFieldOfVisionEnabled; private double viewSubjectsRadius; private double viewTokensRadius; @@ -81,18 +83,16 @@ public void addTokens(int tokens) { currentTokens += tokens; + // this can only be invoked on the server side RoundConfiguration configuration = getGroupDataModel().getRoundConfiguration(); if ( ! configuration.isPracticeRound() ) { totalTokens += tokens; totalIncome += (tokens * configuration.getDollarsPerToken()); } } - - public Circle getSubjectsFieldOfVision() { - RoundConfiguration roundConfiguration = getGroupDataModel().getRoundConfiguration(); - if (roundConfiguration.isSubjectsFieldOfVisionEnabled()) { + if (isSubjectsFieldOfVisionEnabled()) { return new Circle(getPoint(), viewSubjectsRadius); } else { @@ -112,8 +112,7 @@ } public Circle getTokensFieldOfVision() { - RoundConfiguration roundConfiguration = getGroupDataModel().getRoundConfiguration(); - if (roundConfiguration.isTokensFieldOfVisionEnabled()) { + if (isTokensFieldOfVisionEnabled()) { return new Circle(getPoint(), viewTokensRadius); } else { @@ -345,10 +344,12 @@ public void initializePosition() { RoundConfiguration roundConfiguration = getGroupDataModel().getRoundConfiguration(); setExplicitCollectionMode(roundConfiguration.isAlwaysInExplicitCollectionMode()); - if (roundConfiguration.isSubjectsFieldOfVisionEnabled()) { + subjectsFieldOfVisionEnabled = roundConfiguration.isSubjectsFieldOfVisionEnabled(); + if (subjectsFieldOfVisionEnabled) { viewSubjectsRadius = roundConfiguration.getViewSubjectsRadius(); } - if (roundConfiguration.isTokensFieldOfVisionEnabled()) { + tokensFieldOfVisionEnabled = roundConfiguration.isTokensFieldOfVisionEnabled(); + if (tokensFieldOfVisionEnabled) { viewTokensRadius = roundConfiguration.getViewTokensRadius(); } if (roundConfiguration.isRealTimeSanctioningEnabled()) { @@ -453,5 +454,21 @@ return totalIncome; } + public boolean isSubjectsFieldOfVisionEnabled() { + return subjectsFieldOfVisionEnabled; + } + public boolean isTokensFieldOfVisionEnabled() { + return tokensFieldOfVisionEnabled; + } + + public double getViewSubjectsRadius() { + return viewSubjectsRadius; + } + + public double getViewTokensRadius() { + return viewTokensRadius; + } + + } Modified: foraging/trunk/src/main/resources/configuration/asu-experiments/mobile-fov-oa-chat-sanction/round0.xml =================================================================== --- foraging/trunk/src/main/resources/configuration/asu-experiments/mobile-fov-oa-chat-sanction/round0.xml 2009-04-21 16:59:21 UTC (rev 116) +++ foraging/trunk/src/main/resources/configuration/asu-experiments/mobile-fov-oa-chat-sanction/round0.xml 2009-04-21 17:26:20 UTC (rev 117) @@ -42,10 +42,10 @@ collected a green token, a new token can once again appear on that empty cell. However, the rate at which new tokens will appear depends on the number of adjacent cells that still have tokens. The more tokens in the 8 cells around -an empty cell, the faster a new token will appear on that empty cell. Tokens -generate new tokens. Thus the middle cell in Image 1 denoted with X will be -regenerated at a faster rate than the middle cell in Image 2. When all -neighboring cells are empty, there is no renewal. +an empty cell, the faster a new token will appear on that empty cell. Existing +tokens can generate new tokens. Thus the middle cell in Image 1 denoted with X will +be regenerated at a faster rate than the middle cell in Image 2. When all +neighboring cells are empty, there is no renewal. <table width="100%"> <tr> @@ -91,7 +91,7 @@ <br> <form> Which of the statements is incorrect? <br> -<input type="radio" name="q1" value="A">Your decisions of where to collect tokens affect the regeneration of tokens.<br> +<input type="radio" name="q1" value="A">Your decisions of where to collect tokens affects the regeneration of tokens.<br> <input type="radio" name="q1" value="B">When you have collected all tokens on the screen, no new tokens will appear.<br> <input type="radio" name="q1" value="C">Tokens grow from the middle of the @@ -118,7 +118,8 @@ You can earn more, up to a maximum of 40 dollars, by participating in this experiment, which will take about an hour. The amount of money you earn depends on your decisions as well as the decisions of your group members -during the four rounds of the experiment. +during the four rounds of the experiment. Please be patient while the rest of the +participants are seated, the experiment will begin shortly. </p> ]]> </entry> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <al...@us...> - 2009-04-21 16:59:32
|
Revision: 116 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=116&view=rev Author: alllee Date: 2009-04-21 16:59:21 +0000 (Tue, 21 Apr 2009) Log Message: ----------- caching view subjects + tokens radius in client data, gets initialized during initializePosition and giving ClientData a little more intelligence about whether or not it can view another subject. For now logic for testing whether or not tokens are within the field of vision will still reside in SubjectView for optimization purposes, we don't want to recompute the Circle for every token that we want to render, though we could pass in a Collection<Point> and return a Collection<Point> that is filtered... Also tweaking the configuration a little bit for the pre-test treatment this afternoon. Modified Paths: -------------- foraging/trunk/src/main/java/edu/asu/commons/foraging/client/Circle.java foraging/trunk/src/main/java/edu/asu/commons/foraging/client/GameWindow2D.java foraging/trunk/src/main/java/edu/asu/commons/foraging/client/SubjectView.java foraging/trunk/src/main/java/edu/asu/commons/foraging/conf/RoundConfiguration.java foraging/trunk/src/main/java/edu/asu/commons/foraging/model/ClientData.java foraging/trunk/src/main/resources/configuration/asu-experiments/mobile-fov-oa-chat-sanction/round0.xml Modified: foraging/trunk/src/main/java/edu/asu/commons/foraging/client/Circle.java =================================================================== --- foraging/trunk/src/main/java/edu/asu/commons/foraging/client/Circle.java 2009-04-20 20:24:46 UTC (rev 115) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/client/Circle.java 2009-04-21 16:59:21 UTC (rev 116) @@ -1,6 +1,7 @@ package edu.asu.commons.foraging.client; import java.awt.Point; +import java.io.Serializable; /** * $Id$ @@ -11,9 +12,11 @@ * @author <a href='mailto:All...@as...'>Allen Lee</a> * @version $Revision$ */ -public class Circle { - - private Point center; +public class Circle implements Serializable { + + private static final long serialVersionUID = 6400834001276229287L; + + private Point center; private final double radius; public Circle(Point center, double radius) { Modified: foraging/trunk/src/main/java/edu/asu/commons/foraging/client/GameWindow2D.java =================================================================== --- foraging/trunk/src/main/java/edu/asu/commons/foraging/client/GameWindow2D.java 2009-04-20 20:24:46 UTC (rev 115) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/client/GameWindow2D.java 2009-04-21 16:59:21 UTC (rev 116) @@ -366,8 +366,12 @@ // don't allow self-flagellation :-). return; } - event = new RealTimeSanctionRequest(dataModel.getId(), sanctionee); - dataModel.sanction(dataModel.getId(), sanctionee); + // only allow sanctions for subjects within this subject's field of vision + Point subjectPosition = dataModel.getClientDataMap().get(sanctionee).getPoint(); + if (dataModel.getClientData().isSubjectInFieldOfVision(subjectPosition)) { + event = new RealTimeSanctionRequest(dataModel.getId(), sanctionee); + dataModel.sanction(dataModel.getId(), sanctionee); + } } else return; break; Modified: foraging/trunk/src/main/java/edu/asu/commons/foraging/client/SubjectView.java =================================================================== --- foraging/trunk/src/main/java/edu/asu/commons/foraging/client/SubjectView.java 2009-04-20 20:24:46 UTC (rev 115) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/client/SubjectView.java 2009-04-21 16:59:21 UTC (rev 116) @@ -109,7 +109,7 @@ int characterHeight = fontMetrics.getAscent(); int verticalCharacterSpacing = (int) ( (dh - characterHeight) / 2); Circle fieldOfVision = null; - if (dataModel.getRoundConfiguration().isSubjectFieldOfVisionEnabled()) { + if (dataModel.getRoundConfiguration().isSubjectsFieldOfVisionEnabled()) { fieldOfVision = new Circle(dataModel.getCurrentPosition(), dataModel.getRoundConfiguration().getViewSubjectsRadius()); } for (Map.Entry<Identifier, ClientData> entry : positions.entrySet()) { Modified: foraging/trunk/src/main/java/edu/asu/commons/foraging/conf/RoundConfiguration.java =================================================================== --- foraging/trunk/src/main/java/edu/asu/commons/foraging/conf/RoundConfiguration.java 2009-04-20 20:24:46 UTC (rev 115) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/conf/RoundConfiguration.java 2009-04-21 16:59:21 UTC (rev 116) @@ -104,12 +104,12 @@ return getBooleanProperty("tokens-field-of-vision", false); } - public boolean isSubjectFieldOfVisionEnabled() { + public boolean isSubjectsFieldOfVisionEnabled() { return getBooleanProperty("subjects-field-of-vision", false); } public double getViewSubjectsRadius() { - if (isSubjectFieldOfVisionEnabled()) { + if (isSubjectsFieldOfVisionEnabled()) { return getDoubleProperty("view-subjects-radius", 6.0d); } throw new UnsupportedOperationException("subject field of vision is not enabled."); Modified: foraging/trunk/src/main/java/edu/asu/commons/foraging/model/ClientData.java =================================================================== --- foraging/trunk/src/main/java/edu/asu/commons/foraging/model/ClientData.java 2009-04-20 20:24:46 UTC (rev 115) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/model/ClientData.java 2009-04-21 16:59:21 UTC (rev 116) @@ -7,6 +7,7 @@ import java.util.Queue; import java.util.concurrent.TimeUnit; +import edu.asu.commons.foraging.client.Circle; import edu.asu.commons.foraging.conf.RoundConfiguration; import edu.asu.commons.foraging.event.RealTimeSanctionRequest; import edu.asu.commons.foraging.graphics.Point3D; @@ -42,6 +43,9 @@ private Duration freezeDuration; private LinkedList<RealTimeSanctionRequest> latestSanctions; private AnimationData animationData; + + private double viewSubjectsRadius; + private double viewTokensRadius; public ClientData(Identifier id) { this.id = id; @@ -84,6 +88,39 @@ } } + + + public Circle getSubjectsFieldOfVision() { + RoundConfiguration roundConfiguration = getGroupDataModel().getRoundConfiguration(); + if (roundConfiguration.isSubjectsFieldOfVisionEnabled()) { + return new Circle(getPoint(), viewSubjectsRadius); + } + else { + return null; + } + } + + public boolean isSubjectInFieldOfVision(Point subjectPosition) { + Circle circle = getSubjectsFieldOfVision(); + if (circle == null) { + // if the field of vision is null that means that there is no + // field of vision enabled. + return true; + } + return circle.contains(subjectPosition); + // could also do return circle == null || circle.contains(point); + } + + public Circle getTokensFieldOfVision() { + RoundConfiguration roundConfiguration = getGroupDataModel().getRoundConfiguration(); + if (roundConfiguration.isTokensFieldOfVisionEnabled()) { + return new Circle(getPoint(), viewTokensRadius); + } + else { + return null; + } + } + public void addToken() { addTokens(1); } @@ -151,11 +188,9 @@ public synchronized void postRoundSanctionPenalty(final int tokens) { if (tokens < 0) { - System.err.println("Adding to penalties: " + tokens + " for id: " + id); sanctionPenalties += Math.abs(tokens); } else { - System.err.println("Adding to bonuses: " + tokens + " for id: " + id); sanctionBonuses += tokens; } } @@ -273,7 +308,7 @@ case 4: return ( topLeftCorner.add(new Point3D(worldWidth * 3, 0, worldDepth * 3)) ); default: - throw new IllegalArgumentException("initializePosition is hardcoded and does not support more than 4 clients"); + throw new IllegalArgumentException("generate3DPosition is hardcoded to only support up to 4 clients"); } } @@ -295,7 +330,9 @@ public void setExplicitCollectionMode(boolean explicitCollectionMode) { this.explicitCollectionMode = explicitCollectionMode; } + + /** * This method only makes sense within the group that this client data is embedded. */ @@ -308,6 +345,12 @@ public void initializePosition() { RoundConfiguration roundConfiguration = getGroupDataModel().getRoundConfiguration(); setExplicitCollectionMode(roundConfiguration.isAlwaysInExplicitCollectionMode()); + if (roundConfiguration.isSubjectsFieldOfVisionEnabled()) { + viewSubjectsRadius = roundConfiguration.getViewSubjectsRadius(); + } + if (roundConfiguration.isTokensFieldOfVisionEnabled()) { + viewTokensRadius = roundConfiguration.getViewTokensRadius(); + } if (roundConfiguration.isRealTimeSanctioningEnabled()) { latestSanctions = new LinkedList<RealTimeSanctionRequest>(); } Modified: foraging/trunk/src/main/resources/configuration/asu-experiments/mobile-fov-oa-chat-sanction/round0.xml =================================================================== --- foraging/trunk/src/main/resources/configuration/asu-experiments/mobile-fov-oa-chat-sanction/round0.xml 2009-04-20 20:24:46 UTC (rev 115) +++ foraging/trunk/src/main/resources/configuration/asu-experiments/mobile-fov-oa-chat-sanction/round0.xml 2009-04-21 16:59:21 UTC (rev 116) @@ -10,6 +10,7 @@ <entry key='resource-generator'>mobile</entry> <entry key='tokens-field-of-vision'>true</entry> +<entry key='view-tokens-radius'>3.0</entry> <entry key='subjects-field-of-vision'>true</entry> <entry key='regrowth-rate'>.01</entry> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <al...@us...> - 2009-04-20 20:24:55
|
Revision: 115 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=115&view=rev Author: alllee Date: 2009-04-20 20:24:46 +0000 (Mon, 20 Apr 2009) Log Message: ----------- halving default token birth probability for mobile resources and increasing amount of time server sleeps, currently performing updates 10 times / second (instead of 20). May tweak this more later after testing the configuration from the CARL lab to the the ETS server. Modified Paths: -------------- foraging/trunk/pom.xml foraging/trunk/src/main/java/edu/asu/commons/foraging/client/GameWindow2D.java foraging/trunk/src/main/java/edu/asu/commons/foraging/conf/RoundConfiguration.java foraging/trunk/src/main/java/edu/asu/commons/foraging/model/ResourceDispenser.java foraging/trunk/src/main/java/edu/asu/commons/foraging/model/ResourceGenerator.java foraging/trunk/src/main/java/edu/asu/commons/foraging/server/ForagingServer.java Modified: foraging/trunk/pom.xml =================================================================== --- foraging/trunk/pom.xml 2009-04-20 20:21:13 UTC (rev 114) +++ foraging/trunk/pom.xml 2009-04-20 20:24:46 UTC (rev 115) @@ -16,11 +16,22 @@ <id>dev.commons.asu.edu</id> <name>dev.commons Maven2 repository</name> <url>http://dev.commons.asu.edu/archiva/repository/internal</url> + <releases><enabled>true</enabled></releases> + <snapshots><enabled>false</enabled></snapshots> </repository> <repository> + <id>snapshot.dev.commons.asu.edu</id> + <name>dev.commons Maven2 snapshot repository</name> + <url>http://dev.commons.asu.edu/archiva/repository/snapshots</url> + <releases><enabled>false</enabled></releases> + <snapshots><enabled>true</enabled></snapshots> + </repository> + <repository> <id>dev.tdar.org</id> <name>tDAR Maven2 repository</name> <url>http://dev.tdar.org/archiva/repository/internal</url> + <releases><enabled>true</enabled></releases> + <snapshots><enabled>false</enabled></snapshots> </repository> <!-- <repository> Modified: foraging/trunk/src/main/java/edu/asu/commons/foraging/client/GameWindow2D.java =================================================================== --- foraging/trunk/src/main/java/edu/asu/commons/foraging/client/GameWindow2D.java 2009-04-20 20:21:13 UTC (rev 114) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/client/GameWindow2D.java 2009-04-20 20:24:46 UTC (rev 115) @@ -126,7 +126,9 @@ timeLeftLabel.setText(getTimeLeftLabelText(roundTimeLeft)); // FIXME: subjectView.repaint() causes graphical glitches here // only when we transition from 3D -> 2D experiment. Find out why. - repaint(); + informationLabel.repaint(); + timeLeftLabel.repaint(); + subjectView.repaint(); } }); } @@ -387,9 +389,18 @@ } else { event = new ClientMovementRequest(client.getId(), direction); + // move the client directly, this may get overridden later by a client update. + /* + if (dataModel.getRoundConfiguration().isAlwaysInExplicitCollectionMode()) { + Point newPosition = direction.apply(dataModel.getCurrentPosition()); + dataModel.getClientData().setPosition(newPosition); + subjectView.repaint(); + } + */ } if (keyReleased) { - // FIXME: have client directly handle these requests. + // FIXME: have client directly render these requests? Would + // make the app more "responsive" and less tied to server latency. channel.handle(event); keyReleased = false; } Modified: foraging/trunk/src/main/java/edu/asu/commons/foraging/conf/RoundConfiguration.java =================================================================== --- foraging/trunk/src/main/java/edu/asu/commons/foraging/conf/RoundConfiguration.java 2009-04-20 20:21:13 UTC (rev 114) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/conf/RoundConfiguration.java 2009-04-20 20:24:46 UTC (rev 115) @@ -23,7 +23,7 @@ private static final double DEFAULT_TOKEN_MOVEMENT_PROBABILITY = 0.02d; - private static final double DEFAULT_TOKEN_BIRTH_PROBABILITY = 0.02d; + private static final double DEFAULT_TOKEN_BIRTH_PROBABILITY = 0.01d; private final static Map<String, SanctionType> sanctionTypeMap = new HashMap<String, SanctionType>(3); public enum SanctionType { Modified: foraging/trunk/src/main/java/edu/asu/commons/foraging/model/ResourceDispenser.java =================================================================== --- foraging/trunk/src/main/java/edu/asu/commons/foraging/model/ResourceDispenser.java 2009-04-20 20:21:13 UTC (rev 114) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/model/ResourceDispenser.java 2009-04-20 20:24:46 UTC (rev 115) @@ -27,13 +27,16 @@ */ public class ResourceDispenser { - private final static Logger logger = Logger.getLogger( ResourceDispenser.class.getName() ); + private final static Map<String, Type> resourceGeneratorTypeMap = new HashMap<String, Type>(3); + public enum Type { DENSITY_DEPENDENT("density-dependent"), TOP_BOTTOM_PATCHY("top-bottom-patchy"), MOBILE("mobile"); + final String name; private Type(String name) { + this.name = name; resourceGeneratorTypeMap.put(name, this); } @@ -49,6 +52,10 @@ } return type; } + + public String toString() { + return name; + } } private final ServerDataModel serverDataModel; Modified: foraging/trunk/src/main/java/edu/asu/commons/foraging/model/ResourceGenerator.java =================================================================== --- foraging/trunk/src/main/java/edu/asu/commons/foraging/model/ResourceGenerator.java 2009-04-20 20:21:13 UTC (rev 114) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/model/ResourceGenerator.java 2009-04-20 20:24:46 UTC (rev 115) @@ -46,4 +46,4 @@ return newResources; } } -} \ No newline at end of file +} Modified: foraging/trunk/src/main/java/edu/asu/commons/foraging/server/ForagingServer.java =================================================================== --- foraging/trunk/src/main/java/edu/asu/commons/foraging/server/ForagingServer.java 2009-04-20 20:21:13 UTC (rev 114) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/server/ForagingServer.java 2009-04-20 20:24:46 UTC (rev 115) @@ -78,7 +78,7 @@ private final Map<Identifier, ClientData> clients = new HashMap<Identifier, ClientData>(); public final static int SYNCHRONIZATION_FREQUENCY = 60; - public final static int SERVER_SLEEP_INTERVAL = 50; + public final static int SERVER_SLEEP_INTERVAL = 100; private Identifier facilitatorId; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |