[gee-svn] SF.net SVN: gabel: [196] trunk/gee/war
Status: Alpha
Brought to you by:
alllee
|
From: <al...@us...> - 2006-06-20 06:45:02
|
Revision: 196 Author: alllee Date: 2006-06-19 23:44:52 -0700 (Mon, 19 Jun 2006) ViewCVS: http://svn.sourceforge.net/gabel/?rev=196&view=rev Log Message: ----------- adding default forager consent form bean to application context. Modified Paths: -------------- trunk/gee/src/java/edu/indiana/psych/gee/AbstractExperiment.java trunk/gee/src/java/edu/indiana/psych/gee/action/StartExperiment.java trunk/gee/src/java/edu/indiana/psych/gee/bean/ConsentForm.java trunk/gee/src/java/edu/indiana/psych/gee/forager/ForagerExperimentParameters.java trunk/gee/src/java/edu/indiana/psych/gee/service/ExperimentConfigurationService.java trunk/gee/war/WEB-INF/applicationContext.xml trunk/gee/war/WEB-INF/classes/webwork.properties trunk/gee/war/WEB-INF/classes/xwork.xml trunk/gee/war/consent.jsp trunk/gee/war/index.jsp Removed Paths: ------------- trunk/gee/src/java/edu/indiana/psych/gee/action/StartExperiment.properties Modified: trunk/gee/src/java/edu/indiana/psych/gee/AbstractExperiment.java =================================================================== --- trunk/gee/src/java/edu/indiana/psych/gee/AbstractExperiment.java 2006-06-19 21:52:04 UTC (rev 195) +++ trunk/gee/src/java/edu/indiana/psych/gee/AbstractExperiment.java 2006-06-20 06:44:52 UTC (rev 196) @@ -8,6 +8,7 @@ import edu.indiana.psych.gee.event.EventChannel; import edu.indiana.psych.gee.net.DispatcherFactory; import edu.indiana.psych.gee.net.ServerDispatcher; +import edu.indiana.psych.gee.service.ConsentFormService; import edu.indiana.psych.gee.service.ExperimentConfigurationService; import edu.indiana.psych.gee.service.ExperimentService; import edu.indiana.psych.gee.time.Duration; @@ -33,6 +34,7 @@ private ExperimentService experimentService; private ExperimentConfigurationService configurationService; + private ConsentFormService consentFormService; private C configuration; // private ExperimentRoundParameters currentParameters; @@ -134,8 +136,8 @@ } public String toString() { - return String.format("[ %s ] experiment [ %s ] running on port %d", - super.toString(), getName(), getServerPort()); + return String.format("[ %s ] experiment [ %s:%s ] running on port %d", + super.toString(), getName(), getIdentifier(), getServerPort()); } @@ -215,6 +217,10 @@ this.configurationService = configurationService; } + public void setConsentFormService(ConsentFormService consentFormService) { + this.consentFormService = consentFormService; + } + public void setDefaultConfiguration(C defaultConfiguration) { if (defaultConfiguration == null) { throw new IllegalArgumentException("Cannot set default configuration to null."); @@ -222,11 +228,17 @@ ExperimentConfiguration configuration = configurationService.find(defaultConfiguration.getClass(), defaultConfiguration.getExperimentIdentifier()); if (configuration == null) { this.defaultConfiguration = defaultConfiguration; + consentFormService.persist(defaultConfiguration.getConsentForm()); configurationService.persist(defaultConfiguration); } else { this.defaultConfiguration = (C) configuration; } + if (configuration == null) { + configuration = defaultConfiguration; + } + + } Modified: trunk/gee/src/java/edu/indiana/psych/gee/action/StartExperiment.java =================================================================== --- trunk/gee/src/java/edu/indiana/psych/gee/action/StartExperiment.java 2006-06-19 21:52:04 UTC (rev 195) +++ trunk/gee/src/java/edu/indiana/psych/gee/action/StartExperiment.java 2006-06-20 06:44:52 UTC (rev 196) @@ -24,6 +24,11 @@ // no consent form available for this experiment.. just start? getLogger().warn("XXX: No consent form available for this experiment: " + getExperiment()); } + getLogger().warn("XXX: configuration: " + getExperiment().getConfiguration()); + getLogger().warn("XXX: configuration's consent: " + getExperiment().getConfiguration().getConsentForm()); + getLogger().warn("XXX: consent form: " + consentForm); + getLogger().warn("XXX: consent form date approved: " + consentForm.getIrbDateApproved()); + getLogger().warn("XXX: consent form date expires: " + consentForm.getIrbDateApprovalExpires()); return INPUT; } @@ -45,10 +50,14 @@ return consentForm; } - public void setExperimentIdentifier(String experimentName) { - this.experimentIdentifier = experimentName; + public String getExperimentIdentifier() { + return experimentIdentifier; } + public void setExperimentIdentifier(String experimentIdentifier) { + this.experimentIdentifier = experimentIdentifier; + } + public Participant getParticipant() { return participant; } Deleted: trunk/gee/src/java/edu/indiana/psych/gee/action/StartExperiment.properties =================================================================== --- trunk/gee/src/java/edu/indiana/psych/gee/action/StartExperiment.properties 2006-06-19 21:52:04 UTC (rev 195) +++ trunk/gee/src/java/edu/indiana/psych/gee/action/StartExperiment.properties 2006-06-20 06:44:52 UTC (rev 196) @@ -1,2 +0,0 @@ -approval.date = Approval Date: {0, date, MMMMMMMMM dd, yyyy} -approval.expiration.date = Expires: {0, date, MMMMMMMMM dd, yyyy} Modified: trunk/gee/src/java/edu/indiana/psych/gee/bean/ConsentForm.java =================================================================== --- trunk/gee/src/java/edu/indiana/psych/gee/bean/ConsentForm.java 2006-06-19 21:52:04 UTC (rev 195) +++ trunk/gee/src/java/edu/indiana/psych/gee/bean/ConsentForm.java 2006-06-20 06:44:52 UTC (rev 196) @@ -91,11 +91,6 @@ } @Temporal(TemporalType.DATE) public Date getIrbDateApproved() { - if (irbDateApproved == null || isToday(irbDateApproved)) { - Calendar calendar = Calendar.getInstance(); - calendar.set(2005, 9, 26); - irbDateApproved = calendar.getTime(); - } return irbDateApproved; } @@ -103,17 +98,6 @@ this.irbDateApproved = irbDateApproved; } - // FIXME: atrocity - private boolean isToday(Date date) { - Calendar now = Calendar.getInstance(); - now.setTime(new Date()); - Calendar then = Calendar.getInstance(); - then.setTime(date); - return (now.get(Calendar.MONTH) == then.get(Calendar.MONTH) - && now.get(Calendar.YEAR) == then.get(Calendar.YEAR) - && now.get(Calendar.DAY_OF_MONTH) == then.get(Calendar.DAY_OF_MONTH)); - } - public String getParticipation() { return participation; } Modified: trunk/gee/src/java/edu/indiana/psych/gee/forager/ForagerExperimentParameters.java =================================================================== --- trunk/gee/src/java/edu/indiana/psych/gee/forager/ForagerExperimentParameters.java 2006-06-19 21:52:04 UTC (rev 195) +++ trunk/gee/src/java/edu/indiana/psych/gee/forager/ForagerExperimentParameters.java 2006-06-20 06:44:52 UTC (rev 196) @@ -1,6 +1,8 @@ package edu.indiana.psych.gee.forager; import java.awt.Dimension; +import java.io.IOException; +import java.io.InputStream; import java.util.Collections; import java.util.List; import java.util.Properties; Modified: trunk/gee/src/java/edu/indiana/psych/gee/service/ExperimentConfigurationService.java =================================================================== --- trunk/gee/src/java/edu/indiana/psych/gee/service/ExperimentConfigurationService.java 2006-06-19 21:52:04 UTC (rev 195) +++ trunk/gee/src/java/edu/indiana/psych/gee/service/ExperimentConfigurationService.java 2006-06-20 06:44:52 UTC (rev 196) @@ -21,7 +21,6 @@ public class ExperimentConfigurationService { private ExperimentConfigurationDao experimentConfigurationDao; -// private ConsentFormDao consentFormDao; public <E extends ExperimentConfiguration> List<E> findAll(Class<E> configurationClass) { @@ -62,8 +61,4 @@ this.experimentConfigurationDao = experimentConfigurationDao; } -// public void setConsentFormDao(ConsentFormDao consentFormDao) { -// this.consentFormDao = consentFormDao; -// } - } Modified: trunk/gee/war/WEB-INF/applicationContext.xml =================================================================== --- trunk/gee/war/WEB-INF/applicationContext.xml 2006-06-19 21:52:04 UTC (rev 195) +++ trunk/gee/war/WEB-INF/applicationContext.xml 2006-06-20 06:44:52 UTC (rev 196) @@ -35,7 +35,6 @@ <property name="password" value="${db.password}"/> </bean> - <!-- hibernate beans, session factory and transaction manager --> <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="configLocation" value="/WEB-INF/hibernate.cfg.xml"/> @@ -60,6 +59,9 @@ <property name="sessionFactory" ref="sessionFactory"/> </bean> <!-- application layer beans --> + <bean id="consentFormService" class="edu.indiana.psych.gee.service.ConsentFormService"> + <property name='consentFormDao' ref='consentFormDao'/> + </bean> <bean id="experimentService" class="edu.indiana.psych.gee.service.ExperimentService"/> <bean id="configurationService" class="edu.indiana.psych.gee.service.ExperimentConfigurationService"> <property name="experimentConfigurationDao" ref="experimentConfigurationDao"/> @@ -72,6 +74,7 @@ <property name="description" value="The Forager web experiment explores how individuals allocate themselves in a world with scarce resources via an always-available applet."/> <property name='clientJarName' value='forager-client.jar'/> <property name='clientMainClass' value='edu.indiana.psych.gee.forager.client.ForagerApplet'/> + <property name='consentForm' ref='foragerConsentForm'/> </bean> <bean id="defaultForagerExperimentConfiguration" class="edu.indiana.psych.gee.forager.ForagerConfiguration"> <constructor-arg value="groups.psych.indiana.edu"/> @@ -82,15 +85,65 @@ <property name='clientJarName' value='forager-client.jar'/> <property name='clientMainClass' value='edu.indiana.psych.gee.forager.client.ForagerApplet'/> <property name='triggeredExperiment' value='true'/> + <property name='consentForm' ref='foragerConsentForm'/> </bean> <bean id="forager-web" class="edu.indiana.psych.gee.forager.ForagerExperiment"> <property name="configurationService" ref='configurationService'/> + <property name="consentFormService" ref='consentFormService'/> <property name="defaultConfiguration" ref="defaultForagerWebConfiguration"/> <property name="experimentService" ref="experimentService"/> </bean> <bean id="forager-experiment" class="edu.indiana.psych.gee.forager.ForagerExperiment"> <property name="configurationService" ref='configurationService'/> + <property name="consentFormService" ref='consentFormService'/> <property name="defaultConfiguration" ref="defaultForagerExperimentConfiguration"/> <property name="experimentService" ref="experimentService"/> </bean> + <bean id='foragerConsentForm' class='edu.indiana.psych.gee.bean.ConsentForm'> + <property name='studyNumber' value='#04-9064'/> + <property name='description' value='You are invited to participate in a + research study, entitled Group Behavior. The purpose of the study is to + investigate how people think, act, and make decisions in groups. You will + be given a full debriefing at the end of the experiment. Each of the + experiments will take 5-10 minutes to complete. The particular + instructions for an experiment will be displayed on the computer screen. + During the experiment, you will be interacting with a group of humans or + artificial intelligence agents. You will see the choices they make, and + they will see your choices.'/> + <property name='deception' value='No deception is used in this study.'/> + <property name='confidentiality' value='The information in the study + records will be kept confidential. Data will be made available only to + persons conducting the study. No reference will be made in verbal or + written form which could link your name to the study. Your name is not + recorded with your data.'/> + <property name='compensation' value='There is no monetary compensation for + participating in this study.'/> + <property name='risks' value='There are no anticipated risks associated + with the experiments.'/> + <property name='benefits' value='Society benefits from this research + because an understanding of how groups behave can help us to predict the + behaviors of complex organizations and develop technologies that promote + the efficient and accurate flow of information within groups. You benefit + from this experience because you learn something about how group + psychology experiments are designed and conducted, what issues are of + interest to cognitive scientists, and what kinds of group behaviors emerge + when individuals try to reach their goals in an environment that consists + largely of other individuals. In addition, many people find the + experiments to be fun and intriguing. At the end of the experiment, you + will be shown your own performance compared to the average performance of + others in your group, a debriefing that describes what the experiment was + about, and links to related research.'/> + <property name='participation' value='Your participation in this study is + purely voluntary. You may decline to participate. If you decide to + participate, you may withdraw from the study at any time without penalty + or loss of benefits. If you withdraw from the study prior to the + completion of your session your data will not be saved.'/> + <property name='irbDateApproved' ref='consentFormDate'/> + </bean> + <bean id='consentFormDate' factory-bean='dateFormatter' factory-method='parse'> + <constructor-arg><value>10/26/2005</value></constructor-arg> + </bean> + <bean id="dateFormatter" class="java.text.SimpleDateFormat"> + <constructor-arg><value>MM/dd/yyyy</value></constructor-arg> + </bean> </beans> Modified: trunk/gee/war/WEB-INF/classes/webwork.properties =================================================================== --- trunk/gee/war/WEB-INF/classes/webwork.properties 2006-06-19 21:52:04 UTC (rev 195) +++ trunk/gee/war/WEB-INF/classes/webwork.properties 2006-06-20 06:44:52 UTC (rev 196) @@ -1,3 +1,4 @@ webwork.objectFactory=spring webwork.devMode=true webwork.ui.theme=ajax +webwork.custom.i18n.resources=format.properties Modified: trunk/gee/war/WEB-INF/classes/xwork.xml =================================================================== --- trunk/gee/war/WEB-INF/classes/xwork.xml 2006-06-19 21:52:04 UTC (rev 195) +++ trunk/gee/war/WEB-INF/classes/xwork.xml 2006-06-20 06:44:52 UTC (rev 196) @@ -51,5 +51,4 @@ </package> <include file="gee-ajax.xml"/> <include file="gee-admin.xml"/> - <include file="gee-csan.xml"/> </xwork> Modified: trunk/gee/war/consent.jsp =================================================================== --- trunk/gee/war/consent.jsp 2006-06-19 21:52:04 UTC (rev 195) +++ trunk/gee/war/consent.jsp 2006-06-20 06:44:52 UTC (rev 196) @@ -1,5 +1,5 @@ <head> -<title> Consent Form for ${experimentName}</title> +<title>Consent Form for ${experimentIdentifier}</title> <#assign commitDate="$Date$"> <#assign lastModified=commitDate?word_list[1]> <meta name="lastModifiedDate" content="${commitDate}"/> @@ -8,7 +8,7 @@ <TABLE BGCOLOR="#A4B5C5" CELLPADDING="4" CELLSPACING="0" WIDTH="100%" BORDER="0"> <TR> <TD WIDTH="100%"> - <H3>${experimentName} consent form</H3> + <H3>${experimentIdentifier} consent form</H3> </TD> <TD ALIGN="right" VALIGN="top" BGCOLOR="#A4B5C5" WIDTH="70%" style="white-space: nowrap;"> <b>Study #04-9064</b><br/> @@ -20,7 +20,7 @@ <TABLE CELLPADDING="4" CELLSPACING="2" BORDER="0"> <TR> <TD> - <B>${experimentName}</B><BR> + <B>${experimentIdentifier}</B><BR> <TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0" WIDTH="100%"> <TR><TD WIDTH="100%" BGCOLOR="#A4B5C5" HEIGHT="5"><IMG SRC="/images/blank.gif" WIDTH="1" HEIGHT="1"></TD></TR> </TABLE> @@ -64,6 +64,9 @@ <B>Contact</B><BR> + <#if consentForm.contact?exists> + ${consentForm.contact} + <#else> <TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0" WIDTH="100%"> <TR><TD WIDTH="100%" BGCOLOR="#A4B5C5" HEIGHT="5"><IMG SRC="/images/blank.gif" WIDTH="1" HEIGHT="1"></TD></TR> </TABLE> @@ -104,6 +107,7 @@ </TD></TR> </TABLE> </TD></TR></TABLE> + </#if> <P> <B>Participation</B><BR> @@ -129,19 +133,23 @@ <@ww.select label="Age" name="participant.age" required="true" list=["Under 18", "18-24", "25-36", "37-55", "Over 55"]/> <@ww.textfield label="Name" name="participant.name" required="true" /> - <@ww.hidden name="experimentName"/> + <@ww.hidden name="experimentIdentifier"/> <@ww.submit/> </@ww.form> <hr /> <small> -IRB Approved -<br/> -<@ww.text name="approval.date"> - <@ww.param value="'consentForm.irbDateApproved'"/> -</@ww.text> -<br/> -<@ww.text name="approval.expiration.date"> - <@ww.param value="'consentForm.irbDateApprovalExpires'"/> -</@ww.text> +<table border=1 cellspacing=1 cellpadding=4 style='border-style:outset;'> +<thead> +<th style='border-style:none;'>IRB Approved</td><td style='border-style:none;'> </td> +</thead> +<tr> +<td style='border-style:none;'>Approval Date:</td> +<td style='border-style:none;'>${consentForm.irbDateApproved?date}</td> +</tr> +<tr> +<td style='border-style:none;'>Expires:</td> +<td style='border-style:none;'>${consentForm.irbDateApprovalExpires?date}</td> +</tr> +</table> </small> Modified: trunk/gee/war/index.jsp =================================================================== --- trunk/gee/war/index.jsp 2006-06-19 21:52:04 UTC (rev 195) +++ trunk/gee/war/index.jsp 2006-06-20 06:44:52 UTC (rev 196) @@ -76,10 +76,10 @@ <!-- emit developers dynamically? --> <UL> <LI><A HREF="http://cognitrn.psych.indiana.edu/rgoldsto/rob.html">Rob Goldstone - Director</A> - <LI>Andy Jones - Developer / Researcher - <LI><a href="http://www.cs.indiana.edu/~alllee">Allen Lee - Lead Programmer / "Researcher"</a> - <LI>Zoran Rilak - Developer / Researcher - <LI>Michael Roberts - Developer / Researcher + <LI>Andy Jones + <LI><a href="http://www.cs.indiana.edu/~alllee">Allen Lee</a> + <LI>Zoran Rilak + <LI>Michael Roberts </UL> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |