Index: lams_learning/src/java/org/lamsfoundation/lams/learning/service/LearnerService.java =================================================================== diff -u -r0a50c865925ec0818895cbc9c4ce3b6e0beefa9c -r4ce8d52796b8d19898bfc31ae6f9b00db78d2061 --- lams_learning/src/java/org/lamsfoundation/lams/learning/service/LearnerService.java (.../LearnerService.java) (revision 0a50c865925ec0818895cbc9c4ce3b6e0beefa9c) +++ lams_learning/src/java/org/lamsfoundation/lams/learning/service/LearnerService.java (.../LearnerService.java) (revision 4ce8d52796b8d19898bfc31ae6f9b00db78d2061) @@ -388,18 +388,21 @@ { LearnerProgress progress = learnerProgressDAO.getLearnerProgressByLearner(learnerId, lessonId); - // if we skip a sequence in an optional sequence, or have been force completed for branching / optional sequence - // and we go back to the sequence later, then the LessonComplete flag must be reset so that it will step through - // all the activities in the sequence - otherwise it will go to the "Completed" screen after the first activity in the sequence - if ( clearCompletedFlag && activity.getParentActivity() != null && activity.getParentActivity().isSequenceActivity() - && progress.isComplete() && ! progress.getCompletedActivities().contains(activity) ) - progress.setLessonComplete(LearnerProgress.LESSON_NOT_COMPLETE); - - progressEngine.setActivityAttempted(progress, activity); - progress.setCurrentActivity(activity); - progress.setNextActivity(activity); + if ( ! progress.getCompletedActivities().contains(activity) ) { + // if we skip a sequence in an optional sequence, or have been force completed for branching / optional sequence + // and we go back to the sequence later, then the LessonComplete flag must be reset so that it will step through + // all the activities in the sequence - otherwise it will go to the "Completed" screen after the first activity in the sequence + if ( clearCompletedFlag && activity.getParentActivity() != null && activity.getParentActivity().isSequenceActivity() + && progress.isComplete() ) + progress.setLessonComplete(LearnerProgress.LESSON_NOT_COMPLETE); + + progressEngine.setActivityAttempted(progress, activity); + progress.setCurrentActivity(activity); + progress.setNextActivity(activity); - learnerProgressDAO.saveLearnerProgress(progress); + learnerProgressDAO.saveLearnerProgress(progress); + } + return progress; }