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.11 -r1.12
--- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaAppConstants.java 11 Jul 2005 06:34:21 -0000 1.11
+++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaAppConstants.java 13 Jul 2005 03:12:28 -0000 1.12
@@ -35,6 +35,7 @@
public static final String TARGET_MODE_AUTHORING ="Authoring";
public static final String TARGET_MODE_LEARNING ="Learning";
public static final String TARGET_MODE_MONITORING ="Monitoring";
+ public static final String TARGET_MODE_EXPORT_PORTFOLIO ="ExportPortfolio";
public static final String AUTHORING_STARTER ="starter";
public static final String LEARNING_STARTER ="learningStarter";
@@ -140,8 +141,16 @@
public static final String USER_EXCEPTION_MONITORINGTAB_CONTENTID_REQUIRED ="userExceptionMonitoringTabContentIdRequired";
public static final String USER_EXCEPTION_DEAFULTCONTENT_NOTSETUP ="userExceptionDefaultContentNotSetup";
-
/**
+ * export portfolio constants
+ */
+ public static final String MODE ="mode";
+ public static final String LEARNER ="learner";
+ public static final String TEACHER ="teacher";
+ public static final String USER_EXCEPTION_MODE_REQUIRED ="userExceptionModeRequired";
+ public static final String PORTFOLIO_REPORT ="portfolioReport";
+
+ /**
* user actions
*/
public static final String ADD_NEW_QUESTION ="addNewQuestion";
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.6 -r1.7
--- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaResources.properties 11 Jul 2005 05:35:29 -0000 1.6
+++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaResources.properties 13 Jul 2005 03:12:28 -0000 1.7
@@ -59,10 +59,12 @@
error.defineLater =Sorry, this activity's content is not ready yet.
Please wait for your teacher to make the content ready.
error.toolSessionId.required =Tool Activity Error! Can't continue
URL is not complete. The Tool Activity requires a toolSession id.
error.contentId.required =Tool Activity Error! Can't continue
URL is not complete. The Tool Activity requires a content id.
-error.authoringUser.notAvailable =Tool Activity Error! Can't continue. Tool Activity expects a user id.
The expected format is either : TOOLURL?userId=A&toolContentId=B or TOOLURL?userId=A
+error.authoringUser.notAvailable =Tool Activity Error! Can't continue. Tool Activity expects a user id.
+error.userId.required =Tool Activity Error! Can't continue
URL is not complete. The Tool Activity requires a user id.
error.userId.notNumeric =Tool Activity Error! Can't continue. The user id passed to the Tool Activity must be numerical.
error.userId.existing =Tool Activity Error! Can't continue. The user id passed to the Tool Activity refers to a student that has already used the activity.
Each learner activity should be associated with a unique userId.
error.defaultContent.notSetup =Tool Activity Error! Can't continue. The default content for the tool has not been setup properly.
+error.mode.required =Tool Activity Error! Can't continue
URL is not complete. The Tool Activity requires a mode.
#Monitoring mode resources
button.startLesson =Start Lesson
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.9 -r1.10
--- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaUtils.java 11 Jul 2005 02:08:04 -0000 1.9
+++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaUtils.java 13 Jul 2005 03:12:28 -0000 1.10
@@ -277,6 +277,11 @@
return user;
}
+ public static User createStandardUser(Integer userId)
+ {
+ return createAuthoringUser(userId);
+ }
+
public static User createUser(Integer userId)
{
User user=new User();
Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaExportPortfolioForm.java
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/Attic/QaExportPortfolioForm.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaExportPortfolioForm.java 13 Jul 2005 03:12:28 -0000 1.1
@@ -0,0 +1,25 @@
+/*
+ * ozgurd
+ * Created on 26/04/2005
+ *
+ * TODO To change the template for this generated file go to
+ * Window - Preferences - Java - Code Style - Code Templates
+ */
+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;
+
+/**
+ * @author Ozgur Demirtas
+ *
+ * TODO To change the template for this generated type comment go to
+ * Window - Preferences - Java - Code Style - Code Templates
+ */
+public class QaExportPortfolioForm extends ActionForm implements QaAppConstants
+{
+
+}
Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaExportPortfolioStarterAction.java
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/Attic/QaExportPortfolioStarterAction.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaExportPortfolioStarterAction.java 13 Jul 2005 03:12:28 -0000 1.1
@@ -0,0 +1,206 @@
+/*
+ * Created on 8/03/2005
+ *
+ * TODO To change the template for this generated file go to
+ * Window - Preferences - Java - Code Style - Code Templates
+ */
+
+/**
+ * @author Ozgur Demirtas
+ *
+ * /&mode=learner&toolSessionId=231&userId=
+*/
+
+
+package org.lamsfoundation.lams.tool.qa.web;
+import java.io.IOException;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.log4j.Logger;
+import org.apache.struts.Globals;
+import org.apache.struts.action.Action;
+import org.apache.struts.action.ActionForm;
+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.lamsfoundation.lams.tool.exception.ToolException;
+import org.lamsfoundation.lams.tool.qa.QaAppConstants;
+import org.lamsfoundation.lams.tool.qa.QaApplicationException;
+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.usermanagement.User;
+
+public class QaExportPortfolioStarterAction extends Action implements QaAppConstants {
+ static Logger logger = Logger.getLogger(QaExportPortfolioStarterAction.class.getName());
+
+ public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
+ throws IOException, ServletException, QaApplicationException, ToolException
+ {
+ /**
+ * retrive the service
+ */
+ IQaService qaService=null;
+ qaService = QaServiceProxy.getQaService(getServlet().getServletContext());
+ logger.debug("retrieved qaService : " + qaService);
+ request.getSession().setAttribute(TOOL_SERVICE, qaService);
+
+
+ /**
+ * persist time zone information to session scope.
+ */
+ QaUtils.persistTimeZone(request);
+
+ /**
+ * mark the http session as an authoring activity
+ */
+ request.getSession().setAttribute(TARGET_MODE,TARGET_MODE_EXPORT_PORTFOLIO);
+
+ /**
+ * obtain and setup the current user's data
+ */
+
+ String userId="";
+ userId=request.getParameter(USER_ID);
+ logger.debug("userId: " + userId);
+ try
+ {
+ User user=QaUtils.createStandardUser(new Integer(userId));
+ request.getSession().setAttribute(TOOL_USER, user);
+ }
+ catch(NumberFormatException e)
+ {
+ persistError(request,"error.userId.notNumeric");
+ request.setAttribute(USER_EXCEPTION_USERID_NOTNUMERIC, new Boolean(true));
+ logger.debug("forwarding to: " + PORTFOLIO_REPORT);
+ return (mapping.findForward(PORTFOLIO_REPORT));
+ }
+
+
+ if ((userId == null) || (userId.length()==0))
+ {
+ logger.debug("error: The tool expects userId");
+ persistError(request,"error.userId.required");
+ request.setAttribute(USER_EXCEPTION_USERID_NOTAVAILABLE, new Boolean(true));
+ logger.debug("forwarding to: " + PORTFOLIO_REPORT);
+ return (mapping.findForward(PORTFOLIO_REPORT));
+ }
+ logger.debug("TOOL_USER is:" + request.getSession().getAttribute(TOOL_USER));
+
+
+ String mode="";
+ mode=request.getParameter(MODE);
+ logger.debug("mode: " + mode);
+ boolean useToolSessionId=false;
+ if ((mode != null) && mode.equalsIgnoreCase(LEARNER))
+ {
+ logger.debug("mode is:" + mode + " use toolSessionId");
+ useToolSessionId=true;
+ }
+ else if ((mode != null) && mode.equalsIgnoreCase(TEACHER))
+ {
+ logger.debug("mode is:" + mode + " use toolContentId");
+ useToolSessionId=false;
+ }
+ else
+ {
+ logger.debug("Warning mode is: unknown");
+ persistError(request,"error.mode.required");
+ request.setAttribute(USER_EXCEPTION_MODE_REQUIRED, new Boolean(true));
+ logger.debug("forwarding to: " + PORTFOLIO_REPORT);
+ return (mapping.findForward(PORTFOLIO_REPORT));
+ }
+
+ String strToolSessionId="";
+ Long toolSessionId=null;
+ if (useToolSessionId == true)
+ {
+ logger.debug("reading TOOL_SESSION_ID");
+ strToolSessionId=request.getParameter(TOOL_SESSION_ID);
+ logger.debug("toolSessionId :" + strToolSessionId);
+
+ try
+ {
+ if ((strToolSessionId != null) && (strToolSessionId.length() > 0))
+ {
+ toolSessionId=new Long(strToolSessionId);
+ request.getSession().setAttribute(TOOL_SESSION_ID, toolSessionId);
+ }
+ else
+ {
+ persistError(request,"error.toolSessionId.required");
+ request.setAttribute(USER_EXCEPTION_TOOLSESSIONID_REQUIRED, new Boolean(true));
+ logger.debug("forwarding to: " + PORTFOLIO_REPORT);
+ return (mapping.findForward(PORTFOLIO_REPORT));
+ }
+ }
+ catch(NumberFormatException e)
+ {
+ persistError(request,"error.sessionId.numberFormatException");
+ request.setAttribute(USER_EXCEPTION_NUMBERFORMAT, new Boolean(true));
+ logger.debug("forwarding to: " + PORTFOLIO_REPORT);
+ return (mapping.findForward(PORTFOLIO_REPORT));
+ }
+ logger.debug("final toolSessionId :" + toolSessionId);
+ }
+
+ String strToolContentId="";
+ Long toolContentId=null;
+
+ if (useToolSessionId == false)
+ {
+ logger.debug("reading TOOL_CONTENT_ID");
+ strToolContentId=request.getParameter(TOOL_CONTENT_ID);
+ logger.debug("TOOL_CONTENT_ID: " + strToolContentId);
+
+ try
+ {
+ if ((strToolContentId != null) && (strToolContentId.length() > 0))
+ {
+ if (!QaUtils.existsContent(new Long(strToolContentId).longValue(), request))
+ {
+ persistError(request,"error.content.doesNotExist");
+ request.setAttribute(USER_EXCEPTION_CONTENT_DOESNOTEXIST, new Boolean(true));
+ logger.debug("forwarding to: " + PORTFOLIO_REPORT);
+ return (mapping.findForward(PORTFOLIO_REPORT));
+ }
+ request.getSession().setAttribute(TOOL_CONTENT_ID, new Long(strToolContentId));
+ }
+ else
+ {
+ persistError(request,"error.contentId.required");
+ request.setAttribute(USER_EXCEPTION_CONTENTID_REQUIRED, new Boolean(true));
+ logger.debug("forwarding to: " + PORTFOLIO_REPORT);
+ return (mapping.findForward(PORTFOLIO_REPORT));
+ }
+ }
+ catch(NumberFormatException e)
+ {
+ persistError(request,"error.contentId.numberFormatException");
+ request.setAttribute(USER_EXCEPTION_NUMBERFORMAT, new Boolean(true));
+ logger.debug("forwarding to: " + PORTFOLIO_REPORT);
+ return (mapping.findForward(PORTFOLIO_REPORT));
+ }
+ }
+
+ return (mapping.findForward(PORTFOLIO_REPORT));
+ }
+
+
+ /**
+ * persists error messages to request scope
+ * @param request
+ * @param message
+ */
+ public void persistError(HttpServletRequest request, String message)
+ {
+ ActionMessages errors= new ActionMessages();
+ errors.add(Globals.ERROR_KEY, new ActionMessage(message));
+ logger.debug("add " + message +" to ActionMessages:");
+ saveErrors(request,errors);
+ }
+}
Index: lams_tool_laqa/web/exportPortfolioIndex.jsp
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_laqa/web/Attic/exportPortfolioIndex.jsp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_tool_laqa/web/exportPortfolioIndex.jsp 13 Jul 2005 03:12:28 -0000 1.1
@@ -0,0 +1,6 @@
+<%@ taglib uri="/WEB-INF/struts-html-el.tld" prefix="html" %>
+<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
+<%@ taglib uri="/WEB-INF/struts-logic-el.tld" prefix="logic-el" %>
+<%@ taglib uri="/WEB-INF/c.tld" prefix="c" %>
+<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %>
+
Index: lams_tool_laqa/web/portfolioReport.jsp
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_laqa/web/Attic/portfolioReport.jsp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_tool_laqa/web/portfolioReport.jsp 13 Jul 2005 03:12:28 -0000 1.1
@@ -0,0 +1,35 @@
+<%@ taglib uri="/WEB-INF/struts-html-el.tld" prefix="html" %>
+<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
+<%@ taglib uri="/WEB-INF/struts-logic-el.tld" prefix="logic-el" %>
+<%@ taglib uri="/WEB-INF/c.tld" prefix="c" %>
+<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %>
+
+
+
+
+
+
+
+ main portfoloio report
+
+
+
+
+
\ 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.3 -r1.4
--- lams_tool_laqa/web/WEB-INF/struts-config.xml 6 Jul 2005 04:53:07 -0000 1.3
+++ lams_tool_laqa/web/WEB-INF/struts-config.xml 13 Jul 2005 03:12:28 -0000 1.4
@@ -189,6 +189,23 @@
+
+
+
+
+
+
+
Index: lams_tool_laqa/web/WEB-INF/tiles/tiles-defs.xml
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_laqa/web/WEB-INF/tiles/Attic/tiles-defs.xml,v
diff -u -r1.1 -r1.2
--- lams_tool_laqa/web/WEB-INF/tiles/tiles-defs.xml 21 Jun 2005 05:43:22 -0000 1.1
+++ lams_tool_laqa/web/WEB-INF/tiles/tiles-defs.xml 13 Jul 2005 03:12:28 -0000 1.2
@@ -86,6 +86,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+