[virtualcommons-svn] commit/foraging: alllee: fixing instructions for IU experiments (online qualtr
Status: Beta
Brought to you by:
alllee
From: Bitbucket <com...@bi...> - 2012-01-30 19:34:30
|
1 new commit in foraging: https://bitbucket.org/virtualcommons/foraging/changeset/14f5d16b9584/ changeset: 14f5d16b9584 user: alllee date: 2012-01-30 20:34:12 summary: fixing instructions for IU experiments (online qualtrics survey in the last round means we don't have a paper exit survey, etc.) minor refactoring on FacilitatorWindow, reordering menu items to hopefully be a little more sensible. Should redesign UI at some point when we have more time. affected #: 7 files diff -r da8f368535e463ba02486c618b09828c533ebb5d -r 14f5d16b9584e8d1c699fd9c63946844370cc9ac src/main/java/edu/asu/commons/foraging/facilitator/Facilitator.java --- a/src/main/java/edu/asu/commons/foraging/facilitator/Facilitator.java +++ b/src/main/java/edu/asu/commons/foraging/facilitator/Facilitator.java @@ -39,7 +39,6 @@ */ public class Facilitator extends BaseFacilitator<ServerConfiguration, RoundConfiguration> { - private final static Facilitator INSTANCE = new Facilitator(); private ServerDataModel serverDataModel; private FacilitatorWindow facilitatorWindow; private boolean experimentRunning = false; @@ -51,6 +50,14 @@ @SuppressWarnings("rawtypes") public Facilitator(ServerConfiguration configuration) { super(configuration); + } + + void createFacilitatorWindow(Dimension dimension) { + facilitatorWindow = new FacilitatorWindow(dimension, this); + if (getId() == null) { + // configure for unconnected functionality + facilitatorWindow.configureForReplay(); + } addEventProcessor(new EventTypeProcessor<SetConfigurationEvent>(SetConfigurationEvent.class) { public void handle(SetConfigurationEvent event) { RoundConfiguration configuration = (RoundConfiguration) event.getParameters(); @@ -58,10 +65,10 @@ } }); addEventProcessor(new EventTypeProcessor<TrustGameResultsFacilitatorEvent>(TrustGameResultsFacilitatorEvent.class){ - @Override - public void handle(TrustGameResultsFacilitatorEvent event) { - facilitatorWindow.updateTrustGame(event); - } + @Override + public void handle(TrustGameResultsFacilitatorEvent event) { + facilitatorWindow.updateTrustGame(event); + } }); addEventProcessor(new EventTypeProcessor<FacilitatorUpdateEvent>(FacilitatorUpdateEvent.class) { @@ -104,18 +111,6 @@ } - public static Facilitator getInstance() { - return INSTANCE; - } - - void createFacilitatorWindow(Dimension dimension) { - facilitatorWindow = new FacilitatorWindow(dimension, this); - if (getId() == null) { - // configure for unconnected functionality - facilitatorWindow.configureForReplay(); - } - } - /* * Send a request to server to start an experiment */ @@ -190,8 +185,7 @@ return facilitatorWindow; } - public void setRoundParameters( - List<RoundConfiguration> roundConfiguration) { + public void setRoundParameters(List<RoundConfiguration> roundConfiguration) { getServerConfiguration().setAllParameters(roundConfiguration); } @@ -204,14 +198,14 @@ } public static void main(String[] args) { - Runnable createGuiRunnable = new Runnable() { + SwingUtilities.invokeLater(new Runnable() { public void run() { Dimension dimension = new Dimension(700, 700); - Facilitator facilitator = Facilitator.getInstance(); + Facilitator facilitator = new Facilitator(); facilitator.connect(); JFrame frame = new JFrame(); - frame.setTitle("Facilitator window: " + facilitator.getId()); - frame.setSize((int) dimension.getWidth(), (int) dimension.getHeight()); + frame.setTitle("Facilitator: " + facilitator.getId()); + frame.setSize(dimension); facilitator.createFacilitatorWindow(dimension); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.getContentPane().add(facilitator.getFacilitatorWindow()); @@ -219,8 +213,7 @@ // frame.pack(); frame.setVisible(true); } - }; - SwingUtilities.invokeLater(createGuiRunnable); + }); } public RoundConfiguration getCurrentRoundConfiguration() { diff -r da8f368535e463ba02486c618b09828c533ebb5d -r 14f5d16b9584e8d1c699fd9c63946844370cc9ac src/main/java/edu/asu/commons/foraging/facilitator/FacilitatorWindow.java --- a/src/main/java/edu/asu/commons/foraging/facilitator/FacilitatorWindow.java +++ b/src/main/java/edu/asu/commons/foraging/facilitator/FacilitatorWindow.java @@ -129,15 +129,7 @@ // Round menu JMenu menu = new JMenu("Round"); menu.setMnemonic(KeyEvent.VK_R); - - startChatMenuItem = new JMenuItem("Start chat"); - startChatMenuItem.setEnabled(true); - startChatMenuItem.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - facilitator.sendBeginChatRoundRequest(); - } - }); - menu.add(startChatMenuItem); + showInstructionsMenuItem = new JMenuItem("Show Instructions"); showInstructionsMenuItem.setMnemonic(KeyEvent.VK_I); @@ -149,15 +141,7 @@ } }); menu.add(showInstructionsMenuItem); - - showTrustGameMenuItem = new JMenuItem("Show Trust Game"); - showTrustGameMenuItem.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - facilitator.sendShowTrustGameRequest(); - } - }); - menu.add(showTrustGameMenuItem); - + startRoundMenuItem = new JMenuItem("Start"); startRoundMenuItem.setMnemonic(KeyEvent.VK_T); startRoundMenuItem.setEnabled(false); @@ -177,17 +161,35 @@ } }); menu.add(stopRoundMenuItem); - + showExitInstructionsMenuItem = createMenuItem(menu, "Show exit instructions", new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - facilitator.sendShowExitInstructionsRequest(); - } + @Override + public void actionPerformed(ActionEvent e) { + facilitator.sendShowExitInstructionsRequest(); + } }); + startChatMenuItem = new JMenuItem("Start chat"); + startChatMenuItem.setEnabled(true); + startChatMenuItem.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + facilitator.sendBeginChatRoundRequest(); + } + }); + menu.add(startChatMenuItem); + + showTrustGameMenuItem = new JMenuItem("Show Trust Game"); + showTrustGameMenuItem.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + facilitator.sendShowTrustGameRequest(); + } + }); + menu.add(showTrustGameMenuItem); + + menuBar.add(menu); - + // voting menu menu = new JMenu("Voting"); diff -r da8f368535e463ba02486c618b09828c533ebb5d -r 14f5d16b9584e8d1c699fd9c63946844370cc9ac src/main/java/edu/asu/commons/foraging/model/GroupDataModel.java --- a/src/main/java/edu/asu/commons/foraging/model/GroupDataModel.java +++ b/src/main/java/edu/asu/commons/foraging/model/GroupDataModel.java @@ -1,7 +1,6 @@ package edu.asu.commons.foraging.model; import java.awt.Point; -import java.io.Serializable; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -43,7 +42,7 @@ * @version $Revision$ */ -public class GroupDataModel implements Serializable, Comparable<GroupDataModel>, DataModel<ServerConfiguration, RoundConfiguration> { +public class GroupDataModel implements Comparable<GroupDataModel>, DataModel<ServerConfiguration, RoundConfiguration> { private static final long serialVersionUID = -4756267788191037505L; @@ -809,4 +808,9 @@ return selectedRules.get(0); } + @Override + public ServerConfiguration getExperimentConfiguration() { + return serverDataModel.getExperimentConfiguration(); + } + } diff -r da8f368535e463ba02486c618b09828c533ebb5d -r 14f5d16b9584e8d1c699fd9c63946844370cc9ac src/main/resources/configuration/iu/2011/vote-punish/round9.xml --- a/src/main/resources/configuration/iu/2011/vote-punish/round9.xml +++ b/src/main/resources/configuration/iu/2011/vote-punish/round9.xml @@ -19,22 +19,25 @@ <![CDATA[https://qtrial.qualtrics.com/SE/?SID=SV_e8rPe7yyhue5OVm&SURVEY_ID={surveyId}]]></entry> -<entry key="last-round-debriefing"> +<entry key='survey-instructions'><![CDATA[ - <p> - This was the last round, but not the end of the experiment. We will now - determine your payments. While we are doing this, we request that you - carefully fill out a brief survey. - </p> - <p> - When we are ready we will call you one by one to the room next door. We will - pay you there in private. Please wait until your computer number is called, - and then proceed to the room next door to turn in your computer number and - your survey. - </p> - <p> - Please answer the survey carefully and thank you for participating. - </p> + <h1>Survey</h1> + <hr> + <p> + We would like to again ask you some quick questions. Please <a href='{surveyUrl}'>click here</a> to begin the survey. + </p> + <p> + We will continue after all of the surveys have been completed by all the + participants in the room. Please press the "Continue" button at the + bottom of the screen after you have successfully completed the survey. + </p> + <p> + If you encounter any problems with the survey <b>please inform the experimenter</b>. + </p> + <br> + <form> + <input type="submit" value="Continue" name="continue"> + </form> ]]></entry> diff -r da8f368535e463ba02486c618b09828c533ebb5d -r 14f5d16b9584e8d1c699fd9c63946844370cc9ac src/main/resources/configuration/iu/2011/vote-punish/server.xml --- a/src/main/resources/configuration/iu/2011/vote-punish/server.xml +++ b/src/main/resources/configuration/iu/2011/vote-punish/server.xml @@ -244,15 +244,16 @@ Your <b>total income</b> is <b>{clientData.grandTotalIncome}</b>. </p> {if (showExitInstructions)} -<h2>Exit Survey</h2> +<h2>Final Round</h2><hr> -<p> -This was the last round, but not the end of the experiment. We ask that you please carefully fill out a brief survey as we prepare your payments. -</p> + <p>This was the last round of the experiment.</p><h2>Payment</h2><hr><p> -When payments are ready we will call you up one by one. Please wait until your computer number, <b>{clientData.id}</b>, is called to turn in your survey and receive payment. Please answer the survey carefully and thank you for participating. +Please wait quietly while we prepare your payments. When payments are ready we will +call you up one by one. Please wait until your computer number, +<b>{clientData.id}</b>, is called before coming up to receive payment. Thank you +for participating. </p> {endif} ]]> @@ -308,16 +309,12 @@ <p><b>Do you have any questions?</b> If you have any questions at this time, raise your hand and someone will come over to your station and answer it. - Otherwise, please click the continue button below. </p> - <form> - <input type="submit" value="Continue" name="continue"> - </form> ]]></entry><entry key='waiting-room-instructions'><![CDATA[ -<h1>Waiting Room</h1> +<h1>Please Wait</h1><hr><p>Please wait while the other participants complete their tasks.</p> ]]> diff -r da8f368535e463ba02486c618b09828c533ebb5d -r 14f5d16b9584e8d1c699fd9c63946844370cc9ac src/main/resources/configuration/iu/2011/vote/round9.xml --- a/src/main/resources/configuration/iu/2011/vote/round9.xml +++ b/src/main/resources/configuration/iu/2011/vote/round9.xml @@ -19,22 +19,25 @@ <![CDATA[https://qtrial.qualtrics.com/SE/?SID=SV_e8rPe7yyhue5OVm&SURVEY_ID={surveyId}]]></entry> -<entry key="last-round-debriefing"> +<entry key='survey-instructions'><![CDATA[ - <p> - This was the last round, but not the end of the experiment. We will now - determine your payments. While we are doing this, we request that you - carefully fill out a brief survey. - </p> - <p> - When we are ready we will call you one by one to the room next door. We will - pay you there in private. Please wait until your computer number is called, - and then proceed to the room next door to turn in your computer number and - your survey. - </p> - <p> - Please answer the survey carefully and thank you for participating. - </p> + <h1>Survey</h1> + <hr> + <p> + We would like to again ask you some quick questions. Please <a href='{surveyUrl}'>click here</a> to begin the survey. + </p> + <p> + We will continue after all of the surveys have been completed by all the + participants in the room. Please press the "Continue" button at the + bottom of the screen after you have successfully completed the survey. + </p> + <p> + If you encounter any problems with the survey <b>please inform the experimenter</b>. + </p> + <br> + <form> + <input type="submit" value="Continue" name="continue"> + </form> ]]></entry> diff -r da8f368535e463ba02486c618b09828c533ebb5d -r 14f5d16b9584e8d1c699fd9c63946844370cc9ac src/main/resources/configuration/iu/2011/vote/server.xml --- a/src/main/resources/configuration/iu/2011/vote/server.xml +++ b/src/main/resources/configuration/iu/2011/vote/server.xml @@ -244,15 +244,16 @@ Your <b>total income</b> is <b>{clientData.grandTotalIncome}</b>. </p> {if (showExitInstructions)} -<h2>Exit Survey</h2> +<h2>Final Round</h2><hr> -<p> -This was the last round, but not the end of the experiment. We ask that you please carefully fill out a brief survey as we prepare your payments. -</p> + <p>This was the last round of the experiment.</p><h2>Payment</h2><hr><p> -When payments are ready we will call you up one by one. Please wait until your computer number, <b>{clientData.id}</b>, is called to turn in your survey and receive payment. Please answer the survey carefully and thank you for participating. +Please wait quietly while we prepare your payments. When payments are ready we will +call you up one by one. Please wait until your computer number, +<b>{clientData.id}</b>, is called before coming up to receive payment. Thank you +for participating. </p> {endif} ]]> @@ -308,16 +309,12 @@ <p><b>Do you have any questions?</b> If you have any questions at this time, raise your hand and someone will come over to your station and answer it. - Otherwise, please click the continue button below. </p> - <form> - <input type="submit" value="Continue" name="continue"> - </form> ]]></entry><entry key='waiting-room-instructions'><![CDATA[ -<h1>Waiting Room</h1> +<h1>Please Wait</h1><hr><p>Please wait while the other participants complete their tasks.</p> ]]> Repository URL: https://bitbucket.org/virtualcommons/foraging/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. |