Index: lams_admin/conf/language/lams/ApplicationResources.properties =================================================================== diff -u -r60dd4bbd334d67e6ced927859c35ca83720db776 -r9d95acc370aaf50efff1ff08f51751cffd302604 --- lams_admin/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 60dd4bbd334d67e6ced927859c35ca83720db776) +++ lams_admin/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 9d95acc370aaf50efff1ff08f51751cffd302604) @@ -626,6 +626,12 @@ config.smtp.port =SMTP port config.smtp.auth.security =SMTP authentication security config.server.country =Country - - +sysadmin.lesson.gradebook.complete =Display activity scores on completion +sysadmin.lesson.liveedit =Enable Live Edit +sysadmin.lesson.notification =Enable lesson notifications +sysadmin.lesson.presence =Allow learners to see who is online +sysadmin.lesson.im =Enable Instant Messaging +sysadmin.lesson.force.restart =Learners always start from the first activity +sysadmin.lesson.allow.restart =Learners can restart the lesson +sysadmin.lesson.default =Lesson default settings #======= End labels: Exported 620 labels for en AU ===== Index: lams_admin/web/WEB-INF/struts-config.xml =================================================================== diff -u -r7acb20e485013e119c7dfd90854f123c09f147cb -r9d95acc370aaf50efff1ff08f51751cffd302604 --- lams_admin/web/WEB-INF/struts-config.xml (.../struts-config.xml) (revision 7acb20e485013e119c7dfd90854f123c09f147cb) +++ lams_admin/web/WEB-INF/struts-config.xml (.../struts-config.xml) (revision 9d95acc370aaf50efff1ff08f51751cffd302604) @@ -109,6 +109,13 @@ + + + + + + + Index: lams_admin/web/servermaintain.jsp =================================================================== diff -u -r953f62a7fc515e2dc5c4ad983df233070cf7a82c -r9d95acc370aaf50efff1ff08f51751cffd302604 --- lams_admin/web/servermaintain.jsp (.../servermaintain.jsp) (revision 953f62a7fc515e2dc5c4ad983df233070cf7a82c) +++ lams_admin/web/servermaintain.jsp (.../servermaintain.jsp) (revision 9d95acc370aaf50efff1ff08f51751cffd302604) @@ -63,6 +63,39 @@ + + + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
@@ -82,6 +115,10 @@ } }); + $('#learnerPresenceAvailable').change(function(){ + $('#learnerImAvailable').prop('disabled', !$(this).is(':checked')); + }).change(); + // validate signup form on keyup and submit var validator = $("#ext-server-form").validate({ rules: { Index: lams_central/src/java/org/lamsfoundation/lams/web/action/LtiAction.java =================================================================== diff -u -r7d42c3a0d64c5e7a30a7fd895ab73aa4ad109074 -r9d95acc370aaf50efff1ff08f51751cffd302604 --- lams_central/src/java/org/lamsfoundation/lams/web/action/LtiAction.java (.../LtiAction.java) (revision 7d42c3a0d64c5e7a30a7fd895ab73aa4ad109074) +++ lams_central/src/java/org/lamsfoundation/lams/web/action/LtiAction.java (.../LtiAction.java) (revision 9d95acc370aaf50efff1ff08f51751cffd302604) @@ -62,7 +62,7 @@ /** * Shows either addLesson.jsp or learnerMonitor.jsp pages. - * + * * @author Andrey Balan */ public class LtiAction extends LamsDispatchAction { @@ -80,6 +80,7 @@ * Single entry point to LAMS LTI processing mechanism. It determines here whether to show author or learnerMonitor * pages */ + @Override public ActionForward unspecified(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, UserAccessDeniedException, JSONException, RepositoryCheckedException, UserInfoFetchException, UserInfoValidationException { @@ -88,7 +89,7 @@ String resourceLinkId = request.getParameter(BasicLTIConstants.RESOURCE_LINK_ID); String tcGradebookId = request.getParameter(BasicLTIConstants.LIS_RESULT_SOURCEDID); String extUserId = request.getParameter(BasicLTIConstants.USER_ID); - + ExtServerLessonMap lesson = integrationService.getLtiConsumerLesson(consumerKey, resourceLinkId); //support for ContentItemSelectionRequest. If lesson was created during such request, update its ExtServerLesson's resourceLinkId for the first time boolean isContentItemSelection = WebUtil.readBooleanParam(request, "custom_isContentItemSelection", false); @@ -98,7 +99,7 @@ lesson.setResourceLinkId(resourceLinkId); userManagementService.save(lesson); } - + //update lessonFinishCallbackUrl. We store it one time during the very first call to LAMS and it stays the same all the time afterwards String lessonFinishCallbackUrl = request.getParameter(BasicLTIConstants.LIS_OUTCOME_SERVICE_URL); ExtServer extServer = integrationService.getExtServer(consumerKey); @@ -118,13 +119,13 @@ return mapping.findForward("error"); } - //determine whether to show author or learnerMonitor pages + //determine whether to show author or learnerMonitor pages if (lesson == null) { return addLesson(mapping, form, request, response); - + } else { - //as per LTI spec we need to update tool consumer's gradebook id on every LTI call + //as per LTI spec we need to update tool consumer's gradebook id on every LTI call ExtUserUseridMap extUserMap = integrationService.getExistingExtUserUseridMap(extServer, extUserId); extUserMap.setTcGradebookId(tcGradebookId); userManagementService.save(extUserMap); @@ -167,7 +168,7 @@ request.setAttribute(BasicLTIConstants.CONTEXT_ID, contextId); request.setAttribute(CentralConstants.PARAM_TITLE, resourceLinkTitle); request.setAttribute(CentralConstants.PARAM_DESC, resourceLinkDescription); - + //support for ContentItemSelectionRequest String ltiMessageType = request.getParameter(BasicLTIConstants.LTI_MESSAGE_TYPE); if (LtiUtils.LTI_MESSAGE_TYPE_CONTENTITEMSELECTIONREQUEST.equals(ltiMessageType)) { @@ -177,11 +178,11 @@ "ContentItemSelectionRequest is missing content_item_return_url parameter"); return null; } - + request.setAttribute(BasicLTIConstants.LTI_MESSAGE_TYPE, ltiMessageType); request.setAttribute(LtiUtils.CONTENT_ITEM_RETURN_URL, contentItemReturnUrl); request.setAttribute("title", request.getParameter("title")); - request.setAttribute("desc", request.getParameter("text").replaceAll("\\<[^>]*>","")); + request.setAttribute("desc", request.getParameter("text").replaceAll("\\<[^>]*>", "")); request.setAttribute("data", request.getParameter("data")); } @@ -206,7 +207,7 @@ String contextId = request.getParameter(BasicLTIConstants.CONTEXT_ID); Integer organisationId = new Integer(WebUtil.readIntParam(request, CentralConstants.ATTR_COURSE_ID)); boolean enableLessonIntro = WebUtil.readBooleanParam(request, "enableLessonIntro", false); - + //only monitors are allowed to create lesson if (!securityService.isGroupMonitor(organisationId, userId, "add lesson", false)) { response.sendError(HttpServletResponse.SC_FORBIDDEN, "User is not a monitor in the organisation"); @@ -218,8 +219,11 @@ // 1. init lesson Lesson lesson = monitoringService.initializeLesson(title, desc, new Long(ldIdStr), - organisation.getOrganisationId(), user.getUserId(), null, false, enableLessonIntro, false, false, - true, true, false, false, true, null, null); + organisation.getOrganisationId(), user.getUserId(), null, false, enableLessonIntro, + extServer.getLearnerPresenceAvailable(), extServer.getLearnerImAvailable(), + extServer.getLiveEditEnabled(), extServer.getEnableLessonNotifications(), + extServer.getForceLearnerRestart(), extServer.getAllowLearnerRestart(), + extServer.getGradebookOnComplete(), null, null); // 2. create lessonClass for lesson List staffList = new LinkedList(); staffList.add(user); @@ -234,13 +238,13 @@ monitoringService.startLesson(lesson.getLessonId(), user.getUserId()); // store information which extServer has started the lesson integrationService.createExtServerLessonMap(lesson.getLessonId(), resourceLinkId, extServer); - + //support for ContentItemSelectionRequest String ltiMessageType = request.getParameter(BasicLTIConstants.LTI_MESSAGE_TYPE); String contentItemReturnUrl = request.getParameter(LtiUtils.CONTENT_ITEM_RETURN_URL); if (LtiUtils.LTI_MESSAGE_TYPE_CONTENTITEMSELECTIONREQUEST.equals(ltiMessageType)) { String opaqueTCData = request.getParameter("data"); - + // Get the post data for the placement String returnValues = postLaunchHTML(extServer, lesson, contentItemReturnUrl, opaqueTCData); @@ -262,8 +266,8 @@ out.println("\n"); return null; - - //regular BasicLTI request + + //regular BasicLTI request } else { //set roles to contain monitor so that the user can see monitor link ActionRedirect redirect = new ActionRedirect(mapping.findForwardConfig("learnerMonitorRedirect")); @@ -273,18 +277,19 @@ return redirect; } } - + /** - * Return HTML form to be posted to TC + * Return HTML form to be posted to TC */ - private String postLaunchHTML(ExtServer extServer, Lesson lesson, String contentItemReturnUrl, String opaqueTCData) throws JSONException, UnsupportedEncodingException { + private String postLaunchHTML(ExtServer extServer, Lesson lesson, String contentItemReturnUrl, String opaqueTCData) + throws JSONException, UnsupportedEncodingException { String key = extServer.getServerid(); String secret = extServer.getServerkey(); - + //required parameters // // -// +// // // // @@ -300,16 +305,16 @@ if (StringUtils.isNotBlank(opaqueTCData)) { properties.put("data", opaqueTCData); } - + properties.put("lti_msg", "Information about LAMS lesson has been imported successfully."); properties.put(OAuth.OAUTH_VERSION, OAuth.VERSION_1_0); properties.put("oauth_callback", "about:blank"); properties.put(OAuth.OAUTH_SIGNATURE_METHOD, OAuth.HMAC_SHA1); - + //contentItem Json // { -// "@context" : "http://purl.imsglobal.org/ctx/lti/v1/ContentItem", -// "@graph" : [ +// "@context" : "http://purl.imsglobal.org/ctx/lti/v1/ContentItem", +// "@graph" : [ // { // "@type" : "LtiLinkItem", // "mediaType" : "application/vnd.ims.lti.v1.ltilink", @@ -356,14 +361,14 @@ /** * Once lesson was created, start showing learnerMonitor page to everybody regardless of his role. */ - public ActionForward learnerMonitor(ActionMapping mapping, ActionForm form, HttpServletRequest request, + public ActionForward learnerMonitor(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, UserAccessDeniedException, JSONException, RepositoryCheckedException, UserInfoValidationException, UserInfoFetchException { initServices(); Integer userId = getUser().getUserID(); String consumerKey = request.getParameter(LtiUtils.OAUTH_CONSUMER_KEY); String resourceLinkId = request.getParameter(BasicLTIConstants.RESOURCE_LINK_ID); - + //get orgId // String contextId = request.getParameter(BasicLTIConstants.CONTEXT_ID); // ExtServer extServer = integrationService.getExtServer(consumerKey); @@ -390,7 +395,7 @@ LearnerProgressDTO learnerProgress = learnProg.getLearnerProgressData(); request.setAttribute("learnerProgressDto", learnerProgress); } - + // check if we need to create svg, png files on the server // if (lesson.isDisplayDesignImage() && lesson.getLearnerProgresses().isEmpty()) { // Long learningDesignId = lesson.getLearningDesign().getLearningDesignId(); @@ -426,7 +431,7 @@ .getRequiredWebApplicationContext(getServlet().getServletContext()) .getBean("userManagementService"); } - + if (learningDesignService == null) { learningDesignService = (ILearningDesignService) WebApplicationContextUtils .getRequiredWebApplicationContext(getServlet().getServletContext()) Index: lams_central/src/java/org/lamsfoundation/lams/webservice/xml/LessonManagerServlet.java =================================================================== diff -u -r3b255feabeeae3729398d969d6ee4d76947777d3 -r9d95acc370aaf50efff1ff08f51751cffd302604 --- lams_central/src/java/org/lamsfoundation/lams/webservice/xml/LessonManagerServlet.java (.../LessonManagerServlet.java) (revision 3b255feabeeae3729398d969d6ee4d76947777d3) +++ lams_central/src/java/org/lamsfoundation/lams/webservice/xml/LessonManagerServlet.java (.../LessonManagerServlet.java) (revision 9d95acc370aaf50efff1ff08f51751cffd302604) @@ -64,7 +64,6 @@ import org.lamsfoundation.lams.usermanagement.service.IUserManagementService; import org.lamsfoundation.lams.util.CentralConstants; import org.lamsfoundation.lams.util.DateUtil; -import org.lamsfoundation.lams.util.LanguageUtil; import org.lamsfoundation.lams.util.WebUtil; import org.lamsfoundation.lams.web.session.SessionManager; import org.lamsfoundation.lams.web.util.AttributeNames; @@ -144,12 +143,18 @@ String lastNames = request.getParameter("lastNames"); String emails = request.getParameter("emails"); - boolean presenceEnable = WebUtil.readBooleanParam(request, CentralConstants.PARAM_LEARNER_PRESENCE_ENABLE, - false); - boolean imEnable = WebUtil.readBooleanParam(request, CentralConstants.PARAM_LEARNER_IM_ENABLE, false); - boolean enableNotifications = WebUtil.readBooleanParam(request, CentralConstants.PARAM_ENABLE_NOTIFICATIONS, - false); + String presenceEnableString = WebUtil.readStrParam(request, CentralConstants.PARAM_LEARNER_PRESENCE_ENABLE, + true); + Boolean presenceEnable = presenceEnableString == null ? null : Boolean.valueOf(presenceEnableString); + String imEnableString = WebUtil.readStrParam(request, CentralConstants.PARAM_LEARNER_IM_ENABLE, true); + Boolean imEnable = imEnableString == null ? null : Boolean.valueOf(imEnableString); + + String enableNotificationString = WebUtil.readStrParam(request, CentralConstants.PARAM_ENABLE_NOTIFICATIONS, + true); + Boolean enableNotifications = enableNotificationString == null ? null + : Boolean.valueOf(enableNotificationString); + Long ldId = null; Long lsId = null; ServletOutputStream outputStream = null; @@ -186,8 +191,7 @@ } else if (method.equals(CentralConstants.METHOD_SCHEDULE)) { ldId = new Long(ldIdStr); Long lessonId = scheduleLesson(serverId, datetime, hashValue, username, ldId, courseId, title, desc, - startDate, country, locale, customCSV, presenceEnable, imEnable, - enableNotifications); + startDate, country, locale, customCSV, presenceEnable, imEnable, enableNotifications); element = document.createElement(CentralConstants.ELEM_LESSON); element.setAttribute(CentralConstants.ATTR_LESSON_ID, lessonId.toString()); @@ -301,8 +305,8 @@ return; } else if (method.equals(CentralConstants.METHOD_LIST_MONITOR)) { - element = getLessonMonitorList(document, serverId, datetime, hashValue, username, courseId, - country, locale); + element = getLessonMonitorList(document, serverId, datetime, hashValue, username, courseId, country, + locale); } else { String msg = "Method :" + method + " is not recognised"; log.error(msg); @@ -370,7 +374,7 @@ private static Long startLesson(String serverId, String datetime, String hashValue, String username, long ldId, String courseId, String title, String desc, String countryIsoCode, String langIsoCode, String customCSV, - boolean presenceEnable, boolean imEnable, boolean enableNotifications) throws RemoteException { + Boolean presenceEnable, Boolean imEnable, Boolean enableNotifications) throws RemoteException { try { ExtServer extServer = integrationService.getExtServer(serverId); Authenticator.authenticate(extServer, datetime, username, hashValue); @@ -382,8 +386,12 @@ // 1. init lesson Lesson lesson = monitoringService.initializeLesson(title, desc, ldId, organisation.getOrganisationId(), - user.getUserId(), customCSV, false, false, presenceEnable, imEnable, true, enableNotifications, - false, false, true, null, null); + user.getUserId(), customCSV, false, false, + presenceEnable == null ? extServer.getLearnerPresenceAvailable() : presenceEnable, + imEnable == null ? extServer.getLearnerImAvailable() : imEnable, extServer.getLiveEditEnabled(), + enableNotifications == null ? extServer.getEnableLessonNotifications() : enableNotifications, + extServer.getForceLearnerRestart(), extServer.getAllowLearnerRestart(), + extServer.getGradebookOnComplete(), null, null); // 2. create lessonClass for lesson LessonManagerServlet.createLessonClass(lesson, organisation, user); // 3. start lesson @@ -399,7 +407,7 @@ private Long scheduleLesson(String serverId, String datetime, String hashValue, String username, long ldId, String courseId, String title, String desc, String startDate, String countryIsoCode, String langIsoCode, - String customCSV, boolean presenceEnable, boolean imEnable, boolean enableNotifications) + String customCSV, Boolean presenceEnable, Boolean imEnable, Boolean enableNotifications) throws RemoteException { try { ExtServer extServer = integrationService.getExtServer(serverId); @@ -410,7 +418,11 @@ // 1. init lesson Lesson lesson = monitoringService.initializeLesson(title, desc, ldId, orgMap.getOrganisation().getOrganisationId(), userMap.getUser().getUserId(), customCSV, false, - false, presenceEnable, imEnable, true, enableNotifications, false, false, true, null, null); + false, presenceEnable == null ? extServer.getLearnerPresenceAvailable() : presenceEnable, + imEnable == null ? extServer.getLearnerImAvailable() : imEnable, extServer.getLiveEditEnabled(), + enableNotifications == null ? extServer.getEnableLessonNotifications() : enableNotifications, + extServer.getForceLearnerRestart(), extServer.getAllowLearnerRestart(), + extServer.getGradebookOnComplete(), null, null); // 2. create lessonClass for lesson LessonManagerServlet.createLessonClass(lesson, orgMap.getOrganisation(), userMap.getUser()); // 3. schedule lesson @@ -706,7 +718,7 @@ private Long startPreview(String serverId, String datetime, String hashValue, String username, Long ldId, String courseId, String title, String desc, String countryIsoCode, String langIsoCode, String customCSV, - boolean presenceEnable, boolean imEnable) throws RemoteException { + Boolean presenceEnable, Boolean imEnable) throws RemoteException { try { ExtServer extServer = integrationService.getExtServer(serverId); @@ -718,7 +730,8 @@ // 1. init lesson Lesson lesson = monitoringService.initializeLessonForPreview(title, desc, ldId, userId, customCSV, - presenceEnable, imEnable, false); + presenceEnable == null ? extServer.getLearnerPresenceAvailable() : presenceEnable, + imEnable == null ? extServer.getLearnerImAvailable() : imEnable, extServer.getLiveEditEnabled()); // 2. create lessonClass for lesson monitoringService.createPreviewClassForLesson(userId, lesson.getLessonId()); Index: lams_central/web/css/outcome.css =================================================================== diff -u --- lams_central/web/css/outcome.css (revision 0) +++ lams_central/web/css/outcome.css (revision 9d95acc370aaf50efff1ff08f51751cffd302604) @@ -0,0 +1,27 @@ +div#titleDiv { + font-size: small; + font-weight: bold; + padding: 5px 0; + text-align: center; + border-bottom: thin dotted #AAAAAA; } + +.manageButton { + cursor: pointer; + width: 16px; + height: 16px; } + +#addButton { + float: right; + margin: 20px 10px 10px 0; } + +.outcomeContainer { + font-size: 1.3em; } + +.outcomeContainer .row { + padding-top: 10px; } + +.outcomeContainer .row:first-child { + border-bottom: thin solid #AAAAAA; } + +textarea { + width: 100%; } Index: lams_common/conf/hibernate/mappings/org/lamsfoundation/lams/integration/ExtServerOrgMap.hbm.xml =================================================================== diff -u -r953f62a7fc515e2dc5c4ad983df233070cf7a82c -r9d95acc370aaf50efff1ff08f51751cffd302604 --- lams_common/conf/hibernate/mappings/org/lamsfoundation/lams/integration/ExtServerOrgMap.hbm.xml (.../ExtServerOrgMap.hbm.xml) (revision 953f62a7fc515e2dc5c4ad983df233070cf7a82c) +++ lams_common/conf/hibernate/mappings/org/lamsfoundation/lams/integration/ExtServerOrgMap.hbm.xml (.../ExtServerOrgMap.hbm.xml) (revision 9d95acc370aaf50efff1ff08f51751cffd302604) @@ -151,7 +151,29 @@ length="65535" not-null="false" /> - + + + + + + + + + + + + + + + +