Index: lams_learning/src/java/org/lamsfoundation/lams/learning/web/action/LearnerAction.java =================================================================== diff -u -r08950e1090443c3423a3d1c587416a2fccd8bbdf -r07bdeb1ca1ca44acb357de2c547836db915a5976 --- lams_learning/src/java/org/lamsfoundation/lams/learning/web/action/LearnerAction.java (.../LearnerAction.java) (revision 08950e1090443c3423a3d1c587416a2fccd8bbdf) +++ lams_learning/src/java/org/lamsfoundation/lams/learning/web/action/LearnerAction.java (.../LearnerAction.java) (revision 07bdeb1ca1ca44acb357de2c547836db915a5976) @@ -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
===================================================================
diff -u -r111e662f28d6a65e079d57bbf2a76bb1d138508a -r07bdeb1ca1ca44acb357de2c547836db915a5976
--- lams_learning/web/controlFrame.jsp (.../controlFrame.jsp) (revision 111e662f28d6a65e079d57bbf2a76bb1d138508a)
+++ lams_learning/web/controlFrame.jsp (.../controlFrame.jsp) (revision 07bdeb1ca1ca44acb357de2c547836db915a5976)
@@ -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
===================================================================
diff -u -r552a798a5d0bb5837eebbc3571f0d9b79be735c8 -r07bdeb1ca1ca44acb357de2c547836db915a5976
Binary files differ
Index: lams_learning/web/main.jsp
===================================================================
diff -u -rdedcc950b33ba2d2074ccc1db51443b5ee56f1a3 -r07bdeb1ca1ca44acb357de2c547836db915a5976
--- lams_learning/web/main.jsp (.../main.jsp) (revision dedcc950b33ba2d2074ccc1db51443b5ee56f1a3)
+++ lams_learning/web/main.jsp (.../main.jsp) (revision 07bdeb1ca1ca44acb357de2c547836db915a5976)
@@ -51,7 +51,7 @@