[virtualcommons-svn] commit/irrigation: alllee: merging improvements to facilitator and instruction
Status: Beta
Brought to you by:
alllee
From: Bitbucket <com...@bi...> - 2012-03-28 05:55:07
|
1 new commit in irrigation: https://bitbucket.org/virtualcommons/irrigation/changeset/944a7083d27e/ changeset: 944a7083d27e branch: stable user: alllee date: 2012-03-28 07:55:06 summary: merging improvements to facilitator and instructions back into stable branch affected #: 9 files diff -r 4e044b944d4a03c4b0089891fa10b18b76fe69d0 -r 944a7083d27e8214d72084f705f6eeb32e04cbc0 ivy.xml --- a/ivy.xml +++ b/ivy.xml @@ -7,5 +7,6 @@ <dependencies><dependency org="edu.asu.commons" name="csidex" rev="0.5-SNAPSHOT"/><dependency org="org.jfree" name="jfreechart" rev="1.0.14"/> + <dependency org="javax.jnlp" name="javaws" rev="1.6.0_30"/></dependencies></ivy-module> diff -r 4e044b944d4a03c4b0089891fa10b18b76fe69d0 -r 944a7083d27e8214d72084f705f6eeb32e04cbc0 pom.xml --- a/pom.xml +++ b/pom.xml @@ -54,6 +54,12 @@ <artifactId>forms</artifactId><version>1.1.0</version></dependency> + <dependency> + <groupId>javax.jnlp</groupId> + <artifactId>javaws</artifactId> + <version>1.6.0_30</version> + <scope>provided</scope> + </dependency></dependencies><build><finalName>irrigation</finalName> diff -r 4e044b944d4a03c4b0089891fa10b18b76fe69d0 -r 944a7083d27e8214d72084f705f6eeb32e04cbc0 src/main/java/edu/asu/commons/irrigation/facilitator/FacilitatorWindow.java --- a/src/main/java/edu/asu/commons/irrigation/facilitator/FacilitatorWindow.java +++ b/src/main/java/edu/asu/commons/irrigation/facilitator/FacilitatorWindow.java @@ -9,6 +9,7 @@ import javax.swing.BoxLayout; import javax.swing.JButton; import javax.swing.JLabel; +import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JSplitPane; @@ -21,6 +22,7 @@ import edu.asu.commons.irrigation.events.ShowGameScreenshotRequest; import edu.asu.commons.irrigation.events.ShowQuizRequest; import edu.asu.commons.ui.HtmlEditorPane; +import edu.asu.commons.ui.HtmlSelection; import edu.asu.commons.ui.UserInterfaceUtils; /** @@ -59,6 +61,8 @@ private JButton stopRoundButton; + private JButton copyToClipboardButton; + /** * This is the default constructor */ @@ -81,6 +85,7 @@ addToBoxLayout(buttonPanel, getShowQuizButton()); addToBoxLayout(buttonPanel, getStartRoundOverrideButton()); addToBoxLayout(buttonPanel, getStopRoundButton()); + addToBoxLayout(buttonPanel, getCopyToClipboardButton()); add(buttonPanel, BorderLayout.NORTH); informationEditorPane = UserInterfaceUtils.createInstructionsEditorPane(); informationScrollPane = new JScrollPane(informationEditorPane); @@ -104,6 +109,36 @@ splitPane.setResizeWeight(proportion); } + private JButton getCopyToClipboardButton() { + // create copy to clipboard menu item + if (copyToClipboardButton == null) { + copyToClipboardButton = new JButton("Copy to clipboard"); + copyToClipboardButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + String text = informationEditorPane.getSelectedText(); + if (text == null || text.trim().isEmpty()) { + addMessage("No text selected, copying all text in the editor pane to the clipboard."); + text = informationEditorPane.getText(); + if (text == null || text.trim().isEmpty()) { + // if text is still empty, give up + JOptionPane.showMessageDialog(FacilitatorWindow.this, "Unable to find any text to copy to the clipboard."); + return; + } + } + if (UserInterfaceUtils.getClipboardService() != null) { + HtmlSelection selection = new HtmlSelection(text); + UserInterfaceUtils.getClipboardService().setContents(selection); + } + else { + addMessage("Clipboard service is not available."); + } + } + }); + } + return copyToClipboardButton; + } + private void addToBoxLayout(JPanel buttonPanel, JButton button) { buttonPanel.add(button); buttonPanel.add(Box.createHorizontalStrut(5)); diff -r 4e044b944d4a03c4b0089891fa10b18b76fe69d0 -r 944a7083d27e8214d72084f705f6eeb32e04cbc0 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 @@ -119,7 +119,7 @@ } // ignore the request if not every group has submit their tokens. if (isTokenInvestmentComplete()) { - sendFacilitatorMessage("Starting round."); + sendFacilitatorMessage("Starting actual round."); synchronized (roundSignal) { roundSignal.notifyAll(); } @@ -274,9 +274,9 @@ private volatile int numberOfCompletedQuizzes = 0; @Override public void handle(QuizResponseEvent quizResponseEvent) { - sendFacilitatorMessage("Received quiz response: " + quizResponseEvent); clients.get(quizResponseEvent.getId()).addCorrectQuizAnswers(quizResponseEvent.getNumberOfCorrectQuizAnswers()); numberOfCompletedQuizzes++; + sendFacilitatorMessage(String.format("%d/%d quiz response: %s", numberOfCompletedQuizzes, clients.size(), quizResponseEvent)); if (numberOfCompletedQuizzes >= clients.size()) { sendFacilitatorMessage("All quizzes completed: " + numberOfCompletedQuizzes); numberOfCompletedQuizzes = 0; @@ -443,6 +443,7 @@ getConfiguration().isLastRound())); } } + sendFacilitatorMessage("Round ended, ready to begin chat again"); transmit(new FacilitatorEndRoundEvent(getFacilitatorId(), serverDataModel)); } diff -r 4e044b944d4a03c4b0089891fa10b18b76fe69d0 -r 944a7083d27e8214d72084f705f6eeb32e04cbc0 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 @@ -4,6 +4,8 @@ <comment>Irrigation experiment server configuration</comment><entry key="hostname">@SERVER_ADDRESS@</entry><entry key="port">@PORT_NUMBER@</entry> + +<entry key="number-of-rounds">22</entry><entry key="round0">round0.xml</entry><entry key="round1">round1.xml</entry><entry key="round2">round2.xml</entry> @@ -30,7 +32,8 @@ <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> + +<entry key='chat-duration'>60</entry><entry key='round-duration'>50</entry><entry key="q1">49</entry> @@ -408,13 +411,14 @@ <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> + <h2>Payment: You Are Computer Number {clientData.id.stationNumber}</h2><hr><p> + <b>Please note the computer number listed above and write it on your survey.</b> 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 + your computer number, <b>{clientData.id.stationNumber}</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> + <b>NOTE: Please 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> @@ -485,7 +489,7 @@ <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> +<tr align="RIGHT"><td>{data}</td><td>{data.allTokensEarnedThisRound}</td><td>{data.totalDollarsEarnedThisRound}</td><td>{data.quizEarnings}</td><td>{data.grandTotalIncome}</td></tr> }} </table> {if (self.lastRound)} diff -r 4e044b944d4a03c4b0089891fa10b18b76fe69d0 -r 944a7083d27e8214d72084f705f6eeb32e04cbc0 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 @@ -4,6 +4,8 @@ <comment>Irrigation experiment server configuration</comment><entry key="hostname">@SERVER_ADDRESS@</entry><entry key="port">@PORT_NUMBER@</entry> + +<entry key="number-of-rounds">22</entry><entry key="round0">round0.xml</entry><entry key="round1">round1.xml</entry><entry key="round2">round2.xml</entry> @@ -30,7 +32,8 @@ <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> + +<entry key='chat-duration'>60</entry><entry key='round-duration'>50</entry><entry key="q1">49</entry> @@ -408,13 +411,14 @@ <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> + <h2>Payment: You Are Computer Number {clientData.id.stationNumber}</h2><hr><p> + <b>Please note the computer number listed above and write it on your survey.</b> 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 + your computer number, <b>{clientData.id.stationNumber}</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> + <b>NOTE: Please 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> @@ -485,7 +489,7 @@ <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> +<tr align="RIGHT"><td>{data}</td><td>{data.allTokensEarnedThisRound}</td><td>{data.totalDollarsEarnedThisRound}</td><td>{data.quizEarnings}</td><td>{data.grandTotalIncome}</td></tr> }} </table> {if (self.lastRound)} diff -r 4e044b944d4a03c4b0089891fa10b18b76fe69d0 -r 944a7083d27e8214d72084f705f6eeb32e04cbc0 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 @@ -4,6 +4,8 @@ <comment>Irrigation experiment server configuration</comment><entry key="hostname">@SERVER_ADDRESS@</entry><entry key="port">@PORT_NUMBER@</entry> + +<entry key="number-of-rounds">22</entry><entry key="round0">round0.xml</entry><entry key="round1">round1.xml</entry><entry key="round2">round2.xml</entry> @@ -30,7 +32,8 @@ <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> + +<entry key='chat-duration'>60</entry><entry key='round-duration'>50</entry><entry key="q1">49</entry> @@ -408,13 +411,14 @@ <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> + <h2>Payment: You Are Computer Number {clientData.id.stationNumber}</h2><hr><p> + <b>Please note the computer number listed above and write it on your survey.</b> 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 + your computer number, <b>{clientData.id.stationNumber}</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> + <b>NOTE: Please 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> @@ -485,7 +489,7 @@ <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> +<tr align="RIGHT"><td>{data}</td><td>{data.allTokensEarnedThisRound}</td><td>{data.totalDollarsEarnedThisRound}</td><td>{data.quizEarnings}</td><td>{data.grandTotalIncome}</td></tr> }} </table> {if (self.lastRound)} diff -r 4e044b944d4a03c4b0089891fa10b18b76fe69d0 -r 944a7083d27e8214d72084f705f6eeb32e04cbc0 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 @@ -4,6 +4,8 @@ <comment>Irrigation experiment server configuration</comment><entry key="hostname">@SERVER_ADDRESS@</entry><entry key="port">@PORT_NUMBER@</entry> + +<entry key="number-of-rounds">22</entry><entry key="round0">round0.xml</entry><entry key="round1">round1.xml</entry><entry key="round2">round2.xml</entry> @@ -30,7 +32,8 @@ <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> + +<entry key='chat-duration'>60</entry><entry key='round-duration'>50</entry><entry key="q1">49</entry> @@ -408,13 +411,14 @@ <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> + <h2>Payment: You Are Computer Number {clientData.id.stationNumber}</h2><hr><p> + <b>Please note the computer number listed above and write it on your survey.</b> 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 + your computer number, <b>{clientData.id.stationNumber}</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> + <b>NOTE: Please 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> @@ -485,7 +489,7 @@ <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> +<tr align="RIGHT"><td>{data}</td><td>{data.allTokensEarnedThisRound}</td><td>{data.totalDollarsEarnedThisRound}</td><td>{data.quizEarnings}</td><td>{data.grandTotalIncome}</td></tr> }} </table> {if (self.lastRound)} diff -r 4e044b944d4a03c4b0089891fa10b18b76fe69d0 -r 944a7083d27e8214d72084f705f6eeb32e04cbc0 src/main/resources/configuration/asu/2011/t4/irrigation.xml --- a/src/main/resources/configuration/asu/2011/t4/irrigation.xml +++ b/src/main/resources/configuration/asu/2011/t4/irrigation.xml @@ -4,6 +4,8 @@ <comment>Irrigation experiment server configuration</comment><entry key="hostname">@SERVER_ADDRESS@</entry><entry key="port">@PORT_NUMBER@</entry> + +<entry key="number-of-rounds">22</entry><entry key="round0">round0.xml</entry><entry key="round1">round1.xml</entry><entry key="round2">round2.xml</entry> @@ -30,7 +32,8 @@ <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> + +<entry key='chat-duration'>60</entry><entry key='round-duration'>50</entry><entry key="q1">49</entry> @@ -408,13 +411,14 @@ <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> + <h2>Payment: You Are Computer Number {clientData.id.stationNumber}</h2><hr><p> + <b>Please note the computer number listed above and write it on your survey.</b> 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 + your computer number, <b>{clientData.id.stationNumber}</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> + <b>NOTE: Please 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> @@ -485,7 +489,7 @@ <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> +<tr align="RIGHT"><td>{data}</td><td>{data.allTokensEarnedThisRound}</td><td>{data.totalDollarsEarnedThisRound}</td><td>{data.quizEarnings}</td><td>{data.grandTotalIncome}</td></tr> }} </table> {if (self.lastRound)} 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. |