[virtualcommons-svn] commit/foraging: alllee: evaluating stringtemplate for our templating needs.
Status: Beta
Brought to you by:
alllee
From: Bitbucket <com...@bi...> - 2011-09-29 22:16:27
|
1 new changeset in foraging: http://bitbucket.org/virtualcommons/foraging/changeset/2eeafaccc6fd/ changeset: 2eeafaccc6fd user: alllee date: 2011-09-30 00:16:16 summary: evaluating stringtemplate for our templating needs. affected #: 5 files (-1 bytes) --- a/ivy.xml Thu Sep 29 14:54:18 2011 -0700 +++ b/ivy.xml Thu Sep 29 15:16:16 2011 -0700 @@ -8,5 +8,6 @@ <dependency org="edu.asu.commons" name="csidex" rev="0.2-SNAPSHOT"/><dependency org="net.java.dev.jogl" name="jogl" rev="1.1.1-rc6"/><dependency org="javax.media" name="jmf" rev="2.1.1e"/> + <dependency org="org.antlr" name="stringtemplate" rev="4.0.2"/></dependencies></ivy-module> --- a/pom.xml Thu Sep 29 14:54:18 2011 -0700 +++ b/pom.xml Thu Sep 29 15:16:16 2011 -0700 @@ -83,6 +83,11 @@ <version>0.2-SNAPSHOT</version></dependency><dependency> + <groupId>org.antlr</groupId> + <artifactId>stringtemplate</artifactId> + <version>4.0.2</version> + </dependency> + <dependency><groupId>net.java.dev.jogl</groupId><artifactId>jogl</artifactId><version>1.1.1-rc6</version> --- a/src/main/java/edu/asu/commons/foraging/conf/RoundConfiguration.java Thu Sep 29 14:54:18 2011 -0700 +++ b/src/main/java/edu/asu/commons/foraging/conf/RoundConfiguration.java Thu Sep 29 15:16:16 2011 -0700 @@ -12,6 +12,7 @@ import edu.asu.commons.foraging.graphics.Point3D; import edu.asu.commons.foraging.model.ClientData; import edu.asu.commons.foraging.model.EnforcementMechanism; +import edu.asu.commons.net.Identifier; /** @@ -655,6 +656,24 @@ public double getQuizCorrectAnswerReward() { return getDoubleProperty("quiz-correct-answer-reward", getParentConfiguration().getQuizCorrectAnswerReward()); } + + public boolean isExternalSurveyEnabled() { + return getBooleanProperty("external-survey-enabled"); + } + + public String getSurveyInstructions() { + return getProperty("survey-instructions"); + } + + public String getSurveyLink() { + return getProperty("survey-link", "https://qtrial.qualtrics.com/SE/?SID=SV_38lReBOv0Wk7wgY"); + } + + public String getSurveyInstructions(Identifier id) { + String surveyInstructions = getSurveyInstructions(); + String updatedSurveyInstructions = surveyInstructions.replace("@PLAYER_ID@", id.toString()); + return updatedSurveyInstructions; + } @Override public String toString() { --- a/src/main/java/edu/asu/commons/foraging/conf/ServerConfiguration.java Thu Sep 29 14:54:18 2011 -0700 +++ b/src/main/java/edu/asu/commons/foraging/conf/ServerConfiguration.java Thu Sep 29 15:16:16 2011 -0700 @@ -88,10 +88,6 @@ "Your view of the resource will be limited in this round. The area visible to you will be shaded."); } - public boolean isExternalSurveyEnabled() { - return getBooleanProperty("external-survey-enabled"); - } - public boolean shouldAskForSurveyId() { return getBooleanProperty("survey-id-enabled"); } --- a/src/main/resources/configuration/indiana-experiments/fall-2011/pretest/round4.xml Thu Sep 29 14:54:18 2011 -0700 +++ b/src/main/resources/configuration/indiana-experiments/fall-2011/pretest/round4.xml Thu Sep 29 15:16:16 2011 -0700 @@ -52,6 +52,7 @@ ]]></entry> +<entry key='external-survey-enabled'>true</entry><entry key='survey-instructions'><![CDATA[ <h1>Survey</h1> @@ -70,12 +71,18 @@ ]]></entry> +<entry key='survey-link'> + <![CDATA[ + https://qtrial.qualtrics.com/SE/?SID=SV_38lReBOv0Wk7wgY + ]]> +</entry> + <entry key="instructions"><![CDATA[ <h3>Round 4 Instructions</h3><hr><p> - In this round you will + Round 4 is about to begin. </p><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. |