Index: lams_tool_notebook/build.properties =================================================================== RCS file: /usr/local/cvsroot/lams_tool_notebook/build.properties,v diff -u -r1.12 -r1.12.8.1 --- lams_tool_notebook/build.properties 9 Dec 2008 05:40:32 -0000 1.12 +++ lams_tool_notebook/build.properties 10 May 2011 05:24:50 -0000 1.12.8.1 @@ -3,7 +3,7 @@ signature=lantbk11 #project version -tool.version=20081118 +tool.version=20110510 package=org/lamsfoundation/lams/tool/notebook package.name=org.lamsfoundation.lams.tool.notebook Index: lams_tool_notebook/conf/language/lams/ApplicationResources.properties =================================================================== RCS file: /usr/local/cvsroot/lams_tool_notebook/conf/language/lams/ApplicationResources.properties,v diff -u -r1.17.8.3 -r1.17.8.4 --- lams_tool_notebook/conf/language/lams/ApplicationResources.properties 16 Apr 2010 06:54:03 -0000 1.17.8.3 +++ lams_tool_notebook/conf/language/lams/ApplicationResources.properties 10 May 2011 05:24:50 -0000 1.17.8.4 @@ -109,6 +109,16 @@ textsearch.all.words =has all these words: textsearch.phrase =has this exact wording or phrase: textsearch.any.words =has one or more of these words: +monitor.summary.date.restriction =Date restriction +monitor.summary.when.date.restriction.is.set =Learners will not be able to write on the notebook after the set date and time. +monitor.summary.after.date =Date/time: +monitor.summary.set.restriction =Set restriction +monitor.summary.unset.restriction =Remove restriction +authoring.info.teacher.set.restriction =The instructor has set a restriction to this activity from {0} onwards. +monitor.summary.notification =Notification +monitor.summary.date.restriction.set =Date restriction has been set +monitor.summary.date.restriction.removed =Date restriction has been removed + #======= End labels: Exported 103 labels for en AU ===== Index: lams_tool_notebook/db/sql/create_lams_tool_notebook.sql =================================================================== RCS file: /usr/local/cvsroot/lams_tool_notebook/db/sql/create_lams_tool_notebook.sql,v diff -u -r1.7 -r1.7.10.1 --- lams_tool_notebook/db/sql/create_lams_tool_notebook.sql 4 Oct 2008 02:47:52 -0000 1.7 +++ lams_tool_notebook/db/sql/create_lams_tool_notebook.sql 10 May 2011 05:24:50 -0000 1.7.10.1 @@ -7,7 +7,7 @@ drop table if exists tl_lantbk11_session; drop table if exists tl_lantbk11_user; create table tl_lantbk11_attachment (uid bigint not null auto_increment, file_version_id bigint, file_type varchar(255), file_name varchar(255), file_uuid bigint, create_date datetime, notebook_uid bigint, primary key (uid))type=innodb; -create table tl_lantbk11_notebook (uid bigint not null auto_increment, create_date datetime, update_date datetime, create_by bigint, title varchar(255), instructions text, run_offline bit, lock_on_finished bit, allow_rich_editor bit, online_instructions text, offline_instructions text, content_in_use bit, define_later bit, tool_content_id bigint, primary key (uid))type=innodb; +create table tl_lantbk11_notebook (uid bigint not null auto_increment, create_date datetime, update_date datetime, create_by bigint, title varchar(255), instructions text, run_offline bit, lock_on_finished bit, allow_rich_editor bit, online_instructions text, offline_instructions text, content_in_use bit, define_later bit, tool_content_id bigint, submission_deadline datetime DEFAULT NULL, primary key (uid))type=innodb; create table tl_lantbk11_session (uid bigint not null auto_increment, session_end_date datetime, session_start_date datetime, status integer, session_id bigint, session_name varchar(250), notebook_uid bigint, primary key (uid))type=innodb; create table tl_lantbk11_user (uid bigint not null auto_increment, user_id bigint, last_name varchar(255), login_name varchar(255), first_name varchar(255), finishedActivity bit, notebook_session_uid bigint, entry_uid bigint, primary key (uid))type=innodb; alter table tl_lantbk11_attachment add index FK12090F57FC940906 (notebook_uid), add constraint FK12090F57FC940906 foreign key (notebook_uid) references tl_lantbk11_notebook (uid); Index: lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/dbupdates/patch20110510_updateTo236.sql =================================================================== RCS file: /usr/local/cvsroot/lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/dbupdates/patch20110510_updateTo236.sql,v diff -u -r1.1 -r1.1.2.1 Binary files differ Index: lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/dto/NotebookDTO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/dto/NotebookDTO.java,v diff -u -r1.9 -r1.9.10.1 --- lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/dto/NotebookDTO.java 2 May 2008 07:46:41 -0000 1.9 +++ lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/dto/NotebookDTO.java 10 May 2011 05:25:13 -0000 1.9.10.1 @@ -25,6 +25,7 @@ package org.lamsfoundation.lams.tool.notebook.dto; +import java.util.Date; import java.util.Iterator; import java.util.Set; import java.util.TreeSet; @@ -57,6 +58,8 @@ public boolean lockOnFinish; + public Date submissionDeadline; + public Set onlineInstructionsFiles; public Set offlineInstructionsFiles; @@ -196,6 +199,20 @@ this.lockOnFinish = lockOnFinish; } + /** + * @return the submissionDeadline + */ + public Date getSubmissionDeadline() { + return submissionDeadline; + } + + /** + * @param submissionDeadline the submissionDeadline to set + */ + public void setSubmissionDeadline(Date submissionDeadline) { + this.submissionDeadline = submissionDeadline; + } + public Long getCurrentTab() { return currentTab; } Index: lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/model/Notebook.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/model/Notebook.java,v diff -u -r1.11 -r1.11.10.1 --- lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/model/Notebook.java 31 Oct 2008 01:41:51 -0000 1.11 +++ lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/model/Notebook.java 10 May 2011 05:24:50 -0000 1.11.10.1 @@ -77,6 +77,9 @@ private boolean contentInUse; private boolean defineLater; + + // LDEV-2657 + private Date submissionDeadline; private Long toolContentId; @@ -285,7 +288,22 @@ this.defineLater = defineLater; } + public void setSubmissionDeadline(Date submissionDeadline) { + this.submissionDeadline = submissionDeadline; + } + /** + * + * @hibernate.property column="submission_deadline" + * @return date submissionDeadline + * + */ + + public Date getSubmissionDeadline() { + return submissionDeadline; + } + + /** * @hibernate.property column="tool_content_id" length="20" * */ Index: lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/util/NotebookConstants.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/util/NotebookConstants.java,v diff -u -r1.5 -r1.5.10.1 --- lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/util/NotebookConstants.java 31 Oct 2008 01:41:51 -0000 1.5 +++ lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/util/NotebookConstants.java 10 May 2011 05:24:50 -0000 1.5.10.1 @@ -60,4 +60,8 @@ public static final String ERROR_MSG_CONDITION = "error.condition"; public static final String ERROR_MSG_NAME_BLANK = "error.condition.name.blank"; public static final String ERROR_MSG_NAME_DUPLICATED = "error.condition.duplicated.name"; + + // for submission deadline LDEV-2657 + public static final String ATTR_SUBMISSION_DEADLINE = "submissionDeadline"; + public static final String ATTR_IS_SUBMISSION_DEADLINE_PASSED = "isSubmissionDeadlinePassed"; } \ No newline at end of file Index: lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/web/actions/LearningAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/web/actions/LearningAction.java,v diff -u -r1.10 -r1.10.10.1 --- lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/web/actions/LearningAction.java 2 May 2008 07:00:36 -0000 1.10 +++ lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/web/actions/LearningAction.java 10 May 2011 05:24:50 -0000 1.10.10.1 @@ -25,9 +25,12 @@ package org.lamsfoundation.lams.tool.notebook.web.actions; import java.io.IOException; +import java.util.Date; +import java.util.TimeZone; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; import org.apache.log4j.Logger; import org.apache.struts.action.ActionForm; @@ -50,6 +53,7 @@ import org.lamsfoundation.lams.tool.notebook.util.NotebookException; import org.lamsfoundation.lams.tool.notebook.web.forms.LearningForm; import org.lamsfoundation.lams.usermanagement.dto.UserDTO; +import org.lamsfoundation.lams.util.DateUtil; import org.lamsfoundation.lams.util.WebUtil; import org.lamsfoundation.lams.web.action.LamsDispatchAction; import org.lamsfoundation.lams.web.session.SessionManager; @@ -131,6 +135,22 @@ if (notebook.isRunOffline()) { return mapping.findForward("runOffline"); } + + // date and time restriction LDEV-2657 + Date submissionDeadline = notebook.getSubmissionDeadline(); + if (submissionDeadline != null) { + HttpSession ss = SessionManager.getSession(); + UserDTO learnerDto = (UserDTO) ss.getAttribute(AttributeNames.USER); + TimeZone learnerTimeZone = learnerDto.getTimeZone(); + Date tzSubmissionDeadline = DateUtil.convertToTimeZoneFromDefault(learnerTimeZone, submissionDeadline); + Date currentLearnerDate = DateUtil.convertToTimeZoneFromDefault(learnerTimeZone, new Date()); + notebookDTO.submissionDeadline = tzSubmissionDeadline; + + //calculate whether deadline has passed, and if so forward to "runOffline" + if (currentLearnerDate.after(tzSubmissionDeadline)) { + return mapping.findForward("runOffline"); + } + } NotebookUser notebookUser; if (mode.equals(ToolAccessMode.TEACHER)) { Index: lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/web/actions/MonitoringAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/web/actions/MonitoringAction.java,v diff -u -r1.9.8.1 -r1.9.8.2 --- lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/web/actions/MonitoringAction.java 7 Dec 2010 18:36:21 -0000 1.9.8.1 +++ lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/web/actions/MonitoringAction.java 10 May 2011 05:24:50 -0000 1.9.8.2 @@ -24,8 +24,12 @@ package org.lamsfoundation.lams.tool.notebook.web.actions; +import java.util.Date; +import java.util.TimeZone; + import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; import org.apache.log4j.Logger; import org.apache.struts.action.ActionForm; @@ -38,9 +42,13 @@ import org.lamsfoundation.lams.tool.notebook.model.NotebookUser; import org.lamsfoundation.lams.tool.notebook.service.INotebookService; import org.lamsfoundation.lams.tool.notebook.service.NotebookServiceProxy; +import org.lamsfoundation.lams.tool.notebook.util.NotebookConstants; import org.lamsfoundation.lams.tool.service.LamsToolService; +import org.lamsfoundation.lams.usermanagement.dto.UserDTO; +import org.lamsfoundation.lams.util.DateUtil; import org.lamsfoundation.lams.util.WebUtil; import org.lamsfoundation.lams.web.action.LamsDispatchAction; +import org.lamsfoundation.lams.web.session.SessionManager; import org.lamsfoundation.lams.web.util.AttributeNames; /** @@ -89,6 +97,16 @@ request.setAttribute("contentFolderID", contentFolderID); request.setAttribute("isGroupedActivity", isGroupedActivity); + Date submissionDeadline = notebook.getSubmissionDeadline(); + + if (submissionDeadline != null) { + HttpSession ss = SessionManager.getSession(); + UserDTO teacher = (UserDTO) ss.getAttribute(AttributeNames.USER); + TimeZone teacherTimeZone = teacher.getTimeZone(); + Date tzSubmissionDeadline = DateUtil.convertToTimeZoneFromDefault(teacherTimeZone, submissionDeadline); + request.setAttribute(NotebookConstants.ATTR_SUBMISSION_DEADLINE, tzSubmissionDeadline.getTime()); + } + return mapping.findForward("success"); } @@ -109,6 +127,41 @@ return mapping.findForward("notebookDisplay"); } + /** + * Set Submission Deadline + * + * @param mapping + * @param form + * @param request + * @param response + * @return + */ + public ActionForward setSubmissionDeadline(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) { + + setupService(); + + Long contentID = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID); + + Notebook notebook = notebookService + .getNotebookByContentId(contentID); + + Long dateParameter = WebUtil.readLongParam(request, NotebookConstants.ATTR_SUBMISSION_DEADLINE, true); + Date tzSubmissionDeadline = null; + if (dateParameter != null) { + Date submissionDeadline = new Date(dateParameter); + HttpSession ss = SessionManager.getSession(); + org.lamsfoundation.lams.usermanagement.dto.UserDTO teacher = (org.lamsfoundation.lams.usermanagement.dto.UserDTO) ss.getAttribute(AttributeNames.USER); + TimeZone teacherTimeZone = teacher.getTimeZone(); + tzSubmissionDeadline = DateUtil.convertFromTimeZoneToDefault(teacherTimeZone, submissionDeadline); + } + notebook.setSubmissionDeadline(tzSubmissionDeadline); + notebookService.saveOrUpdateNotebook(notebook); + return null; + } + + + /** * set up notebookService */ Index: lams_tool_notebook/web/pages/learning/notebook.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_notebook/web/pages/learning/notebook.jsp,v diff -u -r1.21.8.1 -r1.21.8.2 --- lams_tool_notebook/web/pages/learning/notebook.jsp 14 Sep 2009 07:11:37 -0000 1.21.8.1 +++ lams_tool_notebook/web/pages/learning/notebook.jsp 10 May 2011 05:24:50 -0000 1.21.8.2 @@ -52,6 +52,14 @@ ${notebookDTO.instructions}

+ +
+ + + +
+
+
Index: lams_tool_notebook/web/pages/learning/runOffline.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_notebook/web/pages/learning/Attic/runOffline.jsp,v diff -u -r1.8.8.1 -r1.8.8.2 --- lams_tool_notebook/web/pages/learning/runOffline.jsp 14 Sep 2009 07:11:37 -0000 1.8.8.1 +++ lams_tool_notebook/web/pages/learning/runOffline.jsp 10 May 2011 05:24:50 -0000 1.8.8.2 @@ -15,10 +15,21 @@ ${notebookDTO.title} -

- -

- + + +

+ +

+
+ +
+ + + +
+
+
+ Fisheye: Tag 1.1 refers to a dead (removed) revision in file `lams_tool_notebook/web/pages/monitoring/daterestriction.jsp'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_notebook/web/pages/monitoring/summary.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_notebook/web/pages/monitoring/summary.jsp,v diff -u -r1.7.8.1 -r1.7.8.2 --- lams_tool_notebook/web/pages/monitoring/summary.jsp 7 Dec 2010 18:36:21 -0000 1.7.8.1 +++ lams_tool_notebook/web/pages/monitoring/summary.jsp 10 May 2011 05:24:50 -0000 1.7.8.2 @@ -1,12 +1,22 @@ <%@ include file="/common/taglibs.jsp"%> - + + + + + + - - - + + + + + + -

+

@@ -69,6 +147,8 @@

+<%@include file="daterestriction.jsp"%> +