Index: lams_learning/conf/language/ApplicationResources.properties
===================================================================
RCS file: /usr/local/cvsroot/lams_learning/conf/language/Attic/ApplicationResources.properties,v
diff -u -r1.6 -r1.7
--- lams_learning/conf/language/ApplicationResources.properties 11 Jun 2006 02:48:35 -0000 1.6
+++ lams_learning/conf/language/ApplicationResources.properties 14 Jun 2006 23:13:31 -0000 1.7
@@ -11,15 +11,24 @@
exit.heading=You have exited from this Lesson.
# Message for the "You have exited" screen
exit.message=You can resume this lesson using the Resume button.
+# Text for all "Next" buttons in learning.
+label.next.button=Next
+# Text for all "Finish" buttons in learning.
+label.finish.button=Finish
+# Message displayed in a parallel activity window when one activity is finished but the other one isn't finished.
message.activity.parallel.partialComplete=You have to complete the other task before progressing to the next activity....
+# Message displayed in a parallel activity window if the user's browser can't support frames.
message.activity.parallel.noFrames=Your browser does not handle frames!
+
+# Message displayed in the optional activity window if the user tries to click Choose without selecting an activity from the list.
message.activity.options.noActivitySelected=Please select an activity from the list
+# Message displayed in the optional activity window to let the learner know how many activities they need to complete to finish the optional activity
message.activity.options.activityCount=You must complete at least {0} of these {1} activities.
+# General instructions displayed in the optional activity window
message.activity.options.note=Note: Once you finish any of the above activities you can revisit them by using the progress bar on the left.
-
+# Optional activity window Choose button
label.activity.options.choose=Choose
-label.activity.finish=Finish
label.synch.gate.title=Synch Gate
label.synch.gate.message=You have stopped at a gate. You cannot continue until all of your group/class reach this point.
label.permission.gate.title=Permission Gate
@@ -28,14 +37,21 @@
label.schedule.gate.open.message=Schedule Gate will be opened at:
label.schedule.gate.close.message=Schedule Gate will be closed at:
label.gate.waiting.learners={0} out of {1} are waiting in front of the gate.
-label.gate.refresh.message=Click Next if you are told that the gate is open. This page will refresh automatically in 1 minute.
-label.gate.next.button=Next
+label.gate.refresh.message=Click Next if you are told that the gate is open. This page will refresh automatically in 1 minute.
+# Message displayed when a closed gate is encountered during a preview.
+label.gate.preview.message=As this is a preview, clicking Next will go to the next activity. Normally the learner would have to wait until the gate is opened.
# Heading for the two "grouping" pages
label.view.groups.title=Groups
# Message displayed to learner who is waiting for chosen grouping to occur
-message.view.groups.wait=Some of your following tasks require a group. You cannot continue until the groups have been selected. Click Next if you are told that the groups have been created. This page will refresh automatically in 5 minutes.
+label.view.view.groups.wait.message=Some of your following tasks require a group. You cannot continue until the groups have been selected. Click Next if you are told that the groups have been created. This page will refresh automatically in 5 minutes.
+# Message displayed when a chosen grouping is encountered during a preview.
+label.grouping.preview.message=As this is a preview, clicking Next will do an automatic grouping. Normally the learner would have to wait until the grouping is done.
+# Heading for page used in Preview when an activity is set to define later.
+label.preview.definelater.title=Activity is set to Define Later
+label.preview.definelater.message=The next activity ({0}) is set to define later. Normally a staff member would set the content for the activity before the learner's can access the activity. For the purposes of preview, the default content for the activity will be displayed.
+
# Export Portfolio internal system error
error.system.exportPortfolio=An internal error has occurred with the Export Portfolio Functionality. If reporting this error, please report:
{0}
# Export Portfolio system error in the learner module
Index: lams_learning/conf/xdoclet/struts-forms.xml
===================================================================
RCS file: /usr/local/cvsroot/lams_learning/conf/xdoclet/struts-forms.xml,v
diff -u -r1.5 -r1.6
--- lams_learning/conf/xdoclet/struts-forms.xml 17 May 2006 07:25:02 -0000 1.5
+++ lams_learning/conf/xdoclet/struts-forms.xml 14 Jun 2006 23:13:32 -0000 1.6
@@ -1,4 +1,5 @@
Learner will progress to the next activity if the gate is open. Otherwise, * the learner should see the waiting page.
* + *Has a special override key - if the parameter force is set and the + * lesson is a preview lesson, then the gate will be opened straight away. This + * allows the author to see gate shut initially but override it and open it + * rather than being held up by the gate.
+ * * @author Jacky Fang * @since 2005-4-7 * @version 1.1 @@ -91,6 +97,9 @@ private static final String VIEW_SCHEDULE_GATE = "scheduleGate"; private static final String VIEW_SYNCH_GATE = "synchGate"; + /** Input parameter. Boolean value */ + public static final String PARAM_FORCE_GATE_OPEN = "force"; + //--------------------------------------------------------------------- // Struts Dispatch Method //--------------------------------------------------------------------- @@ -115,13 +124,15 @@ //validate pre-condition. validateLearnerProgress(learnerProgress); + boolean forceGate = WebUtil.readBooleanParam(request,PARAM_FORCE_GATE_OPEN,false); + //initialize service object ILearnerService learnerService = LearnerServiceProxy.getLearnerService(getServlet().getServletContext()); Integer totalNumActiveLearners = learnerService.getCountActiveLearnersByLesson(learnerProgress.getLesson().getLessonId()); //knock the gate boolean gateOpen = learnerService.knockGate(learnerProgress.getLesson().getLessonId(), learnerProgress.getNextActivity().getActivityId(), - learnerProgress.getUser()); + learnerProgress.getUser(),forceGate); // if the gate is open, let the learner go to the next activity ( updating the cached learner progress on the way ) // pass only the ids in to completeActivity, so that the service level looks up the objects. // if we reuse our cached entries, hibernate may throw session errors (if the objects are CGLIB entities). @@ -139,7 +150,7 @@ else { learnerProgress = learnerService.getProgressById(learnerProgress.getLearnerProgressId()); LearningWebUtil.setLearnerProgress(learnerProgress); - return findViewByGateType(mapping, (DynaActionForm)form, learnerProgress.getCurrentActivity(), totalNumActiveLearners); + return findViewByGateType(mapping, (DynaActionForm)form, learnerProgress.getCurrentActivity(), totalNumActiveLearners, learnerProgress.getLesson().isPreviewLesson()); } } @@ -185,11 +196,13 @@ private ActionForward findViewByGateType(ActionMapping mapping, DynaActionForm gateForm, Activity gate, - Integer totalNumActiveLearners) + Integer totalNumActiveLearners, + boolean isPreviewLesson) { //dispatch the view according to the type of the gate. if ( gate != null ) { gateForm.set("totalLearners",totalNumActiveLearners); + gateForm.set("previewLesson",isPreviewLesson); if(gate.isSynchGate()) return viewSynchGate(mapping,gateForm,(SynchGateActivity)gate); else if(gate.isScheduleGate()) Index: lams_learning/src/java/org/lamsfoundation/lams/learning/web/action/GroupingAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_learning/src/java/org/lamsfoundation/lams/learning/web/action/GroupingAction.java,v diff -u -r1.15 -r1.16 --- lams_learning/src/java/org/lamsfoundation/lams/learning/web/action/GroupingAction.java 6 Jun 2006 02:35:26 -0000 1.15 +++ lams_learning/src/java/org/lamsfoundation/lams/learning/web/action/GroupingAction.java 14 Jun 2006 23:13:30 -0000 1.16 @@ -36,6 +36,7 @@ import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; +import org.apache.struts.action.DynaActionForm; import org.lamsfoundation.lams.learning.service.ILearnerService; import org.lamsfoundation.lams.learning.service.LearnerServiceException; import org.lamsfoundation.lams.learning.service.LearnerServiceProxy; @@ -45,6 +46,7 @@ import org.lamsfoundation.lams.learningdesign.Grouping; import org.lamsfoundation.lams.learningdesign.GroupingActivity; import org.lamsfoundation.lams.lesson.LearnerProgress; +import org.lamsfoundation.lams.util.WebUtil; import org.lamsfoundation.lams.web.action.LamsDispatchAction; import org.lamsfoundation.lams.web.util.AttributeNames; @@ -55,6 +57,9 @@ * (random grouping) and allows the learner to view the result of the grouping. * * + *Has a special override key - if the parameter force is set and the + * lesson is a preview lesson, any chosen grouping will be overridden. + *
* @author Jacky Fang * @since 2005-3-29 * @version 1.1 @@ -78,6 +83,9 @@ public class GroupingAction extends LamsDispatchAction { + /** Input parameter. Boolean value */ + public static final String PARAM_FORCE_GROUPING = "force"; + //--------------------------------------------------------------------- // Instance variables //--------------------------------------------------------------------- @@ -99,6 +107,8 @@ //--------------------------------------------------------------------- /** * Perform the grouping for the users who are currently running the lesson. + * If force is set to true, then we should be in preview mode, and we want to + * override the chosen grouping to make it group straight away. * * @param mapping * @param form @@ -117,17 +127,21 @@ LearnerProgress learnerProgress = LearningWebUtil.getLearnerProgressByID(request, getServlet().getServletContext()); validateLearnerProgress(learnerProgress); - + + boolean forceGroup = WebUtil.readBooleanParam(request,PARAM_FORCE_GROUPING,false); + //initialize service object ILearnerService learnerService = LearnerServiceProxy.getLearnerService(getServlet().getServletContext()); boolean groupingDone = learnerService.performGrouping(learnerProgress.getLesson().getLessonId(), learnerProgress.getNextActivity().getActivityId(), - LearningWebUtil.getUserId()); + LearningWebUtil.getUserId(),forceGroup); LearningWebUtil.putActivityInRequest(request, learnerProgress.getNextActivity(), learnerService); LearningWebUtil.setLessonId(learnerProgress.getLesson().getLessonId()); + DynaActionForm groupForm = (DynaActionForm)form; + groupForm.set("previewLesson",learnerProgress.getLesson().isPreviewLesson()); return mapping.findForward(groupingDone ? VIEW_GROUP : WAIT_GROUP); } 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.24 -r1.25 --- lams_learning/src/java/org/lamsfoundation/lams/learning/web/action/LearnerAction.java 8 Jun 2006 01:03:02 -0000 1.24 +++ lams_learning/src/java/org/lamsfoundation/lams/learning/web/action/LearnerAction.java 14 Jun 2006 23:13:30 -0000 1.25 @@ -310,10 +310,16 @@ //SessionBean sessionBean = LearningWebUtil.getSessionBean(request,getServlet().getServletContext()); + Integer learnerId = LearningWebUtil.getUserId(); ILearnerService learnerService = LearnerServiceProxy.getLearnerService(getServlet().getServletContext()); - long learnerProgressId = WebUtil.readLongParam(request,LearningWebUtil.PARAM_PROGRESS_ID); - LearnerProgressDTO learnerProgress = learnerService.getProgressDTOById(new Long(learnerProgressId)); + Long lessonId = WebUtil.readLongParam(request,AttributeNames.PARAM_LESSON_ID,true); + if ( lessonId == null ) { + // temporary code until Flash gets updated to send the lessonID parameter + lessonId = WebUtil.readLongParam(request,LearningWebUtil.PARAM_PROGRESS_ID); + } + LearnerProgressDTO learnerProgress = learnerService.getProgressDTOByLessonId(lessonId, learnerId); + message = new FlashMessage("getFlashProgressData",learnerProgress); } catch (Exception e ) { Index: lams_learning/test/java/org/lamsfoundation/lams/learning/service/TestLearnerService.java =================================================================== RCS file: /usr/local/cvsroot/lams_learning/test/java/org/lamsfoundation/lams/learning/service/Attic/TestLearnerService.java,v diff -u -r1.33 -r1.34 --- lams_learning/test/java/org/lamsfoundation/lams/learning/service/TestLearnerService.java 2 Jun 2006 07:56:27 -0000 1.33 +++ lams_learning/test/java/org/lamsfoundation/lams/learning/service/TestLearnerService.java 14 Jun 2006 23:13:31 -0000 1.34 @@ -337,7 +337,7 @@ assertTrue("verify the existance of test user",!randomGrouping.doesLearnerExist(testUser)); - learnerService.performGrouping(Test_Lesson_ID,randomGroupingActivity.getActivityId(),testUser.getUserId()); + learnerService.performGrouping(Test_Lesson_ID,randomGroupingActivity.getActivityId(),testUser.getUserId(),false); assertTrue("verify the existance of test user",randomGrouping.doesLearnerExist(testUser)); } @@ -347,7 +347,7 @@ //get sync gate GateActivity synchGate = (GateActivity)learnerService.getActivity(new Long(TEST_SYNCHGATE_ACTIVITY_ID)); - boolean gateOpen = learnerService.knockGate(Test_Lesson_ID, synchGate.getActivityId(),testUser); + boolean gateOpen = learnerService.knockGate(Test_Lesson_ID, synchGate.getActivityId(),testUser,false); assertTrue("gate is closed",!gateOpen); synchGate = (GateActivity)learnerService.getActivity(new Long(TEST_SYNCHGATE_ACTIVITY_ID)); @@ -362,7 +362,7 @@ //get sync gate GateActivity synchGate = (GateActivity)learnerService.getActivity(new Long(TEST_SYNCHGATE_ACTIVITY_ID)); - boolean gateOpen = learnerService.knockGate(Test_Lesson_ID, synchGate.getActivityId(),testUser2); + boolean gateOpen = learnerService.knockGate(Test_Lesson_ID, synchGate.getActivityId(),testUser2,false); assertTrue("gate is closed",gateOpen); synchGate = (GateActivity)learnerService.getActivity(new Long(TEST_SYNCHGATE_ACTIVITY_ID)); Index: lams_learning/web/optionsActivity.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_learning/web/optionsActivity.jsp,v diff -u -r1.11 -r1.12 --- lams_learning/web/optionsActivity.jsp 13 Jun 2006 00:47:57 -0000 1.11 +++ lams_learning/web/optionsActivity.jsp 14 Jun 2006 23:13:31 -0000 1.12 @@ -149,7 +149,7 @@
- |
-
- |