diff --git i/api/src/java/org/sakaiproject/evaluation/model/EvalEvaluation.java w/api/src/java/org/sakaiproject/evaluation/model/EvalEvaluation.java index f8e3d74..f72ddab 100644 --- i/api/src/java/org/sakaiproject/evaluation/model/EvalEvaluation.java +++ w/api/src/java/org/sakaiproject/evaluation/model/EvalEvaluation.java @@ -1,6 +1,8 @@ package org.sakaiproject.evaluation.model; +import java.text.ParseException; +import java.text.SimpleDateFormat; import java.util.Date; import java.util.HashSet; import java.util.List; @@ -17,6 +19,9 @@ import org.sakaiproject.evaluation.utils.EvalUtils; */ public class EvalEvaluation implements Comparable, java.io.Serializable { + + private static final String ISO8601_DATE_FORMAT_STRING = "yyyy-MM-dd'T'HH:mm:ss"; + private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat(ISO8601_DATE_FORMAT_STRING); // Fields private Long id; @@ -687,6 +692,47 @@ public class EvalEvaluation implements Comparable, java.io.Seria this.startDate = startDate; } + public String getStartDateStr() { + return DATE_FORMAT.format(startDate); + } + + public void setStartDateStr(String startDateStr) { + try { + Date parsedDate = DATE_FORMAT.parse(startDateStr); + if (parsedDate != null) { + startDate = parsedDate; + } + } catch (ParseException e) { + } + } + + public String getStopDateStr() { + return DATE_FORMAT.format(stopDate); + } + + public void setStopDateStr(String stopDateStr) { + try { + Date parsedDate = DATE_FORMAT.parse(stopDateStr); + if (parsedDate != null) { + stopDate = parsedDate; + } + } catch (ParseException e) { + } + } + + public String getDueDateStr() { + return DATE_FORMAT.format(dueDate); + } + + public void setDueDateStr(String dueDateStr) { + try { + Date parsedDate = DATE_FORMAT.parse(dueDateStr); + if (parsedDate != null) { + dueDate = parsedDate; + } + } catch (ParseException e) { + } + } public String getState() { return state; } diff --git i/tool/src/java/org/sakaiproject/evaluation/tool/producers/EvaluationSettingsProducer.java w/tool/src/java/org/sakaiproject/evaluation/tool/producers/EvaluationSettingsProducer.java index c1bb4f0..453964f 100644 --- i/tool/src/java/org/sakaiproject/evaluation/tool/producers/EvaluationSettingsProducer.java +++ w/tool/src/java/org/sakaiproject/evaluation/tool/producers/EvaluationSettingsProducer.java @@ -15,6 +15,7 @@ package org.sakaiproject.evaluation.tool.producers; import java.text.DateFormat; +import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; @@ -107,11 +108,6 @@ public class EvaluationSettingsProducer implements ViewComponentProducer, ViewPa this.authoringService = authoringService; } - private FormatAwareDateInputEvolver dateevolver; - public void setDateEvolver(FormatAwareDateInputEvolver dateevolver) { - this.dateevolver = dateevolver; - } - private TextInputEvolver richTextEvolver; public void setRichTextEvolver(TextInputEvolver richTextEvolver) { this.richTextEvolver = richTextEvolver; @@ -294,19 +290,19 @@ public class EvaluationSettingsProducer implements ViewComponentProducer, ViewPa // Start Date UIBranchContainer showStartDate = UIBranchContainer.make(form, "showStartDate:"); - generateDateSelector(showStartDate, "startDate", evaluationOTP + "startDate", + generateDateSelector(showStartDate, "startDate", evaluationOTP + "startDateStr", null, currentEvalState, EvalConstants.EVALUATION_STATE_ACTIVE, useDateTime); // Due Date UIBranchContainer showDueDate = UIBranchContainer.make(form, "showDueDate:"); - generateDateSelector(showDueDate, "dueDate", evaluationOTP + "dueDate", + generateDateSelector(showDueDate, "dueDate", evaluationOTP + "dueDateStr", reOpenDueDate, currentEvalState, EvalConstants.EVALUATION_STATE_GRACEPERIOD, useDateTime); // Stop Date - Show the "Stop date" text box only if allowed in the System settings Boolean useStopDate = (Boolean) settings.get(EvalSettings.EVAL_USE_STOP_DATE); if (useStopDate) { UIBranchContainer showStopDate = UIBranchContainer.make(form, "showStopDate:"); - generateDateSelector(showStopDate, "stopDate", evaluationOTP + "stopDate", + generateDateSelector(showStopDate, "stopDate", evaluationOTP + "stopDateStr", reOpenStopDate, currentEvalState, EvalConstants.EVALUATION_STATE_CLOSED, useDateTime); } @@ -618,16 +614,14 @@ public class EvaluationSettingsProducer implements ViewComponentProducer, ViewPa UIOutput.make(parent, rsfId + "_disabled", null, binding) .resolver = new ELReference("dateResolver." + suffix); } else { - UIInput datePicker = UIInput.make(parent, rsfId + ":", binding); - if (useDateTime) { - dateevolver.setStyle(FormatAwareDateInputEvolver.DATE_TIME_INPUT); - } else { - dateevolver.setStyle(FormatAwareDateInputEvolver.DATE_INPUT); - } - dateevolver.evolveDateInput(datePicker, initValue); + String value = (initValue != null)?DATE_FORMAT.format(initValue):""; + UIInput datePicker = UIInput.make(parent, rsfId + "-iso8601", binding, value); } } + private static final String ISO8601_DATE_FORMAT_STRING = "yyyy-MM-dd'T'HH:mm:ss"; + private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat(ISO8601_DATE_FORMAT_STRING); + /** * Reduces code duplication
* This will render the view date picker control or a message depending on various system settings
@@ -650,13 +644,7 @@ public class EvaluationSettingsProducer implements ViewComponentProducer, ViewPa UIMessage.make(parent, rsfId + "_label", "evalsettings.view.results.date.label"); } else { // allow them to choose the date using a date picker - UIInput dateInput = UIInput.make(parent, rsfId + ":", binding); - if (useDateTime) { - dateevolver.setStyle(FormatAwareDateInputEvolver.DATE_TIME_INPUT); - } else { - dateevolver.setStyle(FormatAwareDateInputEvolver.DATE_INPUT); - } - dateevolver.evolveDateInput(dateInput); + UIInput dateInput = UIInput.make(parent, rsfId + "-iso8601", binding); } } } diff --git i/tool/src/webapp/WEB-INF/requestContext.xml w/tool/src/webapp/WEB-INF/requestContext.xml index 5541650..110b3e5 100644 --- i/tool/src/webapp/WEB-INF/requestContext.xml +++ w/tool/src/webapp/WEB-INF/requestContext.xml @@ -543,7 +543,6 @@ ref="org.sakaiproject.evaluation.logic.EvalEvaluationService" /> - diff --git i/tool/src/webapp/content/templates/evaluation_settings.html w/tool/src/webapp/content/templates/evaluation_settings.html index efca6d5..4ee6618 100644 --- i/tool/src/webapp/content/templates/evaluation_settings.html +++ w/tool/src/webapp/content/templates/evaluation_settings.html @@ -7,11 +7,40 @@ - + + + + + - - + + +
@@ -85,33 +114,33 @@
- - - - - - + + + + Users may begin submitting evaluation responses on this date
- - - - - + + + Evaluation ends on this date, no more responses after this date
- - - - - + + + Users may still submit responses up until this date (defines a grace period)