Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaAppConstants.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaAppConstants.java,v diff -u -r1.37 -r1.38 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaAppConstants.java 4 Mar 2006 19:39:17 -0000 1.37 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaAppConstants.java 5 Mar 2006 13:23:14 -0000 1.38 @@ -44,6 +44,7 @@ public static final String LEARNING_STARTER ="learningStarter"; public static final String MONITORING_STARTER ="monitoringStarter"; public static final String LOAD_MONITORING ="loadMonitoring"; + public static final String LOAD_VIEW_ONLY ="loadViewOnly"; public static final String EDIT_RESPONSE ="editResponse"; public static final String EDITABLE_RESPONSE_ID ="editableResponseId"; public static final String COPY_TOOL_CONTENT ="copyToolContent"; @@ -60,7 +61,7 @@ public static final String SOURCE_MC_STARTER ="sourceMcStarter"; public static final String IS_MONITORED_CONTENT_IN_USE ="isMonitoredContentInUse"; - public static final String LOAD_MONITORING_CONTENT_EDITACTIVITY ="loadMonitoringEditActivity"; + public static final String LOAD_MONITORING_CONTENT_EDITACTIVITY ="loadMonitoringEditActivity"; /* * refers to number of questions presented initially, we have a single record for default content Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaResources.properties =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/Attic/QaResources.properties,v diff -u -r1.20 -r1.21 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaResources.properties 2 Mar 2006 21:20:05 -0000 1.20 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaResources.properties 5 Mar 2006 13:23:14 -0000 1.21 @@ -144,6 +144,7 @@ error.contentrepository =An error has occurred when saving/deleting instruction file {0}. The files may not be saved correctly. monitoring.feedback.instructionUpdate =The content has been updated successfully. +label.openEditor =Open Richtext Editor label.user =User label.question.col =Question: label.attemptTime =Attempt Date/Time @@ -154,7 +155,9 @@ button.summary =Summary button.editActivity =Edit Activity button.stats =Stats +label.save =Save label.edit =Edit +label.cancel =Cancel label.update =Update label.hide =Hide label.unHide =UnHide Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaUtils.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/Attic/QaUtils.java,v diff -u -r1.26 -r1.27 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaUtils.java 4 Mar 2006 19:39:17 -0000 1.26 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaUtils.java 5 Mar 2006 13:23:14 -0000 1.27 @@ -36,10 +36,8 @@ import javax.servlet.http.HttpSession; import org.apache.log4j.Logger; - import org.lamsfoundation.lams.tool.qa.service.IQaService; import org.lamsfoundation.lams.tool.qa.web.QaAuthoringForm; -import org.lamsfoundation.lams.usermanagement.User; import org.lamsfoundation.lams.usermanagement.dto.UserDTO; import org.lamsfoundation.lams.web.session.SessionManager; import org.lamsfoundation.lams.web.util.AttributeNames; @@ -572,24 +570,43 @@ } - public static String getDestination(String sourceMcStarter) + public static void setDefineLater(HttpServletRequest request, boolean value, String toolContentId) + { + IQaService qaService = (IQaService)request.getSession().getAttribute(TOOL_SERVICE); + logger.debug("qaService: " + qaService); + logger.debug("value:" + value); + logger.debug("toolContentId:" + toolContentId); + + QaContent qaContent=qaService.loadQa(new Long(toolContentId).longValue()); + logger.debug("qaContent:" + qaContent); + if (qaContent != null) + { + qaContent.setDefineLater(value); + logger.debug("defineLater has been set to true"); + qaService.updateQa(qaContent); + } + } + + + public static String getDestination(String sourceMcStarter, String requestedModule) { - logger.debug("sourceMcStarter: " + sourceMcStarter); + logger.debug("sourceMcStarter: " + sourceMcStarter + " and requestedModule:" + requestedModule); - if ((sourceMcStarter != null) && !sourceMcStarter.equals("monitoring")) + if (requestedModule.equals(DEFINE_LATER)) { - logger.debug("request is from authoring or define Later url. return to: " + LOAD_QUESTIONS); - return LOAD_QUESTIONS; + logger.debug("request is from define Later url. return to: " + LOAD_VIEW_ONLY); + return LOAD_VIEW_ONLY; } - else if (sourceMcStarter == null) + if (requestedModule.equals(AUTHORING)) { logger.debug("request is from authoring url. return to: " + LOAD_QUESTIONS); return LOAD_QUESTIONS; } + else { - logger.debug("request is from monitoring url. return to: " + LOAD_MONITORING_CONTENT_EDITACTIVITY); - return LOAD_MONITORING_CONTENT_EDITACTIVITY; + logger.debug("request is from an unknown source. return null"); + return null; } } } Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/hibernate/QaContentDAO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/hibernate/QaContentDAO.java,v diff -u -r1.10 -r1.11 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/hibernate/QaContentDAO.java 15 Feb 2006 14:09:59 -0000 1.10 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/hibernate/QaContentDAO.java 5 Mar 2006 13:23:15 -0000 1.11 @@ -91,11 +91,9 @@ logger.debug("before updateQa: " + qa); this.getHibernateTemplate().update(qa); } - - - public QaContent getQaBySession(final Long sessionId) - { + public QaContent getQaBySession(final Long sessionId) + { return (QaContent) getHibernateTemplate().execute(new HibernateCallback() { @@ -107,7 +105,7 @@ .uniqueResult(); } }); - } + } public void saveQa(QaContent qa) @@ -124,6 +122,7 @@ public void UpdateQa(QaContent qa) { + this.getSession().setFlushMode(FlushMode.AUTO); this.getHibernateTemplate().update(qa); } Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/Attic/QAction.java,v diff -u -r1.26 -r1.27 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QAction.java 4 Mar 2006 05:42:42 -0000 1.26 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QAction.java 5 Mar 2006 13:23:15 -0000 1.27 @@ -46,6 +46,7 @@ import org.lamsfoundation.lams.contentrepository.RepositoryCheckedException; import org.lamsfoundation.lams.contentrepository.client.IToolContentHandler; import org.lamsfoundation.lams.tool.exception.ToolException; + import org.lamsfoundation.lams.tool.qa.QaAppConstants; import org.lamsfoundation.lams.tool.qa.QaComparator; import org.lamsfoundation.lams.tool.qa.QaContent; @@ -62,35 +63,8 @@ import org.springframework.web.context.WebApplicationContext; import org.springframework.web.context.support.WebApplicationContextUtils; - /** * - * change the logic about completion status - * - */ - -/** - * - * once lams_learning is ready and appContext file is src/ then FINISH toool session will work. - * - */ - -/** - * - * done: removed styling, except error messages and table centering - * - */ - -/** - * The tool's Spring configuration file: qaCompactApplicationContext.xml - * Main service bean of the tool is: org.lamsfoundation.lams.tool.qa.service.QaServicePOJO - * - * done: config file is read from classpath - */ - - -/** - * * the tool's web.xml will be modified to have classpath to learning service. * This is how the tool gets the definition of "learnerService" */ @@ -261,6 +235,44 @@ return mapping.findForward(LOAD_QUESTIONS); } + + public ActionForward editActivityQuestions(ActionMapping mapping, + ActionForm form, + HttpServletRequest request, + HttpServletResponse response) throws IOException, + ServletException, + ToolException + { + logger.debug("dispatching editActivityQuestions..."); + + QaAuthoringForm qaAuthoringForm = (QaAuthoringForm) form; + logger.debug("qaAuthoringForm: " + qaAuthoringForm); + + IQaService qaService = (IQaService)request.getSession().getAttribute(TOOL_SERVICE); + logger.debug("qaService: " + qaService); + if (qaService == null) + { + logger.debug("will retrieve qaService"); + qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); + logger.debug("retrieving qaService from session: " + qaService); + } + + /* determine whether the request is from Monitoring url Edit Activity*/ + String sourceMcStarter = (String) request.getAttribute(SOURCE_MC_STARTER); + logger.debug("sourceMcStarter: " + sourceMcStarter); + + request.getSession().setAttribute(DEFINE_LATER_IN_EDIT_MODE, new Boolean(true)); + request.getSession().setAttribute(SHOW_AUTHORING_TABS,new Boolean(false).toString()); + + String toolContentId=qaAuthoringForm.getToolContentId(); + logger.debug("toolContentId: " + toolContentId); + QaUtils.setDefineLater(request, true, toolContentId); + + logger.debug("forwarding to : " + LOAD_QUESTIONS); + return mapping.findForward(LOAD_QUESTIONS); + } + + public ActionForward addNewQuestion(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { request.getSession().setAttribute(SUBMIT_SUCCESS, new Integer(0)); @@ -293,7 +305,7 @@ addFileToContentRepository(request, qaAuthoringForm); qaAuthoringForm.resetUserAction(); -// request.getSession().setAttribute(CHOICE,CHOICE_TYPE_INSTRUCTIONS); //FIXME: ?? + // request.getSession().setAttribute(CHOICE,CHOICE_TYPE_INSTRUCTIONS); return (mapping.findForward(LOAD_QUESTIONS)); } Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaAuthoringForm.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/Attic/QaAuthoringForm.java,v diff -u -r1.9 -r1.10 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaAuthoringForm.java 24 Feb 2006 15:05:59 -0000 1.9 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaAuthoringForm.java 5 Mar 2006 13:23:15 -0000 1.10 @@ -42,7 +42,7 @@ protected String submitOfflineFile; protected String submitOnlineFile; protected String dispatch; - + protected String choice; protected String choiceBasic; protected String choiceAdvanced; Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaStarterAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaStarterAction.java,v diff -u -r1.33 -r1.34 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaStarterAction.java 4 Mar 2006 19:39:16 -0000 1.33 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaStarterAction.java 5 Mar 2006 13:23:15 -0000 1.34 @@ -143,7 +143,6 @@ logger.debug("qaAuthoringForm: " + qaAuthoringForm); qaAuthoringForm.resetRadioBoxes(); - IQaService qaService = (IQaService)request.getSession().getAttribute(TOOL_SERVICE); logger.debug("qaService: " + qaService); if (qaService == null) @@ -156,29 +155,33 @@ String servletPath=request.getServletPath(); logger.debug("getServletPath: "+ servletPath); + String requestedModule=null; if (servletPath.indexOf("authoringStarter") > 0) { logger.debug("request is for authoring module"); request.getSession().setAttribute(ACTIVE_MODULE, AUTHORING); request.getSession().setAttribute(DEFINE_LATER_IN_EDIT_MODE, new Boolean(true)); request.getSession().setAttribute(SHOW_AUTHORING_TABS,new Boolean(true).toString()); + requestedModule=AUTHORING; } else { logger.debug("request is for define later module. either direct or by monitoring module"); request.getSession().setAttribute(ACTIVE_MODULE, DEFINE_LATER); request.getSession().setAttribute(DEFINE_LATER_IN_EDIT_MODE, new Boolean(false)); - request.getSession().setAttribute(SHOW_AUTHORING_TABS,new Boolean(false).toString()); + request.getSession().setAttribute(SHOW_AUTHORING_TABS,new Boolean(false).toString()); + requestedModule=DEFINE_LATER; } + logger.debug("requestedModule: " + requestedModule); /* in development this needs to be called only once. */ /* QaUtils.configureContentRepository(request); */ String sourceMcStarter = (String) request.getAttribute(SOURCE_MC_STARTER); logger.debug("sourceMcStarter: " + sourceMcStarter); - + /* * obtain and setup the current user's data * get session from shared session. */ @@ -279,7 +282,7 @@ } logger.debug("will return to jsp with: " + sourceMcStarter); - String destination=QaUtils.getDestination(sourceMcStarter); + String destination=QaUtils.getDestination(sourceMcStarter, requestedModule); logger.debug("destination: " + destination); return (mapping.findForward(destination)); } @@ -315,7 +318,6 @@ QaContent qaContent = qaService.retrieveQa(toolContentId); logger.debug("QaContent: " + qaContent); - QaUtils.setDefaultSessionAttributes(request, qaContent, qaAuthoringForm); QaUtils.populateUploadedFilesData(request, qaContent, qaService); request.getSession().setAttribute(IS_DEFINE_LATER, new Boolean(qaContent.isDefineLater())); Index: lams_tool_laqa/web/AuthoringMaincontent.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/web/Attic/AuthoringMaincontent.jsp,v diff -u -r1.2 -r1.3 --- lams_tool_laqa/web/AuthoringMaincontent.jsp 24 Feb 2006 15:05:59 -0000 1.2 +++ lams_tool_laqa/web/AuthoringMaincontent.jsp 5 Mar 2006 13:23:14 -0000 1.3 @@ -27,194 +27,7 @@ <%@ taglib uri="fck-editor" prefix="FCK" %> <%@ taglib uri="tags-lams" prefix="lams" %> - -<% -String protocol = request.getProtocol(); -if(protocol.startsWith("HTTPS")){ - protocol = "https://"; -}else{ - protocol = "http://"; -} -String root = protocol+request.getServerName()+":"+request.getServerPort()+request.getContextPath()+"/"; -String pathToLams = protocol+request.getServerName()+":"+request.getServerPort()+request.getContextPath()+"/../.."; - -%> - - - - - - -<bean:message key="label.authoring"/> - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
    
- - - - - - - - - -
-

- - - - - -
- - - -
- -
- -
- -
- Cancel - Save -
- - - - -
-

-
- -
-
- - - -
-

-
- -
-
-
- - - - -
- - - -
\ No newline at end of file + \ No newline at end of file Index: lams_tool_laqa/web/WEB-INF/struts-config.xml =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/web/WEB-INF/struts-config.xml,v diff -u -r1.15 -r1.16 --- lams_tool_laqa/web/WEB-INF/struts-config.xml 4 Mar 2006 19:39:17 -0000 1.15 +++ lams_tool_laqa/web/WEB-INF/struts-config.xml 5 Mar 2006 13:23:15 -0000 1.16 @@ -60,6 +60,12 @@ redirect="false" /> + + + + + + + + + +<%@ taglib uri="tags-bean" prefix="bean"%> +<%@ taglib uri="tags-html" prefix="html"%> +<%@ taglib uri="tags-logic" prefix="logic" %> +<%@ taglib uri="tags-core" prefix="c"%> +<%@ taglib uri="tags-fmt" prefix="fmt" %> +<%@ taglib uri="fck-editor" prefix="FCK" %> +<%@ taglib uri="tags-lams" prefix="lams" %> + + + + + + + +
+ +
    
+ + + +
+
    +
  • +
  • +
  • +
+
+ +
+ + + + + + +
+
+ +
+ +
+ Cancel + +
+ + +
+

+
+ +
+
+
+ + + + + + + +
+

+
+ +
+
+
+
+ + + + + + \ No newline at end of file Index: lams_tool_laqa/web/authoring/AuthoringTabsHolder.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/web/authoring/AuthoringTabsHolder.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_laqa/web/authoring/AuthoringTabsHolder.jsp 5 Mar 2006 13:23:14 -0000 1.1 @@ -0,0 +1,150 @@ +<%-- +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 +--%> + +<%@ taglib uri="tags-bean" prefix="bean"%> +<%@ taglib uri="tags-html" prefix="html"%> +<%@ taglib uri="tags-logic" prefix="logic" %> +<%@ taglib uri="tags-core" prefix="c"%> +<%@ taglib uri="tags-fmt" prefix="fmt" %> +<%@ taglib uri="fck-editor" prefix="FCK" %> +<%@ taglib uri="tags-lams" prefix="lams" %> + + + + +<% +String protocol = request.getProtocol(); +if(protocol.startsWith("HTTPS")){ + protocol = "https://"; +}else{ + protocol = "http://"; +} +String root = protocol+request.getServerName()+":"+request.getServerPort()+request.getContextPath()+"/"; +String pathToLams = protocol+request.getServerName()+":"+request.getServerPort()+request.getContextPath()+"/../.."; + +%> + + + + + + +<bean:message key="label.authoring"/> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + + +
+ +
\ No newline at end of file Index: lams_tool_laqa/web/authoring/BasicContent.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/web/authoring/BasicContent.jsp,v diff -u -r1.5 -r1.6 --- lams_tool_laqa/web/authoring/BasicContent.jsp 4 Mar 2006 05:42:42 -0000 1.5 +++ lams_tool_laqa/web/authoring/BasicContent.jsp 5 Mar 2006 13:23:14 -0000 1.6 @@ -28,22 +28,33 @@ <%@ taglib uri="tags-lams" prefix="lams" %> -
+
+

+ + + + +
+ + + +
+ - -
: + @@ -52,16 +63,16 @@
: + @@ -76,13 +87,13 @@ @@ -102,21 +113,20 @@ " style="visibility: hidden; display: none;">
.text">
"> @@ -133,7 +143,6 @@
@@ -148,8 +157,6 @@