Index: lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/web/actions/LearningAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/web/actions/LearningAction.java,v diff -u -r1.32 -r1.33 --- lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/web/actions/LearningAction.java 13 Jun 2006 06:26:23 -0000 1.32 +++ lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/web/actions/LearningAction.java 13 Jun 2006 07:28:00 -0000 1.33 @@ -170,6 +170,10 @@ return mapping.findForward("error"); } + boolean lock = session.getForum().getLockWhenFinished(); + lock = lock && (session.getStatus() == ForumConstants.SESSION_STATUS_FINISHED ? true : false); + request.getSession().setAttribute(ForumConstants.FINISHEDLOCK, new Boolean(lock)); + Forum forum = session.getForum(); //add define later support if(forum.isDefineLater()){ @@ -190,12 +194,7 @@ allowRichEditor); request.getSession().setAttribute(ForumConstants.LIMITED_CHARS, new Integer(allowNumber)); - boolean lock = session.getForum().getLockWhenFinished(); - lock = lock - && (session.getStatus() == ForumConstants.SESSION_STATUS_FINISHED ? true - : false); - request.getSession().setAttribute(ForumConstants.FINISHEDLOCK, - new Boolean(lock)); + // get all root topic to display on init page List rootTopics = forumService.getRootTopics(sessionId); Index: lams_tool_forum/web/jsps/learning/runoffline.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_forum/web/jsps/learning/Attic/runoffline.jsp,v diff -u -r1.1 -r1.2 --- lams_tool_forum/web/jsps/learning/runoffline.jsp 8 Jun 2006 07:37:33 -0000 1.1 +++ lams_tool_forum/web/jsps/learning/runoffline.jsp 13 Jun 2006 07:28:00 -0000 1.2 @@ -1,5 +1,13 @@ -<%@ include file="/includes/taglibs.jsp" %> +<%@ include file="/includes/taglibs.jsp"%>
- +

+

+ + + + + + +

Index: lams_tool_larsrc/conf/language/ApplicationResources.properties =================================================================== RCS file: /usr/local/cvsroot/lams_tool_larsrc/conf/language/Attic/ApplicationResources.properties,v diff -u -r1.20 -r1.21 --- lams_tool_larsrc/conf/language/ApplicationResources.properties 17 May 2006 06:55:32 -0000 1.20 +++ lams_tool_larsrc/conf/language/ApplicationResources.properties 13 Jun 2006 07:26:59 -0000 1.21 @@ -177,3 +177,8 @@ label.hide=Hide label.save=Save label.cancel=Cancel + + +#======= New labels: after 08/06/2006 ============= +define.later.message=Please wait for the teacher to define this part. +run.offline.message=This activity is not being done on the computer. Please see your instructor for details. Index: lams_tool_larsrc/conf/xdoclet/struts-actions.xml =================================================================== RCS file: /usr/local/cvsroot/lams_tool_larsrc/conf/xdoclet/struts-actions.xml,v diff -u -r1.24 -r1.25 --- lams_tool_larsrc/conf/xdoclet/struts-actions.xml 18 May 2006 06:39:06 -0000 1.24 +++ lams_tool_larsrc/conf/xdoclet/struts-actions.xml 13 Jun 2006 07:26:59 -0000 1.25 @@ -14,6 +14,7 @@ scope="session" parameter="definelater" validate="false"> + + + 0){ + //if it is runOffline content, then need not check minimum view count + if(miniViewFlag > 0 && !StringUtils.equalsIgnoreCase(runOffline,"true")){ ActionErrors errors = new ActionErrors(); errors.add(ActionMessages.GLOBAL_MESSAGE,new ActionMessage("lable.learning.minimum.view.number.less",miniViewFlag)); this.addErrors(request,errors); @@ -243,6 +245,16 @@ log.error(e); return mapping.findForward(ResourceConstants.ERROR); } + + //add define later support + if(resource.isDefineLater()){ + return mapping.findForward("defineLater"); + } + //add run offline support + if(resource.getRunOffline()){ + return mapping.findForward("runOffline"); + } + //init resource item list List resourceItemList = getResourceItemList(request); resourceItemList.clear(); @@ -276,6 +288,11 @@ } request.setAttribute(ResourceConstants.ATTR_RUN_AUTO,new Boolean(runAuto)); + //set contentInUse flag to true! + resource.setContentInUse(true); + resource.setDefineLater(false); + service.saveOrUpdateResource(resource); + return mapping.findForward(ResourceConstants.SUCCESS); } //************************************************************************************* Index: lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/web/action/MonitoringAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/web/action/MonitoringAction.java,v diff -u -r1.7 -r1.8 --- lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/web/action/MonitoringAction.java 17 May 2006 06:55:32 -0000 1.7 +++ lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/web/action/MonitoringAction.java 13 Jun 2006 07:26:59 -0000 1.8 @@ -42,6 +42,7 @@ import org.lamsfoundation.lams.tool.rsrc.model.Resource; import org.lamsfoundation.lams.tool.rsrc.service.IResourceService; import org.lamsfoundation.lams.tool.rsrc.service.ResourceApplicationException; +import org.lamsfoundation.lams.tool.rsrc.util.ResourceWebUtils; import org.lamsfoundation.lams.util.WebUtil; import org.lamsfoundation.lams.web.util.AttributeNames; import org.springframework.web.context.WebApplicationContext; @@ -50,7 +51,7 @@ import sun.util.logging.resources.logging; public class MonitoringAction extends Action { - private static Logger log = Logger.getLogger(MonitoringAction.class); + public static Logger log = Logger.getLogger(MonitoringAction.class); public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { @@ -130,7 +131,7 @@ Resource resource = service.getResourceByContentId(contentId); resource.toDTO(); - request.getSession().setAttribute(ResourceConstants.PAGE_EDITABLE, new Boolean(isResourceEditable(resource))); + request.getSession().setAttribute(ResourceConstants.PAGE_EDITABLE, new Boolean(ResourceWebUtils.isResourceEditable(resource))); request.getSession().setAttribute(ResourceConstants.ATTR_RESOURCE, resource); request.getSession().setAttribute(ResourceConstants.ATTR_TOOL_CONTENT_ID, contentId); return mapping.findForward(ResourceConstants.SUCCESS); @@ -157,20 +158,5 @@ WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(getServlet() .getServletContext()); return (IResourceService) wac.getBean(ResourceConstants.RESOURCE_SERVICE); - } - - private boolean isResourceEditable(Resource resource) { - if ( (resource.isDefineLater() == true) && (resource.isContentInUse()==true) ) - { -// throw new ResourceApplicationException("An exception has occurred: There is a bug in this tool, conflicting flags are set"); - log.error("An exception has occurred: There is a bug in this tool, conflicting flags are set"); - return false; - } - else if ( (resource.isDefineLater() == true) && (resource.isContentInUse() == false)) - return true; - else if ( (resource.isDefineLater() == false) && (resource.isContentInUse() == false)) - return true; - else // (content.isContentInUse()==true && content.isDefineLater() == false) - return false; } } Index: lams_tool_larsrc/web/pages/authoring/definelater.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_larsrc/web/pages/authoring/definelater.jsp,v diff -u -r1.2 -r1.3 --- lams_tool_larsrc/web/pages/authoring/definelater.jsp 5 Jun 2006 15:40:57 -0000 1.2 +++ lams_tool_larsrc/web/pages/authoring/definelater.jsp 13 Jun 2006 07:26:59 -0000 1.3 @@ -1,36 +1,30 @@ -<%@ include file="/common/taglibs.jsp" %> -<%@ page import="java.util.HashSet" %> +<%@ include file="/common/taglibs.jsp"%> +<%@ page import="java.util.HashSet"%> <%@ page import="org.lamsfoundation.lams.tool.rsrc.ResourceConstants"%> -<%@ page import="java.util.Set" %> - <% - - Set tabs = new HashSet(); - tabs.add("label.authoring.heading.basic"); - pageContext.setAttribute("tabs", tabs); - - %> +<%@ page import="java.util.Set"%> +<%Set tabs = new HashSet(); + tabs.add("label.authoring.heading.basic"); + pageContext.setAttribute("tabs", tabs); + + %> - <fmt:message key="label.author.title"/> - - <%@ include file="/common/header.jsp" %> - <%@ include file="/common/fckeditorheader.jsp" %> + <fmt:message key="label.author.title" /> + + <%@ include file="/common/header.jsp"%> + <%@ include file="/common/fckeditorheader.jsp"%> + + - - - + + + - - - - + + + -

+

+ +

- - - -
- - - - -
- <%@ include file="/common/messages.jsp" %> -
+ + + +
+ + + - - - - - - <%-- Default value - cancelButtonLabelKey="label.authoring.cancel.button" - saveButtonLabelKey="label.authoring.save.button" - cancelConfirmMsgKey="authoring.msg.cancel.save" - accessMode="author" - --%> - + + - -
- + +
-
+ +
Index: lams_tool_larsrc/web/pages/authoring/definelaterforbid.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_larsrc/web/pages/authoring/definelaterforbid.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_larsrc/web/pages/authoring/definelaterforbid.jsp 13 Jun 2006 07:26:59 -0000 1.1 @@ -0,0 +1,4 @@ +<%@ include file="/common/taglibs.jsp"%> +
+ +
Index: lams_tool_larsrc/web/pages/learning/definelater.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_larsrc/web/pages/learning/definelater.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_larsrc/web/pages/learning/definelater.jsp 13 Jun 2006 07:26:59 -0000 1.1 @@ -0,0 +1,17 @@ +<%@include file="/common/taglibs.jsp"%> + + + + <%@ include file="/common/header.jsp"%> + + + + +
+

+ +

+
+ + +
Index: lams_tool_larsrc/web/pages/learning/runoffline.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_larsrc/web/pages/learning/Attic/runoffline.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_larsrc/web/pages/learning/runoffline.jsp 13 Jun 2006 07:26:59 -0000 1.1 @@ -0,0 +1,31 @@ +<%@include file="/common/taglibs.jsp"%> + + + + <%@ include file="/common/header.jsp"%> + + + + + +

+ ${resource.title} +

+
+

+ +

+

+ +

+ + + +
Index: lams_tool_sbmt/conf/language/ApplicationResources.properties =================================================================== RCS file: /usr/local/cvsroot/lams_tool_sbmt/conf/language/Attic/ApplicationResources.properties,v diff -u -r1.4 -r1.5 --- lams_tool_sbmt/conf/language/ApplicationResources.properties 12 May 2006 06:34:09 -0000 1.4 +++ lams_tool_sbmt/conf/language/ApplicationResources.properties 13 Jun 2006 07:27:25 -0000 1.5 @@ -100,4 +100,9 @@ #======= End labels: Exported 89 labels for en AU ===== #======== New label since 12/05/2006 ========= -authoring.msg.cancel.save=Do you want to close this window without saving? \ No newline at end of file +authoring.msg.cancel.save=Do you want to close this window without saving? + +#======= New labels: after 08/06/2006 ============= +define.later.message=Please wait for the teacher to define this part. +run.offline.message=This activity is not being done on the computer. Please see your instructor for details. +message.monitoring.edit.activity.not.editable=This Activity is no longer editable \ No newline at end of file Index: lams_tool_sbmt/conf/xdoclet/struts-actions.xml =================================================================== RCS file: /usr/local/cvsroot/lams_tool_sbmt/conf/xdoclet/struts-actions.xml,v diff -u -r1.2 -r1.3 --- lams_tool_sbmt/conf/xdoclet/struts-actions.xml 12 May 2006 06:34:09 -0000 1.2 +++ lams_tool_sbmt/conf/xdoclet/struts-actions.xml 13 Jun 2006 07:27:25 -0000 1.3 @@ -1,18 +1,18 @@ Index: lams_tool_sbmt/db/sql/tool_insert.sql =================================================================== RCS file: /usr/local/cvsroot/lams_tool_sbmt/db/sql/tool_insert.sql,v diff -u -r1.16 -r1.17 --- lams_tool_sbmt/db/sql/tool_insert.sql 10 Apr 2006 11:11:07 -0000 1.16 +++ lams_tool_sbmt/db/sql/tool_insert.sql 13 Jun 2006 07:27:25 -0000 1.17 @@ -44,7 +44,7 @@ 'tool/lasbmt11/learner.do?mode=teacher', 'tool/lasbmt11/authoring.do', 'tool/lasbmt11/monitoring.do', -'tool/lasbmt11/definelater.do?method=editActivity&mode=definelater', +'tool/lasbmt11/definelater.do?mode=teacher', 'tool/lasbmt11/exportPortfolio?mode=learner', 'tool/lasbmt11/exportPortfolio?mode=teacher', 'tool/lasbmt11/contribute.do', Index: lams_tool_sbmt/src/java/org/lamsfoundation/lams/tool/sbmt/service/SubmitFilesService.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_sbmt/src/java/org/lamsfoundation/lams/tool/sbmt/service/SubmitFilesService.java,v diff -u -r1.49 -r1.50 --- lams_tool_sbmt/src/java/org/lamsfoundation/lams/tool/sbmt/service/SubmitFilesService.java 7 Jun 2006 06:08:28 -0000 1.49 +++ lams_tool_sbmt/src/java/org/lamsfoundation/lams/tool/sbmt/service/SubmitFilesService.java 13 Jun 2006 07:27:25 -0000 1.50 @@ -165,7 +165,7 @@ */ private SubmitFilesContent duplicateDefaultToolContent(Long toolContentId) { long contentId=0; - contentId =toolService.getToolDefaultContentIdBySignature(SbmtConstants.TOOLSIGNNATURE); + contentId =toolService.getToolDefaultContentIdBySignature(SbmtConstants.TOOL_SIGNATURE); SubmitFilesContent content = new SubmitFilesContent(); content.setContentID(new Long(contentId)); return content; @@ -739,7 +739,7 @@ log.error(error); throw new SubmitFilesException(error); } - Long defaultToolContentId = getToolDefaultContentIdBySignature(SbmtConstants.TOOLSIGNNATURE); + Long defaultToolContentId = getToolDefaultContentIdBySignature(SbmtConstants.TOOL_SIGNATURE); SubmitFilesContent defaultContent = getSubmitFilesContent(defaultToolContentId); if(defaultContent == null) { Index: lams_tool_sbmt/src/java/org/lamsfoundation/lams/tool/sbmt/util/SbmtConstants.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_sbmt/src/java/org/lamsfoundation/lams/tool/sbmt/util/SbmtConstants.java,v diff -u -r1.11 -r1.12 --- lams_tool_sbmt/src/java/org/lamsfoundation/lams/tool/sbmt/util/SbmtConstants.java 6 Apr 2006 06:41:33 -0000 1.11 +++ lams_tool_sbmt/src/java/org/lamsfoundation/lams/tool/sbmt/util/SbmtConstants.java 13 Jun 2006 07:27:25 -0000 1.12 @@ -27,7 +27,7 @@ public class SbmtConstants { - public static final String TOOLSIGNNATURE = "lasbmt11"; + public static final String TOOL_SIGNATURE = "lasbmt11"; public static final String DEFAULT_TITLE = "Submit Files Title"; public static final String AUTHORING_DTO = "authoring"; @@ -41,4 +41,5 @@ public static final String ATTACHMENT_LIST = "attachmentList"; public static final String DELETED_ATTACHMENT_LIST = "deletedAttachmentList"; public static final String READ_ONLY_MODE = "readOnlyMode"; + public static final String PAGE_EDITABLE = "isPageEditable"; } Index: lams_tool_sbmt/src/java/org/lamsfoundation/lams/tool/sbmt/util/SbmtWebUtils.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_sbmt/src/java/org/lamsfoundation/lams/tool/sbmt/util/Attic/SbmtWebUtils.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_sbmt/src/java/org/lamsfoundation/lams/tool/sbmt/util/SbmtWebUtils.java 13 Jun 2006 07:27:25 -0000 1.1 @@ -0,0 +1,53 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2.0 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + +/* $$Id$$ */ +package org.lamsfoundation.lams.tool.sbmt.util; + +import org.lamsfoundation.lams.tool.sbmt.SubmitFilesContent; +import org.lamsfoundation.lams.tool.sbmt.exception.SubmitFilesException; + + +/** + * Contains helper methods used by the Action Servlets + * + * @author Anthony Sukkar + * + */ +public class SbmtWebUtils { + + public static boolean isSbmtEditable(SubmitFilesContent submitContent) { + if ( (submitContent.isDefineLater() == true) && (submitContent.isContentInUse()==true) ) + { + throw new SubmitFilesException("An exception has occurred: There is a bug in this tool, conflicting flags are set"); + //return false; + } + else if ( (submitContent.isDefineLater() == true) && (submitContent.isContentInUse() == false)) + return true; + else if ( (submitContent.isDefineLater() == false) && (submitContent.isContentInUse() == false)) + return true; + else // (content.isContentInUse()==true && content.isDefineLater() == false) + return false; + } + +} Index: lams_tool_sbmt/src/java/org/lamsfoundation/lams/tool/sbmt/web/AuthoringAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_sbmt/src/java/org/lamsfoundation/lams/tool/sbmt/web/AuthoringAction.java,v diff -u -r1.20 -r1.21 --- lams_tool_sbmt/src/java/org/lamsfoundation/lams/tool/sbmt/web/AuthoringAction.java 19 May 2006 05:24:42 -0000 1.20 +++ lams_tool_sbmt/src/java/org/lamsfoundation/lams/tool/sbmt/web/AuthoringAction.java 13 Jun 2006 07:27:25 -0000 1.21 @@ -46,15 +46,17 @@ import org.apache.struts.upload.FormFile; import org.lamsfoundation.lams.authoring.web.AuthoringConstants; import org.lamsfoundation.lams.contentrepository.client.IToolContentHandler; +import org.lamsfoundation.lams.tool.ToolAccessMode; import org.lamsfoundation.lams.tool.sbmt.InstructionFiles; import org.lamsfoundation.lams.tool.sbmt.SubmitFilesContent; import org.lamsfoundation.lams.tool.sbmt.dto.AuthoringDTO; import org.lamsfoundation.lams.tool.sbmt.service.ISubmitFilesService; import org.lamsfoundation.lams.tool.sbmt.service.SubmitFilesServiceProxy; import org.lamsfoundation.lams.tool.sbmt.util.SbmtConstants; +import org.lamsfoundation.lams.tool.sbmt.util.SbmtWebUtils; import org.lamsfoundation.lams.util.WebUtil; -import org.lamsfoundation.lams.web.util.AttributeNames; import org.lamsfoundation.lams.web.action.LamsDispatchAction; +import org.lamsfoundation.lams.web.util.AttributeNames; /** * @author Manpreet Minhas @@ -90,6 +92,8 @@ public ActionForward updateContent(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { + ToolAccessMode mode = getAccessMode(request); + SubmitFilesContent content = getContent(form); submitFilesService = SubmitFilesServiceProxy.getSubmitFilesService(this @@ -144,7 +148,16 @@ content.setInstructionFiles(attPOSet); content.setToolSession(persistContent.getToolSession()); //copy web page value into persist content, as above, the "Set" type value kept. - PropertyUtils.copyProperties(persistContent,content); + if(mode.isAuthor()){ + Long uid = persistContent.getContentID(); + PropertyUtils.copyProperties(persistContent,content); + persistContent.setContentID(uid); + }else{ +// if it is Teacher, then just update basic tab content (definelater) + persistContent.setInstruction(content.getInstruction()); + persistContent.setTitle(content.getTitle()); + persistContent.setDefineLater(false); + } submitFilesService.saveOrUpdateContent(persistContent); request.setAttribute("sbmtSuccess", new Boolean(true)); @@ -238,8 +251,10 @@ /** * This page will display initial submit tool content. Or just a blank page if the toolContentID does not - * exist before. + * exist before. * + *
+ * Define later will use this method to initial page as well. * @see org.apache.struts.actions.DispatchAction#unspecified(org.apache.struts.action.ActionMapping, * org.apache.struts.action.ActionForm, * javax.servlet.http.HttpServletRequest, @@ -248,13 +263,29 @@ protected ActionForward unspecified(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { + ToolAccessMode mode = getAccessMode(request); + Long contentID = new Long(WebUtil.readLongParam(request,AttributeNames.PARAM_TOOL_CONTENT_ID)); request.getSession().setAttribute(AttributeNames.PARAM_TOOL_CONTENT_ID,contentID); //get back the upload file list and display them on page submitFilesService = SubmitFilesServiceProxy.getSubmitFilesService(this .getServlet().getServletContext()); SubmitFilesContent persistContent = submitFilesService.getSubmitFilesContent(contentID); + + if(mode.isTeacher()){ + boolean isForumEditable = SbmtWebUtils.isSbmtEditable(persistContent); + if(!isForumEditable){ + request.setAttribute(SbmtConstants.PAGE_EDITABLE, new Boolean(isForumEditable)); + return mapping.findForward("forbidden"); + } + + if(!persistContent.isContentInUse()){ + persistContent.setDefineLater(true); + submitFilesService.saveOrUpdateContent(persistContent); + } + } + //if this content does not exist(empty without id), create a content by default content record. if(persistContent == null){ persistContent = submitFilesService.createDefaultContent(contentID); @@ -281,7 +312,7 @@ authForm.set("lockOnFinished",persistContent.isLockOnFinished()?"1":null); return mapping.getInputForward(); } - + //*********************************************************** // Private/protected methods //*********************************************************** @@ -368,4 +399,19 @@ } return list; } + + /** + * @param request + * @return + */ + private ToolAccessMode getAccessMode(HttpServletRequest request) { + ToolAccessMode mode; + String modeStr = request.getParameter("mode"); + if(StringUtils.equalsIgnoreCase(modeStr,ToolAccessMode.TEACHER.toString())) + mode = ToolAccessMode.TEACHER; + else + mode = ToolAccessMode.AUTHOR; + return mode; + } + } Index: lams_tool_sbmt/src/java/org/lamsfoundation/lams/tool/sbmt/web/LearnerAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_sbmt/src/java/org/lamsfoundation/lams/tool/sbmt/web/LearnerAction.java,v diff -u -r1.27 -r1.28 --- lams_tool_sbmt/src/java/org/lamsfoundation/lams/tool/sbmt/web/LearnerAction.java 8 Jun 2006 00:59:19 -0000 1.27 +++ lams_tool_sbmt/src/java/org/lamsfoundation/lams/tool/sbmt/web/LearnerAction.java 13 Jun 2006 07:27:25 -0000 1.28 @@ -72,7 +72,9 @@ * validate="false" * * @struts.action-forward name="upload" path="/learner/sbmtLearner.jsp" - * @struts.action-forward name="contentInUse" path="/learner/contentinuse.jsp" + * @struts.action-forward name="defineLater" path="/learner/definelater.jsp" + * @struts.action-forward name="runOffline" path="/learner/runoffline.jsp" + * */ public class LearnerAction extends DispatchAction { @@ -129,15 +131,28 @@ submitFilesService = SubmitFilesServiceProxy.getSubmitFilesService(this.getServlet().getServletContext()); SubmitFilesSession session = submitFilesService.getSessionById(sessionID); SubmitFilesContent content = session.getContent(); - //if content in use, return special page. - if(content.isContentInUse()) - return mapping.findForward("contentInUse"); + List filesUploaded = submitFilesService.getFilesUploadedByUser(userID,sessionID); Learner learner = submitFilesService.getLearner(sessionID,userID); setLearnerDTO(request, sessionID,user,learner, content, filesUploaded); //to avoid user without patience click "upload" button too fast saveToken(request); + + //if content in use, return special page. + if(content.isDefineLater()){ + return mapping.findForward("defineLater"); + } + //add run offline support + if(content.isRunOffline()){ + return mapping.findForward("runOffline"); + } + + //set contentInUse flag to true! + content.setContentInUse(true); + content.setDefineLater(false); + submitFilesService.saveOrUpdateContent(content); + return mapping.getInputForward(); } Index: lams_tool_sbmt/src/java/org/lamsfoundation/lams/tool/sbmt/web/MonitoringAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_sbmt/src/java/org/lamsfoundation/lams/tool/sbmt/web/MonitoringAction.java,v diff -u -r1.28 -r1.29 --- lams_tool_sbmt/src/java/org/lamsfoundation/lams/tool/sbmt/web/MonitoringAction.java 6 Apr 2006 06:41:33 -0000 1.28 +++ lams_tool_sbmt/src/java/org/lamsfoundation/lams/tool/sbmt/web/MonitoringAction.java 13 Jun 2006 07:27:25 -0000 1.29 @@ -43,24 +43,25 @@ import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.hssf.util.Region; import org.apache.struts.action.ActionForm; -import org.apache.struts.action.DynaActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import org.apache.struts.action.ActionMessage; import org.apache.struts.action.ActionMessages; +import org.apache.struts.action.DynaActionForm; import org.lamsfoundation.lams.tool.sbmt.SubmitFilesContent; import org.lamsfoundation.lams.tool.sbmt.SubmitFilesSession; import org.lamsfoundation.lams.tool.sbmt.dto.AuthoringDTO; import org.lamsfoundation.lams.tool.sbmt.dto.FileDetailsDTO; -import org.lamsfoundation.lams.tool.sbmt.dto.StatisticDTO; import org.lamsfoundation.lams.tool.sbmt.dto.SessionDTO; +import org.lamsfoundation.lams.tool.sbmt.dto.StatisticDTO; import org.lamsfoundation.lams.tool.sbmt.service.ISubmitFilesService; import org.lamsfoundation.lams.tool.sbmt.service.SubmitFilesServiceProxy; import org.lamsfoundation.lams.tool.sbmt.util.SbmtConstants; +import org.lamsfoundation.lams.tool.sbmt.util.SbmtWebUtils; import org.lamsfoundation.lams.usermanagement.dto.UserDTO; import org.lamsfoundation.lams.util.WebUtil; -import org.lamsfoundation.lams.web.util.AttributeNames; import org.lamsfoundation.lams.web.action.LamsDispatchAction; +import org.lamsfoundation.lams.web.util.AttributeNames; /** @@ -78,7 +79,6 @@ * * @struts.action-forward name="instructions" path="/monitoring/monitoring.jsp" * @struts.action-forward name="showActivity" path="/monitoring/monitoring.jsp" - * @struts.action-forward name="editActivity" path="/monitoring/monitoring.jsp" * @struts.action-forward name="success" path="/monitoring/monitoring.jsp" * @struts.action-forward name="load" path="/monitoring/monitoring.jsp" * @@ -441,66 +441,6 @@ return mapping.findForward("showActivity"); } /** - * Provide editable page for activity. The information will be same with "Basic" tab in authoring page. - * @param mapping - * @param form - * @param request - * @param response - * @return - */ - public ActionForward editActivity(ActionMapping mapping, - ActionForm form, - HttpServletRequest request, - HttpServletResponse response){ - Long contentID = new Long(WebUtil.readLongParam(request,AttributeNames.PARAM_TOOL_CONTENT_ID)); - getAuthoringActivity(contentID, request); - String mode = request.getParameter("mode"); - - setTab(request); - - // do other tabs - doTabs(mapping, form, request, response); - - if(StringUtils.equals(mode,"definelater")) - return mapping.findForward("definelater"); - else - return mapping.findForward("editActivity"); - } - /** - * Update activity to database. The information will be same with "Basic" tab in authoring page. - * @param mapping - * @param form - * @param request - * @param response - * @return - */ - public ActionForward updateActivity(ActionMapping mapping, - ActionForm form, - HttpServletRequest request, - HttpServletResponse response){ - Long contentID = new Long(WebUtil.readLongParam(request,AttributeNames.PARAM_TOOL_CONTENT_ID)); - String title = WebUtil.readStrParam(request,"title"); - String instructions = WebUtil.readStrParam(request,"instructions"); - - //get back the upload file list and display them on page - submitFilesService = SubmitFilesServiceProxy.getSubmitFilesService(this - .getServlet().getServletContext()); - SubmitFilesContent content = submitFilesService.getSubmitFilesContent(contentID); - content.setTitle(title); - content.setInstruction(instructions); - submitFilesService.saveOrUpdateContent(content); - - getAuthoringActivity(contentID, request); - setTab(request); - doTabs(mapping, form, request, response); - - String mode = request.getParameter("mode"); - if(StringUtils.equals(mode,"definelater")) - return mapping.findForward("definelatersuccess"); - else - return mapping.findForward("success"); - } - /** * Provide statistic information. Includes:
*
  • Files not marked
  • *
  • Files marked
  • @@ -576,6 +516,8 @@ persistContent.setContentID(contentID); AuthoringDTO authorDto = new AuthoringDTO(persistContent); request.setAttribute(SbmtConstants.AUTHORING_DTO,authorDto); + + request.setAttribute(SbmtConstants.PAGE_EDITABLE, new Boolean(SbmtWebUtils.isSbmtEditable(persistContent))); } private ISubmitFilesService getSubmitFilesService(){ return SubmitFilesServiceProxy Index: lams_tool_sbmt/web/WEB-INF/struts/struts-config.xml =================================================================== RCS file: /usr/local/cvsroot/lams_tool_sbmt/web/WEB-INF/struts/Attic/struts-config.xml,v diff -u -r1.27 -r1.28 --- lams_tool_sbmt/web/WEB-INF/struts/struts-config.xml 12 May 2006 06:34:09 -0000 1.27 +++ lams_tool_sbmt/web/WEB-INF/struts/struts-config.xml 13 Jun 2006 07:27:25 -0000 1.28 @@ -97,10 +97,15 @@ redirect="false" /> +
    - Index: lams_tool_sbmt/web/authoring/authoring.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_sbmt/web/authoring/authoring.jsp,v diff -u -r1.29 -r1.30 --- lams_tool_sbmt/web/authoring/authoring.jsp 19 May 2006 05:24:41 -0000 1.29 +++ lams_tool_sbmt/web/authoring/authoring.jsp 13 Jun 2006 07:27:25 -0000 1.30 @@ -1,5 +1,7 @@ <%@include file="/common/taglibs.jsp"%> <%@ taglib uri="fck-editor" prefix="FCK"%> + +<%@ page import="org.lamsfoundation.lams.tool.sbmt.util.SbmtConstants"%> <%@ page import="java.util.HashSet"%> <%@ page import="java.util.Set"%> @@ -107,7 +109,7 @@ cancelConfirmMsgKey="authoring.msg.cancel.save" accessMode="author" --%> - + Index: lams_tool_sbmt/web/authoring/definelater.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_sbmt/web/authoring/definelater.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_sbmt/web/authoring/definelater.jsp 13 Jun 2006 07:27:25 -0000 1.1 @@ -0,0 +1,96 @@ +<%@include file="/common/taglibs.jsp"%> +<%@ taglib uri="fck-editor" prefix="FCK"%> + +<%@ page import="org.lamsfoundation.lams.tool.sbmt.util.SbmtConstants"%> +<%@ page import="java.util.HashSet"%> +<%@ page import="java.util.Set"%> + + + + + + + +<%Set tabs = new HashSet(); + tabs.add("label.authoring.heading.basic"); + pageContext.setAttribute("tabs", tabs); + + %> + + + + + <fmt:message key="activity.title" /> + + + + + + + + + + + + + + + + +

    + +

    + + + + +
    + + + + +
    + <%@ include file="/common/messages.jsp"%> +
    + + + + + + +
    + + + +
    + +
    Index: lams_tool_sbmt/web/authoring/definelaterforbid.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_sbmt/web/authoring/definelaterforbid.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_sbmt/web/authoring/definelaterforbid.jsp 13 Jun 2006 07:27:25 -0000 1.1 @@ -0,0 +1,4 @@ +<%@ include file="/common/taglibs.jsp"%> +
    + +
    Fisheye: Tag 1.2 refers to a dead (removed) revision in file `lams_tool_sbmt/web/learner/contentinuse.jsp'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_sbmt/web/learner/definelater.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_sbmt/web/learner/definelater.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_sbmt/web/learner/definelater.jsp 13 Jun 2006 07:27:25 -0000 1.1 @@ -0,0 +1,13 @@ +<%@include file="/common/taglibs.jsp"%> + + + + + + +
    + +
    + + +
    Index: lams_tool_sbmt/web/learner/runoffline.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_sbmt/web/learner/Attic/runoffline.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_sbmt/web/learner/runoffline.jsp 13 Jun 2006 07:27:25 -0000 1.1 @@ -0,0 +1,28 @@ +<%@include file="/common/taglibs.jsp"%> + + + + <%@include file="/common/header.jsp"%> + + + + +
    +

    + +

    +

    + + + + +

    + + +
    Fisheye: Tag 1.4 refers to a dead (removed) revision in file `lams_tool_sbmt/web/monitoring/definelater.jsp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.10 refers to a dead (removed) revision in file `lams_tool_sbmt/web/monitoring/editactivity.jsp'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_sbmt/web/monitoring/showactivity.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_sbmt/web/monitoring/Attic/showactivity.jsp,v diff -u -r1.6 -r1.7 --- lams_tool_sbmt/web/monitoring/showactivity.jsp 19 May 2006 05:24:41 -0000 1.6 +++ lams_tool_sbmt/web/monitoring/showactivity.jsp 13 Jun 2006 07:27:25 -0000 1.7 @@ -20,9 +20,23 @@ - - - + + + + + + + + + + + + +
    + +
    +
    +
    \ No newline at end of file