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("