Index: lams_learning/src/java/org/lamsfoundation/lams/learning/web/action/LearnerAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_learning/src/java/org/lamsfoundation/lams/learning/web/action/LearnerAction.java,v diff -u -r1.36 -r1.37 --- lams_learning/src/java/org/lamsfoundation/lams/learning/web/action/LearnerAction.java 17 Sep 2006 06:17:57 -0000 1.36 +++ lams_learning/src/java/org/lamsfoundation/lams/learning/web/action/LearnerAction.java 29 Jan 2007 04:08:09 -0000 1.37 @@ -130,8 +130,8 @@ } /** - *

The structs dispatch action that joins a learner into a lesson. The - * learner could either start a lesson or resume a lesson.

+ *

The structs dispatch action that joins a learner into a lesson. This + * call is used for a user to start a lesson.

* * @param mapping An ActionMapping class that will be used by the Action class to tell * the ActionServlet where to send the end-user. @@ -171,13 +171,74 @@ if(log.isDebugEnabled()) log.debug("The learner ["+learner+"] joined lesson. The" + +"progress data is:"+learnerProgress.toString()); + + LearningWebUtil.putLearnerProgressInRequest(request,learnerProgress); + + String url = "learning/" + mapping.findForward(DISPLAY_ACTIVITY).getPath() + "?lessonID=" + lessonID; + + redirectToURL(mapping, response, url); + + } catch (Exception e ) { + // handle exception + if(log.isDebugEnabled()) + log.debug("An error occurred while attempting to join the lesson."); + return mapping.findForward(ActivityMapping.ERROR); + } + + return null; + } + + /** + *

The structs dispatch action that joins a learner into a lesson. This + * call is used for a user to resume a lesson.

+ * + * @param mapping An ActionMapping class that will be used by the Action class to tell + * the ActionServlet where to send the end-user. + * + * @param form The ActionForm class that will contain any data submitted + * by the end-user via a form. + * @param request A standard Servlet HttpServletRequest class. + * @param response A standard Servlet HttpServletResponse class. + * @return An ActionForward class that will be returned to the ActionServlet indicating where + * the user is to go next. + * + * @throws IOException + * @throws ServletException + */ + public ActionForward resumeLesson(ActionMapping mapping, + ActionForm form, + HttpServletRequest request, + HttpServletResponse response) throws IOException, + ServletException + { + //initialize service object + ICoreLearnerService learnerService = LearnerServiceProxy.getLearnerService(getServlet().getServletContext()); + + FlashMessage message = null; + try { + + //get user and lesson based on request. + Integer learner = LearningWebUtil.getUserId(); + long lessonID = WebUtil.readLongParam(request,AttributeNames.PARAM_LESSON_ID); + + + if(log.isDebugEnabled()) + log.debug("The learner ["+learner+"] is joining the lesson ["+lessonID+"]"); + + //join user to the lesson on the server + LearnerProgress learnerProgress = learnerService.joinLesson(learner,lessonID); + + if(log.isDebugEnabled()) + log.debug("The learner ["+learner+"] joined lesson. The" +"porgress data is:"+learnerProgress.toString()); LearningWebUtil.putLearnerProgressInRequest(request,learnerProgress); //serialize a acknowledgement flash message with the path of display next //activity - message = new FlashMessage("joinLesson", mapping.findForward(DISPLAY_ACTIVITY).getPath()); + + message = new FlashMessage("joinLesson", mapping.findForward(DISPLAY_ACTIVITY).getPath()); } catch (Exception e ) { message = handleException(e, "joinLesson", learnerService); @@ -191,9 +252,7 @@ response.getWriter().print(wddxPacket); return null; } - - /** *

Exit the current lesson that is running in the leaner window. It * expects lesson id passed as parameter from flash component. Index: lams_learning/web/controlFrame.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_learning/web/Attic/controlFrame.jsp,v diff -u -r1.20 -r1.21 --- lams_learning/web/controlFrame.jsp 9 Oct 2006 05:07:40 -0000 1.20 +++ lams_learning/web/controlFrame.jsp 29 Jan 2007 04:08:03 -0000 1.21 @@ -49,6 +49,8 @@ doAlert(args); }else if (command == "openPopUp"){ openPopUpFS(args); + }else if (command == "closeWindow"){ + closeWindow(args); } } @@ -89,6 +91,10 @@ openPopUp(url, title, h, w, resize, status, scrollbar, menubar, toolbar); } + + function closeWindow() { + top.window.close(); + } //--> Index: lams_learning/web/lams_learner.swf =================================================================== RCS file: /usr/local/cvsroot/lams_learning/web/Attic/lams_learner.swf,v diff -u -r1.61 -r1.62 Binary files differ Index: lams_learning/web/main.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_learning/web/main.jsp,v diff -u -r1.16 -r1.17 --- lams_learning/web/main.jsp 24 Nov 2006 02:00:24 -0000 1.16 +++ lams_learning/web/main.jsp 29 Jan 2007 04:08:03 -0000 1.17 @@ -51,7 +51,7 @@ &mode=" name="controlFrame" scrolling="NO"> - + " name="contentFrame" scrolling="YES"> Index: lams_learning/web/welcome.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_learning/web/welcome.jsp,v diff -u -r1.12 -r1.13 --- lams_learning/web/welcome.jsp 28 Sep 2006 23:29:23 -0000 1.12 +++ lams_learning/web/welcome.jsp 29 Jan 2007 04:08:03 -0000 1.13 @@ -19,13 +19,24 @@ http://www.gnu.org/licenses/gpl.txt --%> +<%@ taglib uri="tags-bean" prefix="bean"%> <%@ taglib uri="tags-fmt" prefix="fmt" %> +<%@ taglib uri="tags-core" prefix="c" %> -

- +
+ + + + + +