virtualcommons-svn Mailing List for Virtual Commons Experiment Software (Page 18)
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: A L. <iss...@bi...> - 2012-03-23 06:16:21
|
--- you can reply above this line --- New issue 38: consider backbone.js and/or knockout.js https://bitbucket.org/virtualcommons/vcweb/issue/38/consider-backbonejs-and-or-knockoutjs A Lee / alllee on Fri, 23 Mar 2012 07:16:15 +0100: Description: Could be useful for the experimenter dashboard and participant interfaces. Responsible: alllee -- This is an issue notification from bitbucket.org. You are receiving this either because you are the owner of the issue, or you are following the issue. |
From: Bitbucket <com...@bi...> - 2012-03-22 05:22:13
|
1 new commit in irrigation: https://bitbucket.org/virtualcommons/irrigation/changeset/13f446cab25d/ changeset: 13f446cab25d user: alllee date: 2012-03-22 06:22:06 summary: updating first 10 rounds of all treatments affected #: 44 files diff -r 73437a9a1c4e6ed76babe74022d6b1ecb642c300 -r 13f446cab25d3d9be42b046782528b8ccbcdb277 src/main/resources/configuration/asu/2011/t1/round0.xml --- a/src/main/resources/configuration/asu/2011/t1/round0.xml +++ b/src/main/resources/configuration/asu/2011/t1/round0.xml @@ -6,6 +6,7 @@ <entry key="practice-round">true</entry><entry key='reset-infrastructure-efficiency'>true</entry><entry key='initial-infrastructure-efficiency'>50</entry> +<entry key='field-of-vision'>1</entry><entry key="instructions"> @@ -15,6 +16,7 @@ to your earnings. If you have any questions feel free to raise your hand and to ask your question. <br> +{self.specialInstructions} <b>Do you have any questions?</b></p> ]]> diff -r 73437a9a1c4e6ed76babe74022d6b1ecb642c300 -r 13f446cab25d3d9be42b046782528b8ccbcdb277 src/main/resources/configuration/asu/2011/t1/round1.xml --- a/src/main/resources/configuration/asu/2011/t1/round1.xml +++ b/src/main/resources/configuration/asu/2011/t1/round1.xml @@ -3,14 +3,16 @@ <properties><comment>Irrigation experiment round configuration</comment><entry key="practice-round">true</entry> +<entry key='field-of-vision'>1</entry><entry key="instructions"><![CDATA[ -<h3>Practice Round 2</h3> +<h2>Practice Round 2</h2> +<hr><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. +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> +{self.specialInstructions} ]]></entry></properties> diff -r 73437a9a1c4e6ed76babe74022d6b1ecb642c300 -r 13f446cab25d3d9be42b046782528b8ccbcdb277 src/main/resources/configuration/asu/2011/t1/round10.xml --- a/src/main/resources/configuration/asu/2011/t1/round10.xml +++ b/src/main/resources/configuration/asu/2011/t1/round10.xml @@ -2,13 +2,5 @@ <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"><properties><comment>Irrigation experiment round configuration</comment> - -<entry key="instructions"> -<![CDATA[ -<h3>Round 9 Instructions</h3> -<p> -This round is the same as the previous round. -</p> -]]> -</entry> +<entry key='field-of-vision'>1</entry></properties> diff -r 73437a9a1c4e6ed76babe74022d6b1ecb642c300 -r 13f446cab25d3d9be42b046782528b8ccbcdb277 src/main/resources/configuration/asu/2011/t1/round11.xml --- a/src/main/resources/configuration/asu/2011/t1/round11.xml +++ b/src/main/resources/configuration/asu/2011/t1/round11.xml @@ -2,14 +2,5 @@ <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"><properties><comment>Irrigation experiment round configuration</comment> - -<entry key="instructions"> -<![CDATA[ -<h3>Round 10 Instructions</h3> -<p> -This round is the same as the previous round. -</p> - -]]> -</entry> +<entry key='field-of-vision'>1</entry></properties> diff -r 73437a9a1c4e6ed76babe74022d6b1ecb642c300 -r 13f446cab25d3d9be42b046782528b8ccbcdb277 src/main/resources/configuration/asu/2011/t1/round2.xml --- a/src/main/resources/configuration/asu/2011/t1/round2.xml +++ b/src/main/resources/configuration/asu/2011/t1/round2.xml @@ -4,18 +4,20 @@ <comment>Irrigation experiment round configuration</comment><entry key='reset-infrastructure-efficiency'>true</entry> +<entry key='field-of-vision'>1</entry><entry key="instructions"><![CDATA[ -<h3>Round 1 Instructions</h3> +<h2>Round {self.roundNumber} Instructions</h2> +<hr><p> -This is the first actual round of the experiment. Before this round begins -you will have the opportunity to text chat with the other participants in your -group, then decide on your level of investment in the irrigation -infrastructure. After the total irrigation infrastructure investment has been -determined you will begin the experiment and make decisions on when to open -your irrigation gates and grow crops. +This is the first actual round of the experiment. Before this round begins you will +have the opportunity to text chat with the other participants in your group, then +decide on your level of investment in the irrigation infrastructure. After the +total irrigation infrastructure investment has been determined you will begin the +experiment and make decisions on when to open your irrigation gates and grow crops. </p> +{self.specialInstructions} ]]></entry></properties> diff -r 73437a9a1c4e6ed76babe74022d6b1ecb642c300 -r 13f446cab25d3d9be42b046782528b8ccbcdb277 src/main/resources/configuration/asu/2011/t1/round4.xml --- a/src/main/resources/configuration/asu/2011/t1/round4.xml +++ b/src/main/resources/configuration/asu/2011/t1/round4.xml @@ -2,13 +2,5 @@ <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"><properties><comment>Irrigation experiment round configuration</comment> - -<entry key="instructions"> -<![CDATA[ -<h3>Round 3 Instructions</h3> -<p> -This round is the same as the previous round. -</p> -]]> -</entry> +<entry key='field-of-vision'>1</entry></properties> diff -r 73437a9a1c4e6ed76babe74022d6b1ecb642c300 -r 13f446cab25d3d9be42b046782528b8ccbcdb277 src/main/resources/configuration/asu/2011/t1/round5.xml --- a/src/main/resources/configuration/asu/2011/t1/round5.xml +++ b/src/main/resources/configuration/asu/2011/t1/round5.xml @@ -2,13 +2,5 @@ <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"><properties><comment>Irrigation experiment round configuration</comment> - -<entry key="instructions"> -<![CDATA[ -<h3>Round 4 Instructions</h3> -<p> -This round is the same as the previous round. -</p> -]]> -</entry> +<entry key='field-of-vision'>1</entry></properties> diff -r 73437a9a1c4e6ed76babe74022d6b1ecb642c300 -r 13f446cab25d3d9be42b046782528b8ccbcdb277 src/main/resources/configuration/asu/2011/t1/round6.xml --- a/src/main/resources/configuration/asu/2011/t1/round6.xml +++ b/src/main/resources/configuration/asu/2011/t1/round6.xml @@ -2,14 +2,5 @@ <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"><properties><comment>Irrigation experiment round configuration</comment> - -<entry key="instructions"> -<![CDATA[ -<h3>Round 5 Instructions</h3> -<p> -This round is the same as the previous round. -</p> - -]]> -</entry> +<entry key='field-of-vision'>1</entry></properties> diff -r 73437a9a1c4e6ed76babe74022d6b1ecb642c300 -r 13f446cab25d3d9be42b046782528b8ccbcdb277 src/main/resources/configuration/asu/2011/t1/round7.xml --- a/src/main/resources/configuration/asu/2011/t1/round7.xml +++ b/src/main/resources/configuration/asu/2011/t1/round7.xml @@ -2,14 +2,5 @@ <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"><properties><comment>Irrigation experiment round configuration</comment> - -<entry key="instructions"> -<![CDATA[ -<h3>Round 6 Instructions</h3> -<p> -This round is the same as the previous round. -</p> - -]]> -</entry> +<entry key='field-of-vision'>1</entry></properties> diff -r 73437a9a1c4e6ed76babe74022d6b1ecb642c300 -r 13f446cab25d3d9be42b046782528b8ccbcdb277 src/main/resources/configuration/asu/2011/t1/round8.xml --- a/src/main/resources/configuration/asu/2011/t1/round8.xml +++ b/src/main/resources/configuration/asu/2011/t1/round8.xml @@ -2,13 +2,5 @@ <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"><properties><comment>Irrigation experiment round configuration</comment> - -<entry key="instructions"> -<![CDATA[ -<h3>Round 7 Instructions</h3> -<p> -This round is the same as the previous round. -</p> -]]> -</entry> +<entry key='field-of-vision'>1</entry></properties> diff -r 73437a9a1c4e6ed76babe74022d6b1ecb642c300 -r 13f446cab25d3d9be42b046782528b8ccbcdb277 src/main/resources/configuration/asu/2011/t1/round9.xml --- a/src/main/resources/configuration/asu/2011/t1/round9.xml +++ b/src/main/resources/configuration/asu/2011/t1/round9.xml @@ -2,14 +2,5 @@ <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"><properties><comment>Irrigation experiment round configuration</comment> - -<entry key="instructions"> -<![CDATA[ -<h3>Round 8 Instructions</h3> -<p> -This round is the same as the previous round. -</p> - -]]> -</entry> +<entry key='field-of-vision'>1</entry></properties> diff -r 73437a9a1c4e6ed76babe74022d6b1ecb642c300 -r 13f446cab25d3d9be42b046782528b8ccbcdb277 src/main/resources/configuration/asu/2011/t2/round0.xml --- a/src/main/resources/configuration/asu/2011/t2/round0.xml +++ b/src/main/resources/configuration/asu/2011/t2/round0.xml @@ -6,6 +6,7 @@ <entry key="practice-round">true</entry><entry key='reset-infrastructure-efficiency'>true</entry><entry key='initial-infrastructure-efficiency'>50</entry> +<entry key='field-of-vision'>1</entry><entry key="instructions"> @@ -15,6 +16,7 @@ to your earnings. If you have any questions feel free to raise your hand and to ask your question. <br> +{self.specialInstructions} <b>Do you have any questions?</b></p> ]]> diff -r 73437a9a1c4e6ed76babe74022d6b1ecb642c300 -r 13f446cab25d3d9be42b046782528b8ccbcdb277 src/main/resources/configuration/asu/2011/t2/round1.xml --- a/src/main/resources/configuration/asu/2011/t2/round1.xml +++ b/src/main/resources/configuration/asu/2011/t2/round1.xml @@ -3,14 +3,16 @@ <properties><comment>Irrigation experiment round configuration</comment><entry key="practice-round">true</entry> +<entry key='field-of-vision'>1</entry><entry key="instructions"><![CDATA[ -<h3>Practice Round 2</h3> +<h2>Practice Round 2</h2> +<hr><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. +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> +{self.specialInstructions} ]]></entry></properties> diff -r 73437a9a1c4e6ed76babe74022d6b1ecb642c300 -r 13f446cab25d3d9be42b046782528b8ccbcdb277 src/main/resources/configuration/asu/2011/t2/round10.xml --- a/src/main/resources/configuration/asu/2011/t2/round10.xml +++ b/src/main/resources/configuration/asu/2011/t2/round10.xml @@ -2,13 +2,5 @@ <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"><properties><comment>Irrigation experiment round configuration</comment> - -<entry key="instructions"> -<![CDATA[ -<h3>Round 9 Instructions</h3> -<p> -This round is the same as the previous round. -</p> -]]> -</entry> +<entry key='field-of-vision'>1</entry></properties> diff -r 73437a9a1c4e6ed76babe74022d6b1ecb642c300 -r 13f446cab25d3d9be42b046782528b8ccbcdb277 src/main/resources/configuration/asu/2011/t2/round11.xml --- a/src/main/resources/configuration/asu/2011/t2/round11.xml +++ b/src/main/resources/configuration/asu/2011/t2/round11.xml @@ -2,14 +2,5 @@ <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"><properties><comment>Irrigation experiment round configuration</comment> - -<entry key="instructions"> -<![CDATA[ -<h3>Round 10 Instructions</h3> -<p> -This round is the same as the previous round. -</p> - -]]> -</entry> +<entry key='field-of-vision'>1</entry></properties> diff -r 73437a9a1c4e6ed76babe74022d6b1ecb642c300 -r 13f446cab25d3d9be42b046782528b8ccbcdb277 src/main/resources/configuration/asu/2011/t2/round2.xml --- a/src/main/resources/configuration/asu/2011/t2/round2.xml +++ b/src/main/resources/configuration/asu/2011/t2/round2.xml @@ -4,18 +4,20 @@ <comment>Irrigation experiment round configuration</comment><entry key='reset-infrastructure-efficiency'>true</entry> +<entry key='field-of-vision'>1</entry><entry key="instructions"><![CDATA[ -<h3>Round 1 Instructions</h3> +<h2>Round {self.roundNumber} Instructions</h2> +<hr><p> -This is the first actual round of the experiment. Before this round begins -you will have the opportunity to text chat with the other participants in your -group, then decide on your level of investment in the irrigation -infrastructure. After the total irrigation infrastructure investment has been -determined you will begin the experiment and make decisions on when to open -your irrigation gates and grow crops. +This is the first actual round of the experiment. Before this round begins you will +have the opportunity to text chat with the other participants in your group, then +decide on your level of investment in the irrigation infrastructure. After the +total irrigation infrastructure investment has been determined you will begin the +experiment and make decisions on when to open your irrigation gates and grow crops. </p> +{self.specialInstructions} ]]></entry></properties> diff -r 73437a9a1c4e6ed76babe74022d6b1ecb642c300 -r 13f446cab25d3d9be42b046782528b8ccbcdb277 src/main/resources/configuration/asu/2011/t2/round4.xml --- a/src/main/resources/configuration/asu/2011/t2/round4.xml +++ b/src/main/resources/configuration/asu/2011/t2/round4.xml @@ -2,13 +2,5 @@ <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"><properties><comment>Irrigation experiment round configuration</comment> - -<entry key="instructions"> -<![CDATA[ -<h3>Round 3 Instructions</h3> -<p> -This round is the same as the previous round. -</p> -]]> -</entry> +<entry key='field-of-vision'>1</entry></properties> diff -r 73437a9a1c4e6ed76babe74022d6b1ecb642c300 -r 13f446cab25d3d9be42b046782528b8ccbcdb277 src/main/resources/configuration/asu/2011/t2/round5.xml --- a/src/main/resources/configuration/asu/2011/t2/round5.xml +++ b/src/main/resources/configuration/asu/2011/t2/round5.xml @@ -2,13 +2,5 @@ <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"><properties><comment>Irrigation experiment round configuration</comment> - -<entry key="instructions"> -<![CDATA[ -<h3>Round 4 Instructions</h3> -<p> -This round is the same as the previous round. -</p> -]]> -</entry> +<entry key='field-of-vision'>1</entry></properties> diff -r 73437a9a1c4e6ed76babe74022d6b1ecb642c300 -r 13f446cab25d3d9be42b046782528b8ccbcdb277 src/main/resources/configuration/asu/2011/t2/round6.xml --- a/src/main/resources/configuration/asu/2011/t2/round6.xml +++ b/src/main/resources/configuration/asu/2011/t2/round6.xml @@ -2,14 +2,5 @@ <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"><properties><comment>Irrigation experiment round configuration</comment> - -<entry key="instructions"> -<![CDATA[ -<h3>Round 5 Instructions</h3> -<p> -This round is the same as the previous round. -</p> - -]]> -</entry> +<entry key='field-of-vision'>1</entry></properties> diff -r 73437a9a1c4e6ed76babe74022d6b1ecb642c300 -r 13f446cab25d3d9be42b046782528b8ccbcdb277 src/main/resources/configuration/asu/2011/t2/round7.xml --- a/src/main/resources/configuration/asu/2011/t2/round7.xml +++ b/src/main/resources/configuration/asu/2011/t2/round7.xml @@ -2,14 +2,5 @@ <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"><properties><comment>Irrigation experiment round configuration</comment> - -<entry key="instructions"> -<![CDATA[ -<h3>Round 6 Instructions</h3> -<p> -This round is the same as the previous round. -</p> - -]]> -</entry> +<entry key='field-of-vision'>1</entry></properties> diff -r 73437a9a1c4e6ed76babe74022d6b1ecb642c300 -r 13f446cab25d3d9be42b046782528b8ccbcdb277 src/main/resources/configuration/asu/2011/t2/round8.xml --- a/src/main/resources/configuration/asu/2011/t2/round8.xml +++ b/src/main/resources/configuration/asu/2011/t2/round8.xml @@ -2,13 +2,5 @@ <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"><properties><comment>Irrigation experiment round configuration</comment> - -<entry key="instructions"> -<![CDATA[ -<h3>Round 7 Instructions</h3> -<p> -This round is the same as the previous round. -</p> -]]> -</entry> +<entry key='field-of-vision'>1</entry></properties> diff -r 73437a9a1c4e6ed76babe74022d6b1ecb642c300 -r 13f446cab25d3d9be42b046782528b8ccbcdb277 src/main/resources/configuration/asu/2011/t2/round9.xml --- a/src/main/resources/configuration/asu/2011/t2/round9.xml +++ b/src/main/resources/configuration/asu/2011/t2/round9.xml @@ -2,14 +2,5 @@ <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"><properties><comment>Irrigation experiment round configuration</comment> - -<entry key="instructions"> -<![CDATA[ -<h3>Round 8 Instructions</h3> -<p> -This round is the same as the previous round. -</p> - -]]> -</entry> +<entry key='field-of-vision'>1</entry></properties> diff -r 73437a9a1c4e6ed76babe74022d6b1ecb642c300 -r 13f446cab25d3d9be42b046782528b8ccbcdb277 src/main/resources/configuration/asu/2011/t3/round0.xml --- a/src/main/resources/configuration/asu/2011/t3/round0.xml +++ b/src/main/resources/configuration/asu/2011/t3/round0.xml @@ -6,6 +6,7 @@ <entry key="practice-round">true</entry><entry key='reset-infrastructure-efficiency'>true</entry><entry key='initial-infrastructure-efficiency'>50</entry> +<entry key='field-of-vision'>1</entry><entry key="instructions"> @@ -15,6 +16,7 @@ to your earnings. If you have any questions feel free to raise your hand and to ask your question. <br> +{self.specialInstructions} <b>Do you have any questions?</b></p> ]]> diff -r 73437a9a1c4e6ed76babe74022d6b1ecb642c300 -r 13f446cab25d3d9be42b046782528b8ccbcdb277 src/main/resources/configuration/asu/2011/t3/round1.xml --- a/src/main/resources/configuration/asu/2011/t3/round1.xml +++ b/src/main/resources/configuration/asu/2011/t3/round1.xml @@ -3,14 +3,16 @@ <properties><comment>Irrigation experiment round configuration</comment><entry key="practice-round">true</entry> +<entry key='field-of-vision'>1</entry><entry key="instructions"><![CDATA[ -<h3>Practice Round 2</h3> +<h2>Practice Round 2</h2> +<hr><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. +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> +{self.specialInstructions} ]]></entry></properties> diff -r 73437a9a1c4e6ed76babe74022d6b1ecb642c300 -r 13f446cab25d3d9be42b046782528b8ccbcdb277 src/main/resources/configuration/asu/2011/t3/round10.xml --- a/src/main/resources/configuration/asu/2011/t3/round10.xml +++ b/src/main/resources/configuration/asu/2011/t3/round10.xml @@ -2,13 +2,5 @@ <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"><properties><comment>Irrigation experiment round configuration</comment> - -<entry key="instructions"> -<![CDATA[ -<h3>Round 9 Instructions</h3> -<p> -This round is the same as the previous round. -</p> -]]> -</entry> +<entry key='field-of-vision'>1</entry></properties> diff -r 73437a9a1c4e6ed76babe74022d6b1ecb642c300 -r 13f446cab25d3d9be42b046782528b8ccbcdb277 src/main/resources/configuration/asu/2011/t3/round11.xml --- a/src/main/resources/configuration/asu/2011/t3/round11.xml +++ b/src/main/resources/configuration/asu/2011/t3/round11.xml @@ -2,14 +2,5 @@ <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"><properties><comment>Irrigation experiment round configuration</comment> - -<entry key="instructions"> -<![CDATA[ -<h3>Round 10 Instructions</h3> -<p> -This round is the same as the previous round. -</p> - -]]> -</entry> +<entry key='field-of-vision'>1</entry></properties> diff -r 73437a9a1c4e6ed76babe74022d6b1ecb642c300 -r 13f446cab25d3d9be42b046782528b8ccbcdb277 src/main/resources/configuration/asu/2011/t3/round2.xml --- a/src/main/resources/configuration/asu/2011/t3/round2.xml +++ b/src/main/resources/configuration/asu/2011/t3/round2.xml @@ -4,18 +4,20 @@ <comment>Irrigation experiment round configuration</comment><entry key='reset-infrastructure-efficiency'>true</entry> +<entry key='field-of-vision'>1</entry><entry key="instructions"><![CDATA[ -<h3>Round 1 Instructions</h3> +<h2>Round {self.roundNumber} Instructions</h2> +<hr><p> -This is the first actual round of the experiment. Before this round begins -you will have the opportunity to text chat with the other participants in your -group, then decide on your level of investment in the irrigation -infrastructure. After the total irrigation infrastructure investment has been -determined you will begin the experiment and make decisions on when to open -your irrigation gates and grow crops. +This is the first actual round of the experiment. Before this round begins you will +have the opportunity to text chat with the other participants in your group, then +decide on your level of investment in the irrigation infrastructure. After the +total irrigation infrastructure investment has been determined you will begin the +experiment and make decisions on when to open your irrigation gates and grow crops. </p> +{self.specialInstructions} ]]></entry></properties> diff -r 73437a9a1c4e6ed76babe74022d6b1ecb642c300 -r 13f446cab25d3d9be42b046782528b8ccbcdb277 src/main/resources/configuration/asu/2011/t3/round4.xml --- a/src/main/resources/configuration/asu/2011/t3/round4.xml +++ b/src/main/resources/configuration/asu/2011/t3/round4.xml @@ -2,13 +2,5 @@ <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"><properties><comment>Irrigation experiment round configuration</comment> - -<entry key="instructions"> -<![CDATA[ -<h3>Round 3 Instructions</h3> -<p> -This round is the same as the previous round. -</p> -]]> -</entry> +<entry key='field-of-vision'>1</entry></properties> diff -r 73437a9a1c4e6ed76babe74022d6b1ecb642c300 -r 13f446cab25d3d9be42b046782528b8ccbcdb277 src/main/resources/configuration/asu/2011/t3/round5.xml --- a/src/main/resources/configuration/asu/2011/t3/round5.xml +++ b/src/main/resources/configuration/asu/2011/t3/round5.xml @@ -2,13 +2,5 @@ <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"><properties><comment>Irrigation experiment round configuration</comment> - -<entry key="instructions"> -<![CDATA[ -<h3>Round 4 Instructions</h3> -<p> -This round is the same as the previous round. -</p> -]]> -</entry> +<entry key='field-of-vision'>1</entry></properties> diff -r 73437a9a1c4e6ed76babe74022d6b1ecb642c300 -r 13f446cab25d3d9be42b046782528b8ccbcdb277 src/main/resources/configuration/asu/2011/t3/round6.xml --- a/src/main/resources/configuration/asu/2011/t3/round6.xml +++ b/src/main/resources/configuration/asu/2011/t3/round6.xml @@ -2,14 +2,5 @@ <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"><properties><comment>Irrigation experiment round configuration</comment> - -<entry key="instructions"> -<![CDATA[ -<h3>Round 5 Instructions</h3> -<p> -This round is the same as the previous round. -</p> - -]]> -</entry> +<entry key='field-of-vision'>1</entry></properties> diff -r 73437a9a1c4e6ed76babe74022d6b1ecb642c300 -r 13f446cab25d3d9be42b046782528b8ccbcdb277 src/main/resources/configuration/asu/2011/t3/round7.xml --- a/src/main/resources/configuration/asu/2011/t3/round7.xml +++ b/src/main/resources/configuration/asu/2011/t3/round7.xml @@ -2,14 +2,5 @@ <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"><properties><comment>Irrigation experiment round configuration</comment> - -<entry key="instructions"> -<![CDATA[ -<h3>Round 6 Instructions</h3> -<p> -This round is the same as the previous round. -</p> - -]]> -</entry> +<entry key='field-of-vision'>1</entry></properties> diff -r 73437a9a1c4e6ed76babe74022d6b1ecb642c300 -r 13f446cab25d3d9be42b046782528b8ccbcdb277 src/main/resources/configuration/asu/2011/t3/round8.xml --- a/src/main/resources/configuration/asu/2011/t3/round8.xml +++ b/src/main/resources/configuration/asu/2011/t3/round8.xml @@ -2,13 +2,5 @@ <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"><properties><comment>Irrigation experiment round configuration</comment> - -<entry key="instructions"> -<![CDATA[ -<h3>Round 7 Instructions</h3> -<p> -This round is the same as the previous round. -</p> -]]> -</entry> +<entry key='field-of-vision'>1</entry></properties> diff -r 73437a9a1c4e6ed76babe74022d6b1ecb642c300 -r 13f446cab25d3d9be42b046782528b8ccbcdb277 src/main/resources/configuration/asu/2011/t3/round9.xml --- a/src/main/resources/configuration/asu/2011/t3/round9.xml +++ b/src/main/resources/configuration/asu/2011/t3/round9.xml @@ -2,14 +2,5 @@ <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"><properties><comment>Irrigation experiment round configuration</comment> - -<entry key="instructions"> -<![CDATA[ -<h3>Round 8 Instructions</h3> -<p> -This round is the same as the previous round. -</p> - -]]> -</entry> +<entry key='field-of-vision'>1</entry></properties> diff -r 73437a9a1c4e6ed76babe74022d6b1ecb642c300 -r 13f446cab25d3d9be42b046782528b8ccbcdb277 src/main/resources/configuration/asu/2011/t4/round0.xml --- a/src/main/resources/configuration/asu/2011/t4/round0.xml +++ b/src/main/resources/configuration/asu/2011/t4/round0.xml @@ -6,6 +6,8 @@ <entry key="practice-round">true</entry><entry key='reset-infrastructure-efficiency'>true</entry><entry key='initial-infrastructure-efficiency'>50</entry> +<entry key='field-of-vision'>1</entry> + <entry key="instructions"><![CDATA[ @@ -14,6 +16,7 @@ to your earnings. If you have any questions feel free to raise your hand and to ask your question. <br> +{self.specialInstructions} <b>Do you have any questions?</b></p> ]]> diff -r 73437a9a1c4e6ed76babe74022d6b1ecb642c300 -r 13f446cab25d3d9be42b046782528b8ccbcdb277 src/main/resources/configuration/asu/2011/t4/round1.xml --- a/src/main/resources/configuration/asu/2011/t4/round1.xml +++ b/src/main/resources/configuration/asu/2011/t4/round1.xml @@ -3,14 +3,16 @@ <properties><comment>Irrigation experiment round configuration</comment><entry key="practice-round">true</entry> +<entry key='field-of-vision'>1</entry><entry key="instructions"><![CDATA[ -<h3>Practice Round 2</h3> +<h2>Practice Round 2</h2> +<hr><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. +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> +{self.specialInstructions} ]]></entry></properties> diff -r 73437a9a1c4e6ed76babe74022d6b1ecb642c300 -r 13f446cab25d3d9be42b046782528b8ccbcdb277 src/main/resources/configuration/asu/2011/t4/round10.xml --- a/src/main/resources/configuration/asu/2011/t4/round10.xml +++ b/src/main/resources/configuration/asu/2011/t4/round10.xml @@ -2,13 +2,5 @@ <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"><properties><comment>Irrigation experiment round configuration</comment> - -<entry key="instructions"> -<![CDATA[ -<h3>Round 9 Instructions</h3> -<p> -This round is the same as the previous round. -</p> -]]> -</entry> +<entry key='field-of-vision'>1</entry></properties> diff -r 73437a9a1c4e6ed76babe74022d6b1ecb642c300 -r 13f446cab25d3d9be42b046782528b8ccbcdb277 src/main/resources/configuration/asu/2011/t4/round11.xml --- a/src/main/resources/configuration/asu/2011/t4/round11.xml +++ b/src/main/resources/configuration/asu/2011/t4/round11.xml @@ -2,14 +2,5 @@ <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"><properties><comment>Irrigation experiment round configuration</comment> - -<entry key="instructions"> -<![CDATA[ -<h3>Round 10 Instructions</h3> -<p> -This round is the same as the previous round. -</p> - -]]> -</entry> +<entry key='field-of-vision'>1</entry></properties> diff -r 73437a9a1c4e6ed76babe74022d6b1ecb642c300 -r 13f446cab25d3d9be42b046782528b8ccbcdb277 src/main/resources/configuration/asu/2011/t4/round2.xml --- a/src/main/resources/configuration/asu/2011/t4/round2.xml +++ b/src/main/resources/configuration/asu/2011/t4/round2.xml @@ -4,18 +4,20 @@ <comment>Irrigation experiment round configuration</comment><entry key='reset-infrastructure-efficiency'>true</entry> +<entry key='field-of-vision'>1</entry><entry key="instructions"><![CDATA[ -<h3>Round 1 Instructions</h3> +<h2>Round {self.roundNumber} Instructions</h2> +<hr><p> -This is the first actual round of the experiment. Before this round begins -you will have the opportunity to text chat with the other participant for -forty seconds, then decide on your level of investment in the irrigation -infrastructure. After the total irrigation infrastructure investment has been -determined you will begin the experiment and make decisions on when to open -your irrigation gates and grow crops. +This is the first actual round of the experiment. Before this round begins you will +have the opportunity to text chat with the other participants in your group, then +decide on your level of investment in the irrigation infrastructure. After the +total irrigation infrastructure investment has been determined you will begin the +experiment and make decisions on when to open your irrigation gates and grow crops. </p> +{self.specialInstructions} ]]></entry></properties> diff -r 73437a9a1c4e6ed76babe74022d6b1ecb642c300 -r 13f446cab25d3d9be42b046782528b8ccbcdb277 src/main/resources/configuration/asu/2011/t4/round4.xml --- a/src/main/resources/configuration/asu/2011/t4/round4.xml +++ b/src/main/resources/configuration/asu/2011/t4/round4.xml @@ -2,13 +2,5 @@ <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"><properties><comment>Irrigation experiment round configuration</comment> - -<entry key="instructions"> -<![CDATA[ -<h3>Round 3 Instructions</h3> -<p> -This round is the same as the previous round. -</p> -]]> -</entry> +<entry key='field-of-vision'>1</entry></properties> diff -r 73437a9a1c4e6ed76babe74022d6b1ecb642c300 -r 13f446cab25d3d9be42b046782528b8ccbcdb277 src/main/resources/configuration/asu/2011/t4/round5.xml --- a/src/main/resources/configuration/asu/2011/t4/round5.xml +++ b/src/main/resources/configuration/asu/2011/t4/round5.xml @@ -2,14 +2,5 @@ <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"><properties><comment>Irrigation experiment round configuration</comment> - -<entry key="instructions"> -<![CDATA[ -<h3>Round 4 Instructions</h3> -<p> -This round is the same as previous rounds. -</p> - -]]> -</entry> +<entry key='field-of-vision'>1</entry></properties> diff -r 73437a9a1c4e6ed76babe74022d6b1ecb642c300 -r 13f446cab25d3d9be42b046782528b8ccbcdb277 src/main/resources/configuration/asu/2011/t4/round6.xml --- a/src/main/resources/configuration/asu/2011/t4/round6.xml +++ b/src/main/resources/configuration/asu/2011/t4/round6.xml @@ -2,14 +2,5 @@ <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"><properties><comment>Irrigation experiment round configuration</comment> - -<entry key="instructions"> -<![CDATA[ -<h3>Round 5 Instructions</h3> -<p> -This round is the same as the previous round. -</p> - -]]> -</entry> +<entry key='field-of-vision'>1</entry></properties> diff -r 73437a9a1c4e6ed76babe74022d6b1ecb642c300 -r 13f446cab25d3d9be42b046782528b8ccbcdb277 src/main/resources/configuration/asu/2011/t4/round7.xml --- a/src/main/resources/configuration/asu/2011/t4/round7.xml +++ b/src/main/resources/configuration/asu/2011/t4/round7.xml @@ -2,14 +2,5 @@ <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"><properties><comment>Irrigation experiment round configuration</comment> - -<entry key="instructions"> -<![CDATA[ -<h3>Round 6 Instructions</h3> -<p> -This round is the same as previous rounds. -</p> - -]]> -</entry> +<entry key='field-of-vision'>1</entry></properties> diff -r 73437a9a1c4e6ed76babe74022d6b1ecb642c300 -r 13f446cab25d3d9be42b046782528b8ccbcdb277 src/main/resources/configuration/asu/2011/t4/round8.xml --- a/src/main/resources/configuration/asu/2011/t4/round8.xml +++ b/src/main/resources/configuration/asu/2011/t4/round8.xml @@ -2,13 +2,5 @@ <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"><properties><comment>Irrigation experiment round configuration</comment> - -<entry key="instructions"> -<![CDATA[ -<h3>Round 7 Instructions</h3> -<p> -This round is the same as the previous round. -</p> -]]> -</entry> +<entry key='field-of-vision'>1</entry></properties> diff -r 73437a9a1c4e6ed76babe74022d6b1ecb642c300 -r 13f446cab25d3d9be42b046782528b8ccbcdb277 src/main/resources/configuration/asu/2011/t4/round9.xml --- a/src/main/resources/configuration/asu/2011/t4/round9.xml +++ b/src/main/resources/configuration/asu/2011/t4/round9.xml @@ -2,14 +2,5 @@ <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"><properties><comment>Irrigation experiment round configuration</comment> - -<entry key="instructions"> -<![CDATA[ -<h3>Round 8 Instructions</h3> -<p> -This round is the same as the previous round. -</p> - -]]> -</entry> +<entry key='field-of-vision'>1</entry></properties> Repository URL: https://bitbucket.org/virtualcommons/irrigation/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. |
From: Bitbucket <com...@bi...> - 2012-03-22 05:18:28
|
1 new commit in irrigation: https://bitbucket.org/virtualcommons/irrigation/changeset/73437a9a1c4e/ changeset: 73437a9a1c4e user: alllee date: 2012-03-22 06:18:22 summary: updating server configurations for all treatments affected #: 4 files diff -r 608c5d7d8e8c73b32edca6913a2b5306d557cf59 -r 73437a9a1c4e6ed76babe74022d6b1ecb642c300 src/main/resources/configuration/asu/2011/t1/irrigation.xml --- a/src/main/resources/configuration/asu/2011/t1/irrigation.xml +++ b/src/main/resources/configuration/asu/2011/t1/irrigation.xml @@ -27,6 +27,8 @@ <entry key="round20">round20.xml</entry><entry key="round21">round21.xml</entry> +<entry key='token-endowment'>10</entry> +<entry key='field-of-vision'>1</entry><entry key="wait-for-participants">true</entry><entry key="number-of-rounds">22</entry> @@ -43,12 +45,7 @@ </entry><entry key="q3">5</entry><entry key='a3'>5 cubic feet per second</entry> -<entry key="explanation3">Since there is only 30 cubic feet per second of water -available, the irrigation infrastructure capacity of 35 cubic feet per -second will not be fully used. When A opens their gate, they take 25 of the -30 cubic feet per second out of the canal, leaving 5 cubic feet per second for -B. -</entry> +<entry key="explanation3">Since there is only 30 cubic feet per second of water available, the irrigation infrastructure capacity of 35 cubic feet per second will not be fully used. When A opens their gate, they take 25 of the 30 cubic feet per second out of the canal, leaving 5 cubic feet per second for B.</entry><entry key="q4">25</entry><entry key="a4">25 cubic feet per second</entry><entry key="explanation4">If A has 25 cfps available and does not take any @@ -59,24 +56,8 @@ <entry key="explanation5">If you invest 7 out of 10 tokens, you keep 3 tokens for yourself. If you apply 202 cubic feet of water to your field you will earn 4 tokens. 3 + 4 = 7 tokens </entry><entry key="q6">19</entry><entry key="a6">19 tokens</entry> -<entry key="explanation6">If you invest all 10 tokens, you keep 0 tokens from -your initial endowment. If you apply 555 cubic feet of water to your field -you will earn 19 tokens. 0 + 19 = 19 tokens.</entry> +<entry key="explanation6">If you invest all 10 tokens, you keep 0 tokens from your initial endowment. If you apply 555 cubic feet of water to your field you will earn 19 tokens. 0 + 19 = 19 tokens.</entry> -<entry key='final-instructions'> -<![CDATA[ -<p> -The experiment is almost over. We have a brief survey for you to fill out while the -facilitator prepares your payments. When the facilitator has finished preparing -payments and you have all completed your surveys your computer number will be -called. You can then go next door to receive your payment. For privacy reasons we -must pay you one at a time. -</p> -<p> -Thanks for participating! -</p> -]]> -</entry><!-- FIXME: lots of parameterizable fields here. should make instructions template-language-pluggable @@ -87,7 +68,7 @@ <hr><p> You have already earned {showUpPayment} dollars by showing up for this exercise. You -can earn more, up to a maximum of about 25 dollars, by participating in this +can earn more, up to a maximum of about 45 dollars, by participating in this experiment which will take about an hour to an hour and a half. The amount of money you earn depends on your decisions AND the decisions of other people in this room over the course of the experiment. @@ -106,7 +87,7 @@ infrastructure. Based on the <b>water delivery capacity</b> of the irrigation infrastructure and the availability of water you will be able to grow crops. Tokens earned in a round is the sum of tokens not invested plus tokens earned by growing -crops. Each token is worth 5 cents. In each round you will first decide how much to +crops. Each token is worth {dollarsPerToken}. In each round you will first decide how much to invest in the irrigation infrastructure. Based on the combined contributions of all 5 participants in your group in each round, your group can maintain the capacity of the irrigation infrastructure for growing crops. @@ -114,9 +95,11 @@ <p> We will now start a practice round to help illustrate the experiment. Before each -round in this experiment you will have a chat period of %d seconds where you can -send text messages to the other participants. You may discuss any aspect of the -exercise with two important exceptions: +round in this experiment you will have a chat period of {self.chatDuration} seconds +where you can send text messages to the other participants. +{self.restrictedVisibilityInstructions} + +You may discuss any aspect of the exercise with two important exceptions: </p><ol><li>You are <b>not allowed</b> to promise the other participants @@ -136,66 +119,64 @@ <entry key='game-screenshot-instructions'><![CDATA[ -<img src="http://dev.commons.asu.edu/irrigation/images/game-interface-screenshot.jpg"> +<img src="http://dev.commons.asu.edu/irrigation/images/screenshot.jpg"> ]]></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. + This facilitator interface allows you to control the experiment. In general you + will be following a sequence similar to this: +</p> +<ol> + <li>Show instructions</li> + <li>Start round</li> + <li>After round is over, start standalone chat round if necessary</li> + <li>Goto 1.</li> +</ol> +]]> +</entry> +<entry key="welcome-instructions"> +<![CDATA[ +<h1>Welcome</h1> +<hr> +<p> +Welcome to the experiment. We will begin shortly after everyone has been +assigned a station. +<br><br> +Please <b>wait quietly</b> and <b>do not close this window, open any other applications, or communicate with any of the other participants</b>. </p> ]]></entry> - - -<entry key="welcome-instructions"> +<entry key="quiz-instructions"><![CDATA[ -<center> -<h3>Welcome to the CARL lab. Please wait quietly and do not close this window or open any -other applications.</h3> -<h3>The experiment will begin shortly after everyone has been -assigned a station.</h3></center> -]]> -</entry> - - -<entry key="quiz-page1"> -<![CDATA[ +<h2>Quiz</h2> +<hr><p> The first two questions deal with irrigation infrastructure investment. <b>Please refer to Table 1 of your handout</b>. </p> - <form> -Question 1:<br> +<p>Question 1:<br> Given an existing infrastructure efficiency of 20%, if the five participants invest a <b>total of 29 additional tokens</b>, what is the new irrigation infrastructure efficiency?<br><input type="text" name="q1" value = "">% -<br><br> - -Question 2:<br> +</p> +<p>Question 2:<br> Suppose the infrastructure efficiency in the last round was 60%. For the current round, the efficiency will decline by an amount of 25% for a resulting infrastructure efficiency of 35%. If the members of your group invest a total of 15 tokens, what will be your group's resulting water delivery capacity?<br> - <input type="text" name="q2" value = ""> cubic feet per second -<br><br> - -<b>The next two questions deal with the capacity of the irrigation system in relation -to the actual amount of water available.</b> -<br><br> +</p> +<p> +The next two questions deal with the capacity of the irrigation system in relation +to the actual amount of water available. +</p> +<p> Question 3:<br> If the irrigation efficiency is between 71 and 80%, the water delivery capacity of the irrigation system is 35 cubic feet per second. Suppose the water supply @@ -204,40 +185,30 @@ B? <br><input type='text' name='q3' value=''> cubic feet per second -<br><br> -Question 4: +</p> +<p>Question 4:<br> If the available water delivery capacity is 25 cubic feet per second and A, B, C, and D are not using water, how much cubic feet of water per second is available for E?<br><input type='text' name='q4' value=''> cubic feet per second -<br><br> - -<input type="submit" name="submit" value="Submit"><br> -<br> - -]]> -</entry> - -<entry key="quiz-page2"> -<![CDATA[ +</p><p> The final two questions cover the number of tokens you can earn in within a round. -<b>Please refer to table 2 of your handout</b>. +<b>Please refer to Table 2 of your handout</b>. </p> -<form> -Question 5:<br> +<p>Question 5:<br> If you invest 7 of the 10 tokens you start with and you apply 202 cubic feet of water to your fields, what is the total number of tokens you will have earned at the end of the round?<br><input type="text" name="q5" value="">tokens -<br><br> -Question 6:<br> +</p> +<p>Question 6:<br> If you invest all 10 tokens you start with and you apply 555 cubic feet of water to your fields, what is the total number of tokens you will have earned at the end of the round?<br><input type="text" name="q6" value="">tokens -<br><br> -<input type="submit" name="submit" value="Submit"> +</p> +<input type="submit" name="submit" value="Submit"><br></form> ]]></entry> @@ -305,8 +276,11 @@ <entry key='chat-instructions'><![CDATA[ <h3>Chat Instructions</h3> -You may now chat for %d seconds with the other members of your group. You may -discuss any aspect of the exercise with two important exceptions: +<hr> +<p> +You may now chat for {self.chatDuration} seconds with the other members of your group. +{self.restrictedVisibilityInstructions} +You may discuss any aspect of the exercise with two important exceptions: </p><ol><li>You are <b>not allowed</b> to promise the other participants @@ -331,16 +305,23 @@ <entry key="investment-instructions"><![CDATA[ +<h1>Current infrastructure condition</h1> + <hr> + <h2>Current infrastructure efficiency: {actualInfrastructureEfficiency}%</h2> + <h2>Current water delivery capacity: {waterDeliveryCapacity} cubic feet per second</h2> + <h2>Available water supply: {self.waterSupplyCapacity} cubic feet per second</h2> +<h1>Investment Instructions</h1> +<hr><p> -You have been endowed with 10 tokens to invest. You must make a decision about -how much you wish to invest [0,10] in the irrigation infrastructure. You can -see the relationship between total investment and irrigation infrastructure in -the table 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 +You have been endowed with {self.tokenEndowment} tokens to invest. You must make a decision about +how much you wish to invest in the irrigation infrastructure by choosing a number +between 0 and {self.tokenEndowment}. You can see the relationship between total +investment and irrigation infrastructure in the table 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"> @@ -382,5 +363,201 @@ </table> ]]></entry> - +<entry key='client-debriefing'> +<![CDATA[ +<h1>{if (self.practiceRound)}Practice Round{else}Round {self.roundNumber}{endif} Results</h1> +<hr> + <table border=3 cellpadding=5 cellspacing=5> + <tr> + <th>Position</th> + <th>Initial token endowment</th> + <th>Tokens invested</th> + <th>Tokens not invested</th> + <th>Tokens earned from growing crops</th> + <th>Total tokens earned this round</th> + <th>Dollars earned this round</th> + <th>Total dollars earned</th> + </tr> + {dataModel.orderedVisibleClients: {clientData| + <tr align='center' bgcolor='{if (clientData.self)}#FFFFCC{else}#CCCCCC{endif}'> + <td>{clientData.priorityString}</td> + <td>{self.tokenEndowment}</td> + <td>{clientData.investedTokens}</td> + <td>{clientData.uninvestedTokens}</td> + <td>{clientData.tokensEarnedFromWaterCollected}</td> + <td>{clientData.allTokensEarnedThisRound}</td> + <td>{clientData.totalDollarsEarnedThisRound}</td> + <td>{clientData.grandTotalIncome}</td> + </tr> + }} + </table> + <h2>Earnings</h2> + <hr> + <p> + You are in position {clientData.priorityString} and received + {clientData.totalDollarsEarnedThisRound} this past round. Your + <b>total income</b> is <b>{clientData.grandTotalIncome}</b>, including + the {showUpPayment} show-up bonus and {clientData.quizEarnings} for + answering {clientData.correctQuizAnswers} quiz questions correctly. + </p> + {if (self.practiceRound)} + <p><b>NOTE: this was a practice round and did not contribute to your earnings.</b></p> + {endif} + {if (showExitInstructions)} + <h2>Exit Survey</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> + <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. + NOTE: Please <b>answer the survey completely (there may be a back side)</b> + and <b>bring all your belongings with you</b> when you come up to receive + your payment to help us speed up the payment process. + </p> + {endif} +]]> +</entry> +<entry key="same-as-previous-round-instructions"> + <![CDATA[ + <h3>Round {self.roundNumber} Instructions</h3> + <hr> + <p>Round {self.roundNumber} is the same as the previous round.</p> + <p>{self.specialInstructions}</p> + <p>The length of this round is {duration}.</p> + <p><b>Do you have any questions?</b> If you have any questions at this time + please raise your hand and someone will come over to your station and + answer it. + </p> + ]]> +</entry> +<entry key="contribution-summary"> +<![CDATA[ +<h1>Contributions Summary</h1> +<hr> +<p> +Your group invested a total of <b>{groupDataModel.totalContributedTokens} tokens</b> this round, resulting in an infrastructure efficiency of <b>{groupDataModel.infrastructureEfficiency}%</b> and a water delivery capacity of <b>{groupDataModel.irrigationCapacity} cubic feet per second</b>. +The amount of water available to pass through your canal is <b>{groupDataModel.actualWaterDeliveryCapacity} cubic feet per second</b>. +</p> +<table border=2 cellspacing=2 cellpadding=3> +<tr> +<th></th></th><th>Infrastructure Efficiency</th><th>Water Delivery Capacity</th><th>Water Availability</th> +</tr> +<tr align='center'> +<td>Before Investment</td><td>{groupDataModel.infrastructureEfficiencyBeforeInvestment}%</td><td>{groupDataModel.irrigationCapacityBeforeInvestment} cubic feet per second</td><td>{groupDataModel.actualWaterDeliveryCapacity} cubic feet per second</td> +</tr> +<tr align='center'> +<td>After Investment</td><td>{groupDataModel.infrastructureEfficiency}%</td><td>{groupDataModel.irrigationCapacity} cubic feet per second</td><td>{groupDataModel.actualWaterDeliveryCapacity} cubic feet per second</td> +</tr> +</table> +]]> +</entry> +<entry key="special-instructions"> +<![CDATA[ +<h2>Special Instructions</h2> +<hr> +{if (self.restrictedVisibility)} +<p>You can only <b>communicate with and observe the actions</b> of your <b>immediate neighbors</b>.</p> +{endif} +<p> +{if (self.infrastructureEfficiencyReset)} +The irrigation infrastructure efficiency has been <b>reset to {initialInfrastructureEfficiency}%</b> with a corresponding <b>water delivery capacity of {waterDeliveryCapacity} cubic feet per second</b>. +{else} +The irrigation infrastructure efficiency carried over from the previous round is +{initialInfrastructureEfficiency}% but has declined by +{self.infrastructureDegradationFactor} and is now <b>{actualInfrastructureEfficiency}%</b> +with a corresponding <b>water delivery capacity of {waterDeliveryCapacity} cubic feet per second</b>. +{endif} +</p> +<p>The <b>available water supply is {self.waterSupplyCapacity} cubic feet per second</b>.</p> +]]> +</entry> +<entry key="restricted-visibility-instructions"> +<![CDATA[{if (self.restrictedVisibility)}<b>NOTE:</b> In this experiment you can <b>only communicate with and observe the actions of your immediate neighbors</b>.{endif}]]> +</entry> +<entry key="facilitator-debriefing"> +<![CDATA[ +<h3>Round {self.roundNumber} results</h3> +<hr> +<table border=1 cellspacing=3 cellpadding=3> +<tr><th>Participant</th><th>Current tokens</th><th>Current income</th><th>Quiz earnings</th><th>Total income</th></tr> +{clientDataList: {data | +<tr align="RIGHT"><td>{data.id}</td><td>{data.allTokensEarnedThisRound}</td><td>{data.totalDollarsEarnedThisRound}</td><td>{data.quizEarnings}</td><td>{data.grandTotalIncome}</td></tr> +}} +</table> +{if (self.lastRound)} +<h2><font color='blue'>The experiment is over. Please prepare payments.</font></h2> +{endif} +]]> +</entry> +<entry key='quiz-results'> + <![CDATA[ + <h2>Quiz Results</h2> + <hr> + <p> + {if (allCorrect)} + You have answered all the questions correctly and earned <b>{totalQuizEarnings}</b>. + {else} + You answered {numberCorrect} out of {totalQuestions} questions correctly and earned <b>{totalQuizEarnings}</b>. Questions you've answered + incorrectly are highlighted in red. Please see below for more details. + {endif} + </p> + <hr> + <p><span class='q1'>Question 1:</span><br> + Given an existing infrastructure efficiency of 20%, if the five participants invest + a <b>total of 29 additional tokens</b>, what is the new irrigation infrastructure + efficiency? + <br><b>{incorrect_q1} + An existing infrastructure efficiency of 20% + 29 tokens invested = 49% infrastructure efficiency.</b> + </p> + <p><span class='q2'>Question 2:</span><br> + Suppose the infrastructure efficiency in the last round was 60%. For the current + round, the efficiency will decline by an amount of 25% for a resulting + infrastructure efficiency of 35%. If the members of your group invest a total of 15 + tokens, what will be your group's resulting water delivery capacity?<br> + <b>{incorrect_q2} + An existing infrastructure efficiency of 35% + 15 tokens invested = 50% infrastructure efficiency for the current round. + An infrastructure efficiency of 50% corresponds to a water delivery capacity of 5 cubic feet per second.</b> + </p> + <p><span class='q3'>Question 3:</span><br> + If the irrigation efficiency is between 71 and 80%, the water delivery capacity of + the irrigation system is 35 cubic feet per second. Suppose the water supply + available to your group is 30 cubic feet per second and A opens their gate, + diverting water at 25 cubic feet per second. What is the available water flow for + B?<br> + <b>{incorrect_q3} + Since there is only 30 cubic feet per second of water available, the irrigation infrastructure capacity of 35 cubic feet + per second will not be fully used. When A opens their gate, they take 25 of the 30 cubic feet per second out of the + canal, leaving 5 cubic feet per second for B.</b> + </p> + <p><span class='q4'>Question 4:</span><br> + If the available water delivery capacity is 25 cubic feet per second and A, B, C, and D are not using water, how much cubic feet of water per second is available for E?<br> + <b>{incorrect_q4} + If A has 25 cfps available and does not take any water, the same amount is available for the people + downstream. Since B, C and D do not take water, 25 cfps is available for E. + </b> + </p> + <p> + <span class='q5'>Question 5:</span><br> + If you invest 7 of the 10 tokens you start with and you apply 202 cubic feet of + water to your fields, what is the total number of tokens you will have earned at the + end of the round?<br> + <b>{incorrect_q5} + If you invest 7 out of 10 tokens, you keep 3 tokens for yourself. If you apply 202 cubic feet of water to your field you will earn 4 tokens. 3 + 4 = 7 tokens</b> + </p> + <p><span class='q6'>Question 6:</span><br> + If you invest all 10 tokens you start with and you apply 555 cubic feet of water to + your fields, what is the total number of tokens you will have earned at the end of + the round?<br> + <b>{incorrect_q6} + If you invest all 10 tokens, you keep 0 tokens from your initial endowment. If you apply 555 cubic feet of + water to your field you will earn 19 tokens. 0 + 19 = 19 tokens. + </b> + </p> + ]]> +</entry></properties> diff -r 608c5d7d8e8c73b32edca6913a2b5306d557cf59 -r 73437a9a1c4e6ed76babe74022d6b1ecb642c300 src/main/resources/configuration/asu/2011/t2/irrigation.xml --- a/src/main/resources/configuration/asu/2011/t2/irrigation.xml +++ b/src/main/resources/configuration/asu/2011/t2/irrigation.xml @@ -27,6 +27,8 @@ <entry key="round20">round20.xml</entry><entry key="round21">round21.xml</entry> +<entry key='token-endowment'>10</entry> +<entry key='field-of-vision'>1</entry><entry key="wait-for-participants">true</entry><entry key="number-of-rounds">22</entry> @@ -43,12 +45,7 @@ </entry><entry key="q3">5</entry><entry key='a3'>5 cubic feet per second</entry> -<entry key="explanation3">Since there is only 30 cubic feet per second of water -available, the irrigation infrastructure capacity of 35 cubic feet per -second will not be fully used. When A opens their gate, they take 25 of the -30 cubic feet per second out of the canal, leaving 5 cubic feet per second for -B. -</entry> +<entry key="explanation3">Since there is only 30 cubic feet per second of water available, the irrigation infrastructure capacity of 35 cubic feet per second will not be fully used. When A opens their gate, they take 25 of the 30 cubic feet per second out of the canal, leaving 5 cubic feet per second for B.</entry><entry key="q4">25</entry><entry key="a4">25 cubic feet per second</entry><entry key="explanation4">If A has 25 cfps available and does not take any @@ -59,55 +56,50 @@ <entry key="explanation5">If you invest 7 out of 10 tokens, you keep 3 tokens for yourself. If you apply 202 cubic feet of water to your field you will earn 4 tokens. 3 + 4 = 7 tokens </entry><entry key="q6">19</entry><entry key="a6">19 tokens</entry> -<entry key="explanation6">If you invest all 10 tokens, you keep 0 tokens from -your initial endowment. If you apply 555 cubic feet of water to your field -you will earn 19 tokens. 0 + 19 = 19 tokens.</entry> +<entry key="explanation6">If you invest all 10 tokens, you keep 0 tokens from your initial endowment. If you apply 555 cubic feet of water to your field you will earn 19 tokens. 0 + 19 = 19 tokens.</entry> -<entry key='final-instructions'> -<![CDATA[ -<p> -The experiment is almost over. We have a brief survey for you to fill out while the -facilitator prepares your payments. When the facilitator has finished preparing -payments and you have all completed your surveys your computer number will be -called. You can then go next door to receive your payment. For privacy reasons we -must pay you one at a time. -</p> -<p> -Thanks for participating! -</p> -]]> -</entry><!-- FIXME: lots of parameterizable fields here. should make instructions template-language-pluggable --><entry key="initial-instructions"><![CDATA[ +<h1>Instructions</h1> +<hr><p> -You have already earned 5 dollars by showing up for this exercise. You can earn -more, up to an extra 25 dollars. You will participate in this exercise as a part of -a group of five participants. Your group has been formed by randomly assigning you -to FOUR other participants in the room. +You have already earned {showUpPayment} dollars by showing up for this exercise. You +can earn more, up to a maximum of about 45 dollars, by participating in this +experiment which will take about an hour to an hour and a half. The amount of money +you earn depends on your decisions AND the decisions of other people in this room +over the course of the experiment. </p> +<h2>Groups</h2> +<hr> +You will be participating in this exercise as a part of a group of +{self.clientsPerGroup} participants. Your group has been formed by randomly +selecting you and four other participants in the room. +</p> +<h2>How to participate</h2> +<hr><p> -The amount of money you earn will depend on the decisions made by you and the other -members of your group. This exercise mimics decisions people make in irrigation -systems. In each round you will receive 10 tokens which you can invest in the -irrigation infrastructure. Based on the <b>water delivery capacity</b> of the -irrigation infrastructure and the availability of water you will be able to -grow crops. Tokens earned in a round is the sum of tokens not invested plus -tokens earned by growing crops. Each token is worth 5 cents. In each round you -will first decide how much to invest in the irrigation infrastructure. Based -on the combined contributions of all 5 participants in your group in each -round, your group can maintain the capacity of the irrigation infrastructure -for growing crops. +This exercise mimics decisions people make in irrigation systems. In each round you +will receive {self.tokenEndowment} tokens which you can invest in the irrigation +infrastructure. Based on the <b>water delivery capacity</b> of the irrigation +infrastructure and the availability of water you will be able to grow crops. Tokens +earned in a round is the sum of tokens not invested plus tokens earned by growing +crops. Each token is worth {dollarsPerToken}. In each round you will first decide how much to +invest in the irrigation infrastructure. Based on the combined contributions of all +5 participants in your group in each round, your group can maintain the capacity of +the irrigation infrastructure for growing crops. </p><p> We will now start a practice round to help illustrate the experiment. Before each -round in this experiment you will have a chat period of %d seconds where you can -send text messages to the other participants. You may discuss any aspect of the -exercise with two important exceptions: +round in this experiment you will have a chat period of {self.chatDuration} seconds +where you can send text messages to the other participants. +{self.restrictedVisibilityInstructions} + +You may discuss any aspect of the exercise with two important exceptions: </p><ol><li>You are <b>not allowed</b> to promise the other participants @@ -127,66 +119,64 @@ <entry key='game-screenshot-instructions'><![CDATA[ -<img src="http://dev.commons.asu.edu/irrigation/images/game-interface-screenshot.jpg"> +<img src="http://dev.commons.asu.edu/irrigation/images/screenshot.jpg"> ]]></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. + This facilitator interface allows you to control the experiment. In general you + will be following a sequence similar to this: +</p> +<ol> + <li>Show instructions</li> + <li>Start round</li> + <li>After round is over, start standalone chat round if necessary</li> + <li>Goto 1.</li> +</ol> +]]> +</entry> +<entry key="welcome-instructions"> +<![CDATA[ +<h1>Welcome</h1> +<hr> +<p> +Welcome to the experiment. We will begin shortly after everyone has been +assigned a station. +<br><br> +Please <b>wait quietly</b> and <b>do not close this window, open any other applications, or communicate with any of the other participants</b>. </p> ]]></entry> - - -<entry key="welcome-instructions"> +<entry key="quiz-instructions"><![CDATA[ -<center> -<h3>Welcome to the CARL lab. Please wait quietly and do not close this window or open any -other applications.</h3> -<h3>The experiment will begin shortly after everyone has been -assigned a station.</h3></center> -]]> -</entry> - - -<entry key="quiz-page1"> -<![CDATA[ +<h2>Quiz</h2> +<hr><p> The first two questions deal with irrigation infrastructure investment. <b>Please refer to Table 1 of your handout</b>. </p> - <form> -Question 1:<br> +<p>Question 1:<br> Given an existing infrastructure efficiency of 20%, if the five participants invest a <b>total of 29 additional tokens</b>, what is the new irrigation infrastructure efficiency?<br><input type="text" name="q1" value = "">% -<br><br> - -Question 2:<br> +</p> +<p>Question 2:<br> Suppose the infrastructure efficiency in the last round was 60%. For the current round, the efficiency will decline by an amount of 25% for a resulting infrastructure efficiency of 35%. If the members of your group invest a total of 15 tokens, what will be your group's resulting water delivery capacity?<br> - <input type="text" name="q2" value = ""> cubic feet per second -<br><br> - -<b>The next two questions deal with the capacity of the irrigation system in relation -to the actual amount of water available.</b> -<br><br> +</p> +<p> +The next two questions deal with the capacity of the irrigation system in relation +to the actual amount of water available. +</p> +<p> Question 3:<br> If the irrigation efficiency is between 71 and 80%, the water delivery capacity of the irrigation system is 35 cubic feet per second. Suppose the water supply @@ -195,40 +185,30 @@ B? <br><input type='text' name='q3' value=''> cubic feet per second -<br><br> -Question 4: +</p> +<p>Question 4:<br> If the available water delivery capacity is 25 cubic feet per second and A, B, C, and D are not using water, how much cubic feet of water per second is available for E?<br><input type='text' name='q4' value=''> cubic feet per second -<br><br> - -<input type="submit" name="submit" value="Submit"><br> -<br> - -]]> -</entry> - -<entry key="quiz-page2"> -<![CDATA[ +</p><p> The final two questions cover the number of tokens you can earn in within a round. -<b>Please refer to table 2 of your handout</b>. +<b>Please refer to Table 2 of your handout</b>. </p> -<form> -Question 5:<br> +<p>Question 5:<br> If you invest 7 of the 10 tokens you start with and you apply 202 cubic feet of water to your fields, what is the total number of tokens you will have earned at the end of the round?<br><input type="text" name="q5" value="">tokens -<br><br> -Question 6:<br> +</p> +<p>Question 6:<br> If you invest all 10 tokens you start with and you apply 555 cubic feet of water to your fields, what is the total number of tokens you will have earned at the end of the round?<br><input type="text" name="q6" value="">tokens -<br><br> -<input type="submit" name="submit" value="Submit"> +</p> +<input type="submit" name="submit" value="Submit"><br></form> ]]></entry> @@ -296,8 +276,11 @@ <entry key='chat-instructions'><![CDATA[ <h3>Chat Instructions</h3> -You may now chat for %d seconds with the other members of your group. You may -discuss any aspect of the exercise with two important exceptions: +<hr> +<p> +You may now chat for {self.chatDuration} seconds with the other members of your group. +{self.restrictedVisibilityInstructions} +You may discuss any aspect of the exercise with two important exceptions: </p><ol><li>You are <b>not allowed</b> to promise the other participants @@ -322,16 +305,23 @@ <entry key="investment-instructions"><![CDATA[ +<h1>Current infrastructure condition</h1> + <hr> + <h2>Current infrastructure efficiency: {actualInfrastructureEfficiency}%</h2> + <h2>Current water delivery capacity: {waterDeliveryCapacity} cubic feet per second</h2> + <h2>Available water supply: {self.waterSupplyCapacity} cubic feet per second</h2> +<h1>Investment Instructions</h1> +<hr><p> -You have been endowed with 10 tokens to invest. You must make a decision about -how much you wish to invest [0,10] in the irrigation infrastructure. You can -see the relationship between total investment and irrigation infrastructure in -the table 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 +You have been endowed with {self.tokenEndowment} tokens to invest. You must make a decision about +how much you wish to invest in the irrigation infrastructure by choosing a number +between 0 and {self.tokenEndowment}. You can see the relationship between total +investment and irrigation infrastructure in the table 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"> @@ -373,5 +363,201 @@ </table> ]]></entry> - +<entry key='client-debriefing'> +<![CDATA[ +<h1>{if (self.practiceRound)}Practice Round{else}Round {self.roundNumber}{endif} Results</h1> +<hr> + <table border=3 cellpadding=5 cellspacing=5> + <tr> + <th>Position</th> + <th>Initial token endowment</th> + <th>Tokens invested</th> + <th>Tokens not invested</th> + <th>Tokens earned from growing crops</th> + <th>Total tokens earned this round</th> + <th>Dollars earned this round</th> + <th>Total dollars earned</th> + </tr> + {dataModel.orderedVisibleClients: {clientData| + <tr align='center' bgcolor='{if (clientData.self)}#FFFFCC{else}#CCCCCC{endif}'> + <td>{clientData.priorityString}</td> + <td>{self.tokenEndowment}</td> + <td>{clientData.investedTokens}</td> + <td>{clientData.uninvestedTokens}</td> + <td>{clientData.tokensEarnedFromWaterCollected}</td> + <td>{clientData.allTokensEarnedThisRound}</td> + <td>{clientData.totalDollarsEarnedThisRound}</td> + <td>{clientData.grandTotalIncome}</td> + </tr> + }} + </table> + <h2>Earnings</h2> + <hr> + <p> + You are in position {clientData.priorityString} and received + {clientData.totalDollarsEarnedThisRound} this past round. Your + <b>total income</b> is <b>{clientData.grandTotalIncome}</b>, including + the {showUpPayment} show-up bonus and {clientData.quizEarnings} for + answering {clientData.correctQuizAnswers} quiz questions correctly. + </p> + {if (self.practiceRound)} + <p><b>NOTE: this was a practice round and did not contribute to your earnings.</b></p> + {endif} + {if (showExitInstructions)} + <h2>Exit Survey</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> + <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. + NOTE: Please <b>answer the survey completely (there may be a back side)</b> + and <b>bring all your belongings with you</b> when you come up to receive + your payment to help us speed up the payment process. + </p> + {endif} +]]> +</entry> +<entry key="same-as-previous-round-instructions"> + <![CDATA[ + <h3>Round {self.roundNumber} Instructions</h3> + <hr> + <p>Round {self.roundNumber} is the same as the previous round.</p> + <p>{self.specialInstructions}</p> + <p>The length of this round is {duration}.</p> + <p><b>Do you have any questions?</b> If you have any questions at this time + please raise your hand and someone will come over to your station and + answer it. + </p> + ]]> +</entry> +<entry key="contribution-summary"> +<![CDATA[ +<h1>Contributions Summary</h1> +<hr> +<p> +Your group invested a total of <b>{groupDataModel.totalContributedTokens} tokens</b> this round, resulting in an infrastructure efficiency of <b>{groupDataModel.infrastructureEfficiency}%</b> and a water delivery capacity of <b>{groupDataModel.irrigationCapacity} cubic feet per second</b>. +The amount of water available to pass through your canal is <b>{groupDataModel.actualWaterDeliveryCapacity} cubic feet per second</b>. +</p> +<table border=2 cellspacing=2 cellpadding=3> +<tr> +<th></th></th><th>Infrastructure Efficiency</th><th>Water Delivery Capacity</th><th>Water Availability</th> +</tr> +<tr align='center'> +<td>Before Investment</td><td>{groupDataModel.infrastructureEfficiencyBeforeInvestment}%</td><td>{groupDataModel.irrigationCapacityBeforeInvestment} cubic feet per second</td><td>{groupDataModel.actualWaterDeliveryCapacity} cubic feet per second</td> +</tr> +<tr align='center'> +<td>After Investment</td><td>{groupDataModel.infrastructureEfficiency}%</td><td>{groupDataModel.irrigationCapacity} cubic feet per second</td><td>{groupDataModel.actualWaterDeliveryCapacity} cubic feet per second</td> +</tr> +</table> +]]> +</entry> +<entry key="special-instructions"> +<![CDATA[ +<h2>Special Instructions</h2> +<hr> +{if (self.restrictedVisibility)} +<p>You can only <b>communicate with and observe the actions</b> of your <b>immediate neighbors</b>.</p> +{endif} +<p> +{if (self.infrastructureEfficiencyReset)} +The irrigation infrastructure efficiency has been <b>reset to {initialInfrastructureEfficiency}%</b> with a corresponding <b>water delivery capacity of {waterDeliveryCapacity} cubic feet per second</b>. +{else} +The irrigation infrastructure efficiency carried over from the previous round is +{initialInfrastructureEfficiency}% but has declined by +{self.infrastructureDegradationFactor} and is now <b>{actualInfrastructureEfficiency}%</b> +with a corresponding <b>water delivery capacity of {waterDeliveryCapacity} cubic feet per second</b>. +{endif} +</p> +<p>The <b>available water supply is {self.waterSupplyCapacity} cubic feet per second</b>.</p> +]]> +</entry> +<entry key="restricted-visibility-instructions"> +<![CDATA[{if (self.restrictedVisibility)}<b>NOTE:</b> In this experiment you can <b>only communicate with and observe the actions of your immediate neighbors</b>.{endif}]]> +</entry> +<entry key="facilitator-debriefing"> +<![CDATA[ +<h3>Round {self.roundNumber} results</h3> +<hr> +<table border=1 cellspacing=3 cellpadding=3> +<tr><th>Participant</th><th>Current tokens</th><th>Current income</th><th>Quiz earnings</th><th>Total income</th></tr> +{clientDataList: {data | +<tr align="RIGHT"><td>{data.id}</td><td>{data.allTokensEarnedThisRound}</td><td>{data.totalDollarsEarnedThisRound}</td><td>{data.quizEarnings}</td><td>{data.grandTotalIncome}</td></tr> +}} +</table> +{if (self.lastRound)} +<h2><font color='blue'>The experiment is over. Please prepare payments.</font></h2> +{endif} +]]> +</entry> +<entry key='quiz-results'> + <![CDATA[ + <h2>Quiz Results</h2> + <hr> + <p> + {if (allCorrect)} + You have answered all the questions correctly and earned <b>{totalQuizEarnings}</b>. + {else} + You answered {numberCorrect} out of {totalQuestions} questions correctly and earned <b>{totalQuizEarnings}</b>. Questions you've answered + incorrectly are highlighted in red. Please see below for more details. + {endif} + </p> + <hr> + <p><span class='q1'>Question 1:</span><br> + Given an existing infrastructure efficiency of 20%, if the five participants invest + a <b>total of 29 additional tokens</b>, what is the new irrigation infrastructure + efficiency? + <br><b>{incorrect_q1} + An existing infrastructure efficiency of 20% + 29 tokens invested = 49% infrastructure efficiency.</b> + </p> + <p><span class='q2'>Question 2:</span><br> + Suppose the infrastructure efficiency in the last round was 60%. For the current + round, the efficiency will decline by an amount of 25% for a resulting + infrastructure efficiency of 35%. If the members of your group invest a total of 15 + tokens, what will be your group's resulting water delivery capacity?<br> + <b>{incorrect_q2} + An existing infrastructure efficiency of 35% + 15 tokens invested = 50% infrastructure efficiency for the current round. + An infrastructure efficiency of 50% corresponds to a water delivery capacity of 5 cubic feet per second.</b> + </p> + <p><span class='q3'>Question 3:</span><br> + If the irrigation efficiency is between 71 and 80%, the water delivery capacity of + the irrigation system is 35 cubic feet per second. Suppose the water supply + available to your group is 30 cubic feet per second and A opens their gate, + diverting water at 25 cubic feet per second. What is the available water flow for + B?<br> + <b>{incorrect_q3} + Since there is only 30 cubic feet per second of water available, the irrigation infrastructure capacity of 35 cubic feet + per second will not be fully used. When A opens their gate, they take 25 of the 30 cubic feet per second out of the + canal, leaving 5 cubic feet per second for B.</b> + </p> + <p><span class='q4'>Question 4:</span><br> + If the available water delivery capacity is 25 cubic feet per second and A, B, C, and D are not using water, how much cubic feet of water per second is available for E?<br> + <b>{incorrect_q4} + If A has 25 cfps available and does not take any water, the same amount is available for the people + downstream. Since B, C and D do not take water, 25 cfps is available for E. + </b> + </p> + <p> + <span class='q5'>Question 5:</span><br> + If you invest 7 of the 10 tokens you start with and you apply 202 cubic feet of + water to your fields, what is the total number of tokens you will have earned at the + end of the round?<br> + <b>{incorrect_q5} + If you invest 7 out of 10 tokens, you keep 3 tokens for yourself. If you apply 202 cubic feet of water to your field you will earn 4 tokens. 3 + 4 = 7 tokens</b> + </p> + <p><span class='q6'>Question 6:</span><br> + If you invest all 10 tokens you start with and you apply 555 cubic feet of water to + your fields, what is the total number of tokens you will have earned at the end of + the round?<br> + <b>{incorrect_q6} + If you invest all 10 tokens, you keep 0 tokens from your initial endowment. If you apply 555 cubic feet of + water to your field you will earn 19 tokens. 0 + 19 = 19 tokens. + </b> + </p> + ]]> +</entry></properties> diff -r 608c5d7d8e8c73b32edca6913a2b5306d557cf59 -r 73437a9a1c4e6ed76babe74022d6b1ecb642c300 src/main/resources/configuration/asu/2011/t3/irrigation.xml --- a/src/main/resources/configuration/asu/2011/t3/irrigation.xml +++ b/src/main/resources/configuration/asu/2011/t3/irrigation.xml @@ -27,6 +27,8 @@ <entry key="round20">round20.xml</entry><entry key="round21">round21.xml</entry> +<entry key='token-endowment'>10</entry> +<entry key='field-of-vision'>1</entry><entry key="wait-for-participants">true</entry><entry key="number-of-rounds">22</entry> @@ -43,12 +45,7 @@ </entry><entry key="q3">5</entry><entry key='a3'>5 cubic feet per second</entry> -<entry key="explanation3">Since there is only 30 cubic feet per second of water -available, the irrigation infrastructure capacity of 35 cubic feet per -second will not be fully used. When A opens their gate, they take 25 of the -30 cubic feet per second out of the canal, leaving 5 cubic feet per second for -B. -</entry> +<entry key="explanation3">Since there is only 30 cubic feet per second of water available, the irrigation infrastructure capacity of 35 cubic feet per second will not be fully used. When A opens their gate, they take 25 of the 30 cubic feet per second out of the canal, leaving 5 cubic feet per second for B.</entry><entry key="q4">25</entry><entry key="a4">25 cubic feet per second</entry><entry key="explanation4">If A has 25 cfps available and does not take any @@ -59,55 +56,50 @@ <entry key="explanation5">If you invest 7 out of 10 tokens, you keep 3 tokens for yourself. If you apply 202 cubic feet of water to your field you will earn 4 tokens. 3 + 4 = 7 tokens </entry><entry key="q6">19</entry><entry key="a6">19 tokens</entry> -<entry key="explanation6">If you invest all 10 tokens, you keep 0 tokens from -your initial endowment. If you apply 555 cubic feet of water to your field -you will earn 19 tokens. 0 + 19 = 19 tokens.</entry> +<entry key="explanation6">If you invest all 10 tokens, you keep 0 tokens from your initial endowment. If you apply 555 cubic feet of water to your field you will earn 19 tokens. 0 + 19 = 19 tokens.</entry> -<entry key='final-instructions'> -<![CDATA[ -<p> -The experiment is almost over. We have a brief survey for you to fill out while the -facilitator prepares your payments. When the facilitator has finished preparing -payments and you have all completed your surveys your computer number will be -called. You can then go next door to receive your payment. For privacy reasons we -must pay you one at a time. -</p> -<p> -Thanks for participating! -</p> -]]> -</entry><!-- FIXME: lots of parameterizable fields here. should make instructions template-language-pluggable --><entry key="initial-instructions"><![CDATA[ +<h1>Instructions</h1> +<hr><p> -You have already earned 5 dollars by showing up for this exercise. You can earn -more, up to an extra 25 dollars. You will participate in this exercise as a part of -a group of five participants. Your group has been formed by randomly assigning you -to FOUR other participants in the room. +You have already earned {showUpPayment} dollars by showing up for this exercise. You +can earn more, up to a maximum of about 45 dollars, by participating in this +experiment which will take about an hour to an hour and a half. The amount of money +you earn depends on your decisions AND the decisions of other people in this room +over the course of the experiment. </p> +<h2>Groups</h2> +<hr> +You will be participating in this exercise as a part of a group of +{self.clientsPerGroup} participants. Your group has been formed by randomly +selecting you and four other participants in the room. +</p> +<h2>How to participate</h2> +<hr><p> -The amount of money you earn will depend on the decisions made by you and the other -members of your group. This exercise mimics decisions people make in irrigation -systems. In each round you will receive 10 tokens which you can invest in the -irrigation infrastructure. Based on the <b>water delivery capacity</b> of the -irrigation infrastructure and the availability of water you will be able to -grow crops. Tokens earned in a round is the sum of tokens not invested plus -tokens earned by growing crops. Each token is worth 5 cents. In each round you -will first decide how much to invest in the irrigation infrastructure. Based -on the combined contributions of all 5 participants in your group in each -round, your group can maintain the capacity of the irrigation infrastructure -for growing crops. +This exercise mimics decisions people make in irrigation systems. In each round you +will receive {self.tokenEndowment} tokens which you can invest in the irrigation +infrastructure. Based on the <b>water delivery capacity</b> of the irrigation +infrastructure and the availability of water you will be able to grow crops. Tokens +earned in a round is the sum of tokens not invested plus tokens earned by growing +crops. Each token is worth {dollarsPerToken}. In each round you will first decide how much to +invest in the irrigation infrastructure. Based on the combined contributions of all +5 participants in your group in each round, your group can maintain the capacity of +the irrigation infrastructure for growing crops. </p><p> We will now start a practice round to help illustrate the experiment. Before each -round in this experiment you will have a chat period of %d seconds where you can -send text messages to the other participants. You may discuss any aspect of the -exercise with two important exceptions: +round in this experiment you will have a chat period of {self.chatDuration} seconds +where you can send text messages to the other participants. +{self.restrictedVisibilityInstructions} + +You may discuss any aspect of the exercise with two important exceptions: </p><ol><li>You are <b>not allowed</b> to promise the other participants @@ -127,66 +119,64 @@ <entry key='game-screenshot-instructions'><![CDATA[ -<img src="http://dev.commons.asu.edu/irrigation/images/game-interface-screenshot.jpg"> +<img src="http://dev.commons.asu.edu/irrigation/images/screenshot.jpg"> ]]></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. + This facilitator interface allows you to control the experiment. In general you + will be following a sequence similar to this: +</p> +<ol> + <li>Show instructions</li> + <li>Start round</li> + <li>After round is over, start standalone chat round if necessary</li> + <li>Goto 1.</li> +</ol> +]]> +</entry> +<entry key="welcome-instructions"> +<![CDATA[ +<h1>Welcome</h1> +<hr> +<p> +Welcome to the experiment. We will begin shortly after everyone has been +assigned a station. +<br><br> +Please <b>wait quietly</b> and <b>do not close this window, open any other applications, or communicate with any of the other participants</b>. </p> ]]></entry> - - -<entry key="welcome-instructions"> +<entry key="quiz-instructions"><![CDATA[ -<center> -<h3>Welcome to the CARL lab. Please wait quietly and do not close this window or open any -other applications.</h3> -<h3>The experiment will begin shortly after everyone has been -assigned a station.</h3></center> -]]> -</entry> - - -<entry key="quiz-page1"> -<![CDATA[ +<h2>Quiz</h2> +<hr><p> The first two questions deal with irrigation infrastructure investment. <b>Please refer to Table 1 of your handout</b>. </p> - <form> -Question 1:<br> +<p>Question 1:<br> Given an existing infrastructure efficiency of 20%, if the five participants invest a <b>total of 29 additional tokens</b>, what is the new irrigation infrastructure efficiency?<br><input type="text" name="q1" value = "">% -<br><br> - -Question 2:<br> +</p> +<p>Question 2:<br> Suppose the infrastructure efficiency in the last round was 60%. For the current round, the efficiency will decline by an amount of 25% for a resulting infrastructure efficiency of 35%. If the members of your group invest a total of 15 tokens, what will be your group's resulting water delivery capacity?<br> - <input type="text" name="q2" value = ""> cubic feet per second -<br><br> - -<b>The next two questions deal with the capacity of the irrigation system in relation -to the actual amount of water available.</b> -<br><br> +</p> +<p> +The next two questions deal with the capacity of the irrigation system in relation +to the actual amount of water available. +</p> +<p> Question 3:<br> If the irrigation efficiency is between 71 and 80%, the water delivery capacity of the irrigation system is 35 cubic feet per second. Suppose the water supply @@ -195,40 +185,30 @@ B? <br><input type='text' name='q3' value=''> cubic feet per second -<br><br> -Question 4: +</p> +<p>Question 4:<br> If the available water delivery capacity is 25 cubic feet per second and A, B, C, and D are not using water, how much cubic feet of water per second is available for E?<br><input type='text' name='q4' value=''> cubic feet per second -<br><br> - -<input type="submit" name="submit" value="Submit"><br> -<br> - -]]> -</entry> - -<entry key="quiz-page2"> -<![CDATA[ +</p><p> The final two questions cover the number of tokens you can earn in within a round. -<b>Please refer to table 2 of your handout</b>. +<b>Please refer to Table 2 of your handout</b>. </p> -<form> -Question 5:<br> +<p>Question 5:<br> If you invest 7 of the 10 tokens you start with and you apply 202 cubic feet of water to your fields, what is the total number of tokens you will have earned at the end of the round?<br><input type="text" name="q5" value="">tokens -<br><br> -Question 6:<br> +</p> +<p>Question 6:<br> If you invest all 10 tokens you start with and you apply 555 cubic feet of water to your fields, what is the total number of tokens you will have earned at the end of the round?<br><input type="text" name="q6" value="">tokens -<br><br> -<input type="submit" name="submit" value="Submit"> +</p> +<input type="submit" name="submit" value="Submit"><br></form> ]]></entry> @@ -296,8 +276,11 @@ <entry key='chat-instructions'><![CDATA[ <h3>Chat Instructions</h3> -You may now chat for %d seconds with the other members of your group. You may -discuss any aspect of the exercise with two important exceptions: +<hr> +<p> +You may now chat for {self.chatDuration} seconds with the other members of your group. +{self.restrictedVisibilityInstructions} +You may discuss any aspect of the exercise with two important exceptions: </p><ol><li>You are <b>not allowed</b> to promise the other participants @@ -322,16 +305,23 @@ <entry key="investment-instructions"><![CDATA[ +<h1>Current infrastructure condition</h1> + <hr> + <h2>Current infrastructure efficiency: {actualInfrastructureEfficiency}%</h2> + <h2>Current water delivery capacity: {waterDeliveryCapacity} cubic feet per second</h2> + <h2>Available water supply: {self.waterSupplyCapacity} cubic feet per second</h2> +<h1>Investment Instructions</h1> +<hr><p> -You have been endowed with 10 tokens to invest. You must make a decision about -how much you wish to invest [0,10] in the irrigation infrastructure. You can -see the relationship between total investment and irrigation infrastructure in -the table 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 +You have been endowed with {self.tokenEndowment} tokens to invest. You must make a decision about +how much you wish to invest in the irrigation infrastructure by choosing a number +between 0 and {self.tokenEndowment}. You can see the relationship between total +investment and irrigation infrastructure in the table 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"> @@ -373,5 +363,201 @@ </table> ]]></entry> - +<entry key='client-debriefing'> +<![CDATA[ +<h1>{if (self.practiceRound)}Practice Round{else}Round {self.roundNumber}{endif} Results</h1> +<hr> + <table border=3 cellpadding=5 cellspacing=5> + <tr> + <th>Position</th> + <th>Initial token endowment</th> + <th>Tokens invested</th> + <th>Tokens not invested</th> + <th>Tokens earned from growing crops</th> + <th>Total tokens earned this round</th> + <th>Dollars earned this round</th> + <th>Total dollars earned</th> + </tr> + {dataModel.orderedVisibleClients: {clientData| + <tr align='center' bgcolor='{if (clientData.self)}#FFFFCC{else}#CCCCCC{endif}'> + <td>{clientData.priorityString}</td> + <td>{self.tokenEndowment}</td> + <td>{clientData.investedTokens}</td> + <td>{clientData.uninvestedTokens}</td> + <td>{clientData.tokensEarnedFromWaterCollected}</td> + <td>{clientData.allTokensEarnedThisRound}</td> + <td>{clientData.totalDollarsEarnedThisRound}</td> + <td>{clientData.grandTotalIncome}</td> + </tr> + }} + </table> + <h2>Earnings</h2> + <hr> + <p> + You are in position {clientData.priorityString} and received + {clientData.totalDollarsEarnedThisRound} this past round. Your + <b>total income</b> is <b>{clientData.grandTotalIncome}</b>, including + the {showUpPayment} show-up bonus and {clientData.quizEarnings} for + answering {clientData.correctQuizAnswers} quiz questions correctly. + </p> + {if (self.practiceRound)} + <p><b>NOTE: this was a practice round and did not contribute to your earnings.</b></p> + {endif} + {if (showExitInstructions)} + <h2>Exit Survey</h2> + <hr> + <p> + This was the last round, but not the end of the exp... [truncated message content] |
From: Bitbucket <com...@bi...> - 2012-03-19 23:54:09
|
1 new commit in foraging: https://bitbucket.org/virtualcommons/foraging/changeset/78057caab3b6/ changeset: 78057caab3b6 branch: stable user: alllee date: 2012-03-20 00:54:01 summary: merging default branch back into stable affected #: 32 files diff -r bbb67c1354864fb3543f0b66a02482908d18d028 -r 78057caab3b65da359093d97d27c9c9b2fcdbe99 src/main/java/edu/asu/commons/foraging/client/ClientDataModel.java --- a/src/main/java/edu/asu/commons/foraging/client/ClientDataModel.java +++ b/src/main/java/edu/asu/commons/foraging/client/ClientDataModel.java @@ -18,7 +18,7 @@ import edu.asu.commons.foraging.model.ForagingDataModel; import edu.asu.commons.foraging.model.GroupDataModel; import edu.asu.commons.foraging.model.Resource; -import edu.asu.commons.foraging.rules.iu.ForagingStrategy; +import edu.asu.commons.foraging.rules.Strategy; import edu.asu.commons.net.Identifier; import edu.asu.commons.util.Duration; /** @@ -46,7 +46,7 @@ // these are the subjects that have sanctioned us. private Map<Identifier, Duration> sanctioners = new HashMap<Identifier, Duration>(); - private List<ForagingStrategy> selectedRules = new ArrayList<ForagingStrategy>(); + private List<Strategy> selectedStrategies = new ArrayList<Strategy>(); private ForagingClient client; private volatile boolean explicitCollectionMode = false; @@ -271,13 +271,18 @@ return explicitCollectionMode; } - // FIXME: deprecate and remove these later - public void setSelectedRules(List<ForagingStrategy> selectedRules) { - this.selectedRules = selectedRules; + public void setSelectedStrategies(List<Strategy> selectedStrategies) { + this.selectedStrategies = selectedStrategies; + getRoundConfiguration().setSelectedRules(selectedStrategies); } - public List<ForagingStrategy> getSelectedRules() { - return selectedRules; + public List<Strategy> getSelectedStrategies() { + return selectedStrategies; + } + + @Deprecated + public List<Strategy> getSelectedRules() { + return selectedStrategies; } public Point3D getPoint3D(Identifier id) { diff -r bbb67c1354864fb3543f0b66a02482908d18d028 -r 78057caab3b65da359093d97d27c9c9b2fcdbe99 src/main/java/edu/asu/commons/foraging/client/ForagingClient.java --- a/src/main/java/edu/asu/commons/foraging/client/ForagingClient.java +++ b/src/main/java/edu/asu/commons/foraging/client/ForagingClient.java @@ -2,6 +2,7 @@ import java.awt.BorderLayout; import java.awt.Color; +import java.util.Arrays; import java.util.LinkedList; import javax.swing.JFrame; @@ -33,7 +34,7 @@ import edu.asu.commons.foraging.event.RoundStartedEvent; import edu.asu.commons.foraging.event.RuleSelectedUpdateEvent; import edu.asu.commons.foraging.event.RuleVoteRequest; -import edu.asu.commons.foraging.event.ShowImposedStrategyRequest; +import edu.asu.commons.foraging.event.SetImposedStrategyEvent; import edu.asu.commons.foraging.event.ShowSurveyInstructionsRequest; import edu.asu.commons.foraging.event.ShowTrustGameRequest; import edu.asu.commons.foraging.event.ShowVoteScreenRequest; @@ -162,9 +163,9 @@ getGameWindow().showTrustGame(); } }); - addEventProcessor(new EventTypeProcessor<ShowImposedStrategyRequest>(ShowImposedStrategyRequest.class) { - @Override public void handle(ShowImposedStrategyRequest request) { - getGameWindow2D().showImposedStrategy(request.getStrategy()); + addEventProcessor(new EventTypeProcessor<SetImposedStrategyEvent>(SetImposedStrategyEvent.class) { + @Override public void handle(SetImposedStrategyEvent event) { + dataModel.setSelectedStrategies(Arrays.asList(event.getStrategy())); } }); addEventProcessor(new EventTypeProcessor<ShowVotingInstructionsRequest>(ShowVotingInstructionsRequest.class) { @@ -175,7 +176,7 @@ addEventProcessor(new EventTypeProcessor<RuleSelectedUpdateEvent>(RuleSelectedUpdateEvent.class) { @Override public void handle(RuleSelectedUpdateEvent event) { - dataModel.setSelectedRules(event.getSelectedStrategies()); + dataModel.setSelectedStrategies(event.getSelectedStrategies()); getGameWindow2D().showVotingResults(event.getSelectedStrategies(), event.getVotingResults()); } }); @@ -448,8 +449,10 @@ } public void sendRuleVoteRequest(ForagingStrategy selectedRule) { - transmit(new RuleVoteRequest(getId(), selectedRule)); - getGameWindow2D().ruleVoteSubmitted(); + if (selectedRule != null) { + transmit(new RuleVoteRequest(getId(), selectedRule)); + } + getGameWindow2D().strategyNominationSubmitted(); } diff -r bbb67c1354864fb3543f0b66a02482908d18d028 -r 78057caab3b65da359093d97d27c9c9b2fcdbe99 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 @@ -43,7 +43,7 @@ * @author <a href='mailto:All...@as...'>Allen Lee</a> * @version $Rev: 534 $ */ -public class RoundConfiguration extends ExperimentRoundParameters.Base<ServerConfiguration> { +public class RoundConfiguration extends ExperimentRoundParameters.Base<ServerConfiguration, RoundConfiguration> { private static final long serialVersionUID = 8575239803733029326L; @@ -58,7 +58,7 @@ private static final double DEFAULT_TOKEN_MOVEMENT_PROBABILITY = 0.2d; private static final double DEFAULT_TOKEN_BIRTH_PROBABILITY = 0.01d; - private List<ForagingStrategy> selectedRules; + private List<Strategy> selectedRules; public double getTrustGamePayoffIncrement() { return getDoubleProperty("trust-game-payoff", 0.25d); @@ -553,19 +553,19 @@ public boolean isVotingEnabled() { return getBooleanProperty("voting-enabled"); } + + public boolean isImposedStrategyEnabled() { + return getBooleanProperty("imposed-strategy-enabled"); + } public String getVotingInstructions() { - return getProperty("voting-instructions"); + return render(getProperty("voting-instructions")); } public String getInitialVotingInstructions() { return createStringTemplate(getProperty("initial-voting-instructions")).render(); } - public List<ForagingStrategy> getForagingRules() { - return Arrays.asList(ForagingStrategy.values()); - - } public boolean isVotingAndRegulationEnabled() { return getBooleanProperty("voting-and-regulation-enabled", false); } @@ -722,22 +722,25 @@ } public String getSubmittedVoteInstructions() { - return getProperty("submitted-vote-instructions", "<h1>Submitted</h1><hr><p>Your nomination has been recorded. The final results of the nomination will be shown once all the nominations in your group have been received.</p>"); + return render(getProperty("submitted-vote-instructions")); } - public String generateVotingResults(List<ForagingStrategy> selectedRules, Map<ForagingStrategy, Integer> nominations) { + public String generateVotingResults(List<Strategy> selectedRules, Map<Strategy, Integer> nominations) { List<ForagingStrategyNomination> sortedNominations = new ArrayList<ForagingStrategyNomination>(); - for (Map.Entry<ForagingStrategy, Integer> entry: new TreeMap<ForagingStrategy, Integer>(nominations).entrySet()) { - ForagingStrategy strategy = entry.getKey(); + for (Map.Entry<Strategy, Integer> entry: new TreeMap<Strategy, Integer>(nominations).entrySet()) { + Strategy strategy = entry.getKey(); sortedNominations.add(new ForagingStrategyNomination(strategy, entry.getValue(), strategy.equals(selectedRules.get(0)))); } setSelectedRules(selectedRules); ST template = createStringTemplate(getVotingResultsTemplate()); template.add("nominations", sortedNominations); template.add("tiebreaker", selectedRules.size() > 1); - template.add("selectedRules", selectedRules); return template.render(); } + + public List<ForagingStrategy> getForagingStrategies() { + return Arrays.asList(ForagingStrategy.values()); + } public String getVotingResultsTemplate() { return getProperty("voting-results", getParentConfiguration().getVotingResults()); @@ -772,11 +775,11 @@ return template.render(); } - public List<ForagingStrategy> getSelectedRules() { + public List<Strategy> getSelectedRules() { return selectedRules; } - public void setSelectedRules(List<ForagingStrategy> selectedRules) { + public void setSelectedRules(List<Strategy> selectedRules) { this.selectedRules = selectedRules; } @@ -847,10 +850,4 @@ return getProperty("survey-confirmation-message", "Please make sure you have completed the survey before continuing. Have you completed the survey?"); } - - public String getImposedStrategyInstructions(Strategy strategy) { - ST st = createStringTemplate(getProperty("imposed-strategy-instructions")); - st.add("strategy", strategy); - return st.render(); - } } diff -r bbb67c1354864fb3543f0b66a02482908d18d028 -r 78057caab3b65da359093d97d27c9c9b2fcdbe99 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 @@ -24,7 +24,7 @@ * @see * @version $Revision$ */ -public class ServerConfiguration extends ExperimentConfiguration.Base<RoundConfiguration> { +public class ServerConfiguration extends ExperimentConfiguration.Base<ServerConfiguration, RoundConfiguration> { private static final long serialVersionUID = -1737412253553943902L; diff -r bbb67c1354864fb3543f0b66a02482908d18d028 -r 78057caab3b65da359093d97d27c9c9b2fcdbe99 src/main/java/edu/asu/commons/foraging/data/AllDataProcessor.java --- a/src/main/java/edu/asu/commons/foraging/data/AllDataProcessor.java +++ b/src/main/java/edu/asu/commons/foraging/data/AllDataProcessor.java @@ -17,6 +17,8 @@ import edu.asu.commons.foraging.event.QuizResponseEvent; import edu.asu.commons.foraging.event.RealTimeSanctionRequest; import edu.asu.commons.foraging.event.ResourcesAddedEvent; +import edu.asu.commons.foraging.event.RuleSelectedUpdateEvent; +import edu.asu.commons.foraging.event.RuleVoteRequest; import edu.asu.commons.foraging.event.TokenCollectedEvent; import edu.asu.commons.foraging.model.ClientData; import edu.asu.commons.foraging.model.GroupDataModel; @@ -141,6 +143,17 @@ String line = String.format("%s, %s", savedRoundData.toSecondString(event), request.toString()); writer.println(line); } + else if (event instanceof RuleVoteRequest) { + RuleVoteRequest request = (RuleVoteRequest) event; + String line = String.format("%s, %s, %s, Strategy Nomination", savedRoundData.toSecondString(event), request.getId(), request.getRule()); + writer.println(line); + } + else if (event instanceof RuleSelectedUpdateEvent) { + RuleSelectedUpdateEvent update = (RuleSelectedUpdateEvent) event; + String line = String.format("%s, %s, \"%s\", \"%s\", Rule selected", + savedRoundData.toSecondString(event), update.getGroup(), update.getSelectedStrategies(), update.getVotingResults()); + writer.println(line); + } else { writer.println(String.format("%s, %s", savedRoundData.toSecondString(event), event.toString())); } diff -r bbb67c1354864fb3543f0b66a02482908d18d028 -r 78057caab3b65da359093d97d27c9c9b2fcdbe99 src/main/java/edu/asu/commons/foraging/event/RuleSelectedUpdateEvent.java --- a/src/main/java/edu/asu/commons/foraging/event/RuleSelectedUpdateEvent.java +++ b/src/main/java/edu/asu/commons/foraging/event/RuleSelectedUpdateEvent.java @@ -5,7 +5,8 @@ import java.util.Map; import edu.asu.commons.event.AbstractPersistableEvent; -import edu.asu.commons.foraging.rules.iu.ForagingStrategy; +import edu.asu.commons.foraging.model.GroupDataModel; +import edu.asu.commons.foraging.rules.Strategy; import edu.asu.commons.net.Identifier; /** @@ -21,26 +22,35 @@ public class RuleSelectedUpdateEvent extends AbstractPersistableEvent { private static final long serialVersionUID = 4360213814026474451L; - private final List<ForagingStrategy> selectedStrategies; - private final Map<ForagingStrategy, Integer> votingResults; + private final List<Strategy> selectedStrategies; + private final Map<Strategy, Integer> votingResults; + private final GroupDataModel group; - public RuleSelectedUpdateEvent(Identifier id, List<ForagingStrategy> selectedStrategies, Map<ForagingStrategy, Integer> votingResults) { + public RuleSelectedUpdateEvent(Identifier id, GroupDataModel group, List<Strategy> selectedStrategies, Map<Strategy, Integer> votingResults) { super(id, String.format("Strategies (first is tiebreaker): %s, All nominations: %s", selectedStrategies, votingResults)); this.selectedStrategies = selectedStrategies; this.votingResults = votingResults; + this.group = group; } - public ForagingStrategy getSelectedRule() { + public Strategy getSelectedRule() { return selectedStrategies.get(0); } - public List<ForagingStrategy> getSelectedStrategies() { + public List<Strategy> getSelectedStrategies() { return selectedStrategies; } - public Map<ForagingStrategy, Integer> getVotingResults() { + public Map<Strategy, Integer> getVotingResults() { return votingResults; } + /** + * @return the group + */ + public GroupDataModel getGroup() { + return group; + } + } diff -r bbb67c1354864fb3543f0b66a02482908d18d028 -r 78057caab3b65da359093d97d27c9c9b2fcdbe99 src/main/java/edu/asu/commons/foraging/event/SetImposedStrategyEvent.java --- /dev/null +++ b/src/main/java/edu/asu/commons/foraging/event/SetImposedStrategyEvent.java @@ -0,0 +1,22 @@ +package edu.asu.commons.foraging.event; + +import edu.asu.commons.event.AbstractEvent; +import edu.asu.commons.foraging.rules.Strategy; +import edu.asu.commons.net.Identifier; + +public class SetImposedStrategyEvent extends AbstractEvent { + + private static final long serialVersionUID = -6046837892041909032L; + + private Strategy strategy; + + public SetImposedStrategyEvent(Identifier id, Strategy strategy) { + super(id); + this.strategy = strategy; + } + + public Strategy getStrategy() { + return strategy; + } + +} diff -r bbb67c1354864fb3543f0b66a02482908d18d028 -r 78057caab3b65da359093d97d27c9c9b2fcdbe99 src/main/java/edu/asu/commons/foraging/event/ShowImposedStrategyRequest.java --- a/src/main/java/edu/asu/commons/foraging/event/ShowImposedStrategyRequest.java +++ /dev/null @@ -1,26 +0,0 @@ -package edu.asu.commons.foraging.event; - -import edu.asu.commons.event.AbstractEvent; -import edu.asu.commons.foraging.rules.Strategy; -import edu.asu.commons.net.Identifier; - -public class ShowImposedStrategyRequest extends AbstractEvent { - - private static final long serialVersionUID = -6046837892041909032L; - - private Strategy strategy; - - public ShowImposedStrategyRequest(Identifier id) { - super(id); - } - - public ShowImposedStrategyRequest(Identifier id, Strategy strategy) { - super(id); - this.strategy = strategy; - } - - public Strategy getStrategy() { - return strategy; - } - -} diff -r bbb67c1354864fb3543f0b66a02482908d18d028 -r 78057caab3b65da359093d97d27c9c9b2fcdbe99 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 @@ -25,7 +25,6 @@ import edu.asu.commons.foraging.event.FacilitatorUpdateEvent; import edu.asu.commons.foraging.event.ImposeStrategyEvent; import edu.asu.commons.foraging.event.QuizCompletedEvent; -import edu.asu.commons.foraging.event.ShowImposedStrategyRequest; import edu.asu.commons.foraging.event.ShowSurveyInstructionsRequest; import edu.asu.commons.foraging.event.ShowTrustGameRequest; import edu.asu.commons.foraging.event.ShowVoteScreenRequest; @@ -184,7 +183,7 @@ * Send a request to set the configuration object */ public void sendSetConfigRequest() { - transmit(new ConfigurationEvent<ServerConfiguration>(getId(), getServerConfiguration())); + transmit(new ConfigurationEvent<ServerConfiguration, RoundConfiguration>(getId(), getServerConfiguration())); } public FacilitatorWindow getFacilitatorWindow() { @@ -240,12 +239,4 @@ return imposedStrategyDistribution; } - public void sendShowImposedStrategy() { - if (imposedStrategyDistribution == null || imposedStrategyDistribution.isEmpty()) { - facilitatorWindow.addMessage("No imposed strategies selected, please select a strategy first."); - return; - } - transmit(new ShowImposedStrategyRequest(getId())); - } - } diff -r bbb67c1354864fb3543f0b66a02482908d18d028 -r 78057caab3b65da359093d97d27c9c9b2fcdbe99 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 @@ -82,9 +82,9 @@ private JMenuItem showVotingInstructionsMenuItem; private JMenuItem showVoteScreenMenuItem; private JMenuItem showSurveyInstructionsMenuItem; - private JMenuItem showExitInstructionsMenuItem; - private JMenuItem imposeStrategyMenuItem; - + private JMenuItem showExitInstructionsMenuItem; + private JMenuItem imposeStrategyMenuItem; + private HtmlEditorPane messageEditorPane; private StringBuilder instructionsBuilder; @@ -94,7 +94,7 @@ private ClipboardService clipboardService; private Map<Strategy, Integer> imposedStrategies = new HashMap<Strategy, Integer>(); - + public FacilitatorWindow(Dimension dimension, Facilitator facilitator) { this.facilitator = facilitator; initGuiComponents(); @@ -113,7 +113,7 @@ * This method gets called after the end of each round */ public void displayInstructions() { - + } /* @@ -131,7 +131,6 @@ // Round menu JMenu menu = new JMenu("Round"); menu.setMnemonic(KeyEvent.VK_R); - showInstructionsMenuItem = new JMenuItem("Show Instructions"); showInstructionsMenuItem.setMnemonic(KeyEvent.VK_I); @@ -143,7 +142,7 @@ } }); menu.add(showInstructionsMenuItem); - + startRoundMenuItem = new JMenuItem("Start"); startRoundMenuItem.setMnemonic(KeyEvent.VK_T); startRoundMenuItem.setEnabled(false); @@ -170,7 +169,7 @@ facilitator.sendShowExitInstructionsRequest(); } }); - + startChatMenuItem = new JMenuItem("Start chat"); startChatMenuItem.setEnabled(true); startChatMenuItem.addActionListener(new ActionListener() { @@ -188,10 +187,8 @@ }); menu.add(showTrustGameMenuItem); - - menuBar.add(menu); - + // voting menu menu = new JMenu("Voting"); @@ -206,38 +203,34 @@ } }); imposeStrategyMenuItem = createMenuItem(menu, "Add imposed strategy", new ActionListener() { - public void actionPerformed(ActionEvent e) { - ForagingStrategy selection = (ForagingStrategy) JOptionPane.showInputDialog(FacilitatorWindow.this, "Select the strategy to impose:\n", - "Impose Strategy", - JOptionPane.QUESTION_MESSAGE, - null, - ForagingStrategy.values(), - ForagingStrategy.NONE - ); - Integer distribution = imposedStrategies.get(selection); - if (distribution == null) { - distribution = Integer.valueOf(0); - } - imposedStrategies.put(selection, Integer.valueOf(distribution + 1)); - addMessage("Current strategy distribution: " + imposedStrategies); - } + public void actionPerformed(ActionEvent e) { + ForagingStrategy selection = (ForagingStrategy) JOptionPane.showInputDialog(FacilitatorWindow.this, "Select the strategy to impose:\n", + "Impose Strategy", + JOptionPane.QUESTION_MESSAGE, + null, + ForagingStrategy.values(), + ForagingStrategy.NONE + ); + if (selection == null) + return; + Integer distribution = imposedStrategies.get(selection); + if (distribution == null) { + distribution = Integer.valueOf(0); + } + imposedStrategies.put(selection, Integer.valueOf(distribution + 1)); + addMessage("Current strategy distribution: " + imposedStrategies); + } }); createMenuItem(menu, "Clear imposed strategies", new ActionListener() { - public void actionPerformed(ActionEvent e) { - - imposedStrategies.clear(); - } + public void actionPerformed(ActionEvent e) { + imposedStrategies.clear(); + addMessage("Cleared strategy distribution: " + imposedStrategies); + } }); - createMenuItem(menu, "Send imposed strategy", new ActionListener() { - public void actionPerformed(ActionEvent e) { - facilitator.sendImposeStrategyEvent(imposedStrategies); - } - }); - - createMenuItem(menu, "Show imposed strategy", new ActionListener() { - public void actionPerformed(ActionEvent e) { - facilitator.sendShowImposedStrategy(); - } + createMenuItem(menu, "Send imposed strategy distribution", new ActionListener() { + public void actionPerformed(ActionEvent e) { + facilitator.sendImposeStrategyEvent(imposedStrategies); + } }); menuBar.add(menu); @@ -395,16 +388,16 @@ } public void addMessage(final String message) { - SwingUtilities.invokeLater(new Runnable() { - public void run() { - try { - messageEditorPane.getDocument().insertString(0, "-----\n" + message + "\n", null); - messageEditorPane.setCaretPosition(0); - } catch (BadLocationException exception) { - exception.printStackTrace(); - } - } - }); + SwingUtilities.invokeLater(new Runnable() { + public void run() { + try { + messageEditorPane.getDocument().insertString(0, "-----\n" + message + "\n", null); + messageEditorPane.setCaretPosition(0); + } catch (BadLocationException exception) { + exception.printStackTrace(); + } + } + }); } public void quizCompleted(QuizCompletedEvent event) { @@ -469,10 +462,10 @@ public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException { if (String.class.equals(flavor.getRepresentationClass())) { return html; - } + } else if (Reader.class.equals(flavor.getRepresentationClass())) { return new StringReader(html); - } + } else if (InputStream.class.equals(flavor.getRepresentationClass())) { return new ByteArrayInputStream(html.getBytes()); } diff -r bbb67c1354864fb3543f0b66a02482908d18d028 -r 78057caab3b65da359093d97d27c9c9b2fcdbe99 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 @@ -79,7 +79,7 @@ private ArrayList<RegulationData> submittedRegulations = new ArrayList<RegulationData>(); - private ArrayList<ForagingStrategy> selectedRules; + private ArrayList<Strategy> selectedRules; public GroupDataModel(ServerDataModel serverDataModel) { this(serverDataModel, nextGroupId++); @@ -766,9 +766,20 @@ public EventChannel getEventChannel() { return serverDataModel.getEventChannel(); } + + public Map<Strategy, Integer> generateVotingResults() { + return generateVotingResults(getRoundConfiguration().isImposedStrategyEnabled()); + } - public Map<ForagingStrategy, Integer> generateVotingResults() { - Map<ForagingStrategy, Integer> tallyMap = new HashMap<ForagingStrategy, Integer>(); + public Map<Strategy, Integer> generateVotingResults(boolean imposedStrategyEnabled) { + Map<Strategy, Integer> tallyMap = new HashMap<Strategy, Integer>(); + selectedRules = new ArrayList<Strategy>(); + if (imposedStrategyEnabled) { + // short circuits to use the imposed strategy + tallyMap.put(getImposedStrategy(), 1); + selectedRules.add(getImposedStrategy()); + return tallyMap; + } for (ClientData client: clients.values()) { ForagingStrategy rule = client.getVotedRule(); Integer count = tallyMap.get(rule); @@ -777,9 +788,9 @@ } tallyMap.put(rule, count + 1); } - selectedRules = new ArrayList<ForagingStrategy>(); + Integer maxSeenValue = 0; - for (Map.Entry<ForagingStrategy, Integer> entry : tallyMap.entrySet()) { + for (Map.Entry<Strategy, Integer> entry : tallyMap.entrySet()) { Integer currentValue = entry.getValue(); // getLogger().info("rule : " + entry.getKey() + " has a vote value of " + currentValue); @@ -801,12 +812,12 @@ return tallyMap; } - public List<ForagingStrategy> getSelectedRules() { + public List<Strategy> getSelectedRules() { return selectedRules; } - public ForagingStrategy getSelectedRule() { + public Strategy getSelectedRule() { return selectedRules.get(0); } @@ -820,7 +831,7 @@ } public void setImposedStrategy(Strategy imposedStrategy) { - this.imposedStrategy = imposedStrategy; + this.imposedStrategy = imposedStrategy; } } diff -r bbb67c1354864fb3543f0b66a02482908d18d028 -r 78057caab3b65da359093d97d27c9c9b2fcdbe99 src/main/java/edu/asu/commons/foraging/model/ServerDataModel.java --- a/src/main/java/edu/asu/commons/foraging/model/ServerDataModel.java +++ b/src/main/java/edu/asu/commons/foraging/model/ServerDataModel.java @@ -63,6 +63,8 @@ // Maps client Identifiers to the GroupDataModel that the client belongs to private final Map<Identifier, GroupDataModel> clientsToGroups = new HashMap<Identifier, GroupDataModel>(); + private Map<Strategy, Integer> imposedStrategyDistribution; + public ServerDataModel() { super(EventTypeChannel.getInstance()); } @@ -463,24 +465,41 @@ } + public List<GroupDataModel> allocateImposedStrategyDistribution(Map<Strategy, Integer> imposedStrategyDistribution) { - List<GroupDataModel> groups = getOrderedGroups(); - int numberOfGroups = groups.size(); - Collections.shuffle(groups); - Iterator<GroupDataModel> groupIterator = groups.iterator(); - int numberOfStrategies = 0; - for (Map.Entry<Strategy, Integer> entry : imposedStrategyDistribution.entrySet()) { - Strategy strategy = entry.getKey(); - int occurrences = entry.getValue(); - if (numberOfStrategies > numberOfGroups) { - throw new IllegalArgumentException("Invalid number of strategies : " + numberOfStrategies + " for " + numberOfGroups + " groups."); - } - for (int i = 0; i < occurrences; i++) { - GroupDataModel group = groupIterator.next(); - group.setImposedStrategy(strategy); - numberOfStrategies++; - } - } - return groups; + if (imposedStrategyDistribution == null || imposedStrategyDistribution.isEmpty()) { + throw new IllegalArgumentException("No strategy distribution defined. Please create a strategy distribution and try again."); + } + List<GroupDataModel> groups = getOrderedGroups(); + int numberOfGroups = groups.size(); + Collections.shuffle(groups); + Iterator<GroupDataModel> groupIterator = groups.iterator(); + int numberOfStrategies = 0; + for (Map.Entry<Strategy, Integer> entry : imposedStrategyDistribution.entrySet()) { + Strategy strategy = entry.getKey(); + int occurrences = entry.getValue(); + if (numberOfStrategies > numberOfGroups) { + throw new IllegalArgumentException("Invalid number of strategies : " + numberOfStrategies + " for " + numberOfGroups + " groups."); + } + for (int i = 0; i < occurrences; i++) { + GroupDataModel group = groupIterator.next(); + group.setImposedStrategy(strategy); + numberOfStrategies++; + } + } + return groups; } + + public List<GroupDataModel> allocateImposedStrategyDistribution() { + return allocateImposedStrategyDistribution(imposedStrategyDistribution); + } + + public void setImposedStrategyDistribution(Map<Strategy, Integer> strategyDistribution) { + this.imposedStrategyDistribution = strategyDistribution; + } + + public Map<Strategy, Integer> getImposedStrategyDistribution() { + return imposedStrategyDistribution; + } + } diff -r bbb67c1354864fb3543f0b66a02482908d18d028 -r 78057caab3b65da359093d97d27c9c9b2fcdbe99 src/main/java/edu/asu/commons/foraging/rules/iu/ForagingStrategyNomination.java --- a/src/main/java/edu/asu/commons/foraging/rules/iu/ForagingStrategyNomination.java +++ b/src/main/java/edu/asu/commons/foraging/rules/iu/ForagingStrategyNomination.java @@ -1,16 +1,18 @@ package edu.asu.commons.foraging.rules.iu; +import edu.asu.commons.foraging.rules.Strategy; + public class ForagingStrategyNomination { - private final ForagingStrategy strategy; + private final Strategy strategy; private final Integer nominations; private final boolean selected; - public ForagingStrategyNomination(ForagingStrategy strategy, Integer nominations, boolean selected) { + public ForagingStrategyNomination(Strategy strategy, Integer nominations, boolean selected) { this.strategy = strategy; this.nominations = nominations; this.selected = selected; } - public ForagingStrategy getStrategy() { + public Strategy getStrategy() { return strategy; } public Integer getNominations() { diff -r bbb67c1354864fb3543f0b66a02482908d18d028 -r 78057caab3b65da359093d97d27c9c9b2fcdbe99 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 @@ -13,6 +13,7 @@ import java.util.ListIterator; import java.util.Map; import java.util.Set; +import java.util.logging.Level; import edu.asu.commons.event.BeginRoundRequest; import edu.asu.commons.event.ChatEvent; @@ -61,7 +62,8 @@ import edu.asu.commons.foraging.event.RuleSelectedUpdateEvent; import edu.asu.commons.foraging.event.RuleVoteRequest; import edu.asu.commons.foraging.event.SanctionAppliedEvent; -import edu.asu.commons.foraging.event.ShowImposedStrategyRequest; +import edu.asu.commons.foraging.event.SetImposedStrategyEvent; +import edu.asu.commons.foraging.event.ShowVoteScreenRequest; import edu.asu.commons.foraging.event.SurveyIdSubmissionRequest; import edu.asu.commons.foraging.event.SynchronizeClientEvent; import edu.asu.commons.foraging.event.TrustGameResultsFacilitatorEvent; @@ -76,7 +78,7 @@ import edu.asu.commons.foraging.model.ResourceDispenser; import edu.asu.commons.foraging.model.ServerDataModel; import edu.asu.commons.foraging.model.TrustGameResult; -import edu.asu.commons.foraging.rules.iu.ForagingStrategy; +import edu.asu.commons.foraging.rules.Strategy; import edu.asu.commons.foraging.ui.Circle; import edu.asu.commons.net.Dispatcher; import edu.asu.commons.net.Identifier; @@ -102,8 +104,6 @@ public final static int SYNCHRONIZATION_FREQUENCY = 60; public final static int SERVER_SLEEP_INTERVAL = 75; - private Identifier facilitatorId; - // FIXME: investigate using java.util.concurrent constructs instead, e.g., CountDownLatch / CyclicBarrier private final Object roundSignal = new Object(); private final Object quizSignal = new Object(); @@ -253,7 +253,7 @@ clients.put(identifier, new ClientData(identifier)); } // send welcome instructions and experiment configuration - transmit(new SetConfigurationEvent<RoundConfiguration>(identifier, getCurrentRoundConfiguration())); + transmit(new SetConfigurationEvent<ServerConfiguration, RoundConfiguration>(identifier, getCurrentRoundConfiguration())); } }); addEventProcessor(new EventTypeProcessor<DisconnectionRequest>(DisconnectionRequest.class) { @@ -261,7 +261,12 @@ public void handle(DisconnectionRequest event) { synchronized (clients) { Identifier id = event.getId(); - getLogger().warning("Disconnecting client, removing " + id + " from clients " + clients.keySet()); + if (id.equals(getFacilitatorId())) { + getLogger().log(Level.SEVERE, "Disconnecting facilitator.", event.getException()); + } + else { + sendFacilitatorMessage("Received DisconnectionRequest, removing " + id + " from clients " + clients.keySet(), event.getException()); + } clients.remove(id); serverDataModel.removeClient(id); } @@ -281,7 +286,7 @@ public void handle(FacilitatorCensoredChatRequest request) { if (getCurrentRoundConfiguration().isCensoredChat()) { sendFacilitatorMessage("needs approval: " + request); - request.setId(facilitatorId); + request.setId(getFacilitatorId()); transmit(request); } else { @@ -306,7 +311,7 @@ public void handle(final QuizResponseEvent event) { sendFacilitatorMessage("Received quiz response: " + event); numberOfSubmittedQuizzes++; - transmit(new QuizCompletedEvent(facilitatorId, event)); + transmit(new QuizCompletedEvent(getFacilitatorId(), event)); ClientData clientData = clients.get(event.getId()); clientData.addCorrectQuizAnswers(event.getNumberOfCorrectAnswers()); if (numberOfSubmittedQuizzes >= clients.size()) { @@ -333,7 +338,7 @@ transmit(updateEvent); } // update the facilitator - transmit(new FacilitatorSanctionUpdateEvent(facilitatorId, serverDataModel)); + transmit(new FacilitatorSanctionUpdateEvent(getFacilitatorId(), serverDataModel)); Utils.notify(facilitatorSignal); numberOfCompletedSanctions = 0; } @@ -369,7 +374,6 @@ }); addEventProcessor(new EventTypeProcessor<RuleVoteRequest>(RuleVoteRequest.class) { int votesReceived = 0; - @Override public void handle(RuleVoteRequest request) { sendFacilitatorMessage("Received vote rule request: " + request); @@ -377,19 +381,7 @@ client.setVotedRule(request.getRule()); votesReceived++; if (votesReceived >= clients.size()) { - // calculate votes - for (GroupDataModel group : serverDataModel.getGroups()) { - Map<ForagingStrategy, Integer> votingResults = group.generateVotingResults(); - List<ForagingStrategy> selectedRules = group.getSelectedRules(); - for (Identifier id : group.getClientIdentifiers()) { - sendFacilitatorMessage(String.format( - "%s selected [%s] from all rules (%s)", - group, selectedRules, votingResults)); - - transmit(new RuleSelectedUpdateEvent(id, selectedRules, votingResults)); - } - store(new RuleSelectedUpdateEvent(facilitatorId, selectedRules, votingResults)); - } + processNominations(); } } }); @@ -412,6 +404,24 @@ }); } + + private void processNominations() { + boolean imposedStrategyEnabled = getCurrentRoundConfiguration().isImposedStrategyEnabled(); + for (GroupDataModel group : serverDataModel.getGroups()) { + // calculate votes + Map<Strategy, Integer> votingResults = group.generateVotingResults(imposedStrategyEnabled); + List<Strategy> selectedRules = group.getSelectedRules(); + sendFacilitatorMessage(String.format( + "%s selected [%s] from all rules %s (imposed? %s)", + group, selectedRules, votingResults, imposedStrategyEnabled)); + if (! imposedStrategyEnabled) { + for (Identifier id : group.getClientIdentifiers()) { + transmit(new RuleSelectedUpdateEvent(id, group, selectedRules, votingResults)); + } + } + store(new RuleSelectedUpdateEvent(getFacilitatorId(), group, selectedRules, votingResults)); + } + } @Deprecated @SuppressWarnings("unused") @@ -575,8 +585,9 @@ // facilitator handlers addEventProcessor(new EventTypeProcessor<FacilitatorRegistrationRequest>(FacilitatorRegistrationRequest.class) { public void handle(FacilitatorRegistrationRequest event) { - // remap the facilitator ID and remove from the clients list. - facilitatorId = event.getId(); + Identifier facilitatorId = event.getId(); + getLogger().info("Registering facilitator: " + facilitatorId); + setFacilitatorId(event.getId()); synchronized (clients) { clients.remove(facilitatorId); } @@ -585,46 +596,28 @@ addEventProcessor(new EventTypeProcessor<ImposeStrategyEvent>(ImposeStrategyEvent.class) { @Override public void handle(ImposeStrategyEvent event) { - if (! event.getId().equals(facilitatorId)) { + if (! event.getId().equals(getFacilitatorId())) { sendFacilitatorMessage("Ignoring request to impose strategy " + event); return; } + serverDataModel.setImposedStrategyDistribution(event.getStrategyDistribution()); + sendFacilitatorMessage("Setting imposed strategy distribution to " + event.getStrategyDistribution()); persister.store(event); - try { - List<GroupDataModel> groups = serverDataModel.allocateImposedStrategyDistribution(event.getStrategyDistribution()); - StringBuilder builder = new StringBuilder(); - for (GroupDataModel group: groups) { - builder.append('[').append(group).append(':').append(group.getImposedStrategy()).append(']'); - } - sendFacilitatorMessage("Server has imposed strategies for all groups: " + builder); - - } - catch (IllegalArgumentException exception) { - sendFacilitatorMessage("Couldn't allocate strategy distribution: " + event, exception); - } - } - }); - addEventProcessor(new EventTypeProcessor<ShowImposedStrategyRequest>(ShowImposedStrategyRequest.class) { - @Override - public void handle(ShowImposedStrategyRequest request) { - if (! request.getId().equals(facilitatorId)) { - sendFacilitatorMessage("Ignoring request to show imposed strategies from: " + request.getId()); - return; - } - for (Identifier id: clients.keySet()) { - transmit(new ShowImposedStrategyRequest(id, serverDataModel.getGroup(id).getImposedStrategy())); - } - sendFacilitatorMessage("Notified all groups of imposed strategy."); } }); addEventProcessor(new EventTypeProcessor<ShowRequest>(ShowRequest.class, true) { @Override public void handle(ShowRequest request) { // validity checks: request from facilitator? - if (! request.getId().equals(facilitatorId)) { + if (! request.getId().equals(getFacilitatorId())) { sendFacilitatorMessage("Ignoring show request from non facilitator id: " + request.getId()); return; } + // FIXME: bah, more special casing. figure out a better way + // to determine when to send the imposed strategy.. + if (request instanceof ShowVoteScreenRequest && getCurrentRoundConfiguration().isImposedStrategyEnabled()) { + sendImposedStrategy(); + } // if this is a ShowExitInstructionsRequest, is this the last round at least? if (request instanceof ShowExitInstructionsRequest && ! getCurrentRoundConfiguration().isLastRound()) { sendFacilitatorMessage("Ignoring request to show exit instructions, we are not at the last round yet."); @@ -637,7 +630,7 @@ }); addEventProcessor(new EventTypeProcessor<BeginRoundRequest>(BeginRoundRequest.class) { public void handle(BeginRoundRequest event) { - if (event.getId().equals(facilitatorId)) { + if (event.getId().equals(getFacilitatorId())) { if (isReadyToStartRound()) { getLogger().info("Begin round request from facilitator - starting round."); experimentStarted = true; @@ -657,7 +650,7 @@ }); addEventProcessor(new EventTypeProcessor<EndRoundRequest>(EndRoundRequest.class) { public void handle(EndRoundRequest request) { - if (request.getId().equals(facilitatorId)) { + if (request.getId().equals(getFacilitatorId())) { // set current round duration to expire? currentRoundDuration.stop(); } @@ -691,7 +684,7 @@ clientData.setTrustGamePlayerOneAmountToKeep(request.getPlayerOneAmountToKeep()); clientData.setTrustGamePlayerTwoAmountsToKeep(request.getPlayerTwoAmountsToKeep()); persister.store(request); - transmit(new TrustGameSubmissionEvent(facilitatorId, request)); + transmit(new TrustGameSubmissionEvent(getFacilitatorId(), request)); numberOfSubmissions++; sendFacilitatorMessage(String.format("Received trust game submission %s (%d total)", request, numberOfSubmissions)); } @@ -762,7 +755,7 @@ transmit(new ShowExitInstructionsRequest(data.getId(), data.getGroupDataModel())); } } - transmitAndStore(new TrustGameResultsFacilitatorEvent(facilitatorId, serverDataModel, allTrustGameResults)); + transmitAndStore(new TrustGameResultsFacilitatorEvent(getFacilitatorId(), serverDataModel, allTrustGameResults)); Utils.notify(facilitatorSignal); } @@ -855,7 +848,7 @@ // while waiting for connections we must defer group initialization till all clients // are connected (which is unknown, we allow clients to connect until the experiment has started) setupRound(); - sendFacilitatorMessage("Ready to show instructions and the start next round."); + sendFacilitatorMessage("Ready to show instructions and start the next round."); if (getCurrentRoundConfiguration().isQuizEnabled()) { getLogger().info("Waiting for all quizzes to be submitted."); Utils.waitOn(quizSignal); @@ -870,6 +863,23 @@ break; } } + + private void sendImposedStrategy() { + try { + List<GroupDataModel> groups = serverDataModel.allocateImposedStrategyDistribution(); + StringBuilder builder = new StringBuilder(); + for (GroupDataModel group: groups) { + builder.append('[').append(group).append(':').append(group.getImposedStrategy()).append(']'); + for (Identifier id: group.getClientIdentifiers()) { + transmit(new SetImposedStrategyEvent(id, group.getImposedStrategy())); + } + } + sendFacilitatorMessage("Server has imposed strategies for all groups: " + builder); + } + catch (IllegalArgumentException exception) { + sendFacilitatorMessage("Couldn't allocate strategy distribution: " + serverDataModel.getImposedStrategyDistribution(), exception); + } + } private void setupRound() { persister.initialize(getCurrentRoundConfiguration()); @@ -912,9 +922,9 @@ getLogger().info("Advancing to round # " + getConfiguration().getCurrentRoundNumber()); // send the next round configuration to each client for (Identifier id : clients.keySet()) { - transmit(new SetConfigurationEvent<RoundConfiguration>(id, nextRoundConfiguration)); + transmit(new SetConfigurationEvent<ServerConfiguration, RoundConfiguration>(id, nextRoundConfiguration)); } - transmit(new SetConfigurationEvent<RoundConfiguration>(facilitatorId, nextRoundConfiguration)); + transmit(new SetConfigurationEvent<ServerConfiguration, RoundConfiguration>(getFacilitatorId(), nextRoundConfiguration)); } private void processRound() { @@ -978,7 +988,7 @@ } // FIXME: refine this, send basic info to the facilitator (how many resources left, etc.) if (shouldUpdateFacilitator()) { - transmit(new FacilitatorUpdateEvent(facilitatorId, serverDataModel, currentRoundDuration.getTimeLeft())); + transmit(new FacilitatorUpdateEvent(getFacilitatorId(), serverDataModel, currentRoundDuration.getTimeLeft())); } } @@ -990,7 +1000,7 @@ private boolean shouldSynchronize(ClientData data) { long startCount = secondTick.getStartCount(); int assignedNumber = data.getAssignedNumber(); - return (startCount < 2) || ((startCount % SYNCHRONIZATION_FREQUENCY) == (assignedNumber * 10)); + return (startCount == 0) || ((startCount % SYNCHRONIZATION_FREQUENCY) == (assignedNumber * 10)); } private void sendEndRoundEvents() { @@ -998,7 +1008,7 @@ // 1. avg number of tokens collected in this round for the group // 2. total number of tokens collected by this client // 3. number of tokens collected by this client in this round. - transmit(new FacilitatorEndRoundEvent(facilitatorId, serverDataModel)); + transmit(new FacilitatorEndRoundEvent(getFacilitatorId(), serverDataModel)); boolean lastRound = getConfiguration().isLastRound(); for (Map.Entry<Identifier, ClientData> clientDataEntry : clients.entrySet()) { Identifier id = clientDataEntry.getKey(); @@ -1077,7 +1087,7 @@ getLogger().info("monitor rotation interval: " + monitorRotationInterval); } currentRoundDuration.start(); - transmit(new FacilitatorUpdateEvent(facilitatorId, serverDataModel, currentRoundDuration.getTimeLeft())); + transmit(new FacilitatorUpdateEvent(getFacilitatorId(), serverDataModel, currentRoundDuration.getTimeLeft())); secondTick.start(); serverState = ServerState.ROUND_IN_PROGRESS; } diff -r bbb67c1354864fb3543f0b66a02482908d18d028 -r 78057caab3b65da359093d97d27c9c9b2fcdbe99 src/main/java/edu/asu/commons/foraging/ui/GameWindow2D.java --- a/src/main/java/edu/asu/commons/foraging/ui/GameWindow2D.java +++ b/src/main/java/edu/asu/commons/foraging/ui/GameWindow2D.java @@ -57,7 +57,6 @@ import edu.asu.commons.foraging.model.ClientData; import edu.asu.commons.foraging.model.Direction; import edu.asu.commons.foraging.rules.Strategy; -import edu.asu.commons.foraging.rules.iu.ForagingStrategy; import edu.asu.commons.net.Identifier; import edu.asu.commons.ui.HtmlEditorPane; import edu.asu.commons.ui.UserInterfaceUtils; @@ -741,22 +740,27 @@ } public void showVotingScreen() { - if (votingPanel == null) { - votingPanel = new JPanel(); - votingPanel.setLayout(new BoxLayout(votingPanel, BoxLayout.Y_AXIS)); - votingInstructionsEditorPane = UserInterfaceUtils.createInstructionsEditorPane(); - votingInstructionsScrollPane = new JScrollPane(votingInstructionsEditorPane); - votingInstructionsEditorPane.setText(client.getCurrentRoundConfiguration().getVotingInstructions()); - votingPanel.add(votingInstructionsScrollPane); - votingForm = new VotingForm(client); - votingPanel.add(votingForm); - votingPanel.setName(VotingForm.NAME); - add(votingPanel); - } - showPanel(VotingForm.NAME); + SwingUtilities.invokeLater(new Runnable() { + public void run() { + if (votingPanel == null) { + votingPanel = new JPanel(); + votingPanel.setLayout(new BoxLayout(votingPanel, BoxLayout.Y_AXIS)); + votingInstructionsEditorPane = UserInterfaceUtils.createInstructionsEditorPane(); + votingInstructionsScrollPane = new JScrollPane(votingInstructionsEditorPane); + RoundConfiguration configuration = client.getCurrentRoundConfiguration(); + votingInstructionsEditorPane.setText(configuration.getVotingInstructions()); + votingPanel.add(votingInstructionsScrollPane); + votingForm = new VotingForm(client); + votingPanel.add(votingForm); + votingPanel.setName(VotingForm.NAME); + add(votingPanel); + } + showPanel(VotingForm.NAME); + } + }); } - public void showVotingResults(final List<ForagingStrategy> selectedRules, final Map<ForagingStrategy, Integer> votingResults) { + public void showVotingResults(final List<Strategy> selectedRules, final Map<Strategy, Integer> votingResults) { SwingUtilities.invokeLater(new Runnable() { public void run() { votingPanel.removeAll(); @@ -882,18 +886,10 @@ showInstructionsPanel(); } - public void ruleVoteSubmitted() { - setInstructions(dataModel.getRoundConfiguration().getSubmittedVoteInstructions()); + public void strategyNominationSubmitted() { + RoundConfiguration roundConfiguration = dataModel.getRoundConfiguration(); + setInstructions(roundConfiguration.getSubmittedVoteInstructions()); showInstructionsPanel(); } - public void showImposedStrategy(final Strategy strategy) { - SwingUtilities.invokeLater(new Runnable() { - @Override public void run() { - setInstructions(dataModel.getRoundConfiguration().getImposedStrategyInstructions(strategy)); - } - }); - } - - } diff -r bbb67c1354864fb3543f0b66a02482908d18d028 -r 78057caab3b65da359093d97d27c9c9b2fcdbe99 src/main/java/edu/asu/commons/foraging/ui/VotingForm.java --- a/src/main/java/edu/asu/commons/foraging/ui/VotingForm.java +++ b/src/main/java/edu/asu/commons/foraging/ui/VotingForm.java @@ -32,15 +32,21 @@ import javax.swing.WindowConstants; import edu.asu.commons.foraging.client.ForagingClient; +import edu.asu.commons.foraging.rules.Strategy; import edu.asu.commons.foraging.rules.iu.ForagingStrategy; import edu.asu.commons.ui.UserInterfaceUtils; /** * $Id$ + * + * Interface nominate a given ForagingStrategy + * * @author Allen Lee */ public class VotingForm extends JPanel { + private static final int DEFAULT_STRATEGY_GAP_SIZE = 80; + private static final long serialVersionUID = 3871660663519284024L; public final static String NAME = "Strategy voting form"; @@ -48,18 +54,18 @@ private ForagingClient client; public VotingForm(ForagingClient client) { - this(client, new HashMap<ForagingStrategy, Integer>()); + this(client, new HashMap<Strategy, Integer>()); } - public VotingForm(ForagingClient client, Map<ForagingStrategy, Integer> votingResults) { + public VotingForm(ForagingClient client, Map<Strategy, Integer> votingResults) { this.client = client; initComponents(); initForm(votingResults); setName(NAME); } - private void initForm(Map<ForagingStrategy, Integer> votingResults) { - ForagingStrategy[] rules = ForagingStrategy.values(); + private void initForm(Map<Strategy, Integer> votingResults) { + ForagingStrategy[] strategies = ForagingStrategy.values(); JPanel panel = new JPanel(); GroupLayout groupLayout = new GroupLayout(panel); panel.setLayout(groupLayout); @@ -73,7 +79,11 @@ horizontalGroup.addGroup(horizontalButtonParallelGroup); GroupLayout.SequentialGroup verticalGroup = groupLayout.createSequentialGroup(); - String rightColumnHeader = votingResults.isEmpty() ? "Select" : "Nominations"; + boolean imposedStrategyEnabled = (client != null) && client.getCurrentRoundConfiguration().isImposedStrategyEnabled(); + // XXX: this is certainly what Rawlins was warning against + String rightColumnHeader = votingResults.isEmpty() + ? (imposedStrategyEnabled) ? "" : "Select" + : "Nominations"; JLabel rightHeaderLabel = new JLabel(rightColumnHeader); rightHeaderLabel.setFont(UserInterfaceUtils.DEFAULT_BOLD_FONT); horizontalButtonParallelGroup.addComponent(rightHeaderLabel); @@ -83,27 +93,31 @@ horizontalLabelParallelGroup.addComponent(strategyHeaderLabel); verticalGroup.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE).addComponent(strategyHeaderLabel).addGap(20).addComponent(rightHeaderLabel)); - Dimension labelDimension = new Dimension(800, 100); - for (ForagingStrategy rule: rules) { - JLabel ruleLabel = new JLabel("<html>" + rule.getDescription() + "</html>"); + Dimension labelDimension = new Dimension(1000, 100); + + for (ForagingStrategy strategy: strategies) { + JLabel ruleLabel = new JLabel("<html>" + strategy.getDescription() + "</html>"); ruleLabel.setFont(UserInterfaceUtils.DEFAULT_PLAIN_FONT); ruleLabel.setMaximumSize(labelDimension); horizontalLabelParallelGroup.addComponent(ruleLabel); JComponent component = null; - if (votingResults.isEmpty()) { + if (imposedStrategyEnabled) { + component = new JLabel(""); + } + else if (votingResults.isEmpty()) { JRadioButton radioButton = new JRadioButton(); - radioButton.setActionCommand(rule.name()); + radioButton.setActionCommand(strategy.name()); buttonGroup.add(radioButton); component = radioButton; - horizontalButtonParallelGroup.addComponent(radioButton); - verticalGroup.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE).addComponent(ruleLabel).addComponent(radioButton)); +// horizontalButtonParallelGroup.addComponent(radioButton); +// verticalGroup.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE).addComponent(ruleLabel).addComponent(radioButton)); } else { - Integer numberOfVotes = votingResults.get(rule); + Integer numberOfVotes = votingResults.get(strategy); component = new JLabel(String.valueOf(numberOfVotes == null ? 0 : numberOfVotes)); } horizontalButtonParallelGroup.addComponent(component); - verticalGroup.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE).addComponent(ruleLabel).addComponent(component)); + verticalGroup.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE).addComponent(ruleLabel).addGap(DEFAULT_STRATEGY_GAP_SIZE).addComponent(component)); } if (votingResults.isEmpty()) { JButton submitButton = getSubmitButton(); @@ -121,6 +135,10 @@ JButton submitButton = new JButton("Submit"); submitButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { + if (client.getCurrentRoundConfiguration().isImposedStrategyEnabled()) { + client.sendRuleVoteRequest(null); + return; + } ButtonModel model = buttonGroup.getSelection(); if (model == null) { JOptionPane.showMessageDialog(VotingForm.this, "Please select a strategy."); diff -r bbb67c1354864fb3543f0b66a02482908d18d028 -r 78057caab3b65da359093d97d27c9c9b2fcdbe99 src/main/resources/configuration/iu/2011/imposed-punish/round0.xml --- /dev/null +++ b/src/main/resources/configuration/iu/2011/imposed-punish/round0.xml @@ -0,0 +1,103 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"> +<properties> +<comment>Foraging XML-ized experiment round configuration</comment> +<entry key="resource-width">13</entry> +<entry key="resource-depth">13</entry> +<entry key="practice-round">true</entry> +<entry key="private-property">true</entry> +<entry key="duration">240</entry> + +<entry key="quiz">true</entry> +<entry key="q1">C</entry> +<entry key="q2">B</entry> + +<entry key='instructions'> +<![CDATA[ +<h2>Practice Round Instructions</h2> +<hr> +<p> + Once everyone has finished the quiz, we will start a practice round of the token + task. +</p> +<p> + During the practice round, you will have {duration} to practice with the + experimental environment. The decisions you make in this round will NOT + influence your earnings. At the beginning of the practice round + {initialDistri... [truncated message content] |
From: Bitbucket <com...@bi...> - 2012-03-19 23:53:19
|
1 new commit in foraging: https://bitbucket.org/virtualcommons/foraging/changeset/b56c65df661e/ changeset: b56c65df661e user: alllee date: 2012-03-20 00:53:15 summary: merging data processing changes from asu-foraging-2012 into default, replacing facilitator ID with GroupDataModel (that's not present in legacy data) affected #: 2 files diff -r bd870a5665395d74ceddf92845795f604c4dcda1 -r b56c65df661e7cfe14c92ee81016c18236aeb658 src/main/java/edu/asu/commons/foraging/data/AllDataProcessor.java --- a/src/main/java/edu/asu/commons/foraging/data/AllDataProcessor.java +++ b/src/main/java/edu/asu/commons/foraging/data/AllDataProcessor.java @@ -17,6 +17,8 @@ import edu.asu.commons.foraging.event.QuizResponseEvent; import edu.asu.commons.foraging.event.RealTimeSanctionRequest; import edu.asu.commons.foraging.event.ResourcesAddedEvent; +import edu.asu.commons.foraging.event.RuleSelectedUpdateEvent; +import edu.asu.commons.foraging.event.RuleVoteRequest; import edu.asu.commons.foraging.event.TokenCollectedEvent; import edu.asu.commons.foraging.model.ClientData; import edu.asu.commons.foraging.model.GroupDataModel; @@ -141,6 +143,17 @@ String line = String.format("%s, %s", savedRoundData.toSecondString(event), request.toString()); writer.println(line); } + else if (event instanceof RuleVoteRequest) { + RuleVoteRequest request = (RuleVoteRequest) event; + String line = String.format("%s, %s, %s, Strategy Nomination", savedRoundData.toSecondString(event), request.getId(), request.getRule()); + writer.println(line); + } + else if (event instanceof RuleSelectedUpdateEvent) { + RuleSelectedUpdateEvent update = (RuleSelectedUpdateEvent) event; + String line = String.format("%s, %s, \"%s\", \"%s\", Rule selected", + savedRoundData.toSecondString(event), update.getGroup(), update.getSelectedStrategies(), update.getVotingResults()); + writer.println(line); + } else { writer.println(String.format("%s, %s", savedRoundData.toSecondString(event), event.toString())); } 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. |
From: Bitbucket <com...@bi...> - 2012-03-19 21:16:10
|
1 new commit in foraging: https://bitbucket.org/virtualcommons/foraging/changeset/bd870a566539/ changeset: bd870a566539 user: alllee date: 2012-03-19 22:16:04 summary: storing group along with the strategies / results affected #: 2 files diff -r 32416ca0f7224851a587cf05df6ec6f4db522556 -r bd870a5665395d74ceddf92845795f604c4dcda1 src/main/java/edu/asu/commons/foraging/event/RuleSelectedUpdateEvent.java --- a/src/main/java/edu/asu/commons/foraging/event/RuleSelectedUpdateEvent.java +++ b/src/main/java/edu/asu/commons/foraging/event/RuleSelectedUpdateEvent.java @@ -5,6 +5,7 @@ import java.util.Map; import edu.asu.commons.event.AbstractPersistableEvent; +import edu.asu.commons.foraging.model.GroupDataModel; import edu.asu.commons.foraging.rules.Strategy; import edu.asu.commons.net.Identifier; @@ -23,11 +24,13 @@ private static final long serialVersionUID = 4360213814026474451L; private final List<Strategy> selectedStrategies; private final Map<Strategy, Integer> votingResults; + private final GroupDataModel group; - public RuleSelectedUpdateEvent(Identifier id, List<Strategy> selectedStrategies, Map<Strategy, Integer> votingResults) { + public RuleSelectedUpdateEvent(Identifier id, GroupDataModel group, List<Strategy> selectedStrategies, Map<Strategy, Integer> votingResults) { super(id, String.format("Strategies (first is tiebreaker): %s, All nominations: %s", selectedStrategies, votingResults)); this.selectedStrategies = selectedStrategies; this.votingResults = votingResults; + this.group = group; } public Strategy getSelectedRule() { @@ -42,5 +45,12 @@ return votingResults; } + /** + * @return the group + */ + public GroupDataModel getGroup() { + return group; + } + } diff -r 32416ca0f7224851a587cf05df6ec6f4db522556 -r bd870a5665395d74ceddf92845795f604c4dcda1 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 @@ -416,10 +416,10 @@ group, selectedRules, votingResults, imposedStrategyEnabled)); if (! imposedStrategyEnabled) { for (Identifier id : group.getClientIdentifiers()) { - transmit(new RuleSelectedUpdateEvent(id, selectedRules, votingResults)); + transmit(new RuleSelectedUpdateEvent(id, group, selectedRules, votingResults)); } } - store(new RuleSelectedUpdateEvent(getFacilitatorId(), selectedRules, votingResults)); + store(new RuleSelectedUpdateEvent(getFacilitatorId(), group, selectedRules, votingResults)); } } 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. |
From: Bitbucket <com...@bi...> - 2012-03-19 20:56:37
|
1 new commit in foraging: https://bitbucket.org/virtualcommons/foraging/changeset/bb81663c5b40/ changeset: bb81663c5b40 branch: asu-foraging-2012 user: alllee date: 2012-03-19 21:56:32 summary: preliminary strategy nomination data conversion affected #: 1 file diff -r 778cb995bf1154680a88c39587cd40e65e8e67ef -r bb81663c5b40d9ec1833f93fd51e133834f49aeb src/main/java/edu/asu/commons/foraging/data/AllDataProcessor.java --- a/src/main/java/edu/asu/commons/foraging/data/AllDataProcessor.java +++ b/src/main/java/edu/asu/commons/foraging/data/AllDataProcessor.java @@ -17,6 +17,8 @@ import edu.asu.commons.foraging.event.QuizResponseEvent; import edu.asu.commons.foraging.event.RealTimeSanctionRequest; import edu.asu.commons.foraging.event.ResourcesAddedEvent; +import edu.asu.commons.foraging.event.RuleSelectedUpdateEvent; +import edu.asu.commons.foraging.event.RuleVoteRequest; import edu.asu.commons.foraging.event.TokenCollectedEvent; import edu.asu.commons.foraging.model.ClientData; import edu.asu.commons.foraging.model.GroupDataModel; @@ -141,6 +143,17 @@ String line = String.format("%s, %s", savedRoundData.toSecondString(event), request.toString()); writer.println(line); } + else if (event instanceof RuleVoteRequest) { + RuleVoteRequest request = (RuleVoteRequest) event; + String line = String.format("%s, %s, %s, Strategy Nomination", savedRoundData.toSecondString(event), request.getId(), request.getRule()); + writer.println(line); + } + else if (event instanceof RuleSelectedUpdateEvent) { + RuleSelectedUpdateEvent update = (RuleSelectedUpdateEvent) event; + String line = String.format("%s, %s, \"%s\", \"%s\", Rule selected", + savedRoundData.toSecondString(event), update.getId(), update.getSelectedStrategies(), update.getVotingResults()); + writer.println(line); + } else { writer.println(String.format("%s, %s", savedRoundData.toSecondString(event), event.toString())); } 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. |
From: Bitbucket <com...@bi...> - 2012-03-19 20:09:44
|
1 new commit in foraging: https://bitbucket.org/virtualcommons/foraging/changeset/32416ca0f722/ changeset: 32416ca0f722 user: alllee date: 2012-03-19 21:09:38 summary: removing incorrectly overridden voting-instructions template from imposed-punish round4.xml affected #: 3 files diff -r b201f24e3dba4671bfd907673506e8c78bbc2e97 -r 32416ca0f7224851a587cf05df6ec6f4db522556 src/main/resources/configuration/iu/2011/imposed-punish/round4.xml --- a/src/main/resources/configuration/iu/2011/imposed-punish/round4.xml +++ b/src/main/resources/configuration/iu/2011/imposed-punish/round4.xml @@ -63,28 +63,6 @@ <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.</p> ]]></entry> - - - -<entry key='voting-instructions'> -<![CDATA[ -<h1>Strategy Nomination Instructions</h1> -<hr> -<p> -To nominate a strategy, click the radio button that is to the right of the one you choose; then click "submit". The computer will tally the nominations and then report the -results on the next screen. The results will be presented to each person in -your group. -</p> -<h2>Your selection will be anonymous</h2> -<hr> -<p> -The identity of people who nominated a particular strategy will NOT be revealed. -Therefore, neither you nor the experimenter will know who nominated a particular -strategy. -</p> -]]> -</entry> - <entry key='external-survey-enabled'>true</entry><entry key='survey-url'><![CDATA[https://qtrial.qualtrics.com/SE/?SID=SV_3jHrnndEZSM9cqM&SURVEY_ID={surveyId}]]> diff -r b201f24e3dba4671bfd907673506e8c78bbc2e97 -r 32416ca0f7224851a587cf05df6ec6f4db522556 src/main/resources/configuration/iu/2011/imposed-punish/server.xml --- a/src/main/resources/configuration/iu/2011/imposed-punish/server.xml +++ b/src/main/resources/configuration/iu/2011/imposed-punish/server.xml @@ -312,6 +312,7 @@ <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. </p> + <br><br> ]]></entry><entry key='waiting-room-instructions'> @@ -333,7 +334,7 @@ strategies. </p><p><b>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. </p> - + <br><br> {else} <h1>Strategy Nomination Instructions</h1><hr> diff -r b201f24e3dba4671bfd907673506e8c78bbc2e97 -r 32416ca0f7224851a587cf05df6ec6f4db522556 src/main/resources/configuration/iu/2011/imposed/server.xml --- a/src/main/resources/configuration/iu/2011/imposed/server.xml +++ b/src/main/resources/configuration/iu/2011/imposed/server.xml @@ -333,7 +333,7 @@ strategies. </p><p><b>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. </p> - + <br><br> {else} <h1>Strategy Nomination Instructions</h1><hr> 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. |
From: A L. <iss...@bi...> - 2012-03-17 06:24:16
|
--- you can reply above this line --- New issue 37: email notifications https://bitbucket.org/virtualcommons/vcweb/issue/37/email-notifications A Lee / alllee on Sat, 17 Mar 2012 07:24:10 +0100: Description: Set up email notifications for: # experiment started when you are a participant # account creation / password reset? # in-experiment notifications (still need use cases) Responsible: kushal179 -- This is an issue notification from bitbucket.org. You are receiving this either because you are the owner of the issue, or you are following the issue. |
From: Bitbucket <com...@bi...> - 2012-03-08 00:17:11
|
1 new commit in foraging: https://bitbucket.org/virtualcommons/foraging/changeset/b201f24e3dba/ changeset: b201f24e3dba user: alllee date: 2012-03-08 01:17:10 summary: fixing gap size between strategies affected #: 1 file diff -r aacbab9ce97f6c0c6a47f509adbfbb557466701f -r b201f24e3dba4671bfd907673506e8c78bbc2e97 src/main/java/edu/asu/commons/foraging/ui/VotingForm.java --- a/src/main/java/edu/asu/commons/foraging/ui/VotingForm.java +++ b/src/main/java/edu/asu/commons/foraging/ui/VotingForm.java @@ -45,6 +45,8 @@ */ public class VotingForm extends JPanel { + private static final int DEFAULT_STRATEGY_GAP_SIZE = 80; + private static final long serialVersionUID = 3871660663519284024L; public final static String NAME = "Strategy voting form"; @@ -77,7 +79,7 @@ horizontalGroup.addGroup(horizontalButtonParallelGroup); GroupLayout.SequentialGroup verticalGroup = groupLayout.createSequentialGroup(); - boolean imposedStrategyEnabled = client.getCurrentRoundConfiguration().isImposedStrategyEnabled(); + boolean imposedStrategyEnabled = (client != null) && client.getCurrentRoundConfiguration().isImposedStrategyEnabled(); // XXX: this is certainly what Rawlins was warning against String rightColumnHeader = votingResults.isEmpty() ? (imposedStrategyEnabled) ? "" : "Select" @@ -91,7 +93,7 @@ horizontalLabelParallelGroup.addComponent(strategyHeaderLabel); verticalGroup.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE).addComponent(strategyHeaderLabel).addGap(20).addComponent(rightHeaderLabel)); - Dimension labelDimension = new Dimension(800, 100); + Dimension labelDimension = new Dimension(1000, 100); for (ForagingStrategy strategy: strategies) { JLabel ruleLabel = new JLabel("<html>" + strategy.getDescription() + "</html>"); @@ -115,7 +117,7 @@ component = new JLabel(String.valueOf(numberOfVotes == null ? 0 : numberOfVotes)); } horizontalButtonParallelGroup.addComponent(component); - verticalGroup.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE).addComponent(ruleLabel).addComponent(component)); + verticalGroup.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE).addComponent(ruleLabel).addGap(DEFAULT_STRATEGY_GAP_SIZE).addComponent(component)); } if (votingResults.isEmpty()) { JButton submitButton = getSubmitButton(); 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. |
From: Bitbucket <com...@bi...> - 2012-03-07 23:58:22
|
1 new commit in irrigation: https://bitbucket.org/virtualcommons/irrigation/changeset/608c5d7d8e8c/ changeset: 608c5d7d8e8c user: alllee date: 2012-03-08 00:58:23 summary: fixes issue 17 and changing server / round configurations to reflect upstream csidex changes affected #: 4 files diff -r dcb346d0714e129304d5358999e9fe4d4fcd46e4 -r 608c5d7d8e8c73b32edca6913a2b5306d557cf59 src/main/java/edu/asu/commons/irrigation/conf/RoundConfiguration.java --- a/src/main/java/edu/asu/commons/irrigation/conf/RoundConfiguration.java +++ b/src/main/java/edu/asu/commons/irrigation/conf/RoundConfiguration.java @@ -19,7 +19,7 @@ * @author <a href='mailto:All...@as...'>Allen Lee</a> * @version $Rev$ */ -public class RoundConfiguration extends ExperimentRoundParameters.Base<ServerConfiguration> { +public class RoundConfiguration extends ExperimentRoundParameters.Base<ServerConfiguration, RoundConfiguration> { private static final long serialVersionUID = -5053624886508752562L; private String specialInstructions; diff -r dcb346d0714e129304d5358999e9fe4d4fcd46e4 -r 608c5d7d8e8c73b32edca6913a2b5306d557cf59 src/main/java/edu/asu/commons/irrigation/conf/ServerConfiguration.java --- a/src/main/java/edu/asu/commons/irrigation/conf/ServerConfiguration.java +++ b/src/main/java/edu/asu/commons/irrigation/conf/ServerConfiguration.java @@ -18,7 +18,7 @@ * @author <a href='mailto:All...@as...'>Allen Lee</a> * @version $Revision$ */ -public class ServerConfiguration extends ExperimentConfiguration.Base<RoundConfiguration> { +public class ServerConfiguration extends ExperimentConfiguration.Base<ServerConfiguration, RoundConfiguration> { private static final double DEFAULT_QUIZ_CORRECT_ANSWER_REWARD = 0.50d; diff -r dcb346d0714e129304d5358999e9fe4d4fcd46e4 -r 608c5d7d8e8c73b32edca6913a2b5306d557cf59 src/main/java/edu/asu/commons/irrigation/server/IrrigationServer.java --- a/src/main/java/edu/asu/commons/irrigation/server/IrrigationServer.java +++ b/src/main/java/edu/asu/commons/irrigation/server/IrrigationServer.java @@ -271,7 +271,7 @@ } }); addEventProcessor(new EventTypeProcessor<QuizResponseEvent>(QuizResponseEvent.class) { - private int numberOfCompletedQuizzes = 0; + private volatile int numberOfCompletedQuizzes = 0; @Override public void handle(QuizResponseEvent quizResponseEvent) { sendFacilitatorMessage("Received quiz response: " + quizResponseEvent); diff -r dcb346d0714e129304d5358999e9fe4d4fcd46e4 -r 608c5d7d8e8c73b32edca6913a2b5306d557cf59 src/main/resources/configuration/asu/2011/pretest/irrigation.xml --- a/src/main/resources/configuration/asu/2011/pretest/irrigation.xml +++ b/src/main/resources/configuration/asu/2011/pretest/irrigation.xml @@ -68,7 +68,7 @@ <hr><p> You have already earned {showUpPayment} dollars by showing up for this exercise. You -can earn more, up to a maximum of about 25 dollars, by participating in this +can earn more, up to a maximum of about 45 dollars, by participating in this experiment which will take about an hour to an hour and a half. The amount of money you earn depends on your decisions AND the decisions of other people in this room over the course of the experiment. @@ -152,30 +152,31 @@ <entry key="quiz-instructions"><![CDATA[ +<h2>Quiz</h2> +<hr><p> The first two questions deal with irrigation infrastructure investment. <b>Please refer to Table 1 of your handout</b>. </p><form> -Question 1:<br> +<p>Question 1:<br> Given an existing infrastructure efficiency of 20%, if the five participants invest a <b>total of 29 additional tokens</b>, what is the new irrigation infrastructure efficiency?<br><input type="text" name="q1" value = "">% -<br><br> - -Question 2:<br> +</p> +<p>Question 2:<br> Suppose the infrastructure efficiency in the last round was 60%. For the current round, the efficiency will decline by an amount of 25% for a resulting infrastructure efficiency of 35%. If the members of your group invest a total of 15 tokens, what will be your group's resulting water delivery capacity?<br> - <input type="text" name="q2" value = ""> cubic feet per second -<br><br> - -<b>The next two questions deal with the capacity of the irrigation system in relation -to the actual amount of water available.</b> -<br><br> +</p> +<p> +The next two questions deal with the capacity of the irrigation system in relation +to the actual amount of water available. +</p> +<p> Question 3:<br> If the irrigation efficiency is between 71 and 80%, the water delivery capacity of the irrigation system is 35 cubic feet per second. Suppose the water supply @@ -184,30 +185,29 @@ B? <br><input type='text' name='q3' value=''> cubic feet per second -<br><br> -Question 4: +</p> +<p>Question 4:<br> If the available water delivery capacity is 25 cubic feet per second and A, B, C, and D are not using water, how much cubic feet of water per second is available for E?<br><input type='text' name='q4' value=''> cubic feet per second -<br><br> +</p><p> The final two questions cover the number of tokens you can earn in within a round. -<b>Please refer to table 2 of your handout</b>. +<b>Please refer to Table 2 of your handout</b>. </p> -Question 5:<br> +<p>Question 5:<br> If you invest 7 of the 10 tokens you start with and you apply 202 cubic feet of water to your fields, what is the total number of tokens you will have earned at the end of the round?<br><input type="text" name="q5" value="">tokens -<br><br> -Question 6:<br> +</p> +<p>Question 6:<br> If you invest all 10 tokens you start with and you apply 555 cubic feet of water to your fields, what is the total number of tokens you will have earned at the end of the round?<br><input type="text" name="q6" value="">tokens -<br><br> - +</p><input type="submit" name="submit" value="Submit"><br></form> ]]> @@ -506,72 +506,58 @@ incorrectly are highlighted in red. Please see below for more details. {endif} </p> - <br> - <hr> - <span class='q1'>Question 1:</span><br> + <hr> + <p><span class='q1'>Question 1:</span><br> Given an existing infrastructure efficiency of 20%, if the five participants invest a <b>total of 29 additional tokens</b>, what is the new irrigation infrastructure efficiency? <br><b>{incorrect_q1} - An existing infrastructure efficiency of 20% + 29 tokens invested = 49% infrastructure efficiency. - </b> - <br> - - <span class='q2'>Question 2:</span><br> - Suppose the infrastructure efficiency in the last round was 60%. For the current - round, the efficiency will decline by an amount of 25% for a resulting - infrastructure efficiency of 35%. If the members of your group invest a total of 15 - tokens, what will be your group's resulting water delivery capacity?<br> + An existing infrastructure efficiency of 20% + 29 tokens invested = 49% infrastructure efficiency.</b> + </p> + <p><span class='q2'>Question 2:</span><br> + Suppose the infrastructure efficiency in the last round was 60%. For the current + round, the efficiency will decline by an amount of 25% for a resulting + infrastructure efficiency of 35%. If the members of your group invest a total of 15 + tokens, what will be your group's resulting water delivery capacity?<br><b>{incorrect_q2} An existing infrastructure efficiency of 35% + 15 tokens invested = 50% infrastructure efficiency for the current round. An infrastructure efficiency of 50% corresponds to a water delivery capacity of 5 cubic feet per second.</b> - <br><br><br> - -<b>The next two questions deal with the capacity of the irrigation system in relation -to the actual amount of water available.</b> -<br><br> - <span class='q3'>Question 3:</span><br> + </p> + <p><span class='q3'>Question 3:</span><br> If the irrigation efficiency is between 71 and 80%, the water delivery capacity of the irrigation system is 35 cubic feet per second. Suppose the water supply available to your group is 30 cubic feet per second and A opens their gate, diverting water at 25 cubic feet per second. What is the available water flow for - B? - <br> - <b>{incorrect_q3} - Since there is only 30 cubic feet per second of water available, the irrigation infrastructure capacity of 35 cubic feet - per second will not be fully used. When A opens their gate, they take 25 of the 30 cubic feet per second out of the - canal, leaving 5 cubic feet per second for B. - </b> - <br><br><br> - <span class='q4'>Question 4:</span><br> - If the available water delivery capacity is 25 cubic feet per second and A, B, C, - and D are not using water, how much cubic feet of water per second is available for - E?<br> + B?<br> + <b>{incorrect_q3} + Since there is only 30 cubic feet per second of water available, the irrigation infrastructure capacity of 35 cubic feet + per second will not be fully used. When A opens their gate, they take 25 of the 30 cubic feet per second out of the + canal, leaving 5 cubic feet per second for B.</b> + </p> + <p><span class='q4'>Question 4:</span><br> + If the available water delivery capacity is 25 cubic feet per second and A, B, C, and D are not using water, how much cubic feet of water per second is available for E?<br><b>{incorrect_q4} If A has 25 cfps available and does not take any water, the same amount is available for the people downstream. Since B, C and D do not take water, 25 cfps is available for E. </b> - <br><br> -<p> -The final two questions cover the number of tokens you can earn in within a round. -<b>Please refer to table 2 of your handout</b>. -</p> -<span class='q5'>Question 5:</span><br> -If you invest 7 of the 10 tokens you start with and you apply 202 cubic feet of -water to your fields, what is the total number of tokens you will have earned at the -end of the round?<br> - <b>{incorrect_q5} - If you invest 7 out of 10 tokens, you keep 3 tokens for yourself. If you apply 202 cubic feet of water to your field you will earn 4 tokens. 3 + 4 = 7 tokens</b> - <br><br> -<span class='q6'>Question 6:</span><br> -If you invest all 10 tokens you start with and you apply 555 cubic feet of water to -your fields, what is the total number of tokens you will have earned at the end of -the round?<br> -<br> - <b>{incorrect_q6} - If you invest all 10 tokens, you keep 0 tokens from your initial endowment. If you apply 555 cubic feet of - water to your field you will earn 19 tokens. 0 + 19 = 19 tokens. - </b> + </p> + <p> + <span class='q5'>Question 5:</span><br> + If you invest 7 of the 10 tokens you start with and you apply 202 cubic feet of + water to your fields, what is the total number of tokens you will have earned at the + end of the round?<br> + <b>{incorrect_q5} + If you invest 7 out of 10 tokens, you keep 3 tokens for yourself. If you apply 202 cubic feet of water to your field you will earn 4 tokens. 3 + 4 = 7 tokens</b> + </p> + <p><span class='q6'>Question 6:</span><br> + If you invest all 10 tokens you start with and you apply 555 cubic feet of water to + your fields, what is the total number of tokens you will have earned at the end of + the round?<br> + <b>{incorrect_q6} + If you invest all 10 tokens, you keep 0 tokens from your initial endowment. If you apply 555 cubic feet of + water to your field you will earn 19 tokens. 0 + 19 = 19 tokens. + </b> + </p> ]]></entry></properties> Repository URL: https://bitbucket.org/virtualcommons/irrigation/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. |
From: Bitbucket <com...@bi...> - 2012-03-07 23:35:39
|
1 new commit in foraging: https://bitbucket.org/virtualcommons/foraging/changeset/aacbab9ce97f/ changeset: aacbab9ce97f user: alllee date: 2012-03-08 00:11:26 summary: conforming with upstream csidex API changes, removing setter protection from GroupDataModel affected #: 5 files diff -r 7fb3d9c088469392fd84733fbd2e5b45afcc97a8 -r aacbab9ce97f6c0c6a47f509adbfbb557466701f 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 @@ -43,7 +43,7 @@ * @author <a href='mailto:All...@as...'>Allen Lee</a> * @version $Rev: 534 $ */ -public class RoundConfiguration extends ExperimentRoundParameters.Base<ServerConfiguration> { +public class RoundConfiguration extends ExperimentRoundParameters.Base<ServerConfiguration, RoundConfiguration> { private static final long serialVersionUID = 8575239803733029326L; diff -r 7fb3d9c088469392fd84733fbd2e5b45afcc97a8 -r aacbab9ce97f6c0c6a47f509adbfbb557466701f 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 @@ -24,7 +24,7 @@ * @see * @version $Revision$ */ -public class ServerConfiguration extends ExperimentConfiguration.Base<RoundConfiguration> { +public class ServerConfiguration extends ExperimentConfiguration.Base<ServerConfiguration, RoundConfiguration> { private static final long serialVersionUID = -1737412253553943902L; diff -r 7fb3d9c088469392fd84733fbd2e5b45afcc97a8 -r aacbab9ce97f6c0c6a47f509adbfbb557466701f 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 @@ -183,7 +183,7 @@ * Send a request to set the configuration object */ public void sendSetConfigRequest() { - transmit(new ConfigurationEvent<ServerConfiguration>(getId(), getServerConfiguration())); + transmit(new ConfigurationEvent<ServerConfiguration, RoundConfiguration>(getId(), getServerConfiguration())); } public FacilitatorWindow getFacilitatorWindow() { diff -r 7fb3d9c088469392fd84733fbd2e5b45afcc97a8 -r aacbab9ce97f6c0c6a47f509adbfbb557466701f 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 @@ -831,10 +831,7 @@ } public void setImposedStrategy(Strategy imposedStrategy) { - // XXX: defensive set, don't override an already imposed strategy. - if (this.imposedStrategy == null) { - this.imposedStrategy = imposedStrategy; - } + this.imposedStrategy = imposedStrategy; } } diff -r 7fb3d9c088469392fd84733fbd2e5b45afcc97a8 -r aacbab9ce97f6c0c6a47f509adbfbb557466701f 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 @@ -253,7 +253,7 @@ clients.put(identifier, new ClientData(identifier)); } // send welcome instructions and experiment configuration - transmit(new SetConfigurationEvent<RoundConfiguration>(identifier, getCurrentRoundConfiguration())); + transmit(new SetConfigurationEvent<ServerConfiguration, RoundConfiguration>(identifier, getCurrentRoundConfiguration())); } }); addEventProcessor(new EventTypeProcessor<DisconnectionRequest>(DisconnectionRequest.class) { @@ -922,9 +922,9 @@ getLogger().info("Advancing to round # " + getConfiguration().getCurrentRoundNumber()); // send the next round configuration to each client for (Identifier id : clients.keySet()) { - transmit(new SetConfigurationEvent<RoundConfiguration>(id, nextRoundConfiguration)); + transmit(new SetConfigurationEvent<ServerConfiguration, RoundConfiguration>(id, nextRoundConfiguration)); } - transmit(new SetConfigurationEvent<RoundConfiguration>(getFacilitatorId(), nextRoundConfiguration)); + transmit(new SetConfigurationEvent<ServerConfiguration, RoundConfiguration>(getFacilitatorId(), nextRoundConfiguration)); } private void processRound() { 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. |
From: Bitbucket <com...@bi...> - 2012-03-07 08:52:55
|
1 new commit in foraging: https://bitbucket.org/virtualcommons/foraging/changeset/7fb3d9c08846/ changeset: 7fb3d9c08846 user: alllee date: 2012-03-07 09:52:52 summary: updating imposed strategy instructions affected #: 3 files diff -r d572fcd98734afe5bf746264acab8c548bd1f71d -r 7fb3d9c088469392fd84733fbd2e5b45afcc97a8 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 @@ -735,7 +735,6 @@ ST template = createStringTemplate(getVotingResultsTemplate()); template.add("nominations", sortedNominations); template.add("tiebreaker", selectedRules.size() > 1); - template.add("selectedRules", selectedRules); return template.render(); } diff -r d572fcd98734afe5bf746264acab8c548bd1f71d -r 7fb3d9c088469392fd84733fbd2e5b45afcc97a8 src/main/resources/configuration/iu/2011/imposed-punish/server.xml --- a/src/main/resources/configuration/iu/2011/imposed-punish/server.xml +++ b/src/main/resources/configuration/iu/2011/imposed-punish/server.xml @@ -274,7 +274,7 @@ {if (tiebreaker)} <p><b>NOTE:</b> There was a tie and the selected strategy listed here was randomly selected as the winner.</p> {endif} - <p><b> {first(selectedRules)} </b></p> + <p><b> {first(self.selectedRules)} </b></p> ]]></entry> @@ -326,14 +326,14 @@ {if (self.imposedStrategyEnabled)} <h1>Strategies</h1><hr> - <p>You now have the opportunity to consider {self.foragingStrategies.size} - possible strategies for managing how you and the other members of your group - collect tokens for the rest of the experiment. + <p>Below is a list of {self.foragingStrategies.size} strategies, or options, for managing how you and the other + members of your group collect tokens for the rest of the experiment. + <p> + Please read and consider the list of options carefully. Press "Submit" once you have finished reviewing the + strategies. </p> - <p> - Below is the list of different strategies. Please read the list carefully. - Press "Submit" once you have finished reviewing the strategies. - </p> + <p><b>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. </p> + {else} <h1>Strategy Nomination Instructions</h1><hr> @@ -357,8 +357,11 @@ {if (self.imposedStrategyEnabled)} <h1>The Assigned Strategy</h1><hr> - <p>Your group has been assigned the following strategy. Every member in your group is being notified of the same strategy.</p> + <p>Your group has been assigned the following strategy. Every member of your group is being notified of the same strategy.</p><p><b> {first(self.selectedRules)} </b></p> + <h2>Implementation</h2> + <hr> + <p>Neither the computer nor the experimenter will intervene to implement the strategy. </p> {else} <h1>Submitted</h1> diff -r d572fcd98734afe5bf746264acab8c548bd1f71d -r 7fb3d9c088469392fd84733fbd2e5b45afcc97a8 src/main/resources/configuration/iu/2011/imposed/server.xml --- a/src/main/resources/configuration/iu/2011/imposed/server.xml +++ b/src/main/resources/configuration/iu/2011/imposed/server.xml @@ -274,18 +274,10 @@ {if (tiebreaker)} <p><b>NOTE:</b> There was a tie and the selected strategy listed here was randomly selected as the winner.</p> {endif} - <p><b> {first(selectedStrategies)} </b></p> - <h2>Implementation</h2> - <hr> - <p> - Neither the computer, nor the experimenter will intervene to implement the - strategy. - </p> - <p><b>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. - </p> + <p><b> {first(self.selectedRules)} </b></p> ]]></entry> + <entry key='initial-voting-instructions'><![CDATA[ <h1>Important New Instructions!</h1> @@ -329,20 +321,19 @@ <p>Please wait while the other participants complete their tasks.</p> ]]></entry> - <entry key='voting-instructions'><![CDATA[ {if (self.imposedStrategyEnabled)} <h1>Strategies</h1><hr> - <p>You now have the opportunity to consider {self.foragingStrategies.size} - possible strategies for managing how you and the other members of your group - collect tokens for the rest of the experiment. + <p>Below is a list of {self.foragingStrategies.size} strategies, or options, for managing how you and the other + members of your group collect tokens for the rest of the experiment. + <p> + Please read and consider the list of options carefully. Press "Submit" once you have finished reviewing the + strategies. </p> - <p> - Below is the list of different strategies. Please read the list carefully. - Press "Submit" once you have finished reviewing the strategies. - </p> + <p><b>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. </p> + {else} <h1>Strategy Nomination Instructions</h1><hr> @@ -361,14 +352,16 @@ {endif} ]]></entry> - <entry key='submitted-vote-instructions'><![CDATA[ {if (self.imposedStrategyEnabled)} <h1>The Assigned Strategy</h1><hr> - <p>Your group has been assigned the following strategy. Every member in your group is being notified of the same strategy.</p> + <p>Your group has been assigned the following strategy. Every member of your group is being notified of the same strategy.</p><p><b> {first(self.selectedRules)} </b></p> + <h2>Implementation</h2> + <hr> + <p>Neither the computer nor the experimenter will intervene to implement the strategy. </p> {else} <h1>Submitted</h1> 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. |
From: Bitbucket <com...@bi...> - 2012-03-07 00:08:32
|
1 new commit in irrigation: https://bitbucket.org/virtualcommons/irrigation/changeset/dcb346d0714e/ changeset: dcb346d0714e user: alllee date: 2012-03-07 01:08:27 summary: fixing missing <br>, formatting on quiz results could use more improvement affected #: 1 file diff -r 1a1ec2be7895e7f6db071889bb7731a5a4a28dd9 -r dcb346d0714e129304d5358999e9fe4d4fcd46e4 src/main/resources/configuration/asu/2011/pretest/irrigation.xml --- a/src/main/resources/configuration/asu/2011/pretest/irrigation.xml +++ b/src/main/resources/configuration/asu/2011/pretest/irrigation.xml @@ -543,7 +543,7 @@ canal, leaving 5 cubic feet per second for B. </b><br><br><br> - <span class='q4'>Question 4:</span> + <span class='q4'>Question 4:</span><br> If the available water delivery capacity is 25 cubic feet per second and A, B, C, and D are not using water, how much cubic feet of water per second is available for E?<br> Repository URL: https://bitbucket.org/virtualcommons/irrigation/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. |
From: Bitbucket <com...@bi...> - 2012-03-06 09:05:45
|
1 new commit in irrigation: https://bitbucket.org/virtualcommons/irrigation/changeset/1a1ec2be7895/ changeset: 1a1ec2be7895 user: alllee date: 2012-03-06 10:05:27 summary: fixing quiz results template and ui logic affected #: 3 files diff -r 700d1fb9a777ba42e02112205788113ce7a0604b -r 1a1ec2be7895e7f6db071889bb7731a5a4a28dd9 src/main/java/edu/asu/commons/irrigation/client/ExperimentGameWindow.java --- a/src/main/java/edu/asu/commons/irrigation/client/ExperimentGameWindow.java +++ b/src/main/java/edu/asu/commons/irrigation/client/ExperimentGameWindow.java @@ -10,6 +10,7 @@ import java.awt.event.KeyAdapter; import java.awt.event.KeyEvent; import java.util.ArrayList; +import java.util.Collections; import java.util.List; import java.util.Map; import java.util.Properties; @@ -270,19 +271,31 @@ public synchronized void actionPerformed(ActionEvent e) { FormActionEvent formEvent = (FormActionEvent) e; Properties actualAnswers = formEvent.getData(); + System.err.println("actual answers: " + actualAnswers); List<String> incorrectQuestionNumbers = new ArrayList<String>(); List<String> correctQuestionNumbers = new ArrayList<String>(); + List<String> missingQuestions = new ArrayList<String>(); for (Map.Entry<String, String> entry : quizAnswers.entrySet()) { String questionNumber = entry.getKey(); String number = questionNumber.substring(1); String correctAnswer = entry.getValue(); String actualAnswer = actualAnswers.getProperty(questionNumber); - if (actualAnswer == null) { - JOptionPane.showMessageDialog(ExperimentGameWindow.this, "Please enter a quiz answer for question " + number + "."); - return; + if (actualAnswer == null || actualAnswer.trim().isEmpty()) { + missingQuestions.add(number); + continue; } ((correctAnswer.equals(actualAnswer)) ? correctQuestionNumbers : incorrectQuestionNumbers).add(questionNumber); } + int numberOfMissingQuestions = missingQuestions.size(); + if (numberOfMissingQuestions > 0) { + Collections.sort(missingQuestions); + JOptionPane.showMessageDialog(ExperimentGameWindow.this, "Please enter a quiz answer for questions " + missingQuestions); + return; + } + else if (numberOfMissingQuestions == 1) { + JOptionPane.showMessageDialog(ExperimentGameWindow.this, "Please enter a quiz answer for question " + missingQuestions.get(0)); + return; + } setQuestionColors(correctQuestionNumbers, "blue"); setQuestionColors(incorrectQuestionNumbers, "red"); QuizResponseEvent event = new QuizResponseEvent(client.getId(), actualAnswers, incorrectQuestionNumbers); diff -r 700d1fb9a777ba42e02112205788113ce7a0604b -r 1a1ec2be7895e7f6db071889bb7731a5a4a28dd9 src/main/java/edu/asu/commons/irrigation/conf/ServerConfiguration.java --- a/src/main/java/edu/asu/commons/irrigation/conf/ServerConfiguration.java +++ b/src/main/java/edu/asu/commons/irrigation/conf/ServerConfiguration.java @@ -157,11 +157,6 @@ String key = "q" + i; String answer = properties.getProperty(key); answers.put(key, answer); - String quizExplanationKey = "explanation" + i; - String quizExplanation = properties.getProperty(quizExplanationKey); - answers.put(quizExplanationKey, quizExplanation); - String descriptiveAnswerKey = "a" + i; - answers.put(descriptiveAnswerKey, properties.getProperty(descriptiveAnswerKey)); } return answers; } @@ -191,7 +186,7 @@ } public int getChatDuration() { - return getIntProperty("chat-duration", 60); + return getIntProperty("chat-duration", 5); } public String getGameScreenshotInstructions() { diff -r 700d1fb9a777ba42e02112205788113ce7a0604b -r 1a1ec2be7895e7f6db071889bb7731a5a4a28dd9 src/main/resources/configuration/asu/2011/pretest/irrigation.xml --- a/src/main/resources/configuration/asu/2011/pretest/irrigation.xml +++ b/src/main/resources/configuration/asu/2011/pretest/irrigation.xml @@ -195,7 +195,6 @@ The final two questions cover the number of tokens you can earn in within a round. <b>Please refer to table 2 of your handout</b>. </p> -<form> Question 5:<br> If you invest 7 of the 10 tokens you start with and you apply 202 cubic feet of water to your fields, what is the total number of tokens you will have earned at the @@ -210,7 +209,7 @@ <br><br><input type="submit" name="submit" value="Submit"><br> -<br> +</form> ]]></entry> @@ -562,9 +561,8 @@ water to your fields, what is the total number of tokens you will have earned at the end of the round?<br><b>{incorrect_q5} - If you invest 7 out of 10 tokens, you keep 3 tokens for yourself. If you apply 202 cubic feet of water to your field you - will earn 4 tokens. 3 + 4 = 7 tokens - <br><br> + If you invest 7 out of 10 tokens, you keep 3 tokens for yourself. If you apply 202 cubic feet of water to your field you will earn 4 tokens. 3 + 4 = 7 tokens</b> + <br><br><span class='q6'>Question 6:</span><br> If you invest all 10 tokens you start with and you apply 555 cubic feet of water to your fields, what is the total number of tokens you will have earned at the end of Repository URL: https://bitbucket.org/virtualcommons/irrigation/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. |
From: Bitbucket <com...@bi...> - 2012-03-06 07:59:24
|
1 new commit in irrigation: https://bitbucket.org/virtualcommons/irrigation/changeset/700d1fb9a777/ changeset: 700d1fb9a777 user: alllee date: 2012-03-06 08:58:28 summary: removing defunct code affected #: 1 file diff -r 4f9d6b2646344773728e205e0c2e8d312944ce2d -r 700d1fb9a777ba42e02112205788113ce7a0604b src/main/java/edu/asu/commons/irrigation/server/IrrigationServer.java --- a/src/main/java/edu/asu/commons/irrigation/server/IrrigationServer.java +++ b/src/main/java/edu/asu/commons/irrigation/server/IrrigationServer.java @@ -276,9 +276,7 @@ public void handle(QuizResponseEvent quizResponseEvent) { sendFacilitatorMessage("Received quiz response: " + quizResponseEvent); clients.get(quizResponseEvent.getId()).addCorrectQuizAnswers(quizResponseEvent.getNumberOfCorrectQuizAnswers()); - if (quizResponseEvent.isComplete()) { - numberOfCompletedQuizzes++; - } + numberOfCompletedQuizzes++; if (numberOfCompletedQuizzes >= clients.size()) { sendFacilitatorMessage("All quizzes completed: " + numberOfCompletedQuizzes); numberOfCompletedQuizzes = 0; Repository URL: https://bitbucket.org/virtualcommons/irrigation/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. |
From: Bitbucket <iss...@bi...> - 2012-03-06 04:48:56
|
--- you can reply above this line --- New issue 36: persistent messaging support https://bitbucket.org/virtualcommons/vcweb/issue/36/persistent-messaging-support A Lee / alllee on Tue, 6 Mar 2012 05:48:49 +0100: Description: https://github.com/philomat/django-persistent-messages Responsible: alllee -- This is an issue notification from bitbucket.org. You are receiving this either because you are the owner of the issue, or you are following the issue. |
From: Bitbucket <com...@bi...> - 2012-03-06 00:14:37
|
1 new commit in irrigation: https://bitbucket.org/virtualcommons/irrigation/changeset/4f9d6b264634/ changeset: 4f9d6b264634 user: alllee date: 2012-03-06 01:14:37 summary: fixes issue 11, refactoring quiz processing logic and merging quiz questions into a single page affected #: 4 files diff -r 84f2fd3f32f88e70e3bd87b0285f7fb32ef55f9d -r 4f9d6b2646344773728e205e0c2e8d312944ce2d src/main/java/edu/asu/commons/irrigation/client/ExperimentGameWindow.java --- a/src/main/java/edu/asu/commons/irrigation/client/ExperimentGameWindow.java +++ b/src/main/java/edu/asu/commons/irrigation/client/ExperimentGameWindow.java @@ -10,22 +10,23 @@ import java.awt.event.KeyAdapter; import java.awt.event.KeyEvent; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Properties; -import java.util.TreeMap; import javax.swing.Box; import javax.swing.BoxLayout; import javax.swing.JButton; import javax.swing.JEditorPane; import javax.swing.JLabel; +import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTextField; import javax.swing.SwingUtilities; import javax.swing.Timer; +import javax.swing.text.html.HTMLEditorKit; +import javax.swing.text.html.StyleSheet; import edu.asu.commons.irrigation.conf.RoundConfiguration; import edu.asu.commons.irrigation.conf.ServerConfiguration; @@ -69,30 +70,18 @@ private JEditorPane contributionInformationEditorPane; - private JButton nextButton; - - private JPanel instructionsNavigationPanel; - - private JButton previousButton; - private JPanel instructionsPanel; - private int currentQuizPageNumber = 1; - private JPanel submitTokenPanel; private HtmlEditorPane tokenInstructionsEditorPane; -// private int quizzesAnswered = 0; - private TokenContributionChartPanel tokenContributionChartPanel; // private CanalAnimationPanel canalAnimationPanel; private CardLayout cardLayout; - private Map<Integer, String> quizPageResponses = new HashMap<Integer, String>(); - private JLabel investedTokensLabel; public ExperimentGameWindow(IrrigationClient client) { @@ -163,79 +152,7 @@ } return instructionsPanel; } - - private JPanel getQuizNavigationPanel() { - if (instructionsNavigationPanel == null) { - instructionsNavigationPanel = new JPanel(); - instructionsNavigationPanel.setLayout(new BorderLayout()); - instructionsNavigationPanel.add(getPreviousButton(), BorderLayout.LINE_START); - instructionsNavigationPanel.add(getNextButton(), BorderLayout.LINE_END); - } - return instructionsNavigationPanel; - } - private JButton getPreviousButton() { - if (previousButton == null) { - previousButton = new JButton(); - previousButton.setText("Previous"); - previousButton.setEnabled(false); - previousButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - // getting the next instruction Number - if (currentQuizPageNumber > 1) { - currentQuizPageNumber--; - setInstructions(getQuizPage()); - } - previousButton.setEnabled(currentQuizPageNumber > 1); - nextButton.setEnabled(true); - } - }); - } - return previousButton; - } - - private JButton getNextButton() { - if (nextButton == null) { - nextButton = new JButton(); - nextButton.setText("Next"); - nextButton.setEnabled(false); - nextButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - previousButton.setEnabled(true); - currentQuizPageNumber++; - if (currentQuizPageNumber <= getServerConfiguration().getNumberOfQuizPages()) { - setInstructions(getQuizPage()); - } - else { - // this only works in between practice rounds #1 & #2 or after practice round 2 - // should just regenerate all the instructions... - nextButton.setEnabled(false); - disableQuiz(); - showDebriefing(false); -// setInstructions(instructionsBuilder.toString()); - } - } - }); - - } - return nextButton; - } - - // FIXME: replace with StringTemplate - private String getQuizPage() { - StringBuilder builder = new StringBuilder(); - String quizPage = getServerConfiguration().getQuizPage(currentQuizPageNumber); - String quizPageResponse = quizPageResponses.get(currentQuizPageNumber); - if (quizPageResponse == null) { - builder.append(quizPage); - } - else { - quizPage = quizPage.replace("<input type=\"submit\" name=\"submit\" value=\"Submit\">", ""); - builder.append(quizPage).append(quizPageResponse); - } - return builder.toString(); - } - private ServerConfiguration getServerConfiguration() { return clientDataModel.getServerConfiguration(); } @@ -333,65 +250,9 @@ instructionsBuilder.append(clientDataModel.getRoundConfiguration().generateClientDebriefing(clientDataModel, showExitInstructions)); setInstructions(instructionsBuilder.toString()); } - -// /** -// * FIXME: refactor to use StringTemplate -// * @param event -// */ -// private void addDebriefingText(EndRoundEvent event) { -// double showUpPayment = clientDataModel.getServerConfiguration().getShowUpPayment(); -// RoundConfiguration roundConfiguration = clientDataModel.getRoundConfiguration(); -// // FIXME: move this to RoundConfiguration instead and then templatize using -// // StringTemplate -// instructionsBuilder.delete(0, instructionsBuilder.length()); -// instructionsBuilder.append("<b>Results from the previous round</b>"); -// instructionsBuilder.append( -// "<table border='3' cellpadding='5'><thead><th>Position</th><th>Initial token endowment</th><th>Tokens invested</th><th>Tokens not invested</th>" + -// "<th>Tokens earned from growing crops</th><th>Total tokens earned during this round</th>" + -// "<th>Dollars earned during this round</th><th>Total dollars earned (including show-up bonus)</th></thead>" + -// "<tbody>"); -// -// for(ClientData clientData : clientDataModel.getClientDataSortedByPriority()) { -// String backgroundColor = clientData.getPriority() == clientDataModel.getPriority() ? "#FFFFCC" : "CCCCCC"; -// instructionsBuilder.append( -// String.format("<tr align='center' bgcolor='%s'><td>%s</td><td>%d</td><td>%d</td><td>%d</td><td>%d</td><td>%d</td><td>$%3.2f</td><td>$%3.2f</td></tr>", -// backgroundColor, -// clientData.getPriorityString(), -// roundConfiguration.getMaximumTokenInvestment(), -// clientData.getInvestedTokens(), -// clientData.getUninvestedTokens(), -// clientData.getTokensEarnedFromWaterCollected(), -// clientData.getAllTokensEarnedThisRound(), -// clientData.getTotalDollarsEarnedThisRound(), -// clientData.getTotalDollarsEarned() + showUpPayment -// )); -// } -// -// ClientData clientData = clientDataModel.getClientData(); -// instructionsBuilder.append("</tbody></table><hr>"); -// instructionsBuilder.append(String.format("<h3>You (position %s) received $%3.2f this past round. Your total earnings are $%3.2f, including the $%3.2f show up bonus.</h3>", -// clientData.getPriorityString(), clientData.getTotalDollarsEarnedThisRound(), clientData.getTotalDollarsEarned()+showUpPayment, showUpPayment)); -// //append the added practice round instructions -// -// if (roundConfiguration.isPracticeRound()) { -// instructionsBuilder.append(roundConfiguration.getPracticeRoundPaymentInstructions()); -// } -// else if (event.isLastRound()) { -// instructionsBuilder.append(getServerConfiguration().getFinalInstructions()); -// } -// instructionsBuilder.append("<hr>"); -// displayInstructions(instructionsBuilder.toString()); -// } - - // adding the instructions into the instruction Panel - private void setInstructions(final String instructions) { - setInstructions(instructions, false); - } - private void setInstructions(String instructions, boolean caretToEnd) { + private void setInstructions(String instructions) { instructionsEditorPane.setText(instructions); - int caretPosition = caretToEnd ? instructionsEditorPane.getDocument().getLength() - 1 : 0; - instructionsEditorPane.setCaretPosition(caretPosition); } private void displayInstructions(final String instructions) { @@ -407,68 +268,41 @@ return new ActionListener() { private Map<String, String> quizAnswers = configuration.getQuizAnswers(); public synchronized void actionPerformed(ActionEvent e) { - if (quizPageResponses.containsKey(currentQuizPageNumber)) { - // this form has already been submit. - // shouldn't happen - // FIXME: report to user? - return; + FormActionEvent formEvent = (FormActionEvent) e; + Properties actualAnswers = formEvent.getData(); + List<String> incorrectQuestionNumbers = new ArrayList<String>(); + List<String> correctQuestionNumbers = new ArrayList<String>(); + for (Map.Entry<String, String> entry : quizAnswers.entrySet()) { + String questionNumber = entry.getKey(); + String number = questionNumber.substring(1); + String correctAnswer = entry.getValue(); + String actualAnswer = actualAnswers.getProperty(questionNumber); + if (actualAnswer == null) { + JOptionPane.showMessageDialog(ExperimentGameWindow.this, "Please enter a quiz answer for question " + number + "."); + return; + } + ((correctAnswer.equals(actualAnswer)) ? correctQuestionNumbers : incorrectQuestionNumbers).add(questionNumber); } - FormActionEvent formEvent = (FormActionEvent) e; - Properties responses = formEvent.getData(); - List<String> incorrectAnswers = new ArrayList<String>(); - responses.list(System.err); - StringBuilder builder = new StringBuilder(); - TreeMap<String, String> sortedResponses = new TreeMap<String, String>(); - // sort responses so we can put them in order. - for (Map.Entry<Object, Object> entry : responses.entrySet()) { - sortedResponses.put((String) entry.getKey(), (String) entry.getValue()); - } - builder.append("<hr><h2>Results</h2><hr>"); - for (Map.Entry<String, String> entry : sortedResponses.entrySet()) { - String questionNumber = (String) entry.getKey(); - if (questionNumber.charAt(0) == 'q') { - String number = questionNumber.substring(1, questionNumber.length()); - String response = (String) entry.getValue(); - if (response == null || response.trim().isEmpty()) { - // if any responses are empty, abort. - - return; - } - String correctAnswer = quizAnswers.get(questionNumber); - builder.append(String.format("<p><b>Question %s</b><br/>", number)); - String color = "blue"; - if (! response.equals(correctAnswer)) { - incorrectAnswers.add(questionNumber); - color = "red"; - } - builder.append(String.format("Your answer: <font color='%s'>%s</font><br/>", color, response)); - builder.append(String.format("Correct answer: %s<br/>", quizAnswers.get("a" + number))); - builder.append(quizAnswers.get( "explanation" + number )).append("</p>"); - } - } - if (incorrectAnswers.isEmpty()) { - builder.append("<p>Congratulations, you got all of the questions correct.</p>"); - } - else { - builder.append(String.format("<p>You answered %d questions incorrectly. Please review the correct answers.</p>", incorrectAnswers.size())); - } - builder.append("<p><b>Please click the 'Next' button at the bottom right of the screen to continue.</b></p>"); - quizPageResponses.put(currentQuizPageNumber, builder.toString()); - // no matter what we move on to the next question page - // tell them what was right and what was wrong. - if (currentQuizPageNumber <= getServerConfiguration().getNumberOfQuizPages()) { - nextButton.setEnabled(true); - } -// quizzesAnswered++; - QuizResponseEvent event = new QuizResponseEvent(client.getId(), currentQuizPageNumber, responses, incorrectAnswers); + setQuestionColors(correctQuestionNumbers, "blue"); + setQuestionColors(incorrectQuestionNumbers, "red"); + QuizResponseEvent event = new QuizResponseEvent(client.getId(), actualAnswers, incorrectQuestionNumbers); System.err.println("Correct answers: " + event.getNumberOfCorrectQuizAnswers()); clientDataModel.getClientData().addCorrectQuizAnswers(event.getNumberOfCorrectQuizAnswers()); client.transmit(event); - setInstructions(getQuizPage(), true); + setInstructions(getServerConfiguration().getQuizResults(incorrectQuestionNumbers, actualAnswers)); } }; } + + private void setQuestionColors(List<String> questionNumbers, String color) { + HTMLEditorKit editorKit = (HTMLEditorKit) instructionsEditorPane.getEditorKit(); + StyleSheet styleSheet = editorKit.getStyleSheet(); + for (String questionNumber : questionNumbers) { + String styleString = String.format(".%s { color: %s; }", questionNumber, color); + styleSheet.addRule(styleString); + } + } public void displayContributionInformation(final ClientData clientData) { final RoundConfiguration configuration = clientDataModel.getRoundConfiguration(); @@ -576,22 +410,12 @@ public void showQuiz() { SwingUtilities.invokeLater(new Runnable() { public void run() { - setInstructions(getQuizPage()); - getInstructionsPanel().add(getQuizNavigationPanel(), BorderLayout.PAGE_END); + setInstructions(getServerConfiguration().getQuizInstructions()); getInstructionsPanel().revalidate(); } }); } - /** - * Should only be invoked when the instructions navigation panel is done. - * How do we know when it's done? - */ - private void disableQuiz() { - getInstructionsPanel().remove(getQuizNavigationPanel()); - getInstructionsPanel().revalidate(); - } - public void showGameScreenshot() { displayInstructions(getServerConfiguration().getGameScreenshotInstructions()); } diff -r 84f2fd3f32f88e70e3bd87b0285f7fb32ef55f9d -r 4f9d6b2646344773728e205e0c2e8d312944ce2d src/main/java/edu/asu/commons/irrigation/conf/ServerConfiguration.java --- a/src/main/java/edu/asu/commons/irrigation/conf/ServerConfiguration.java +++ b/src/main/java/edu/asu/commons/irrigation/conf/ServerConfiguration.java @@ -2,6 +2,7 @@ import java.text.NumberFormat; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Properties; @@ -169,8 +170,8 @@ return getProperty("general-instructionsq" + pageNumber); } - public String getQuizPage(int pageNumber) { - return getProperty("quiz-page"+pageNumber); + public String getQuizInstructions() { + return render(getProperty("quiz-instructions")); } public String getWaterCollectedToTokensTable() { @@ -261,4 +262,19 @@ } } + public String getQuizResults(List<String> incorrectQuestionNumbers, Map<Object, Object> actualAnswers) { + ST template = createStringTemplate(getProperty("quiz-results")); + // FIXME: actual answers includes the submit button, so there's an off-by-one that we need to deal with. + int totalQuestions = actualAnswers.size() - 1; + int numberCorrect = totalQuestions - incorrectQuestionNumbers.size(); + template.add("allCorrect", incorrectQuestionNumbers.isEmpty()); + template.add("numberCorrect", numberCorrect); + template.add("totalQuestions", totalQuestions); + template.add("totalQuizEarnings", toCurrencyString(getQuizCorrectAnswerReward() * numberCorrect)); + for (String incorrectQuestionNumber : incorrectQuestionNumbers) { + template.add("incorrect_" + incorrectQuestionNumber, String.format("Your answer, %s, was incorrect.", actualAnswers.get(incorrectQuestionNumber))); + } + return template.render(); + } + } diff -r 84f2fd3f32f88e70e3bd87b0285f7fb32ef55f9d -r 4f9d6b2646344773728e205e0c2e8d312944ce2d src/main/java/edu/asu/commons/irrigation/events/QuizResponseEvent.java --- a/src/main/java/edu/asu/commons/irrigation/events/QuizResponseEvent.java +++ b/src/main/java/edu/asu/commons/irrigation/events/QuizResponseEvent.java @@ -20,26 +20,16 @@ private static final long serialVersionUID = -7081410122722056083L; - private int quizPage; private Properties responses; private List<String> incorrectAnswers; - public QuizResponseEvent(Identifier id, int quizPage, Properties responses, List<String> incorrectAnswers) { + public QuizResponseEvent(Identifier id, Properties responses, List<String> incorrectAnswers) { super(id); - this.quizPage = quizPage; this.responses = responses; this.incorrectAnswers = incorrectAnswers; } - - public boolean isComplete() { - return quizPage == 2; - } - - public int getQuizPage(){ - return quizPage; - } public Properties getResponses() { return responses; @@ -50,7 +40,7 @@ } public String toString() { - return id + " quiz page response: " + responses + "\n\t incorrect: " + incorrectAnswers; + return id + " quiz responses: " + responses + "\n\t incorrect: " + incorrectAnswers; } public int getNumberOfCorrectQuizAnswers() { diff -r 84f2fd3f32f88e70e3bd87b0285f7fb32ef55f9d -r 4f9d6b2646344773728e205e0c2e8d312944ce2d src/main/resources/configuration/asu/2011/pretest/irrigation.xml --- a/src/main/resources/configuration/asu/2011/pretest/irrigation.xml +++ b/src/main/resources/configuration/asu/2011/pretest/irrigation.xml @@ -29,7 +29,6 @@ <entry key='token-endowment'>10</entry><entry key='field-of-vision'>1</entry> -<entry key='quiz-pages'>2</entry><entry key="wait-for-participants">true</entry><entry key="number-of-rounds">22</entry> @@ -151,13 +150,12 @@ ]]></entry> -<entry key="quiz-page1"> +<entry key="quiz-instructions"><![CDATA[ <p> The first two questions deal with irrigation infrastructure investment. <b>Please refer to Table 1 of your handout</b>. </p> - <form> Question 1:<br> Given an existing infrastructure efficiency of 20%, if the five participants invest @@ -193,15 +191,6 @@ E?<br><input type='text' name='q4' value=''> cubic feet per second <br><br> - -<input type="submit" name="submit" value="Submit"><br> -<br> - -]]> -</entry> - -<entry key="quiz-page2"> -<![CDATA[ <p> The final two questions cover the number of tokens you can earn in within a round. <b>Please refer to table 2 of your handout</b>. @@ -219,8 +208,9 @@ the round?<br><input type="text" name="q6" value="">tokens <br><br> -<input type="submit" name="submit" value="Submit"> -</form> + +<input type="submit" name="submit" value="Submit"><br> +<br> ]]></entry> @@ -505,4 +495,85 @@ {endif} ]]></entry> +<entry key='quiz-results'> + <![CDATA[ + <h2>Quiz Results</h2> + <hr> + <p> + {if (allCorrect)} + You have answered all the questions correctly and earned <b>{totalQuizEarnings}</b>. + {else} + You answered {numberCorrect} out of {totalQuestions} questions correctly and earned <b>{totalQuizEarnings}</b>. Questions you've answered + incorrectly are highlighted in red. Please see below for more details. + {endif} + </p> + <br> + <hr> + <span class='q1'>Question 1:</span><br> + Given an existing infrastructure efficiency of 20%, if the five participants invest + a <b>total of 29 additional tokens</b>, what is the new irrigation infrastructure + efficiency? + <br><b>{incorrect_q1} + An existing infrastructure efficiency of 20% + 29 tokens invested = 49% infrastructure efficiency. + </b> + <br> + + <span class='q2'>Question 2:</span><br> + Suppose the infrastructure efficiency in the last round was 60%. For the current + round, the efficiency will decline by an amount of 25% for a resulting + infrastructure efficiency of 35%. If the members of your group invest a total of 15 + tokens, what will be your group's resulting water delivery capacity?<br> + <b>{incorrect_q2} + An existing infrastructure efficiency of 35% + 15 tokens invested = 50% infrastructure efficiency for the current round. + An infrastructure efficiency of 50% corresponds to a water delivery capacity of 5 cubic feet per second.</b> + <br><br><br> + +<b>The next two questions deal with the capacity of the irrigation system in relation +to the actual amount of water available.</b> +<br><br> + <span class='q3'>Question 3:</span><br> + If the irrigation efficiency is between 71 and 80%, the water delivery capacity of + the irrigation system is 35 cubic feet per second. Suppose the water supply + available to your group is 30 cubic feet per second and A opens their gate, + diverting water at 25 cubic feet per second. What is the available water flow for + B? + <br> + <b>{incorrect_q3} + Since there is only 30 cubic feet per second of water available, the irrigation infrastructure capacity of 35 cubic feet + per second will not be fully used. When A opens their gate, they take 25 of the 30 cubic feet per second out of the + canal, leaving 5 cubic feet per second for B. + </b> + <br><br><br> + <span class='q4'>Question 4:</span> + If the available water delivery capacity is 25 cubic feet per second and A, B, C, + and D are not using water, how much cubic feet of water per second is available for + E?<br> + <b>{incorrect_q4} + If A has 25 cfps available and does not take any water, the same amount is available for the people + downstream. Since B, C and D do not take water, 25 cfps is available for E. + </b> + <br><br> +<p> +The final two questions cover the number of tokens you can earn in within a round. +<b>Please refer to table 2 of your handout</b>. +</p> +<span class='q5'>Question 5:</span><br> +If you invest 7 of the 10 tokens you start with and you apply 202 cubic feet of +water to your fields, what is the total number of tokens you will have earned at the +end of the round?<br> + <b>{incorrect_q5} + If you invest 7 out of 10 tokens, you keep 3 tokens for yourself. If you apply 202 cubic feet of water to your field you + will earn 4 tokens. 3 + 4 = 7 tokens + <br><br> +<span class='q6'>Question 6:</span><br> +If you invest all 10 tokens you start with and you apply 555 cubic feet of water to +your fields, what is the total number of tokens you will have earned at the end of +the round?<br> +<br> + <b>{incorrect_q6} + If you invest all 10 tokens, you keep 0 tokens from your initial endowment. If you apply 555 cubic feet of + water to your field you will earn 19 tokens. 0 + 19 = 19 tokens. + </b> + ]]> +</entry></properties> Repository URL: https://bitbucket.org/virtualcommons/irrigation/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. |
From: Bitbucket <com...@bi...> - 2012-03-05 22:41:33
|
1 new commit in foraging: https://bitbucket.org/virtualcommons/foraging/changeset/d572fcd98734/ changeset: d572fcd98734 user: alllee date: 2012-03-05 23:41:32 summary: fixes + cleanup for imposed strategy condition. Currently, the imposed strategy for each group is calculated and sent when the show vote screen request is received by the server. affected #: 8 files diff -r b4e233eb7aff92bf8ed80d699427363a2a7dbf97 -r d572fcd98734afe5bf746264acab8c548bd1f71d src/main/java/edu/asu/commons/foraging/client/ClientDataModel.java --- a/src/main/java/edu/asu/commons/foraging/client/ClientDataModel.java +++ b/src/main/java/edu/asu/commons/foraging/client/ClientDataModel.java @@ -273,6 +273,7 @@ public void setSelectedStrategies(List<Strategy> selectedStrategies) { this.selectedStrategies = selectedStrategies; + getRoundConfiguration().setSelectedRules(selectedStrategies); } public List<Strategy> getSelectedStrategies() { diff -r b4e233eb7aff92bf8ed80d699427363a2a7dbf97 -r d572fcd98734afe5bf746264acab8c548bd1f71d 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 @@ -851,10 +851,4 @@ return getProperty("survey-confirmation-message", "Please make sure you have completed the survey before continuing. Have you completed the survey?"); } - - public String getImposedStrategyInstructions(Strategy strategy) { - ST st = createStringTemplate(getProperty("imposed-strategy-instructions")); - st.add("strategy", strategy); - return st.render(); - } } diff -r b4e233eb7aff92bf8ed80d699427363a2a7dbf97 -r d572fcd98734afe5bf746264acab8c548bd1f71d 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 @@ -831,7 +831,10 @@ } public void setImposedStrategy(Strategy imposedStrategy) { - this.imposedStrategy = imposedStrategy; + // XXX: defensive set, don't override an already imposed strategy. + if (this.imposedStrategy == null) { + this.imposedStrategy = imposedStrategy; + } } } diff -r b4e233eb7aff92bf8ed80d699427363a2a7dbf97 -r d572fcd98734afe5bf746264acab8c548bd1f71d src/main/java/edu/asu/commons/foraging/model/ServerDataModel.java --- a/src/main/java/edu/asu/commons/foraging/model/ServerDataModel.java +++ b/src/main/java/edu/asu/commons/foraging/model/ServerDataModel.java @@ -63,6 +63,8 @@ // Maps client Identifiers to the GroupDataModel that the client belongs to private final Map<Identifier, GroupDataModel> clientsToGroups = new HashMap<Identifier, GroupDataModel>(); + private Map<Strategy, Integer> imposedStrategyDistribution; + public ServerDataModel() { super(EventTypeChannel.getInstance()); } @@ -463,24 +465,41 @@ } + public List<GroupDataModel> allocateImposedStrategyDistribution(Map<Strategy, Integer> imposedStrategyDistribution) { - List<GroupDataModel> groups = getOrderedGroups(); - int numberOfGroups = groups.size(); - Collections.shuffle(groups); - Iterator<GroupDataModel> groupIterator = groups.iterator(); - int numberOfStrategies = 0; - for (Map.Entry<Strategy, Integer> entry : imposedStrategyDistribution.entrySet()) { - Strategy strategy = entry.getKey(); - int occurrences = entry.getValue(); - if (numberOfStrategies > numberOfGroups) { - throw new IllegalArgumentException("Invalid number of strategies : " + numberOfStrategies + " for " + numberOfGroups + " groups."); - } - for (int i = 0; i < occurrences; i++) { - GroupDataModel group = groupIterator.next(); - group.setImposedStrategy(strategy); - numberOfStrategies++; - } - } - return groups; + if (imposedStrategyDistribution == null || imposedStrategyDistribution.isEmpty()) { + throw new IllegalArgumentException("No strategy distribution defined. Please create a strategy distribution and try again."); + } + List<GroupDataModel> groups = getOrderedGroups(); + int numberOfGroups = groups.size(); + Collections.shuffle(groups); + Iterator<GroupDataModel> groupIterator = groups.iterator(); + int numberOfStrategies = 0; + for (Map.Entry<Strategy, Integer> entry : imposedStrategyDistribution.entrySet()) { + Strategy strategy = entry.getKey(); + int occurrences = entry.getValue(); + if (numberOfStrategies > numberOfGroups) { + throw new IllegalArgumentException("Invalid number of strategies : " + numberOfStrategies + " for " + numberOfGroups + " groups."); + } + for (int i = 0; i < occurrences; i++) { + GroupDataModel group = groupIterator.next(); + group.setImposedStrategy(strategy); + numberOfStrategies++; + } + } + return groups; } + + public List<GroupDataModel> allocateImposedStrategyDistribution() { + return allocateImposedStrategyDistribution(imposedStrategyDistribution); + } + + public void setImposedStrategyDistribution(Map<Strategy, Integer> strategyDistribution) { + this.imposedStrategyDistribution = strategyDistribution; + } + + public Map<Strategy, Integer> getImposedStrategyDistribution() { + return imposedStrategyDistribution; + } + } diff -r b4e233eb7aff92bf8ed80d699427363a2a7dbf97 -r d572fcd98734afe5bf746264acab8c548bd1f71d 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 @@ -63,6 +63,7 @@ import edu.asu.commons.foraging.event.RuleVoteRequest; import edu.asu.commons.foraging.event.SanctionAppliedEvent; import edu.asu.commons.foraging.event.SetImposedStrategyEvent; +import edu.asu.commons.foraging.event.ShowVoteScreenRequest; import edu.asu.commons.foraging.event.SurveyIdSubmissionRequest; import edu.asu.commons.foraging.event.SynchronizeClientEvent; import edu.asu.commons.foraging.event.TrustGameResultsFacilitatorEvent; @@ -599,21 +600,9 @@ sendFacilitatorMessage("Ignoring request to impose strategy " + event); return; } + serverDataModel.setImposedStrategyDistribution(event.getStrategyDistribution()); + sendFacilitatorMessage("Setting imposed strategy distribution to " + event.getStrategyDistribution()); persister.store(event); - try { - List<GroupDataModel> groups = serverDataModel.allocateImposedStrategyDistribution(event.getStrategyDistribution()); - StringBuilder builder = new StringBuilder(); - for (GroupDataModel group: groups) { - builder.append('[').append(group).append(':').append(group.getImposedStrategy()).append(']'); - for (Identifier id: group.getClientIdentifiers()) { - transmit(new SetImposedStrategyEvent(id, group.getImposedStrategy())); - } - } - sendFacilitatorMessage("Server has imposed strategies for all groups: " + builder); - } - catch (IllegalArgumentException exception) { - sendFacilitatorMessage("Couldn't allocate strategy distribution: " + event, exception); - } } }); addEventProcessor(new EventTypeProcessor<ShowRequest>(ShowRequest.class, true) { @@ -624,6 +613,11 @@ sendFacilitatorMessage("Ignoring show request from non facilitator id: " + request.getId()); return; } + // FIXME: bah, more special casing. figure out a better way + // to determine when to send the imposed strategy.. + if (request instanceof ShowVoteScreenRequest && getCurrentRoundConfiguration().isImposedStrategyEnabled()) { + sendImposedStrategy(); + } // if this is a ShowExitInstructionsRequest, is this the last round at least? if (request instanceof ShowExitInstructionsRequest && ! getCurrentRoundConfiguration().isLastRound()) { sendFacilitatorMessage("Ignoring request to show exit instructions, we are not at the last round yet."); @@ -869,6 +863,23 @@ break; } } + + private void sendImposedStrategy() { + try { + List<GroupDataModel> groups = serverDataModel.allocateImposedStrategyDistribution(); + StringBuilder builder = new StringBuilder(); + for (GroupDataModel group: groups) { + builder.append('[').append(group).append(':').append(group.getImposedStrategy()).append(']'); + for (Identifier id: group.getClientIdentifiers()) { + transmit(new SetImposedStrategyEvent(id, group.getImposedStrategy())); + } + } + sendFacilitatorMessage("Server has imposed strategies for all groups: " + builder); + } + catch (IllegalArgumentException exception) { + sendFacilitatorMessage("Couldn't allocate strategy distribution: " + serverDataModel.getImposedStrategyDistribution(), exception); + } + } private void setupRound() { persister.initialize(getCurrentRoundConfiguration()); diff -r b4e233eb7aff92bf8ed80d699427363a2a7dbf97 -r d572fcd98734afe5bf746264acab8c548bd1f71d src/main/java/edu/asu/commons/foraging/ui/GameWindow2D.java --- a/src/main/java/edu/asu/commons/foraging/ui/GameWindow2D.java +++ b/src/main/java/edu/asu/commons/foraging/ui/GameWindow2D.java @@ -740,19 +740,24 @@ } public void showVotingScreen() { - if (votingPanel == null) { - votingPanel = new JPanel(); - votingPanel.setLayout(new BoxLayout(votingPanel, BoxLayout.Y_AXIS)); - votingInstructionsEditorPane = UserInterfaceUtils.createInstructionsEditorPane(); - votingInstructionsScrollPane = new JScrollPane(votingInstructionsEditorPane); - votingInstructionsEditorPane.setText(client.getCurrentRoundConfiguration().getVotingInstructions()); - votingPanel.add(votingInstructionsScrollPane); - votingForm = new VotingForm(client); - votingPanel.add(votingForm); - votingPanel.setName(VotingForm.NAME); - add(votingPanel); - } - showPanel(VotingForm.NAME); + SwingUtilities.invokeLater(new Runnable() { + public void run() { + if (votingPanel == null) { + votingPanel = new JPanel(); + votingPanel.setLayout(new BoxLayout(votingPanel, BoxLayout.Y_AXIS)); + votingInstructionsEditorPane = UserInterfaceUtils.createInstructionsEditorPane(); + votingInstructionsScrollPane = new JScrollPane(votingInstructionsEditorPane); + RoundConfiguration configuration = client.getCurrentRoundConfiguration(); + votingInstructionsEditorPane.setText(configuration.getVotingInstructions()); + votingPanel.add(votingInstructionsScrollPane); + votingForm = new VotingForm(client); + votingPanel.add(votingForm); + votingPanel.setName(VotingForm.NAME); + add(votingPanel); + } + showPanel(VotingForm.NAME); + } + }); } public void showVotingResults(final List<Strategy> selectedRules, final Map<Strategy, Integer> votingResults) { @@ -882,17 +887,9 @@ } public void strategyNominationSubmitted() { - setInstructions(dataModel.getRoundConfiguration().getSubmittedVoteInstructions()); + RoundConfiguration roundConfiguration = dataModel.getRoundConfiguration(); + setInstructions(roundConfiguration.getSubmittedVoteInstructions()); showInstructionsPanel(); } - public void showImposedStrategy(final Strategy strategy) { - SwingUtilities.invokeLater(new Runnable() { - @Override public void run() { - setInstructions(dataModel.getRoundConfiguration().getImposedStrategyInstructions(strategy)); - } - }); - } - - } diff -r b4e233eb7aff92bf8ed80d699427363a2a7dbf97 -r d572fcd98734afe5bf746264acab8c548bd1f71d src/main/resources/configuration/iu/2011/imposed-punish/server.xml --- a/src/main/resources/configuration/iu/2011/imposed-punish/server.xml +++ b/src/main/resources/configuration/iu/2011/imposed-punish/server.xml @@ -334,9 +334,6 @@ Below is the list of different strategies. Please read the list carefully. Press "Submit" once you have finished reviewing the strategies. </p> - <ol> - {foragingStrategies: { strategy | <li>{strategy}</li> }} - </ol> {else} <h1>Strategy Nomination Instructions</h1><hr> @@ -361,7 +358,7 @@ <h1>The Assigned Strategy</h1><hr><p>Your group has been assigned the following strategy. Every member in your group is being notified of the same strategy.</p> - <p><b> {first(selectedRules)} </b></p> + <p><b> {first(self.selectedRules)} </b></p> {else} <h1>Submitted</h1> diff -r b4e233eb7aff92bf8ed80d699427363a2a7dbf97 -r d572fcd98734afe5bf746264acab8c548bd1f71d src/main/resources/configuration/iu/2011/imposed/server.xml --- a/src/main/resources/configuration/iu/2011/imposed/server.xml +++ b/src/main/resources/configuration/iu/2011/imposed/server.xml @@ -274,7 +274,7 @@ {if (tiebreaker)} <p><b>NOTE:</b> There was a tie and the selected strategy listed here was randomly selected as the winner.</p> {endif} - <p><b> {first(selectedRules)} </b></p> + <p><b> {first(selectedStrategies)} </b></p><h2>Implementation</h2><hr><p> @@ -343,9 +343,6 @@ Below is the list of different strategies. Please read the list carefully. Press "Submit" once you have finished reviewing the strategies. </p> - <ol> - {foragingStrategies: { strategy | <li>{strategy}</li> }} - </ol> {else} <h1>Strategy Nomination Instructions</h1><hr> @@ -371,9 +368,8 @@ <h1>The Assigned Strategy</h1><hr><p>Your group has been assigned the following strategy. Every member in your group is being notified of the same strategy.</p> - <ul> - <li><b>{first(selectedRules)}</b></li> - </ul> + <p><b> {first(self.selectedRules)} </b></p> + {else} <h1>Submitted</h1><hr> 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. |
From: Bitbucket <com...@bi...> - 2012-03-01 08:19:19
|
1 new commit in foraging: https://bitbucket.org/virtualcommons/foraging/changeset/b4e233eb7aff/ changeset: b4e233eb7aff user: alllee date: 2012-03-01 09:19:12 summary: updates to imposed strategy instructions affected #: 2 files diff -r 16fd62a91832b42b904c015cd8aa3aaf2b74eea7 -r b4e233eb7aff92bf8ed80d699427363a2a7dbf97 src/main/resources/configuration/iu/2011/imposed-punish/server.xml --- a/src/main/resources/configuration/iu/2011/imposed-punish/server.xml +++ b/src/main/resources/configuration/iu/2011/imposed-punish/server.xml @@ -275,17 +275,9 @@ <p><b>NOTE:</b> There was a tie and the selected strategy listed here was randomly selected as the winner.</p> {endif} <p><b> {first(selectedRules)} </b></p> - <h2>Implementation</h2> - <hr> - <p> - Neither the computer, nor the experimenter will intervene to implement the - strategy. - </p> - <p><b>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. - </p> ]]></entry> + <entry key='initial-voting-instructions'><![CDATA[ <h1>Important New Instructions!</h1> @@ -363,59 +355,21 @@ {endif} ]]></entry> -<entry key='imposed-strategy-instructions'> -<![CDATA[ -<h1>Important New Instructions!</h1> -<h2>Strategy for managing how players collect tokens for the rest of the experiment</h2> -<hr> -<p> -Your group is being assigned a strategy for how you and the three other people in your group collect tokens for the rest of the experiment. -</p> -<h2>Assigned Strategy</h2> -<hr> -<p> -<b>{strategy}</b> -</p> -<h2>Implementation</h2> -<hr> - <p>Neither the computer nor the experimenter will intervene to implement the - strategy. - </p> - - <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. - </p> -]]> -</entry><entry key='submitted-vote-instructions'><![CDATA[ {if (self.imposedStrategyEnabled)} <h1>The Assigned Strategy</h1><hr> - <p>Your group is being assigned the following strategy. All other members in your group are being notified of the same strategy.</p> - <ul> - <li><b>{first(selectedRules)}</b></li> - </ul> - <h2>Implementation</h2> - <hr> - <p> - Neither the computer, nor the experimenter will intervene to implement the - strategy. - </p> - <p><b>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. - </p> + <p>Your group has been assigned the following strategy. Every member in your group is being notified of the same strategy.</p> + <p><b> {first(selectedRules)} </b></p> {else} <h1>Submitted</h1><hr> - <p>Your nomination has been recorded. The final - results of the nomination will be shown once all the nominations in your - group have been received. + <p>Your nomination has been recorded. The final results of the nomination will be shown once all the + nominations in your group have been received. </p> {endif} ]]></entry> - </properties> diff -r 16fd62a91832b42b904c015cd8aa3aaf2b74eea7 -r b4e233eb7aff92bf8ed80d699427363a2a7dbf97 src/main/resources/configuration/iu/2011/imposed/server.xml --- a/src/main/resources/configuration/iu/2011/imposed/server.xml +++ b/src/main/resources/configuration/iu/2011/imposed/server.xml @@ -365,56 +365,20 @@ ]]></entry> -<entry key='imposed-strategy-instructions'> -<![CDATA[ -<h1>Important New Instructions!</h1> -<h2>Strategy for managing how players collect tokens for the rest of the experiment</h2> -<hr> -<p> -Your group is being assigned a strategy for how you and the three other people in your group collect tokens for the rest of the experiment. -</p> -<h2>Assigned Strategy</h2> -<hr> -<p> -<b>{strategy}</b> -</p> -<h2>Implementation</h2> -<hr> - <p>Neither the computer nor the experimenter will intervene to implement the - strategy. - </p> - - <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. - </p> -]]> -</entry><entry key='submitted-vote-instructions'><![CDATA[ {if (self.imposedStrategyEnabled)} <h1>The Assigned Strategy</h1><hr> - <p>Your group is being assigned the following strategy. All other members in your group are being notified of the same strategy.</p> + <p>Your group has been assigned the following strategy. Every member in your group is being notified of the same strategy.</p><ul><li><b>{first(selectedRules)}</b></li></ul> - <h2>Implementation</h2> - <hr> - <p> - Neither the computer, nor the experimenter will intervene to implement the - strategy. - </p> - <p><b>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. - </p> - {else} <h1>Submitted</h1><hr> - <p>Your nomination has been recorded. The final - results of the nomination will be shown once all the nominations in your - group have been received. + <p>Your nomination has been recorded. The final results of the nomination will be shown once all the + nominations in your group have been received. </p> {endif} ]]> 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. |
From: Bitbucket <com...@bi...> - 2012-02-29 23:11:28
|
1 new commit in foraging: https://bitbucket.org/virtualcommons/foraging/changeset/16fd62a91832/ changeset: 16fd62a91832 user: alllee date: 2012-03-01 00:11:26 summary: null guard when adding imposed strategy to the strategy distribution affected #: 1 file diff -r 2baf677ee041c76f26bcb355d9a37589c1d50581 -r 16fd62a91832b42b904c015cd8aa3aaf2b74eea7 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 @@ -82,9 +82,9 @@ private JMenuItem showVotingInstructionsMenuItem; private JMenuItem showVoteScreenMenuItem; private JMenuItem showSurveyInstructionsMenuItem; - private JMenuItem showExitInstructionsMenuItem; - private JMenuItem imposeStrategyMenuItem; - + private JMenuItem showExitInstructionsMenuItem; + private JMenuItem imposeStrategyMenuItem; + private HtmlEditorPane messageEditorPane; private StringBuilder instructionsBuilder; @@ -94,7 +94,7 @@ private ClipboardService clipboardService; private Map<Strategy, Integer> imposedStrategies = new HashMap<Strategy, Integer>(); - + public FacilitatorWindow(Dimension dimension, Facilitator facilitator) { this.facilitator = facilitator; initGuiComponents(); @@ -113,7 +113,7 @@ * This method gets called after the end of each round */ public void displayInstructions() { - + } /* @@ -131,7 +131,6 @@ // Round menu JMenu menu = new JMenu("Round"); menu.setMnemonic(KeyEvent.VK_R); - showInstructionsMenuItem = new JMenuItem("Show Instructions"); showInstructionsMenuItem.setMnemonic(KeyEvent.VK_I); @@ -143,7 +142,7 @@ } }); menu.add(showInstructionsMenuItem); - + startRoundMenuItem = new JMenuItem("Start"); startRoundMenuItem.setMnemonic(KeyEvent.VK_T); startRoundMenuItem.setEnabled(false); @@ -170,7 +169,7 @@ facilitator.sendShowExitInstructionsRequest(); } }); - + startChatMenuItem = new JMenuItem("Start chat"); startChatMenuItem.setEnabled(true); startChatMenuItem.addActionListener(new ActionListener() { @@ -188,10 +187,8 @@ }); menu.add(showTrustGameMenuItem); - - menuBar.add(menu); - + // voting menu menu = new JMenu("Voting"); @@ -206,32 +203,34 @@ } }); imposeStrategyMenuItem = createMenuItem(menu, "Add imposed strategy", new ActionListener() { - public void actionPerformed(ActionEvent e) { - ForagingStrategy selection = (ForagingStrategy) JOptionPane.showInputDialog(FacilitatorWindow.this, "Select the strategy to impose:\n", - "Impose Strategy", - JOptionPane.QUESTION_MESSAGE, - null, - ForagingStrategy.values(), - ForagingStrategy.NONE - ); - Integer distribution = imposedStrategies.get(selection); - if (distribution == null) { - distribution = Integer.valueOf(0); - } - imposedStrategies.put(selection, Integer.valueOf(distribution + 1)); - addMessage("Current strategy distribution: " + imposedStrategies); - } + public void actionPerformed(ActionEvent e) { + ForagingStrategy selection = (ForagingStrategy) JOptionPane.showInputDialog(FacilitatorWindow.this, "Select the strategy to impose:\n", + "Impose Strategy", + JOptionPane.QUESTION_MESSAGE, + null, + ForagingStrategy.values(), + ForagingStrategy.NONE + ); + if (selection == null) + return; + Integer distribution = imposedStrategies.get(selection); + if (distribution == null) { + distribution = Integer.valueOf(0); + } + imposedStrategies.put(selection, Integer.valueOf(distribution + 1)); + addMessage("Current strategy distribution: " + imposedStrategies); + } }); createMenuItem(menu, "Clear imposed strategies", new ActionListener() { - public void actionPerformed(ActionEvent e) { - - imposedStrategies.clear(); - } + public void actionPerformed(ActionEvent e) { + imposedStrategies.clear(); + addMessage("Cleared strategy distribution: " + imposedStrategies); + } }); createMenuItem(menu, "Send imposed strategy distribution", new ActionListener() { - public void actionPerformed(ActionEvent e) { - facilitator.sendImposeStrategyEvent(imposedStrategies); - } + public void actionPerformed(ActionEvent e) { + facilitator.sendImposeStrategyEvent(imposedStrategies); + } }); menuBar.add(menu); @@ -389,16 +388,16 @@ } public void addMessage(final String message) { - SwingUtilities.invokeLater(new Runnable() { - public void run() { - try { - messageEditorPane.getDocument().insertString(0, "-----\n" + message + "\n", null); - messageEditorPane.setCaretPosition(0); - } catch (BadLocationException exception) { - exception.printStackTrace(); - } - } - }); + SwingUtilities.invokeLater(new Runnable() { + public void run() { + try { + messageEditorPane.getDocument().insertString(0, "-----\n" + message + "\n", null); + messageEditorPane.setCaretPosition(0); + } catch (BadLocationException exception) { + exception.printStackTrace(); + } + } + }); } public void quizCompleted(QuizCompletedEvent event) { @@ -463,10 +462,10 @@ public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException { if (String.class.equals(flavor.getRepresentationClass())) { return html; - } + } else if (Reader.class.equals(flavor.getRepresentationClass())) { return new StringReader(html); - } + } else if (InputStream.class.equals(flavor.getRepresentationClass())) { return new ByteArrayInputStream(html.getBytes()); } 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. |
From: Bitbucket <com...@bi...> - 2012-02-29 22:47:36
|
1 new commit in foraging: https://bitbucket.org/virtualcommons/foraging/changeset/2baf677ee041/ changeset: 2baf677ee041 user: alllee date: 2012-02-29 23:47:31 summary: using SetImposedStrategyEvent to signal the imposed strategy to each client. affected #: 7 files diff -r d5cbf4f5202e68ef393a27522752ce044631a1fc -r 2baf677ee041c76f26bcb355d9a37589c1d50581 src/main/java/edu/asu/commons/foraging/client/ClientDataModel.java --- a/src/main/java/edu/asu/commons/foraging/client/ClientDataModel.java +++ b/src/main/java/edu/asu/commons/foraging/client/ClientDataModel.java @@ -46,7 +46,7 @@ // these are the subjects that have sanctioned us. private Map<Identifier, Duration> sanctioners = new HashMap<Identifier, Duration>(); - private List<Strategy> selectedRules = new ArrayList<Strategy>(); + private List<Strategy> selectedStrategies = new ArrayList<Strategy>(); private ForagingClient client; private volatile boolean explicitCollectionMode = false; @@ -271,13 +271,17 @@ return explicitCollectionMode; } - // FIXME: deprecate and remove these later - public void setSelectedRules(List<Strategy> selectedRules) { - this.selectedRules = selectedRules; + public void setSelectedStrategies(List<Strategy> selectedStrategies) { + this.selectedStrategies = selectedStrategies; } + public List<Strategy> getSelectedStrategies() { + return selectedStrategies; + } + + @Deprecated public List<Strategy> getSelectedRules() { - return selectedRules; + return selectedStrategies; } public Point3D getPoint3D(Identifier id) { diff -r d5cbf4f5202e68ef393a27522752ce044631a1fc -r 2baf677ee041c76f26bcb355d9a37589c1d50581 src/main/java/edu/asu/commons/foraging/client/ForagingClient.java --- a/src/main/java/edu/asu/commons/foraging/client/ForagingClient.java +++ b/src/main/java/edu/asu/commons/foraging/client/ForagingClient.java @@ -2,6 +2,7 @@ import java.awt.BorderLayout; import java.awt.Color; +import java.util.Arrays; import java.util.LinkedList; import javax.swing.JFrame; @@ -33,7 +34,7 @@ import edu.asu.commons.foraging.event.RoundStartedEvent; import edu.asu.commons.foraging.event.RuleSelectedUpdateEvent; import edu.asu.commons.foraging.event.RuleVoteRequest; -import edu.asu.commons.foraging.event.ShowImposedStrategyRequest; +import edu.asu.commons.foraging.event.SetImposedStrategyEvent; import edu.asu.commons.foraging.event.ShowSurveyInstructionsRequest; import edu.asu.commons.foraging.event.ShowTrustGameRequest; import edu.asu.commons.foraging.event.ShowVoteScreenRequest; @@ -162,9 +163,9 @@ getGameWindow().showTrustGame(); } }); - addEventProcessor(new EventTypeProcessor<ShowImposedStrategyRequest>(ShowImposedStrategyRequest.class) { - @Override public void handle(ShowImposedStrategyRequest request) { - getGameWindow2D().showImposedStrategy(request.getStrategy()); + addEventProcessor(new EventTypeProcessor<SetImposedStrategyEvent>(SetImposedStrategyEvent.class) { + @Override public void handle(SetImposedStrategyEvent event) { + dataModel.setSelectedStrategies(Arrays.asList(event.getStrategy())); } }); addEventProcessor(new EventTypeProcessor<ShowVotingInstructionsRequest>(ShowVotingInstructionsRequest.class) { @@ -175,7 +176,7 @@ addEventProcessor(new EventTypeProcessor<RuleSelectedUpdateEvent>(RuleSelectedUpdateEvent.class) { @Override public void handle(RuleSelectedUpdateEvent event) { - dataModel.setSelectedRules(event.getSelectedStrategies()); + dataModel.setSelectedStrategies(event.getSelectedStrategies()); getGameWindow2D().showVotingResults(event.getSelectedStrategies(), event.getVotingResults()); } }); diff -r d5cbf4f5202e68ef393a27522752ce044631a1fc -r 2baf677ee041c76f26bcb355d9a37589c1d50581 src/main/java/edu/asu/commons/foraging/event/SetImposedStrategyEvent.java --- /dev/null +++ b/src/main/java/edu/asu/commons/foraging/event/SetImposedStrategyEvent.java @@ -0,0 +1,22 @@ +package edu.asu.commons.foraging.event; + +import edu.asu.commons.event.AbstractEvent; +import edu.asu.commons.foraging.rules.Strategy; +import edu.asu.commons.net.Identifier; + +public class SetImposedStrategyEvent extends AbstractEvent { + + private static final long serialVersionUID = -6046837892041909032L; + + private Strategy strategy; + + public SetImposedStrategyEvent(Identifier id, Strategy strategy) { + super(id); + this.strategy = strategy; + } + + public Strategy getStrategy() { + return strategy; + } + +} diff -r d5cbf4f5202e68ef393a27522752ce044631a1fc -r 2baf677ee041c76f26bcb355d9a37589c1d50581 src/main/java/edu/asu/commons/foraging/event/ShowImposedStrategyRequest.java --- a/src/main/java/edu/asu/commons/foraging/event/ShowImposedStrategyRequest.java +++ /dev/null @@ -1,26 +0,0 @@ -package edu.asu.commons.foraging.event; - -import edu.asu.commons.event.AbstractEvent; -import edu.asu.commons.foraging.rules.Strategy; -import edu.asu.commons.net.Identifier; - -public class ShowImposedStrategyRequest extends AbstractEvent { - - private static final long serialVersionUID = -6046837892041909032L; - - private Strategy strategy; - - public ShowImposedStrategyRequest(Identifier id) { - super(id); - } - - public ShowImposedStrategyRequest(Identifier id, Strategy strategy) { - super(id); - this.strategy = strategy; - } - - public Strategy getStrategy() { - return strategy; - } - -} diff -r d5cbf4f5202e68ef393a27522752ce044631a1fc -r 2baf677ee041c76f26bcb355d9a37589c1d50581 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 @@ -25,7 +25,6 @@ import edu.asu.commons.foraging.event.FacilitatorUpdateEvent; import edu.asu.commons.foraging.event.ImposeStrategyEvent; import edu.asu.commons.foraging.event.QuizCompletedEvent; -import edu.asu.commons.foraging.event.ShowImposedStrategyRequest; import edu.asu.commons.foraging.event.ShowSurveyInstructionsRequest; import edu.asu.commons.foraging.event.ShowTrustGameRequest; import edu.asu.commons.foraging.event.ShowVoteScreenRequest; @@ -240,12 +239,4 @@ return imposedStrategyDistribution; } - public void sendShowImposedStrategy() { - if (imposedStrategyDistribution == null || imposedStrategyDistribution.isEmpty()) { - facilitatorWindow.addMessage("No imposed strategies selected, please select a strategy first."); - return; - } - transmit(new ShowImposedStrategyRequest(getId())); - } - } diff -r d5cbf4f5202e68ef393a27522752ce044631a1fc -r 2baf677ee041c76f26bcb355d9a37589c1d50581 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 @@ -228,17 +228,11 @@ imposedStrategies.clear(); } }); - createMenuItem(menu, "Send imposed strategy", new ActionListener() { + createMenuItem(menu, "Send imposed strategy distribution", new ActionListener() { public void actionPerformed(ActionEvent e) { facilitator.sendImposeStrategyEvent(imposedStrategies); } }); - - createMenuItem(menu, "Show imposed strategy", new ActionListener() { - public void actionPerformed(ActionEvent e) { - facilitator.sendShowImposedStrategy(); - } - }); menuBar.add(menu); // survey menu diff -r d5cbf4f5202e68ef393a27522752ce044631a1fc -r 2baf677ee041c76f26bcb355d9a37589c1d50581 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,7 +62,7 @@ import edu.asu.commons.foraging.event.RuleSelectedUpdateEvent; import edu.asu.commons.foraging.event.RuleVoteRequest; import edu.asu.commons.foraging.event.SanctionAppliedEvent; -import edu.asu.commons.foraging.event.ShowImposedStrategyRequest; +import edu.asu.commons.foraging.event.SetImposedStrategyEvent; import edu.asu.commons.foraging.event.SurveyIdSubmissionRequest; import edu.asu.commons.foraging.event.SynchronizeClientEvent; import edu.asu.commons.foraging.event.TrustGameResultsFacilitatorEvent; @@ -605,28 +605,17 @@ StringBuilder builder = new StringBuilder(); for (GroupDataModel group: groups) { builder.append('[').append(group).append(':').append(group.getImposedStrategy()).append(']'); + for (Identifier id: group.getClientIdentifiers()) { + transmit(new SetImposedStrategyEvent(id, group.getImposedStrategy())); + } } sendFacilitatorMessage("Server has imposed strategies for all groups: " + builder); - } catch (IllegalArgumentException exception) { sendFacilitatorMessage("Couldn't allocate strategy distribution: " + event, exception); } } }); - addEventProcessor(new EventTypeProcessor<ShowImposedStrategyRequest>(ShowImposedStrategyRequest.class) { - @Override - public void handle(ShowImposedStrategyRequest request) { - if (! request.getId().equals(getFacilitatorId())) { - sendFacilitatorMessage("Ignoring request to show imposed strategies from: " + request.getId()); - return; - } - for (Identifier id: clients.keySet()) { - transmit(new ShowImposedStrategyRequest(id, serverDataModel.getGroup(id).getImposedStrategy())); - } - sendFacilitatorMessage("Notified all groups of imposed strategy."); - } - }); addEventProcessor(new EventTypeProcessor<ShowRequest>(ShowRequest.class, true) { @Override public void handle(ShowRequest request) { 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. |
From: Bitbucket <com...@bi...> - 2012-02-29 22:38:27
|
2 new commits in foraging: https://bitbucket.org/virtualcommons/foraging/changeset/364783961ebf/ changeset: 364783961ebf user: alllee date: 2012-02-29 23:36:30 summary: fixing infinite loop bug when facilitator disconnects no longer using processNominations to deal with an imposed strategy. It should all happen client side as soon as they click submit. affected #: 1 file diff -r 4351f342ae091ac9bd56251f309c75ee67a3fa4d -r 364783961ebf5cb6fcb66667a8e49e5ca3c71a63 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 @@ -13,6 +13,7 @@ import java.util.ListIterator; import java.util.Map; import java.util.Set; +import java.util.logging.Level; import edu.asu.commons.event.BeginRoundRequest; import edu.asu.commons.event.ChatEvent; @@ -259,7 +260,12 @@ public void handle(DisconnectionRequest event) { synchronized (clients) { Identifier id = event.getId(); - sendFacilitatorMessage("Received DisconnectionRequest, removing " + id + " from clients " + clients.keySet(), event.getException()); + if (id.equals(getFacilitatorId())) { + getLogger().log(Level.SEVERE, "Disconnecting facilitator.", event.getException()); + } + else { + sendFacilitatorMessage("Received DisconnectionRequest, removing " + id + " from clients " + clients.keySet(), event.getException()); + } clients.remove(id); serverDataModel.removeClient(id); } @@ -404,12 +410,13 @@ // calculate votes Map<Strategy, Integer> votingResults = group.generateVotingResults(imposedStrategyEnabled); List<Strategy> selectedRules = group.getSelectedRules(); - for (Identifier id : group.getClientIdentifiers()) { - sendFacilitatorMessage(String.format( - "%s selected [%s] from all rules %s (imposed? %s)", - group, selectedRules, votingResults, imposedStrategyEnabled)); - - transmit(new RuleSelectedUpdateEvent(id, selectedRules, votingResults)); + sendFacilitatorMessage(String.format( + "%s selected [%s] from all rules %s (imposed? %s)", + group, selectedRules, votingResults, imposedStrategyEnabled)); + if (! imposedStrategyEnabled) { + for (Identifier id : group.getClientIdentifiers()) { + transmit(new RuleSelectedUpdateEvent(id, selectedRules, votingResults)); + } } store(new RuleSelectedUpdateEvent(getFacilitatorId(), selectedRules, votingResults)); } https://bitbucket.org/virtualcommons/foraging/changeset/d5cbf4f5202e/ changeset: d5cbf4f5202e user: alllee date: 2012-02-29 23:38:17 summary: bugfixes for imposed strategy condition - submit button now goes on to the next page - reusing VotingForm, could also just use the instructions panel as well, would probably be cleaner. - turning submitted-vote-instructions into an actual StringTemplate in server.xml affected #: 5 files diff -r 364783961ebf5cb6fcb66667a8e49e5ca3c71a63 -r d5cbf4f5202e68ef393a27522752ce044631a1fc src/main/java/edu/asu/commons/foraging/client/ForagingClient.java --- a/src/main/java/edu/asu/commons/foraging/client/ForagingClient.java +++ b/src/main/java/edu/asu/commons/foraging/client/ForagingClient.java @@ -448,7 +448,9 @@ } public void sendRuleVoteRequest(ForagingStrategy selectedRule) { - transmit(new RuleVoteRequest(getId(), selectedRule)); + if (selectedRule != null) { + transmit(new RuleVoteRequest(getId(), selectedRule)); + } getGameWindow2D().strategyNominationSubmitted(); } diff -r 364783961ebf5cb6fcb66667a8e49e5ca3c71a63 -r d5cbf4f5202e68ef393a27522752ce044631a1fc 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 @@ -722,7 +722,7 @@ } public String getSubmittedVoteInstructions() { - return getProperty("submitted-vote-instructions", "<h1>Submitted</h1><hr><p>Your nomination has been recorded. The final results of the nomination will be shown once all the nominations in your group have been received.</p>"); + return render(getProperty("submitted-vote-instructions")); } public String generateVotingResults(List<Strategy> selectedRules, Map<Strategy, Integer> nominations) { diff -r 364783961ebf5cb6fcb66667a8e49e5ca3c71a63 -r d5cbf4f5202e68ef393a27522752ce044631a1fc src/main/java/edu/asu/commons/foraging/ui/VotingForm.java --- a/src/main/java/edu/asu/commons/foraging/ui/VotingForm.java +++ b/src/main/java/edu/asu/commons/foraging/ui/VotingForm.java @@ -77,7 +77,11 @@ horizontalGroup.addGroup(horizontalButtonParallelGroup); GroupLayout.SequentialGroup verticalGroup = groupLayout.createSequentialGroup(); - String rightColumnHeader = votingResults.isEmpty() ? "Select" : "Nominations"; + boolean imposedStrategyEnabled = client.getCurrentRoundConfiguration().isImposedStrategyEnabled(); + // XXX: this is certainly what Rawlins was warning against + String rightColumnHeader = votingResults.isEmpty() + ? (imposedStrategyEnabled) ? "" : "Select" + : "Nominations"; JLabel rightHeaderLabel = new JLabel(rightColumnHeader); rightHeaderLabel.setFont(UserInterfaceUtils.DEFAULT_BOLD_FONT); horizontalButtonParallelGroup.addComponent(rightHeaderLabel); @@ -88,23 +92,23 @@ verticalGroup.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE).addComponent(strategyHeaderLabel).addGap(20).addComponent(rightHeaderLabel)); Dimension labelDimension = new Dimension(800, 100); - boolean imposedStrategyEnabled = client.getCurrentRoundConfiguration().isImposedStrategyEnabled(); + for (ForagingStrategy strategy: strategies) { JLabel ruleLabel = new JLabel("<html>" + strategy.getDescription() + "</html>"); ruleLabel.setFont(UserInterfaceUtils.DEFAULT_PLAIN_FONT); ruleLabel.setMaximumSize(labelDimension); horizontalLabelParallelGroup.addComponent(ruleLabel); JComponent component = null; - if (votingResults.isEmpty()) { + if (imposedStrategyEnabled) { + component = new JLabel(""); + } + else if (votingResults.isEmpty()) { JRadioButton radioButton = new JRadioButton(); radioButton.setActionCommand(strategy.name()); buttonGroup.add(radioButton); component = radioButton; - horizontalButtonParallelGroup.addComponent(radioButton); - verticalGroup.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE).addComponent(ruleLabel).addComponent(radioButton)); - } - else if (imposedStrategyEnabled) { - component = new JLabel(""); +// horizontalButtonParallelGroup.addComponent(radioButton); +// verticalGroup.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE).addComponent(ruleLabel).addComponent(radioButton)); } else { Integer numberOfVotes = votingResults.get(strategy); @@ -129,6 +133,10 @@ JButton submitButton = new JButton("Submit"); submitButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { + if (client.getCurrentRoundConfiguration().isImposedStrategyEnabled()) { + client.sendRuleVoteRequest(null); + return; + } ButtonModel model = buttonGroup.getSelection(); if (model == null) { JOptionPane.showMessageDialog(VotingForm.this, "Please select a strategy."); diff -r 364783961ebf5cb6fcb66667a8e49e5ca3c71a63 -r d5cbf4f5202e68ef393a27522752ce044631a1fc src/main/resources/configuration/iu/2011/imposed-punish/server.xml --- a/src/main/resources/configuration/iu/2011/imposed-punish/server.xml +++ b/src/main/resources/configuration/iu/2011/imposed-punish/server.xml @@ -261,14 +261,6 @@ </entry><entry key='voting-results'><![CDATA[ - {if (self.imposedStrategyEnabled)} - <h1>The Assigned Strategy</h1> - <hr> - <p>Your group is being assigned the following strategy. All other members in your group are being notified of the same strategy.</p> - <ul> - <li><b>{first(selectedRules)}</b></li> - </ul> - {else} <h1>Nomination Results</h1><hr><table border=3 cellspacing=3 cellpadding=3> @@ -283,7 +275,6 @@ <p><b>NOTE:</b> There was a tie and the selected strategy listed here was randomly selected as the winner.</p> {endif} <p><b> {first(selectedRules)} </b></p> - {endif} <h2>Implementation</h2><hr><p> @@ -397,5 +388,34 @@ </p> ]]></entry> +<entry key='submitted-vote-instructions'> + <![CDATA[ + {if (self.imposedStrategyEnabled)} + <h1>The Assigned Strategy</h1> + <hr> + <p>Your group is being assigned the following strategy. All other members in your group are being notified of the same strategy.</p> + <ul> + <li><b>{first(selectedRules)}</b></li> + </ul> + <h2>Implementation</h2> + <hr> + <p> + Neither the computer, nor the experimenter will intervene to implement the + strategy. + </p> + <p><b>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. + </p> + + {else} + <h1>Submitted</h1> + <hr> + <p>Your nomination has been recorded. The final + results of the nomination will be shown once all the nominations in your + group have been received. + </p> + {endif} + ]]> +</entry></properties> diff -r 364783961ebf5cb6fcb66667a8e49e5ca3c71a63 -r d5cbf4f5202e68ef393a27522752ce044631a1fc src/main/resources/configuration/iu/2011/imposed/server.xml --- a/src/main/resources/configuration/iu/2011/imposed/server.xml +++ b/src/main/resources/configuration/iu/2011/imposed/server.xml @@ -261,14 +261,6 @@ </entry><entry key='voting-results'><![CDATA[ - {if (self.imposedStrategyEnabled)} - <h1>The Assigned Strategy</h1> - <hr> - <p>Your group is being assigned the following strategy. All other members in your group are being notified of the same strategy.</p> - <ul> - <li><b>{first(selectedRules)}</b></li> - </ul> - {else} <h1>Nomination Results</h1><hr><table border=3 cellspacing=3 cellpadding=3> @@ -283,7 +275,6 @@ <p><b>NOTE:</b> There was a tie and the selected strategy listed here was randomly selected as the winner.</p> {endif} <p><b> {first(selectedRules)} </b></p> - {endif} <h2>Implementation</h2><hr><p> @@ -399,4 +390,33 @@ </p> ]]></entry> +<entry key='submitted-vote-instructions'> + <![CDATA[ + {if (self.imposedStrategyEnabled)} + <h1>The Assigned Strategy</h1> + <hr> + <p>Your group is being assigned the following strategy. All other members in your group are being notified of the same strategy.</p> + <ul> + <li><b>{first(selectedRules)}</b></li> + </ul> + <h2>Implementation</h2> + <hr> + <p> + Neither the computer, nor the experimenter will intervene to implement the + strategy. + </p> + <p><b>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. + </p> + + {else} + <h1>Submitted</h1> + <hr> + <p>Your nomination has been recorded. The final + results of the nomination will be shown once all the nominations in your + group have been received. + </p> + {endif} + ]]> +</entry></properties> 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. |
From: Bitbucket <com...@bi...> - 2012-02-29 18:31:34
|
1 new commit in foraging: https://bitbucket.org/virtualcommons/foraging/changeset/4351f342ae09/ changeset: 4351f342ae09 user: alllee date: 2012-02-29 19:31:26 summary: removing local instance of facilitatorId, was preventing AbstractExperiment.sendFacilitatorMessage from actually transmitting the data to the facilitator affected #: 1 file diff -r 1cc6697f2ffa7798b9862b06e1d3b0ab1db8276a -r 4351f342ae091ac9bd56251f309c75ee67a3fa4d 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 @@ -102,8 +102,6 @@ public final static int SYNCHRONIZATION_FREQUENCY = 60; public final static int SERVER_SLEEP_INTERVAL = 75; - private Identifier facilitatorId; - // FIXME: investigate using java.util.concurrent constructs instead, e.g., CountDownLatch / CyclicBarrier private final Object roundSignal = new Object(); private final Object quizSignal = new Object(); @@ -281,7 +279,7 @@ public void handle(FacilitatorCensoredChatRequest request) { if (getCurrentRoundConfiguration().isCensoredChat()) { sendFacilitatorMessage("needs approval: " + request); - request.setId(facilitatorId); + request.setId(getFacilitatorId()); transmit(request); } else { @@ -306,7 +304,7 @@ public void handle(final QuizResponseEvent event) { sendFacilitatorMessage("Received quiz response: " + event); numberOfSubmittedQuizzes++; - transmit(new QuizCompletedEvent(facilitatorId, event)); + transmit(new QuizCompletedEvent(getFacilitatorId(), event)); ClientData clientData = clients.get(event.getId()); clientData.addCorrectQuizAnswers(event.getNumberOfCorrectAnswers()); if (numberOfSubmittedQuizzes >= clients.size()) { @@ -333,7 +331,7 @@ transmit(updateEvent); } // update the facilitator - transmit(new FacilitatorSanctionUpdateEvent(facilitatorId, serverDataModel)); + transmit(new FacilitatorSanctionUpdateEvent(getFacilitatorId(), serverDataModel)); Utils.notify(facilitatorSignal); numberOfCompletedSanctions = 0; } @@ -413,7 +411,7 @@ transmit(new RuleSelectedUpdateEvent(id, selectedRules, votingResults)); } - store(new RuleSelectedUpdateEvent(facilitatorId, selectedRules, votingResults)); + store(new RuleSelectedUpdateEvent(getFacilitatorId(), selectedRules, votingResults)); } } @@ -579,8 +577,9 @@ // facilitator handlers addEventProcessor(new EventTypeProcessor<FacilitatorRegistrationRequest>(FacilitatorRegistrationRequest.class) { public void handle(FacilitatorRegistrationRequest event) { - // remap the facilitator ID and remove from the clients list. - facilitatorId = event.getId(); + Identifier facilitatorId = event.getId(); + getLogger().info("Registering facilitator: " + facilitatorId); + setFacilitatorId(event.getId()); synchronized (clients) { clients.remove(facilitatorId); } @@ -589,7 +588,7 @@ addEventProcessor(new EventTypeProcessor<ImposeStrategyEvent>(ImposeStrategyEvent.class) { @Override public void handle(ImposeStrategyEvent event) { - if (! event.getId().equals(facilitatorId)) { + if (! event.getId().equals(getFacilitatorId())) { sendFacilitatorMessage("Ignoring request to impose strategy " + event); return; } @@ -611,7 +610,7 @@ addEventProcessor(new EventTypeProcessor<ShowImposedStrategyRequest>(ShowImposedStrategyRequest.class) { @Override public void handle(ShowImposedStrategyRequest request) { - if (! request.getId().equals(facilitatorId)) { + if (! request.getId().equals(getFacilitatorId())) { sendFacilitatorMessage("Ignoring request to show imposed strategies from: " + request.getId()); return; } @@ -625,7 +624,7 @@ @Override public void handle(ShowRequest request) { // validity checks: request from facilitator? - if (! request.getId().equals(facilitatorId)) { + if (! request.getId().equals(getFacilitatorId())) { sendFacilitatorMessage("Ignoring show request from non facilitator id: " + request.getId()); return; } @@ -641,7 +640,7 @@ }); addEventProcessor(new EventTypeProcessor<BeginRoundRequest>(BeginRoundRequest.class) { public void handle(BeginRoundRequest event) { - if (event.getId().equals(facilitatorId)) { + if (event.getId().equals(getFacilitatorId())) { if (isReadyToStartRound()) { getLogger().info("Begin round request from facilitator - starting round."); experimentStarted = true; @@ -661,7 +660,7 @@ }); addEventProcessor(new EventTypeProcessor<EndRoundRequest>(EndRoundRequest.class) { public void handle(EndRoundRequest request) { - if (request.getId().equals(facilitatorId)) { + if (request.getId().equals(getFacilitatorId())) { // set current round duration to expire? currentRoundDuration.stop(); } @@ -695,7 +694,7 @@ clientData.setTrustGamePlayerOneAmountToKeep(request.getPlayerOneAmountToKeep()); clientData.setTrustGamePlayerTwoAmountsToKeep(request.getPlayerTwoAmountsToKeep()); persister.store(request); - transmit(new TrustGameSubmissionEvent(facilitatorId, request)); + transmit(new TrustGameSubmissionEvent(getFacilitatorId(), request)); numberOfSubmissions++; sendFacilitatorMessage(String.format("Received trust game submission %s (%d total)", request, numberOfSubmissions)); } @@ -766,7 +765,7 @@ transmit(new ShowExitInstructionsRequest(data.getId(), data.getGroupDataModel())); } } - transmitAndStore(new TrustGameResultsFacilitatorEvent(facilitatorId, serverDataModel, allTrustGameResults)); + transmitAndStore(new TrustGameResultsFacilitatorEvent(getFacilitatorId(), serverDataModel, allTrustGameResults)); Utils.notify(facilitatorSignal); } @@ -859,7 +858,7 @@ // while waiting for connections we must defer group initialization till all clients // are connected (which is unknown, we allow clients to connect until the experiment has started) setupRound(); - sendFacilitatorMessage("Ready to show instructions and the start next round."); + sendFacilitatorMessage("Ready to show instructions and start the next round."); if (getCurrentRoundConfiguration().isQuizEnabled()) { getLogger().info("Waiting for all quizzes to be submitted."); Utils.waitOn(quizSignal); @@ -918,7 +917,7 @@ for (Identifier id : clients.keySet()) { transmit(new SetConfigurationEvent<RoundConfiguration>(id, nextRoundConfiguration)); } - transmit(new SetConfigurationEvent<RoundConfiguration>(facilitatorId, nextRoundConfiguration)); + transmit(new SetConfigurationEvent<RoundConfiguration>(getFacilitatorId(), nextRoundConfiguration)); } private void processRound() { @@ -982,7 +981,7 @@ } // FIXME: refine this, send basic info to the facilitator (how many resources left, etc.) if (shouldUpdateFacilitator()) { - transmit(new FacilitatorUpdateEvent(facilitatorId, serverDataModel, currentRoundDuration.getTimeLeft())); + transmit(new FacilitatorUpdateEvent(getFacilitatorId(), serverDataModel, currentRoundDuration.getTimeLeft())); } } @@ -994,7 +993,7 @@ private boolean shouldSynchronize(ClientData data) { long startCount = secondTick.getStartCount(); int assignedNumber = data.getAssignedNumber(); - return (startCount < 2) || ((startCount % SYNCHRONIZATION_FREQUENCY) == (assignedNumber * 10)); + return (startCount == 0) || ((startCount % SYNCHRONIZATION_FREQUENCY) == (assignedNumber * 10)); } private void sendEndRoundEvents() { @@ -1002,7 +1001,7 @@ // 1. avg number of tokens collected in this round for the group // 2. total number of tokens collected by this client // 3. number of tokens collected by this client in this round. - transmit(new FacilitatorEndRoundEvent(facilitatorId, serverDataModel)); + transmit(new FacilitatorEndRoundEvent(getFacilitatorId(), serverDataModel)); boolean lastRound = getConfiguration().isLastRound(); for (Map.Entry<Identifier, ClientData> clientDataEntry : clients.entrySet()) { Identifier id = clientDataEntry.getKey(); @@ -1081,7 +1080,7 @@ getLogger().info("monitor rotation interval: " + monitorRotationInterval); } currentRoundDuration.start(); - transmit(new FacilitatorUpdateEvent(facilitatorId, serverDataModel, currentRoundDuration.getTimeLeft())); + transmit(new FacilitatorUpdateEvent(getFacilitatorId(), serverDataModel, currentRoundDuration.getTimeLeft())); secondTick.start(); serverState = ServerState.ROUND_IN_PROGRESS; } 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. |
From: Bitbucket <com...@bi...> - 2012-02-29 18:08:39
|
1 new commit in foraging: https://bitbucket.org/virtualcommons/foraging/changeset/1cc6697f2ffa/ changeset: 1cc6697f2ffa user: alllee date: 2012-02-29 19:08:33 summary: fixing NPE in GroupDataModel and adding imposed strategy to voting results template affected #: 4 files diff -r 08ab85fd7a2122a73b5d796ea20b6f9c4c55984c -r 1cc6697f2ffa7798b9862b06e1d3b0ab1db8276a 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 @@ -773,6 +773,7 @@ public Map<Strategy, Integer> generateVotingResults(boolean imposedStrategyEnabled) { Map<Strategy, Integer> tallyMap = new HashMap<Strategy, Integer>(); + selectedRules = new ArrayList<Strategy>(); if (imposedStrategyEnabled) { // short circuits to use the imposed strategy tallyMap.put(getImposedStrategy(), 1); @@ -787,7 +788,7 @@ } tallyMap.put(rule, count + 1); } - selectedRules = new ArrayList<Strategy>(); + Integer maxSeenValue = 0; for (Map.Entry<Strategy, Integer> entry : tallyMap.entrySet()) { Integer currentValue = entry.getValue(); diff -r 08ab85fd7a2122a73b5d796ea20b6f9c4c55984c -r 1cc6697f2ffa7798b9862b06e1d3b0ab1db8276a 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 @@ -261,7 +261,7 @@ public void handle(DisconnectionRequest event) { synchronized (clients) { Identifier id = event.getId(); - getLogger().warning("Disconnecting client, removing " + id + " from clients " + clients.keySet()); + sendFacilitatorMessage("Received DisconnectionRequest, removing " + id + " from clients " + clients.keySet(), event.getException()); clients.remove(id); serverDataModel.removeClient(id); } diff -r 08ab85fd7a2122a73b5d796ea20b6f9c4c55984c -r 1cc6697f2ffa7798b9862b06e1d3b0ab1db8276a src/main/resources/configuration/iu/2011/imposed-punish/server.xml --- a/src/main/resources/configuration/iu/2011/imposed-punish/server.xml +++ b/src/main/resources/configuration/iu/2011/imposed-punish/server.xml @@ -261,6 +261,14 @@ </entry><entry key='voting-results'><![CDATA[ + {if (self.imposedStrategyEnabled)} + <h1>The Assigned Strategy</h1> + <hr> + <p>Your group is being assigned the following strategy. All other members in your group are being notified of the same strategy.</p> + <ul> + <li><b>{first(selectedRules)}</b></li> + </ul> + {else} <h1>Nomination Results</h1><hr><table border=3 cellspacing=3 cellpadding=3> @@ -275,6 +283,16 @@ <p><b>NOTE:</b> There was a tie and the selected strategy listed here was randomly selected as the winner.</p> {endif} <p><b> {first(selectedRules)} </b></p> + {endif} + <h2>Implementation</h2> + <hr> + <p> + Neither the computer, nor the experimenter will intervene to implement the + strategy. + </p> + <p><b>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. + </p> ]]></entry><entry key='initial-voting-instructions'> diff -r 08ab85fd7a2122a73b5d796ea20b6f9c4c55984c -r 1cc6697f2ffa7798b9862b06e1d3b0ab1db8276a src/main/resources/configuration/iu/2011/imposed/server.xml --- a/src/main/resources/configuration/iu/2011/imposed/server.xml +++ b/src/main/resources/configuration/iu/2011/imposed/server.xml @@ -261,6 +261,14 @@ </entry><entry key='voting-results'><![CDATA[ + {if (self.imposedStrategyEnabled)} + <h1>The Assigned Strategy</h1> + <hr> + <p>Your group is being assigned the following strategy. All other members in your group are being notified of the same strategy.</p> + <ul> + <li><b>{first(selectedRules)}</b></li> + </ul> + {else} <h1>Nomination Results</h1><hr><table border=3 cellspacing=3 cellpadding=3> @@ -275,6 +283,16 @@ <p><b>NOTE:</b> There was a tie and the selected strategy listed here was randomly selected as the winner.</p> {endif} <p><b> {first(selectedRules)} </b></p> + {endif} + <h2>Implementation</h2> + <hr> + <p> + Neither the computer, nor the experimenter will intervene to implement the + strategy. + </p> + <p><b>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. + </p> ]]></entry><entry key='initial-voting-instructions'> 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. |