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.38 -r1.39 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaAppConstants.java 5 Mar 2006 13:23:14 -0000 1.38 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaAppConstants.java 5 Mar 2006 19:09:03 -0000 1.39 @@ -55,9 +55,13 @@ public static final String ACTIVE_MODULE ="activeModule"; public static final String AUTHORING ="authoring"; + public static final String MONITORING ="monitoring"; public static final String DEFINE_LATER_IN_EDIT_MODE ="defineLaterInEditMode"; public static final String SHOW_AUTHORING_TABS ="showAuthoringTabs"; + public static final String MONITORING_ORIGINATED_DEFINELATER ="monitoringOriginatedDefineLater"; public static final String DEFINE_LATER ="defineLater"; + public static final String REQUESTED_MODULE ="requestedModule"; + public static final String SOURCE_MC_STARTER ="sourceMcStarter"; public static final String IS_MONITORED_CONTENT_IN_USE ="isMonitoredContentInUse"; 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.27 -r1.28 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaUtils.java 5 Mar 2006 13:23:14 -0000 1.27 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaUtils.java 5 Mar 2006 19:09:03 -0000 1.28 @@ -430,15 +430,14 @@ } /** - * the only attribute kept is TOOL_SESSION + * the only attributes kept are TOOL_SESSION and TOOL_CONTENT_ID * cleanUpSessionAbsolute(HttpServletRequest request) * @param request */ public static void cleanUpSessionAbsolute(HttpServletRequest request) { request.getSession().removeAttribute(MY_SIGNATURE); request.getSession().removeAttribute(ERROR_MCAPPLICATION); - request.getSession().removeAttribute(TOOL_CONTENT_ID); request.getSession().removeAttribute(TARGET_MODE); request.getSession().removeAttribute(TARGET_MODE_AUTHORING); request.getSession().removeAttribute(TARGET_MODE_LEARNING); @@ -567,6 +566,7 @@ request.getSession().removeAttribute(SOURCE_MC_STARTER); request.getSession().removeAttribute(IS_MONITORED_CONTENT_IN_USE); request.getSession().removeAttribute(LOAD_MONITORING_CONTENT_EDITACTIVITY); + request.getSession().removeAttribute(MONITORING_ORIGINATED_DEFINELATER); } @@ -597,12 +597,11 @@ logger.debug("request is from define Later url. return to: " + LOAD_VIEW_ONLY); return LOAD_VIEW_ONLY; } - if (requestedModule.equals(AUTHORING)) + else if (requestedModule.equals(AUTHORING)) { logger.debug("request is from authoring url. return to: " + LOAD_QUESTIONS); return LOAD_QUESTIONS; } - else { logger.debug("request is from an unknown source. return null"); 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.27 -r1.28 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QAction.java 5 Mar 2006 13:23:15 -0000 1.27 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QAction.java 5 Mar 2006 19:09:03 -0000 1.28 @@ -234,8 +234,41 @@ qaAuthoringForm.resetUserAction(); return mapping.findForward(LOAD_QUESTIONS); } + + public ActionForward getSummary(ActionMapping mapping, + ActionForm form, + HttpServletRequest request, + HttpServletResponse response) throws IOException, + ServletException + { + logger.debug("dispatching proxy getSummary...start with monitoringStarter" + request); + return null; + } + + public ActionForward getInstructions(ActionMapping mapping, + ActionForm form, + HttpServletRequest request, + HttpServletResponse response) throws IOException, + ServletException + { + logger.debug("dispatching proxy getInstructions..." + request); + return null; + + } + + public ActionForward getStats(ActionMapping mapping, + ActionForm form, + HttpServletRequest request, + HttpServletResponse response) throws IOException, + ServletException + { + logger.debug("dispatching proxy getStats..." + request); + return null; + } + + public ActionForward editActivityQuestions(ActionMapping mapping, ActionForm form, HttpServletRequest request, 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.10 -r1.11 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaAuthoringForm.java 5 Mar 2006 13:23:15 -0000 1.10 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaAuthoringForm.java 5 Mar 2006 19:09:03 -0000 1.11 @@ -22,17 +22,16 @@ package org.lamsfoundation.lams.tool.qa.web; /* ActionForm for the Authoring environment*/ -import org.apache.struts.action.ActionForm; -import org.lamsfoundation.lams.tool.qa.QaAppConstants; import org.apache.struts.upload.FormFile; +import org.lamsfoundation.lams.tool.qa.QaAppConstants; /** * @author Ozgur Demirtas * * TODO To change the template for this generated type comment go to * Window - Preferences - Java - Code Style - Code Templates */ -public class QaAuthoringForm extends ActionForm implements QaAppConstants { +public class QaAuthoringForm extends QaLearningForm implements QaAppConstants { /* form controllers */ protected String addContent; protected String removeContent; Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringAction.java,v diff -u -r1.16 -r1.17 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringAction.java 4 Mar 2006 19:39:16 -0000 1.16 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringAction.java 5 Mar 2006 19:09:03 -0000 1.17 @@ -46,6 +46,7 @@ import org.lamsfoundation.lams.tool.qa.QaUsrResp; import org.lamsfoundation.lams.tool.qa.QaUtils; import org.lamsfoundation.lams.tool.qa.service.IQaService; +import org.lamsfoundation.lams.tool.qa.service.QaServiceProxy; import org.lamsfoundation.lams.web.action.LamsDispatchAction; import org.lamsfoundation.lams.web.util.AttributeNames; @@ -132,9 +133,16 @@ { logger.debug("dispatching editActivity..."); QaMonitoringForm qaMonitoringForm = (QaMonitoringForm) form; + IQaService qaService = (IQaService)request.getSession().getAttribute(TOOL_SERVICE); - logger.debug("qaService: " + qaService); - + logger.debug("qaService: " + qaService); + if (qaService == null) + { + logger.debug("will retrieve qaService"); + qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); + logger.debug("retrieving qaService from session: " + qaService); + } + request.getSession().setAttribute(TOOL_SERVICE, qaService); request.getSession().setAttribute(CURRENT_MONITORING_TAB, "editActivity"); QaStarterAction qaStarterAction= new QaStarterAction(); Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringForm.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/Attic/QaMonitoringForm.java,v diff -u -r1.10 -r1.11 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringForm.java 3 Mar 2006 16:51:29 -0000 1.10 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringForm.java 5 Mar 2006 19:09:03 -0000 1.11 @@ -22,7 +22,7 @@ package org.lamsfoundation.lams.tool.qa.web; /* ActionForm for the Monitoring environment */ -import org.apache.struts.action.ActionForm; + import org.lamsfoundation.lams.tool.qa.QaAppConstants; /** @@ -31,7 +31,7 @@ * TODO To change the template for this generated type comment go to * Window - Preferences - Java - Code Style - Code Templates */ -public class QaMonitoringForm extends ActionForm implements QaAppConstants { +public class QaMonitoringForm extends QaAuthoringForm implements QaAppConstants { // controls which method is called by the Lookup map */ protected String method; 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.34 -r1.35 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaStarterAction.java 5 Mar 2006 13:23:15 -0000 1.34 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaStarterAction.java 5 Mar 2006 19:09:03 -0000 1.35 @@ -31,8 +31,7 @@ /** * Tool path The URL path for the tool should be /tool/$TOOL_SIG. * - * CONTENT_LOCKED refers to content being in use or not: Any students answered that content? - * For future CONTENT_LOCKED ->CONTENT_IN_USE + * CONTENT_LOCKED ->CONTENT_IN_USE * * QaStarterAction loads the default content and initializes the presentation Map * Requests can come either from authoring envuironment or from the monitoring environment for Edit Activity screen @@ -166,13 +165,20 @@ } else { - logger.debug("request is for define later module. either direct or by monitoring module"); + logger.debug("request is for define later module either direcly from define later url or monitoring url"); 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()); requestedModule=DEFINE_LATER; + + if (servletPath.indexOf("monitoring") > 0) + { + logger.debug("request is from monitoring url."); + request.getSession().setAttribute(MONITORING_ORIGINATED_DEFINELATER,new Boolean(true).toString()); + } } logger.debug("requestedModule: " + requestedModule); + request.getSession().setAttribute(REQUESTED_MODULE,requestedModule); /* in development this needs to be called only once. */ @@ -214,17 +220,55 @@ /* * find out whether the request is coming from monitoring module for EditActivity tab or from authoring environment url */ + //String strToolContentId=""; + //Long contentID =new Long(WebUtil.readLongParam(request,AttributeNames.PARAM_TOOL_CONTENT_ID)); + + + logger.debug("no problems getting the default content, will render authoring screen"); String strToolContentId=""; - Long contentID =new Long(WebUtil.readLongParam(request,AttributeNames.PARAM_TOOL_CONTENT_ID)); - + /*the authoring url must be passed a tool content id*/ + strToolContentId=request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); + logger.debug("strToolContentId: " + strToolContentId); + + if (strToolContentId == null) + { + /*it is possible that the original request for authoring module is coming from monitoring url which keeps the + TOOL_CONTENT_ID in the session*/ + Long toolContentId =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); + logger.debug("toolContentId: " + toolContentId); + if (toolContentId != null) + { + strToolContentId= toolContentId.toString(); + logger.debug("cached strToolContentId from the session: " + strToolContentId); + } + else + { + logger.debug("we should IDEALLY not arrive here. The TOOL_CONTENT_ID is NOT available from the url or the session."); + /*use default content instead of giving a warning*/ + String defaultContentId=(String) request.getSession().getAttribute(DEFAULT_CONTENT_ID_STR); + logger.debug("using MCQ defaultContentId: " + defaultContentId); + strToolContentId=defaultContentId; + } + } + logger.debug("final strToolContentId: " + strToolContentId); + + if ((strToolContentId == null) || (strToolContentId.equals(""))) + { + persistError(request,"error.contentId.required"); + QaUtils.cleanUpSessionAbsolute(request); + logger.debug("forwarding to: " + ERROR_LIST); + return (mapping.findForward(ERROR_LIST)); + } + + /* API test code for copying the content*/ String copyToolContent= (String) request.getParameter(COPY_TOOL_CONTENT); logger.debug("copyToolContent: " + copyToolContent); if ((copyToolContent != null) && (copyToolContent.equals("1"))) { logger.debug("user request to copy the content"); - Long fromContentId=contentID; + Long fromContentId=new Long(strToolContentId); logger.debug("fromContentId: " + fromContentId); Long toContentId=new Long(9876); @@ -240,7 +284,7 @@ } } - qaAuthoringForm.setToolContentId(contentID.toString()); + qaAuthoringForm.setToolContentId(strToolContentId); /* * find out if the passed tool content id exists in the db @@ -270,15 +314,15 @@ */ - if (!existsContent(contentID.longValue(), qaService)) + if (!existsContent(new Long(strToolContentId).longValue(), qaService)) { String defaultContentIdStr=(String) request.getSession().getAttribute(DEFAULT_CONTENT_ID_STR); logger.debug("defaultContentIdStr:" + defaultContentIdStr); retrieveContent(request, mapping, qaAuthoringForm, mapQuestionContent, new Long(defaultContentIdStr).longValue()); } else { - retrieveContent(request, mapping, qaAuthoringForm, mapQuestionContent, contentID.longValue()); + retrieveContent(request, mapping, qaAuthoringForm, mapQuestionContent, new Long(strToolContentId).longValue()); } logger.debug("will return to jsp with: " + sourceMcStarter); 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.16 -r1.17 --- lams_tool_laqa/web/WEB-INF/struts-config.xml 5 Mar 2006 13:23:15 -0000 1.16 +++ lams_tool_laqa/web/WEB-INF/struts-config.xml 5 Mar 2006 19:09:03 -0000 1.17 @@ -67,6 +67,12 @@ /> + + + + + + + +
+ + +      + +
+
+ + + + +
+ - +
+ +
+ + + + + +
+ +
+
\ No newline at end of file Index: lams_tool_laqa/web/authoring/BasicContentViewOnly.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/web/authoring/Attic/BasicContentViewOnly.jsp,v diff -u -r1.1 -r1.2 --- lams_tool_laqa/web/authoring/BasicContentViewOnly.jsp 5 Mar 2006 13:23:14 -0000 1.1 +++ lams_tool_laqa/web/authoring/BasicContentViewOnly.jsp 5 Mar 2006 19:09:03 -0000 1.2 @@ -27,7 +27,7 @@ <%@ taglib uri="fck-editor" prefix="FCK" %> <%@ taglib uri="tags-lams" prefix="lams" %> - +
Index: lams_tool_laqa/web/monitoring/MonitoringMaincontent.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/web/monitoring/MonitoringMaincontent.jsp,v diff -u -r1.4 -r1.5 --- lams_tool_laqa/web/monitoring/MonitoringMaincontent.jsp 3 Mar 2006 16:51:29 -0000 1.4 +++ lams_tool_laqa/web/monitoring/MonitoringMaincontent.jsp 5 Mar 2006 19:09:37 -0000 1.5 @@ -119,6 +119,7 @@ +
@@ -188,6 +189,8 @@
+ + Index: lams_tool_laqa/web/monitoring/MonitoringTabsHeader.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/web/monitoring/Attic/MonitoringTabsHeader.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_laqa/web/monitoring/MonitoringTabsHeader.jsp 5 Mar 2006 19:09:37 -0000 1.1 @@ -0,0 +1,104 @@ +<%-- +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" %> + + + + + + + + + + + + + + + + + + + + + + + +
  
+ + + + + + +
images/aqua_tab_s_left.gif" name="tab_left_su" width="8" height="25" border="0" id="tab_left_su"/> + images/aqua_tab_s_right.gif" name="tab_right_su" width="8" height="25" border="0" id="tab_right_su"/>
+
+ + + + + + +
images/aqua_tab_s_left.gif" name="tab_left_i" width="8" height="25" border="0" id="tab_left_i"/> + images/aqua_tab_s_right.gif" name="tab_right_i" width="8" height="25" border="0" id="tab_right_i"/>
+
+ + + + + + +
images/aqua_tab_s_left.gif" name="tab_left_e" width="8" height="25" border="0" id="tab_left_e"/> + images/aqua_tab_s_right.gif" name="tab_right_e" width="8" height="25" border="0" id="tab_right_e"/>
+
+ + + + + + +
images/aqua_tab_s_left.gif" name="tab_left_s" width="8" height="25" border="0" id="tab_left_s"/> + images/aqua_tab_s_right.gif" name="tab_right_s" width="8" height="25" border="0" id="tab_right_s"/>
+
+ + + +