Index: lams_build/lib/lams/lams.jar
===================================================================
RCS file: /usr/local/cvsroot/lams_build/lib/lams/lams.jar,v
diff -u -r1.354 -r1.355
Binary files differ
Index: lams_central/conf/language/lams/ApplicationResources.properties
===================================================================
RCS file: /usr/local/cvsroot/lams_central/conf/language/lams/ApplicationResources.properties,v
diff -u -r1.110 -r1.111
--- lams_central/conf/language/lams/ApplicationResources.properties 7 Jan 2013 13:03:52 -0000 1.110
+++ lams_central/conf/language/lams/ApplicationResources.properties 8 Jan 2013 11:19:31 -0000 1.111
@@ -358,6 +358,7 @@
label.tab.lesson =Lesson
label.tab.class =Class
label.tab.advanced =Advanced
+label.tab.conditions =Conditions
label.tab.lesson.title =Select the sequence to add a lesson, and click on Add now
label.tab.class.title =Please use drag n' drop to select or unselect monitors and learners
label.tab.lesson.name =Lesson name:
@@ -385,5 +386,12 @@
label.tab.advanced.field.split.number =No. learners per lesson
label.tab.advanced.field.scheduling =Enable scheduling
label.tab.advanced.split.desc =[0] instances of this lesson will be created
and approximately [1] will be allocated to each lesson
-
+label.tab.conditions.dependencies =Dependencies
+label.tab.conditions.dependencies.desc =Select a lesson that students will need to complete before they can see the lesson you are about to create.
+label.tab.conditions.timelimit =Time limitations
+label.tab.conditions.timelimit.desc =Set the number of days the lesson will be available to students. After this period the lesson will no longer be shown.
If the time should count from the moment the learner starts the lesson, select the option for individual time limit.
+label.tab.conditions.timelimit.days =Number days:
+label.tab.conditions.timelimit.individual =Is this time limit for each individual?
+label.tab.conditions.enable =Enable
+label.tab.conditions.dependencies.desc =Select a lesson that students will need to complete before they can see the lesson you are about to create.
#======= End labels: Exported 345 labels for en AU =====
Index: lams_central/src/java/org/lamsfoundation/lams/web/HomeAction.java
===================================================================
RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/web/HomeAction.java,v
diff -u -r1.41 -r1.42
--- lams_central/src/java/org/lamsfoundation/lams/web/HomeAction.java 7 Jan 2013 13:03:52 -0000 1.41
+++ lams_central/src/java/org/lamsfoundation/lams/web/HomeAction.java 8 Jan 2013 11:19:32 -0000 1.42
@@ -30,6 +30,9 @@
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.TreeSet;
import java.util.Vector;
import javax.servlet.ServletException;
@@ -52,7 +55,9 @@
import org.lamsfoundation.lams.learningdesign.dao.IGroupUserDAO;
import org.lamsfoundation.lams.learningdesign.service.ILearningDesignService;
import org.lamsfoundation.lams.lesson.Lesson;
+import org.lamsfoundation.lams.lesson.dto.LessonDTO;
import org.lamsfoundation.lams.lesson.service.ILessonService;
+import org.lamsfoundation.lams.lesson.util.LessonDTOComparator;
import org.lamsfoundation.lams.usermanagement.Organisation;
import org.lamsfoundation.lams.usermanagement.Role;
import org.lamsfoundation.lams.usermanagement.User;
@@ -366,6 +371,7 @@
}
}
+ @SuppressWarnings("unchecked")
public ActionForward newLesson(ActionMapping mapping, ActionForm form, HttpServletRequest req,
HttpServletResponse res) throws IOException, UserAccessDeniedException, JSONException,
RepositoryCheckedException {
@@ -387,7 +393,7 @@
userJSON.put("firstName", user.getFirstName());
userJSON.put("lastName", user.getLastName());
userJSON.put("login", user.getLogin());
-
+
users.append("selectedLearners", userJSON);
}
@@ -399,17 +405,29 @@
userJSON.put("firstName", user.getFirstName());
userJSON.put("lastName", user.getLastName());
userJSON.put("login", user.getLogin());
-
+
if (userDTO.getUserID().equals(user.getUserID())) {
// creator is always selected
users.append("selectedMonitors", userJSON);
} else {
users.append("unselectedMonitors", userJSON);
}
}
-
+
req.setAttribute("users", users.toString());
+ // find lessons which can be set as preceding ones for newly created lesson
+ Organisation organisation = (Organisation) getService().findById(Organisation.class, organisationID);
+ Set availableLessons = new TreeSet(new LessonDTOComparator());
+ for (Lesson availableLesson : (Set) organisation.getLessons()) {
+ Integer availableLessonState = availableLesson.getLessonStateId();
+ if (!Lesson.REMOVED_STATE.equals(availableLessonState)
+ && !Lesson.FINISHED_STATE.equals(availableLessonState)) {
+ availableLessons.add(new LessonDTO(availableLesson));
+ }
+ }
+ req.setAttribute("availablePrecedingLessons", availableLessons);
+
return mapping.findForward("newLesson");
}
@@ -455,7 +473,7 @@
if (publicFolder != null) {
folderContents.add(publicFolder);
}
- // special behaviour for organisation folders
+ // special behaviour for organisation folders
} else if (folderID.equals(WorkspaceAction.ORG_FOLDER_ID)) {
folderContents = getWorkspaceManagementService().getAccessibleOrganisationWorkspaceFolders(userID);
Index: lams_central/web/newLesson.jsp
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/Attic/newLesson.jsp,v
diff -u -r1.2 -r1.3
--- lams_central/web/newLesson.jsp 7 Jan 2013 21:11:30 -0000 1.2
+++ lams_central/web/newLesson.jsp 8 Jan 2013 11:19:31 -0000 1.3
@@ -1,6 +1,7 @@
<%@ page contentType="text/html; charset=utf-8" language="java"%>
<%@ taglib uri="tags-lams" prefix="lams"%>
<%@ taglib uri="tags-fmt" prefix="fmt"%>
+<%@ taglib uri="tags-core" prefix="c"%>
@@ -45,6 +46,7 @@
initLessonTab();
initClassTab();
initAdvancedTab();
+ initConditionsTab();
});
@@ -63,6 +65,7 @@
+
@@ -122,9 +125,8 @@
-
+