[virtualcommons-svn] SF.net SVN: virtualcommons:[359] irrigation/trunk
Status: Beta
Brought to you by:
alllee
From: <al...@us...> - 2009-11-13 04:17:36
|
Revision: 359 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=359&view=rev Author: alllee Date: 2009-11-13 04:17:26 +0000 (Fri, 13 Nov 2009) Log Message: ----------- - updated build.xml build.dir to reflect maven src structure - added payoff image to interface - wired up facilitator / server events - added quiz questions to server configuration file Modified Paths: -------------- irrigation/trunk/build.xml irrigation/trunk/src/main/java/edu/asu/commons/irrigation/client/ChatPanel.java irrigation/trunk/src/main/java/edu/asu/commons/irrigation/client/ExperimentGameWindow.java irrigation/trunk/src/main/java/edu/asu/commons/irrigation/client/MainIrrigationGameWindow.java irrigation/trunk/src/main/java/edu/asu/commons/irrigation/conf/ServerConfiguration.java irrigation/trunk/src/main/java/edu/asu/commons/irrigation/facilitator/Facilitator.java irrigation/trunk/src/main/java/edu/asu/commons/irrigation/facilitator/FacilitatorWindow.java irrigation/trunk/src/main/java/edu/asu/commons/irrigation/server/IrrigationServer.java irrigation/trunk/src/main/resources/configuration/asu-fall-2009/mixed-pretest/irrigation.xml Added Paths: ----------- irrigation/trunk/src/main/resources/images/ irrigation/trunk/src/main/resources/images/payoff-structure.jpg Modified: irrigation/trunk/build.xml =================================================================== --- irrigation/trunk/build.xml 2009-11-13 00:23:33 UTC (rev 358) +++ irrigation/trunk/build.xml 2009-11-13 04:17:26 UTC (rev 359) @@ -51,7 +51,7 @@ <property file="build.properties" /> <!-- default compilation properties --> <property name='src.dir' value='src/main/java'/> - <property name='build.dir' value='target'/> + <property name='build.dir' value='target/classes'/> <!-- default web & deployment properties --> <property name='web.dir' value='src/main/webapp'/> Modified: irrigation/trunk/src/main/java/edu/asu/commons/irrigation/client/ChatPanel.java =================================================================== --- irrigation/trunk/src/main/java/edu/asu/commons/irrigation/client/ChatPanel.java 2009-11-13 00:23:33 UTC (rev 358) +++ irrigation/trunk/src/main/java/edu/asu/commons/irrigation/client/ChatPanel.java 2009-11-13 04:17:26 UTC (rev 359) @@ -106,11 +106,11 @@ private void sendMessage() { String message = chatField.getText(); if (message != null && ! message.isEmpty() && targetIdentifier != null) { + displayMessage(String.format("%s -> %s", getChatHandle(getClientId()), getChatHandle(targetIdentifier)), + message); chatField.setText(""); irrigationClient.transmit(new ChatRequest(getClientId(), message, targetIdentifier)); - displayMessage( - String.format("%s -> %s", getChatHandle(getClientId()), getChatHandle(targetIdentifier)), - message); + } chatField.requestFocusInWindow(); } @@ -198,7 +198,6 @@ } catch (BadLocationException e) { e.printStackTrace(); - throw new RuntimeException(e); } } @@ -229,8 +228,8 @@ public void handle(final ChatEvent chatEvent) { SwingUtilities.invokeLater(new Runnable() { public void run() { - displayMessage(getChatHandle(chatEvent.getSource()) + " -> " - + getChatHandle(chatEvent.getTarget()), chatEvent.toString()); + displayMessage(String.format("%s -> %s", getChatHandle(chatEvent.getSource()), getChatHandle(chatEvent.getTarget())), + chatEvent.toString()); } }); } Modified: irrigation/trunk/src/main/java/edu/asu/commons/irrigation/client/ExperimentGameWindow.java =================================================================== --- irrigation/trunk/src/main/java/edu/asu/commons/irrigation/client/ExperimentGameWindow.java 2009-11-13 00:23:33 UTC (rev 358) +++ irrigation/trunk/src/main/java/edu/asu/commons/irrigation/client/ExperimentGameWindow.java 2009-11-13 04:17:26 UTC (rev 359) @@ -238,11 +238,18 @@ private String getQuizPage() { - StringBuilder builder = new StringBuilder(getServerConfiguration().getQuizPage(currentQuizPageNumber)); + StringBuilder builder = new StringBuilder(); + String quizPage = getServerConfiguration().getQuizPage(currentQuizPageNumber); String quizPageResponse = quizPageResponses.get(currentQuizPageNumber); - if (quizPageResponse != null) { - builder.append(quizPageResponse); + 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(); } @@ -438,8 +445,7 @@ for (Map.Entry<Object, Object> entry : responses.entrySet()) { sortedResponses.put((String) entry.getKey(), (String) entry.getValue()); } - - builder.append("<h3>Results</h3>"); + builder.append("<hr/><h2>Results</h2>"); for (Map.Entry<String, String> entry : sortedResponses.entrySet()) { String questionNumber = (String) entry.getKey(); if (questionNumber.charAt(0) == 'q') { @@ -456,9 +462,6 @@ builder.append(String.format("Correct answer: %s<br/>", correctAnswer)); builder.append(quizAnswers.get( "qDescriptiveAnswer" + number )).append("</p>"); } - else { - System.err.println("weird stuff in form data: " + questionNumber + ":" + entry.getValue()); - } } quizPageResponses.put(currentQuizPageNumber, builder.toString()); // no matter what we move on to the next question page @@ -468,6 +471,7 @@ } quizzesAnswered++; client.transmit(new QuizResponseEvent(client.getId(), currentQuizPageNumber, responses, incorrectAnswers)); + setInstructions(getQuizPage()); } }; @@ -550,7 +554,9 @@ StringBuilder builder = new StringBuilder(); builder.append( String.format( - "<h2>The current infrastructure efficiency is %d%%. The irrigation capacity is %d cubic feet per second and the water supply is %d cubic feet per second.</h2>", + "<h2>Current infrastructure efficiency: %d%%</h2>" + + "<h2>Current irrigation capacity: %d cubic feet per second</h2>" + + "<h2>Available water supply: %d cubic feet per second</h2>", infrastructureEfficiency, group.calculateFlowCapacity(infrastructureEfficiency), roundConfiguration.getWaterSupplyCapacity() Modified: irrigation/trunk/src/main/java/edu/asu/commons/irrigation/client/MainIrrigationGameWindow.java =================================================================== --- irrigation/trunk/src/main/java/edu/asu/commons/irrigation/client/MainIrrigationGameWindow.java 2009-11-13 00:23:33 UTC (rev 358) +++ irrigation/trunk/src/main/java/edu/asu/commons/irrigation/client/MainIrrigationGameWindow.java 2009-11-13 04:17:26 UTC (rev 359) @@ -11,11 +11,11 @@ import javax.swing.Box; import javax.swing.BoxLayout; import javax.swing.GroupLayout; +import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JProgressBar; -import javax.swing.JScrollPane; import javax.swing.JTextField; import javax.swing.SwingConstants; import javax.swing.SwingUtilities; @@ -23,7 +23,6 @@ import javax.swing.GroupLayout.ParallelGroup; import edu.asu.commons.irrigation.server.ClientData; -import edu.asu.commons.util.HtmlEditorPane; /** * $Id$ * @@ -84,10 +83,6 @@ private JTextField irrigationCapacityTextField; private JTextField waterSupplyTextField; - private HtmlEditorPane waterCollectedToTokensTable; - - private JScrollPane waterCollectedToTokensScrollPane; - public MainIrrigationGameWindow(IrrigationClient client) { super(); this.client = client; @@ -361,15 +356,8 @@ return jPanelDownStreamWindow; } - private JScrollPane getWaterCollectedToTokensTable() { - if (waterCollectedToTokensTable == null) { - waterCollectedToTokensTable = new HtmlEditorPane(); - waterCollectedToTokensTable.setEditable(false); - waterCollectedToTokensTable.setText(client.getServerConfiguration().getWaterCollectedToTokensTable()); - waterCollectedToTokensScrollPane = new JScrollPane(waterCollectedToTokensTable); - waterCollectedToTokensScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); - } - return waterCollectedToTokensScrollPane; + private JLabel getWaterCollectedToTokensTable() { + return new JLabel(new ImageIcon("images/payoff-structure.jpg")); } /** Modified: irrigation/trunk/src/main/java/edu/asu/commons/irrigation/conf/ServerConfiguration.java =================================================================== --- irrigation/trunk/src/main/java/edu/asu/commons/irrigation/conf/ServerConfiguration.java 2009-11-13 00:23:33 UTC (rev 358) +++ irrigation/trunk/src/main/java/edu/asu/commons/irrigation/conf/ServerConfiguration.java 2009-11-13 04:17:26 UTC (rev 359) @@ -129,7 +129,7 @@ } public int getNumberOfQuestionPages() { - return assistant.getIntProperty("question-pages", 8); + return assistant.getIntProperty("question-pages", 2); } public int getChatDuration() { Modified: irrigation/trunk/src/main/java/edu/asu/commons/irrigation/facilitator/Facilitator.java =================================================================== --- irrigation/trunk/src/main/java/edu/asu/commons/irrigation/facilitator/Facilitator.java 2009-11-13 00:23:33 UTC (rev 358) +++ irrigation/trunk/src/main/java/edu/asu/commons/irrigation/facilitator/Facilitator.java 2009-11-13 04:17:26 UTC (rev 359) @@ -32,20 +32,16 @@ */ public class Facilitator { - private final static Facilitator INSTANCE = new Facilitator(); + private Identifier id; - private Identifier id; // @jve:decl-index=0: - private ClientDispatcher dispatcher; private ServerConfiguration configuration; - private ServerDataModel serverGameState; // @jve:decl-index=0: + private ServerDataModel serverDataModel; // @jve:decl-index=0: private FacilitatorWindow facilitatorWindow; - private boolean experimentRunning = false; - private final EventChannel channel = EventChannelFactory.create(); private Facilitator() { @@ -71,10 +67,6 @@ }); } - public static Facilitator getInstance(){ - return INSTANCE; - } - public void setConfiguration(ServerConfiguration configuration) { if (configuration == null) { System.err.println("attempt to setConfiguration with null, ignoring"); @@ -85,10 +77,6 @@ } } - /** - * @param args - */ - /* * Connects facilitator to the server and registers with the server as a facilitator. * @@ -121,8 +109,8 @@ public static void main(String[] args) { Runnable createGuiRunnable = new Runnable() { public void run() { - Dimension dimension = new Dimension(600, 600); - Facilitator facilitator = Facilitator.getInstance(); + Dimension dimension = new Dimension(800, 600); + Facilitator facilitator = new Facilitator(); facilitator.initialize(); facilitator.connect(); JFrame frame = new JFrame(); @@ -161,23 +149,19 @@ return id; } - public ServerDataModel getServerGameState(){ - return serverGameState; + public ServerDataModel getServerDataModel(){ + return serverDataModel; } public ServerConfiguration getConfiguration(){ return configuration; } - public boolean isExperimentRunning(){ - return experimentRunning; - } - public RoundConfiguration getCurrentRoundConfiguration() { return configuration.getCurrentParameters(); } - public void setServerGameState(ServerDataModel serverGameState) { - this.serverGameState = serverGameState; + public void setServerDataModel(ServerDataModel serverGameState) { + this.serverDataModel = serverGameState; } } Modified: irrigation/trunk/src/main/java/edu/asu/commons/irrigation/facilitator/FacilitatorWindow.java =================================================================== --- irrigation/trunk/src/main/java/edu/asu/commons/irrigation/facilitator/FacilitatorWindow.java 2009-11-13 00:23:33 UTC (rev 358) +++ irrigation/trunk/src/main/java/edu/asu/commons/irrigation/facilitator/FacilitatorWindow.java 2009-11-13 04:17:26 UTC (rev 359) @@ -14,6 +14,8 @@ import javax.swing.SwingUtilities; import edu.asu.commons.irrigation.events.BeginChatRoundRequest; +import edu.asu.commons.irrigation.events.ShowGameScreenshotRequest; +import edu.asu.commons.irrigation.events.ShowQuizRequest; import edu.asu.commons.irrigation.events.ShowTokenInvestmentScreenRequest; import edu.asu.commons.irrigation.events.FacilitatorEndRoundEvent; import edu.asu.commons.irrigation.events.ShowInstructionsRequest; @@ -46,6 +48,10 @@ private JButton showInstructionsButton; + private JButton showQuizButton; + + private JButton showScreenshotButton; + private JButton displayInvestmentButton; private StringBuilder builder = new StringBuilder(); @@ -71,7 +77,9 @@ buttonPanel.add(getShowInstructionsButton()); buttonPanel.add(getBeginChatButton()); buttonPanel.add(getDisplayInvestmentButton()); + buttonPanel.add(getShowScreenshotButton()); buttonPanel.add(getStartRoundButton()); + buttonPanel.add(getShowQuizButton()); buttonPanel.add(getStartRoundOverrideButton()); add(buttonPanel, BorderLayout.NORTH); editorPane = new HtmlEditorPane(); @@ -144,20 +152,9 @@ return facilitator; } - /** - * This method initializes Stop - * - * @return javax.swing.JButton - */ - /** - * This method initializes Start_Round_Button - * - * @return javax.swing.JButton - */ - private JButton getStartRoundButton() { + private JButton getStartRoundButton() { if (startRoundButton == null) { - startRoundButton = new JButton(); - startRoundButton.setText("Start Round"); + startRoundButton = new JButton("Start round"); startRoundButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { facilitator.sendBeginRoundRequest(); @@ -167,6 +164,18 @@ return startRoundButton; } + private JButton getShowQuizButton() { + if (showQuizButton == null) { + showQuizButton = new JButton("Show quiz"); + showQuizButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + facilitator.transmit(new ShowQuizRequest(facilitator.getId())); + } + }); + } + return showQuizButton; + } + public void setText(final String text) { SwingUtilities.invokeLater(new Runnable() { public void run() { @@ -218,4 +227,16 @@ setText(builder.toString()); } + private JButton getShowScreenshotButton() { + if (showScreenshotButton == null) { + showScreenshotButton = new JButton("Show screenshot"); + showScreenshotButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + facilitator.transmit(new ShowGameScreenshotRequest(facilitator.getId())); + } + }); + } + return showScreenshotButton; + } + } Modified: irrigation/trunk/src/main/java/edu/asu/commons/irrigation/server/IrrigationServer.java =================================================================== --- irrigation/trunk/src/main/java/edu/asu/commons/irrigation/server/IrrigationServer.java 2009-11-13 00:23:33 UTC (rev 358) +++ irrigation/trunk/src/main/java/edu/asu/commons/irrigation/server/IrrigationServer.java 2009-11-13 04:17:26 UTC (rev 359) @@ -21,7 +21,6 @@ import edu.asu.commons.irrigation.events.BeginChatRoundRequest; import edu.asu.commons.irrigation.events.ClientUpdateEvent; import edu.asu.commons.irrigation.events.CloseGateEvent; -import edu.asu.commons.irrigation.events.ShowTokenInvestmentScreenRequest; import edu.asu.commons.irrigation.events.EndRoundEvent; import edu.asu.commons.irrigation.events.FacilitatorEndRoundEvent; import edu.asu.commons.irrigation.events.InfrastructureUpdateEvent; @@ -31,7 +30,10 @@ import edu.asu.commons.irrigation.events.QuizResponseEvent; import edu.asu.commons.irrigation.events.RegistrationEvent; import edu.asu.commons.irrigation.events.RoundStartedEvent; +import edu.asu.commons.irrigation.events.ShowGameScreenshotRequest; import edu.asu.commons.irrigation.events.ShowInstructionsRequest; +import edu.asu.commons.irrigation.events.ShowQuizRequest; +import edu.asu.commons.irrigation.events.ShowTokenInvestmentScreenRequest; import edu.asu.commons.net.Dispatcher; import edu.asu.commons.net.Identifier; import edu.asu.commons.net.event.ConnectionEvent; @@ -93,6 +95,26 @@ } private void initializeFacilitatorHandlers() { + addEventProcessor(new EventTypeProcessor<ShowGameScreenshotRequest>(ShowGameScreenshotRequest.class) { + public void handle(ShowGameScreenshotRequest request) { + // FIXME: check request id against facilitator id? + synchronized (clients) { + for (Identifier id: clients.keySet()) { + transmit(new ShowGameScreenshotRequest(id)); + } + } + } + }); + addEventProcessor(new EventTypeProcessor<ShowQuizRequest>(ShowQuizRequest.class) { + public void handle(ShowQuizRequest request) { + // FIXME: check request id against facilitator id? + synchronized (clients) { + for (Identifier id: clients.keySet()) { + transmit(new ShowQuizRequest(id)); + } + } + } + }); addEventProcessor(new EventTypeProcessor<FacilitatorRegistrationRequest>(FacilitatorRegistrationRequest.class) { @Override public void handle(FacilitatorRegistrationRequest event) { Modified: irrigation/trunk/src/main/resources/configuration/asu-fall-2009/mixed-pretest/irrigation.xml =================================================================== --- irrigation/trunk/src/main/resources/configuration/asu-fall-2009/mixed-pretest/irrigation.xml 2009-11-13 00:23:33 UTC (rev 358) +++ irrigation/trunk/src/main/resources/configuration/asu-fall-2009/mixed-pretest/irrigation.xml 2009-11-13 04:17:26 UTC (rev 359) @@ -104,8 +104,9 @@ <![CDATA[ <img src="http://dev.commons.asu.edu/irrigation/images/game-interface-screenshot.jpg"> -<b>Table 2</b>: Earnings resulting from the amount of water applied to your field. - +<p> +<b>Table 2</b>: Number of tokens earned from the water applied to your field. +</p> <table border="1" cellspacing="2" cellpadding="2"> <thead> <th>Water units received (cubic feet)</th> @@ -189,173 +190,96 @@ <entry key="quiz-page1"> <![CDATA[ -<br><br> -To continue to the next page, please answer the following question:<br> -<form> -How many OTHER people in the room will be in your group?<br> -<input type="radio" name="q1" value="0">0<br> -<input type="radio" name="q1" value="1">1<br> -<input type="radio" name="q1" value="4">4<br> -<input type="radio" name="q1" value="Everybody">Everybody<br> -<br><br> -<input type="submit" name="submit" value="Submit"> -</form> -]]> -</entry> +<p> +The first two questions deal with irrigation infrastructure investment using Table +1. +</p> +<p> +<b>Table 1</b>: The water delivery capacity as a function of irrigation +infrastructure efficiency +</p> +<table border="1" cellspacing="2" cellpadding="2"> +<thead> +<th>Infrastructure Efficiency (percent)</th> +<th>Water delivery (cubic feet per second)</th> +</thead> +<tr> +<td> ≤ 45</td><td>0</td> +</tr> +<tr> +<td>46-51</td><td>5</td> +</tr> +<tr> +<td>52-55</td><td>10</td> +</tr> +<tr> +<td>56-58</td><td>15</td> +</tr> +<tr> +<td>59-61</td><td>20</td> +</tr> +<tr> +<td>62-65</td><td>25</td> +</tr> +<tr> +<td>66-70</td><td>30</td> +</tr> +<tr> +<td>71-80</td><td>35</td> +</tr> +<tr> +<td>81-100</td><td>40</td> +</tr> +</table> -<entry key="quiz-page2"> -<![CDATA[ -<br><br> -To continue to the next page, please answer the following question:<br> <form> -Which of the following topics are you <b>not allowed</b> to discuss in chat?<br> -<input type="radio" name="q2" value="weather">the weather<br> -<input type="radio" name="q2" value="identity">your real identity<br> -<input type="radio" name="q2" value="experiment">the experiment<br> -<input type="radio" name="q2" value="earnings">what you will do with the money you earn from this experiment<br> -<br><br> -<input type="submit" name="submit" value="Submit"> -</form> -]]> -</entry> - - -<entry key="quiz-page3"> -<![CDATA[ -<br><br> -To continue to the next page, please answer the following questions:<br> -<form> 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? -(<small><b>Note: only enter a number, you don't need to add the % sign</b></small>)<br> -<input type="text" name="q3" value = ""> +efficiency?<br> +<input type="text" name="q1" value = "">% <br><br> Question 2:<br> -Given an existing infrastructure efficiency of 50%, if <b>two participants invest 10 tokens each</b> -while the <b>three other participants invest 2 tokens each</b>, what is the new -irrigation infrastructure efficiency? -(<b>Note: only enter a number, you don't need to add the % sign</b>)<br> -<input type="text" name="q4" value = ""> +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> -<input type="submit" name="submit" value="Submit"><br> -<br> -</form> -]]> -</entry> - -<entry key="quiz-page4"> -<![CDATA[ +<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> -To continue to the next page, please answer the following question:<br> Question 3:<br> -<form> -What is the minimum time to deliver 500 cubic feet of water to your field when -your maximum water flow capacity is available? +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> -<input type="radio" name="q5" value="12.5">12.5 seconds<br> -<input type="radio" name="q5" value="20">20 seconds<br> -<input type="radio" name="q5" value="25">25 seconds<br> -<input type="radio" name="q5" value="50">50 seconds<br> +<input type='text' name='q3' value=''> cubic feet per second <br><br> -<input type="submit" name="submit" value="Submit"> -</form> -]]> -</entry> - - -<entry key="general-instructions5"> -<![CDATA[ -<h3>Positions A,B,C,D and E</h3> -<p> -The animation above illustrates how water flows to each player when their gates are -opened and closed. When a player opens their gate, the black line will rotate to a -vertical position, allowing water (represented by white dots) to flow to them. Note -that the water available downstream of a player with an open port is reduced, -illustrated by a narrowing of the canal. -</p> -<p> -Access to water depends on your position as shown in the window. Water originates -in the box at the upper left part of the screen and travels to the right. Thus, -participant A will have first access to the available water. Water not used by -participant A is then available to be used by participant B. Water not used by -participants A and B is then available for C. Water not used by participants A, B -and C is available for D. Finally, water not used by participants A, B, C and D is -available for E. -</p> -<p> -You can only get water to your field if you have water available to your position. -Suppose that the total irrigation capacity available is 40 cfps and 40 cfps of water -is available. If player A opens their gate they will consume 25 cfps of water and 15 -cfps is left for B. Suppose on the other hand, A does not open the gate, then a -total of 40 cfps is left for B, allowing B to extract water at the maximum rate of -25 cfps. -</p> -<p> -As another example, suppose that the canal system has been allowed to deteriorate -so that the total irrigation capacity available is 20 cfps. While player A’s gate is -open, no water is available for B. If A is NOT using water, 20 cfps is available for -B. -</p> -]]> -</entry> - -<entry key="general-instructionsq5"> -<![CDATA[ +Question 4: +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> -To continue to the next page, please answer the following question:<br> -<form> -Suppose the irrigation efficiency is between 71 and 80% so that the canal flow -capacity is 30 cfps. If A opens their gate and diverts water at 25 cfps what is the -available water flow for B? + +<input type="submit" name="submit" value="Submit"><br> <br> -<input type="radio" name="q6" value="30">30 cfps<br> -<input type="radio" name="q6" value="25">25 cfps<br> -<input type="radio" name="q6" value="15">15 cfps<br> -<input type="radio" name="q6" value="5">5 cfps<br> -<br><br> -If the canal flow capacity available is 25 cfps and A,B,C and D are not using water, -what is the available water for E? -<br> -<input type="radio" name="q7" value="40">40 cfps<br> -<input type="radio" name="q7" value="25">25 cfps<br> -<input type="radio" name="q7" value="15">15 cfps<br> -<input type="radio" name="q7" value="0">0 cfps<br> -<input type="submit" name="submit" value="Submit"> -<br><br> -</form> ]]> </entry> -<entry key="general-instructions6"> +<entry key="quiz-page2"> <![CDATA[ -<h3>How to grow crops</h3> <p> -To start growing crops, click on the yellow button labeled "open gate". -This will open your irrigation gate and allow water to flow to your field if it is -available. The text on the button will change to "close gate" - if -you would like to close the gate and stop extracting water from the canal, just -click on the yellow button again. Your gate will close and the text on the button -will change back to "open gate". +The final two questions cover the number of tokens you can earn in within a round. </p> -<p> -The amount of water units (cubic feet) your field has received is shown on the -screen, as well as the resulting amount of tokens earned from growing a crop. -The number of tokens earned in each round depends on how much water you have -diverted to your field. If you receive less than 150 cubic feet (cf) the crop has -not received enough water to grow a crop and you will thus not receive any tokens. -The maximum earnings are received when between 500 cf and 549 cf are diverted to -your field. If more than 549 cf water is diverted to your field, this will -negatively affect the growth of the crop (i.e. overwatering) and less tokens will be -earned. In the table below you can see the amount of tokens earned for amount of -water applied to your field. -</p> -<b>Table 2</b>: Earnings resulting from the amount of water applied to your field. - +<b>Table 2</b>: Tokens earned from the amount of water applied to your field. <table border="1" cellspacing="2" cellpadding="2"> <thead> <th>Water units received (cubic feet)</th> @@ -407,15 +331,30 @@ <td>> 899</td><td>0</td> </tr> </table> - +<p> Your earnings at the end of the round depend on your investment and the number of -tokens received for the crop. For example, suppose you invest 6 out of the 10 -tokens you are endowed with at the start of the round and you receive 333 cubic feet -of water. Your total earnings will be the amount of tokens leftover from your -initial endowment (10 - 6) plus the tokens you earned from your crop (15 tokens for -333 cubic feet of water, see Table 2). The total number of tokens earned is 19 -($0.85 since each token is $0.05). +tokens you receive from applying water to your fields and growing a crop. As an +example, suppose you invest 6 tokens out of the 10 tokens you are endowed with at +the start of each round. If you receive 333 cubic feet of water you would receive a +grand total of 19 tokens (4 tokens left over from your 10 token endowment + 15 +tokens for growing a crop with 333 cubic feet of water). Since each token is worth +$0.05, you would have an actual earnings of $0.85 for that round. +<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 +end of the round?<br> +<input type="text" name="q5" value="">tokens +<br><br> +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"> +</form> ]]> </entry> @@ -475,93 +414,6 @@ ]]> </entry> - -<entry key="general-instructionsq6"> -<![CDATA[ -<br><br> -To continue to the next page, please answer the following question:<br> -<form> -If you invest 7 of the 10 tokens you started with, and you put 202 cf of water -on your field, what is the <b>total number of tokens</b> you will have earned -for that round? -<br> -<input type="radio" name="q8" value="3">3<br> -<input type="radio" name="q8" value="5">5<br> -<input type="radio" name="q8" value="7">7<br> -<input type="radio" name="q8" value="13">13<br> -<br><br> -If you invest all 10 tokens you start with, and you put 555 cf of water on your -field, what is the total number of tokens your will have earned for that round? -<br> -<input type="radio" name="q9" value="10">10<br> -<input type="radio" name="q9" value="19">19<br> -<input type="radio" name="q9" value="20">20<br> -<input type="radio" name="q9" value="29">29<br> -<br><br> -<input type="submit" name="submit" value="Submit"> -</form> -]]> -</entry> - -<entry key="general-instructions7"> -<![CDATA[ -<h3>Scores</h3> -<p> -The total number of tokens collected during a round is shown on the screen with the -message: -<br><br> -Total tokens earned this round: 0 -<br><br> -This the total of tokens not invested in irrigation structure plus additional -tokens earned by growing a crop. -<br> -You will also see the scores of the other participants summarized on the screen. -Finally, you will see the water flow capacity of each player at any given moment, as -illustrated in the figure below. - -]]> -</entry> - - -<entry key="general-instructionsq7"> -<![CDATA[ -<br><br> -To continue to the next page, please answer the following question:<br> -<form> -Each token is worth 5 cents, thus if you collected 30 tokens in a round you earned: -<br> -<input type="radio" name="q10" value=".15">$0.15<br> -<input type="radio" name="q10" value=".50">$0.50<br> -<input type="radio" name="q10" value="1.50">$1.50<br> -<input type="radio" name="q10" value="2.50">$2.50<br> -<br><br> -<input type="submit" name="submit" value="Submit"> -<br><br> -</form> -]]> -</entry> - -<entry key="general-instructions8"> -<![CDATA[ -<p> -We will now start with two practice rounds. This practice round will not -contribute to your earnings – it is intended to acquaint you with the -functioning of the exercise environment. -</p> -<p> -You will first chat via text with other participants in your group and then -decide how much you wish to invest in irrigation infrastructure maintenance. -After all investment decisions have been made you will begin the actual round -and make real-time decisions on when to open your gates and irrigate your -fields. -</p> -<p> -If you have any questions feel free to raise your hand and to ask your question. -<b>Do you have any questions so far?</b> -</p> -]]> -</entry> - <entry key="investment-instructions"> <![CDATA[ <h3>Invest tokens in the irrigation infrastructure</h3> Added: irrigation/trunk/src/main/resources/images/payoff-structure.jpg =================================================================== (Binary files differ) Property changes on: irrigation/trunk/src/main/resources/images/payoff-structure.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |