Index: lams_common/src/java/org/lamsfoundation/lams/tool/ToolContentManager.java =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/tool/ToolContentManager.java,v diff -u -r1.1 -r1.2 --- lams_common/src/java/org/lamsfoundation/lams/tool/ToolContentManager.java 1 Feb 2005 22:33:59 -0000 1.1 +++ lams_common/src/java/org/lamsfoundation/lams/tool/ToolContentManager.java 6 May 2005 05:26:20 -0000 1.2 @@ -1,19 +1,32 @@ -/* ******************************************************************************** - * Copyright Notice - * ================= - * This file contains propriety information of LAMS Foundation. - * Copying or reproduction with prior written permission is prohibited. - * Copyright (c) 2004 - * Created on 2004-12-7 - ******************************************************************************** */ - +/*************************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * 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 + * ***********************************************************************/ package org.lamsfoundation.lams.tool; /** * Tool interface that defines the contract regarding tool content manipulation. * * @author Jacky Fang 2004-12-7 + * @author Fiona Malikoff May 2005 * */ public interface ToolContentManager @@ -26,6 +39,22 @@ */ public void copyToolContent(Long fromContentId, Long toContentId); + /** This tool content should be define later, that is, the + * teacher will define the content at runtime. The toolContentId + * should already exist in the tool. This method will normally be + * called after copyToolContent. + * @param toolContentId the tool content id of the tool content to be changed. + */ + public void setAsDefineLater(Long toolContentId); + + /** This tool content should be setup to run offline, that is, the + * activity will be done offline. The toolContentId + * should already exist in the tool. This method will normally be + * called after copyToolContent. + * @param toolContentId the tool content id of the tool content to be changed. + */ + public void setAsRunOffline(Long toolContentId); + /** * Remove tool's content according specified the content id. It will be * needed by lams to modify the learning design. Index: lams_common/src/java/org/lamsfoundation/lams/tool/service/LamsCoreToolService.java =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/tool/service/LamsCoreToolService.java,v diff -u -r1.5 -r1.6 --- lams_common/src/java/org/lamsfoundation/lams/tool/service/LamsCoreToolService.java 22 Mar 2005 01:31:14 -0000 1.5 +++ lams_common/src/java/org/lamsfoundation/lams/tool/service/LamsCoreToolService.java 6 May 2005 05:33:38 -0000 1.6 @@ -158,9 +158,17 @@ //TODO we need to remove this once all done. if (isSurvey(toolActivity)) { - ToolContentManager contentManager = (ToolContentManager) findToolService(toolActivity); + ToolContentManager contentManager = (ToolContentManager) findToolService(toolActivity); contentManager.copyToolContent(toolActivity.getToolContentId(), newToolcontentID); + if ( toolActivity.getDefineLater() != null && + toolActivity.getDefineLater().booleanValue() ) { + contentManager.setAsDefineLater(newToolcontentID); + } + if ( toolActivity.getRunOffline() != null && + toolActivity.getRunOffline().booleanValue() ) { + contentManager.setAsRunOffline(newToolcontentID); + } } return newToolcontentID; }