Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McAppConstants.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McAppConstants.java,v diff -u -r1.76 -r1.77 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McAppConstants.java 3 Apr 2006 13:31:03 -0000 1.76 +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/McAppConstants.java 2 Jun 2006 08:01:30 -0000 1.77 @@ -127,6 +127,8 @@ public static final String MAP_CORRECT_FEEDBACK_LEARNER ="mapCorrectFeedbackLearner"; public static final String MAP_CORRECT_FEEDBACK ="mapCorrectFeedback"; public static final String MAP_FEEDBACK_CORRECT ="mapFeedbackCorrect"; + public static final String IS_PORTFOLIO_EXPORT ="isPortfolioExport"; + public static final String PORTFOLIO_EXPORT_MODE ="portfolioExportMode"; public static final String SELECTED_QUESTION ="selectedQuestion"; Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/ExportServlet.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/ExportServlet.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/ExportServlet.java 2 Jun 2006 08:01:31 -0000 1.1 @@ -0,0 +1,149 @@ +/**************************************************************** + * 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 + * **************************************************************** + */ + + +package org.lamsfoundation.lams.tool.mc.web; + +import javax.servlet.http.Cookie; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.commons.lang.StringUtils; +import org.apache.log4j.Logger; +import org.lamsfoundation.lams.tool.ToolAccessMode; +import org.lamsfoundation.lams.tool.mc.McAppConstants; +import org.lamsfoundation.lams.tool.mc.McApplicationException; +import org.lamsfoundation.lams.tool.mc.pojos.McContent; +import org.lamsfoundation.lams.tool.mc.pojos.McQueUsr; +import org.lamsfoundation.lams.tool.mc.pojos.McSession; +import org.lamsfoundation.lams.tool.mc.service.IMcService; +import org.lamsfoundation.lams.tool.mc.service.McServiceProxy; +import org.lamsfoundation.lams.web.servlet.AbstractExportPortfolioServlet; +/** + *

Enables exporting portfolio for teacher and learner modes.

+ * + * @author Ozgur Demirtas + */ + +public class ExportServlet extends AbstractExportPortfolioServlet implements McAppConstants{ + static Logger logger = Logger.getLogger(ExportServlet.class.getName()); + private static final long serialVersionUID = -4529093489007108143L; + private final String FILENAME = "mc_main.html"; + + + public String doExport(HttpServletRequest request, HttpServletResponse response, String directoryName, Cookie[] cookies) + { + logger.debug("dispathcing doExport"); + request.getSession().setAttribute(IS_PORTFOLIO_EXPORT, new Boolean(true).toString()); + String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath(); + + if (StringUtils.equals(mode,ToolAccessMode.LEARNER.toString())){ + learner(request,response,directoryName,cookies); + }else if (StringUtils.equals(mode,ToolAccessMode.TEACHER.toString())){ + teacher(request,response,directoryName,cookies); + } + + writeResponseToFile(basePath+"/export/exportportfolio.jsp",directoryName,FILENAME,cookies); + + return FILENAME; + } + + public void learner(HttpServletRequest request, HttpServletResponse response, String directoryName, Cookie[] cookies) + { + logger.debug("starting learner mode..."); + request.getSession().setAttribute(PORTFOLIO_EXPORT_MODE, "learner"); + + IMcService mcService = McServiceProxy.getMcService(getServletContext()); + + logger.debug("userID:" + userID); + logger.debug("toolSessionID:" + toolSessionID); + + if (userID == null || toolSessionID == null) + { + String error = "Tool session Id or user Id is null. Unable to continue"; + logger.error(error); + throw new McApplicationException(error); + } + + McSession mcSession=mcService.retrieveMcSession(toolSessionID); + + McQueUsr learner = mcService.getMcUserBySession(userID,mcSession.getUid()); + logger.debug("learner: " + learner); + + if (learner == null) + { + String error="The user with user id " + userID + " does not exist in this session or session may not exist."; + logger.error(error); + throw new McApplicationException(error); + } + + McContent content=mcSession.getMcContent(); + logger.debug("content: " + content); + logger.debug("content id: " + content.getMcContentId()); + + if (content == null) + { + String error="The content for this activity has not been defined yet."; + logger.error(error); + throw new McApplicationException(error); + } + + logger.debug("calling learning mode toolSessionID:" + toolSessionID + " userID: " + userID ); + McMonitoringAction mcMonitoringAction= new McMonitoringAction(); + //voteMonitoringAction.refreshSummaryData(request, content, voteService, true, true, toolSessionID.toString(), userID.toString() , true); + + logger.debug("ending learner mode: "); + } + + public void teacher(HttpServletRequest request, HttpServletResponse response, String directoryName, Cookie[] cookies) + { + logger.debug("starting teacher mode..."); + request.getSession().setAttribute(PORTFOLIO_EXPORT_MODE, "teacher"); + + IMcService mcService = McServiceProxy.getMcService(getServletContext()); + + if (toolContentID==null) + { + String error="Tool Content Id is missing. Unable to continue"; + logger.error(error); + throw new McApplicationException(error); + } + + McContent content=mcService.retrieveMc(toolContentID); + logger.debug("content: " + content); + + if (content == null) + { + String error="Data is missing from the database. Unable to Continue"; + logger.error(error); + throw new McApplicationException(error); + } + + McMonitoringAction mcMonitoringAction= new McMonitoringAction(); + logger.debug("starting refreshSummaryData."); + //voteMonitoringAction.refreshSummaryData(request, content, voteService, true, false, null, null, false); + + logger.debug("ending teacher mode: "); + } + +} Fisheye: Tag 1.4 refers to a dead (removed) revision in file `lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McExportServlet.java'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_lamc/web/authoring/AuthoringMaincontent.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/web/authoring/Attic/AuthoringMaincontent.jsp,v diff -u -r1.24 -r1.25 --- lams_tool_lamc/web/authoring/AuthoringMaincontent.jsp 24 May 2006 23:00:40 -0000 1.24 +++ lams_tool_lamc/web/authoring/AuthoringMaincontent.jsp 2 Jun 2006 08:01:31 -0000 1.25 @@ -157,8 +157,8 @@ - - + + Index: lams_tool_lamc/web/export/ExportContent.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/web/export/Attic/ExportContent.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_lamc/web/export/ExportContent.jsp 2 Jun 2006 08:01:31 -0000 1.1 @@ -0,0 +1,35 @@ +<%-- +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 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 +--%> + + +<%@ 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" %> + + + + + +Export Content goes here \ No newline at end of file Index: lams_tool_lamc/web/export/exportportfolio.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/web/export/exportportfolio.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_lamc/web/export/exportportfolio.jsp 2 Jun 2006 08:01:31 -0000 1.1 @@ -0,0 +1,65 @@ +<%-- +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 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 +--%> + +<%@ page language="java" pageEncoding="UTF-8" contentType="text/html;charset=utf-8" %> +<%@ 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" %> + + + + + + + + + + <bean:message key="label.exportPortfolio"/> + + + + + + + + + + + + + + + + + export portfolio content goes here + + + + + + Index: lams_tool_lamc/web/learning/AnswersContent.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/web/learning/AnswersContent.jsp,v diff -u -r1.11 -r1.12 --- lams_tool_lamc/web/learning/AnswersContent.jsp 24 May 2006 00:07:44 -0000 1.11 +++ lams_tool_lamc/web/learning/AnswersContent.jsp 2 Jun 2006 08:01:30 -0000 1.12 @@ -18,6 +18,7 @@ http://www.gnu.org/licenses/gpl.txt --%> +<%@ page language="java" pageEncoding="UTF-8" contentType="text/html;charset=utf-8" %> <%@ taglib uri="tags-bean" prefix="bean"%> <%@ taglib uri="tags-html" prefix="html"%> <%@ taglib uri="tags-logic" prefix="logic" %> @@ -31,11 +32,8 @@ -<%@ page language="java" pageEncoding="UTF-8" contentType="text/html;charset=utf-8" %> - - Index: lams_tool_lamc/web/learning/IndividualLearnerResults.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/web/learning/Attic/IndividualLearnerResults.jsp,v diff -u -r1.9 -r1.10 --- lams_tool_lamc/web/learning/IndividualLearnerResults.jsp 24 May 2006 00:07:44 -0000 1.9 +++ lams_tool_lamc/web/learning/IndividualLearnerResults.jsp 2 Jun 2006 08:01:30 -0000 1.10 @@ -18,6 +18,7 @@ http://www.gnu.org/licenses/gpl.txt --%> +<%@ page language="java" pageEncoding="UTF-8" contentType="text/html;charset=utf-8" %> <%@ taglib uri="tags-bean" prefix="bean"%> <%@ taglib uri="tags-html" prefix="html"%> <%@ taglib uri="tags-logic" prefix="logic" %> @@ -31,11 +32,8 @@ -<%@ page language="java" pageEncoding="UTF-8" contentType="text/html;charset=utf-8" %> - - Index: lams_tool_lamc/web/learning/Preview.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/web/learning/Attic/Preview.jsp,v diff -u -r1.7 -r1.8 --- lams_tool_lamc/web/learning/Preview.jsp 24 May 2006 00:07:44 -0000 1.7 +++ lams_tool_lamc/web/learning/Preview.jsp 2 Jun 2006 08:01:30 -0000 1.8 @@ -19,7 +19,7 @@ http://www.gnu.org/licenses/gpl.txt --%> - +<%@ page language="java" pageEncoding="UTF-8" contentType="text/html;charset=utf-8" %> <%@ taglib uri="tags-bean" prefix="bean"%> <%@ taglib uri="tags-html" prefix="html"%> <%@ taglib uri="tags-logic" prefix="logic" %> @@ -34,14 +34,11 @@ -<%@ page language="java" pageEncoding="UTF-8" contentType="text/html;charset=utf-8" %> - - <bean:message key="label.preview"/> - + + + + + + + + + + + + export portfolio content goes here + + + + + + Index: lams_tool_laqa/web/learning/AnswersContent.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/web/learning/AnswersContent.jsp,v diff -u -r1.5 -r1.6 --- lams_tool_laqa/web/learning/AnswersContent.jsp 24 May 2006 15:43:23 -0000 1.5 +++ lams_tool_laqa/web/learning/AnswersContent.jsp 2 Jun 2006 07:55:32 -0000 1.6 @@ -18,7 +18,7 @@ http://www.gnu.org/licenses/gpl.txt --%> - +<%@ page language="java" pageEncoding="UTF-8" contentType="text/html;charset=utf-8" %> <%@ taglib uri="tags-bean" prefix="bean"%> <%@ taglib uri="tags-html" prefix="html"%> <%@ taglib uri="tags-logic" prefix="logic" %> @@ -31,11 +31,8 @@ -<%@ page language="java" pageEncoding="UTF-8" contentType="text/html;charset=utf-8" %> - -