[virtualcommons-svn] commit/foraging: 2 new changesets
Status: Beta
Brought to you by:
alllee
From: Bitbucket <com...@bi...> - 2012-01-20 16:22:43
|
2 new commits in foraging: https://bitbucket.org/virtualcommons/foraging/changeset/b3ca85e82159/ changeset: b3ca85e82159 user: alllee date: 2012-01-20 17:16:50 summary: asking the RoundConfiguration for survey instructions will now attempt to be loaded from ServerConfiguration if it's not set at the round level affected #: 7 files diff -r a21112c697c5ebc09975aab27491bb6498471dac -r b3ca85e821599807ef6682bff167286f64320afe src/main/java/edu/asu/commons/foraging/conf/RoundConfiguration.java --- a/src/main/java/edu/asu/commons/foraging/conf/RoundConfiguration.java +++ b/src/main/java/edu/asu/commons/foraging/conf/RoundConfiguration.java @@ -705,7 +705,7 @@ } public String getSurveyInstructions() { - return getProperty("survey-instructions"); + return getProperty("survey-instructions", getParentConfiguration().getSurveyInstructions()); } public String getSurveyUrl(Identifier id) { diff -r a21112c697c5ebc09975aab27491bb6498471dac -r b3ca85e821599807ef6682bff167286f64320afe src/main/java/edu/asu/commons/foraging/conf/ServerConfiguration.java --- a/src/main/java/edu/asu/commons/foraging/conf/ServerConfiguration.java +++ b/src/main/java/edu/asu/commons/foraging/conf/ServerConfiguration.java @@ -118,25 +118,29 @@ "<h3>The experiment has ended and participant payments are listed above. We recommend that you copy and paste it into a text editor for your records.</h3>"); } - public String getFacilitatorDebriefing() { - return assistant.getProperty("facilitator-debriefing"); - } - - public String getClientDebriefing() { - return assistant.getProperty("client-debriefing"); - } - - public double getTotalIncome(ClientData data) { - return getTotalIncome(data, false); - } - - public double getTotalIncome(ClientData data, boolean includeTrustGame) { - double totalIncome = data.getTotalIncome() + getShowUpPayment() + getQuizEarnings(data); - return (includeTrustGame) ? totalIncome + data.getTrustGameIncome() : totalIncome; - } - - public double getQuizEarnings(ClientData data) { + public String getSurveyInstructions() { + return assistant.getProperty("survey-instructions"); + } + + public String getFacilitatorDebriefing() { + return assistant.getProperty("facilitator-debriefing"); + } + + public String getClientDebriefing() { + return assistant.getProperty("client-debriefing"); + } + + public double getTotalIncome(ClientData data) { + return getTotalIncome(data, false); + } + + public double getTotalIncome(ClientData data, boolean includeTrustGame) { + double totalIncome = data.getTotalIncome() + getShowUpPayment() + getQuizEarnings(data); + return (includeTrustGame) ? totalIncome + data.getTrustGameIncome() : totalIncome; + } + + public double getQuizEarnings(ClientData data) { return data.getCorrectQuizAnswers() * getQuizCorrectAnswerReward(); } - + } diff -r a21112c697c5ebc09975aab27491bb6498471dac -r b3ca85e821599807ef6682bff167286f64320afe src/main/java/edu/asu/commons/foraging/event/SurveyCompletedEvent.java --- a/src/main/java/edu/asu/commons/foraging/event/SurveyCompletedEvent.java +++ b/src/main/java/edu/asu/commons/foraging/event/SurveyCompletedEvent.java @@ -5,7 +5,7 @@ import edu.asu.commons.net.Identifier; /** - * $Id: QuizResponseEvent.java 522 2010-06-30 19:17:48Z alllee $ + * $Id$ * * Signals that a client has completed the survey for the given round. * diff -r a21112c697c5ebc09975aab27491bb6498471dac -r b3ca85e821599807ef6682bff167286f64320afe src/main/resources/configuration/iu/2011/vote-punish/round4.xml --- a/src/main/resources/configuration/iu/2011/vote-punish/round4.xml +++ b/src/main/resources/configuration/iu/2011/vote-punish/round4.xml @@ -138,30 +138,6 @@ </entry><entry key='external-survey-enabled'>true</entry> -<entry key='survey-instructions'> - <![CDATA[ - <h1>Survey</h1> - <hr> - <p> - Before we continue to the next round of the token task, we would like to ask you - some quick questions. Please <a href='{surveyUrl}'>click here</a> to - begin the survey. - </p> - <p> - We will continue with the rest of the experiment 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><entry key='survey-url'><![CDATA[https://qtrial.qualtrics.com/SE/?SID=SV_cLX7jnYikmD9eSM&SURVEY_ID={surveyId}]]></entry> diff -r a21112c697c5ebc09975aab27491bb6498471dac -r b3ca85e821599807ef6682bff167286f64320afe src/main/resources/configuration/iu/2011/vote-punish/round7.xml --- a/src/main/resources/configuration/iu/2011/vote-punish/round7.xml +++ b/src/main/resources/configuration/iu/2011/vote-punish/round7.xml @@ -15,26 +15,6 @@ <entry key='external-survey-enabled'>true</entry> -<entry key='survey-instructions'> - <![CDATA[ - <h1>Survey</h1> - <hr> - <p> - Before we continue to the next round of the token task, we would like to ask you - some quick questions. Please <a href='{surveyUrl}'>click here</a> to - begin the survey. - </p> - <p> - We will continue with the rest of the experiment 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> - ]]> -</entry><entry key='survey-url'><![CDATA[https://qtrial.qualtrics.com/SE/?SID=SV_3efXdNaJ6EXZ0S8&SURVEY_ID={surveyId}]]></entry> diff -r a21112c697c5ebc09975aab27491bb6498471dac -r b3ca85e821599807ef6682bff167286f64320afe 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 @@ -15,26 +15,6 @@ <entry key='external-survey-enabled'>true</entry> -<entry key='survey-instructions'> - <![CDATA[ - <h1>Survey</h1> - <hr> - <p> - This was the final round of the token task. To wrap up 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 with the rest of the experiment 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> - ]]> -</entry><entry key='survey-url'><![CDATA[https://qtrial.qualtrics.com/SE/?SID=SV_e8rPe7yyhue5OVm&SURVEY_ID={surveyId}]]></entry> diff -r a21112c697c5ebc09975aab27491bb6498471dac -r b3ca85e821599807ef6682bff167286f64320afe 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 @@ -18,6 +18,31 @@ <entry key="number-of-rounds">10</entry><entry key='external-survey-enabled'>true</entry><entry key='survey-id-enabled'>true</entry> +<entry key='survey-instructions'> + <![CDATA[ + <h1>Survey</h1> + <hr> + <p> + This was the final round of the token task. To wrap up 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 with the rest of the experiment 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> + <entry key="facilitator-instructions"><![CDATA[ <p> https://bitbucket.org/virtualcommons/foraging/changeset/17326d720689/ changeset: 17326d720689 user: alllee date: 2012-01-20 17:22:42 summary: wiring up facilitator messaging when clients report that they've completed the survey (w/o verification though since it's external) affected #: 1 file diff -r b3ca85e821599807ef6682bff167286f64320afe -r 17326d720689fcc2693b661c33d748b8843fe748 src/main/java/edu/asu/commons/foraging/server/ForagingServer.java --- a/src/main/java/edu/asu/commons/foraging/server/ForagingServer.java +++ b/src/main/java/edu/asu/commons/foraging/server/ForagingServer.java @@ -62,6 +62,7 @@ import edu.asu.commons.foraging.event.RuleVoteRequest; import edu.asu.commons.foraging.event.SanctionAppliedEvent; import edu.asu.commons.foraging.event.ShowRequest; +import edu.asu.commons.foraging.event.SurveyCompletedEvent; import edu.asu.commons.foraging.event.SurveyIdSubmissionRequest; import edu.asu.commons.foraging.event.SynchronizeClientEvent; import edu.asu.commons.foraging.event.TrustGameResultsClientEvent; @@ -247,15 +248,15 @@ sendFacilitatorMessage(String.format("Updating %s with station number %s", clientSocketId, request.getStationNumber())); } }); - // client handlers addEventProcessor(new EventTypeProcessor<ConnectionEvent>(ConnectionEvent.class) { @Override public void handle(ConnectionEvent event) { - // handle incoming connections + // handles incoming connections if (experimentStarted) { - // currently not allowing any new connections - // FIXME: would be nice to allow for reconnection / reassociation of clients to ids and data. - // should be logged however so we can remember the context of the data + // currently not allowing any new connections + // FIXME: would be nice to allow for reconnection / + // reassociation of clients to ids and data. should be + // logged however so we can remember the context of the data transmit(new ClientMessageEvent(event.getId(), "The experiment has already started, we cannot add you at this time.")); return; } @@ -300,6 +301,20 @@ } } }); + addEventProcessor(new EventTypeProcessor<SurveyCompletedEvent>(SurveyCompletedEvent.class) { + private int submittedSurveys = 0; + @Override + public void handle(SurveyCompletedEvent event) { + if (getCurrentRoundConfiguration().isExternalSurveyEnabled()) { + submittedSurveys++; + sendFacilitatorMessage(String.format("Received %d of %d surveys: %s", submittedSurveys, clients.size(), event)); + if (submittedSurveys >= clients.size()) { + sendFacilitatorMessage("All surveys have been reported as completed, ready to continue."); + submittedSurveys = 0; + } + } + } + }); addEventProcessor(new EventTypeProcessor<QuizResponseEvent>(QuizResponseEvent.class) { public void handle(final QuizResponseEvent event) { 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. |