Index: lams_bb_integration/RELEASE_NOTES.TXT =================================================================== diff -u -r8dc1bbe9fec28ac8a9666ac1199eb5a558716581 -rdc6d71b150638292aaa1dd2f575e5978604a77a3 --- lams_bb_integration/RELEASE_NOTES.TXT (.../RELEASE_NOTES.TXT) (revision 8dc1bbe9fec28ac8a9666ac1199eb5a558716581) +++ lams_bb_integration/RELEASE_NOTES.TXT (.../RELEASE_NOTES.TXT) (revision dc6d71b150638292aaa1dd2f575e5978604a77a3) @@ -161,4 +161,5 @@ 1.2.25 Release Fixes ==================== -* LDEV-4418: Change back button javascript \ No newline at end of file +* LDEV-4418: Change back button javascript +* LDEV-4478: Add ability to display LAMS CourseGradebook \ No newline at end of file Index: lams_bb_integration/build.xml =================================================================== diff -u -r8dc1bbe9fec28ac8a9666ac1199eb5a558716581 -rdc6d71b150638292aaa1dd2f575e5978604a77a3 --- lams_bb_integration/build.xml (.../build.xml) (revision 8dc1bbe9fec28ac8a9666ac1199eb5a558716581) +++ lams_bb_integration/build.xml (.../build.xml) (revision dc6d71b150638292aaa1dd2f575e5978604a77a3) @@ -46,7 +46,7 @@ + destdir="${build.classes}" deprecation="on" debug="on" target="1.7"> Index: lams_bb_integration/src/org/lamsfoundation/bb/integration/servlet/LinkToolsServlet.java =================================================================== diff -u -r54843a5ae3288a977cdfa75fd43afc9c67831624 -rdc6d71b150638292aaa1dd2f575e5978604a77a3 --- lams_bb_integration/src/org/lamsfoundation/bb/integration/servlet/LinkToolsServlet.java (.../LinkToolsServlet.java) (revision 54843a5ae3288a977cdfa75fd43afc9c67831624) +++ lams_bb_integration/src/org/lamsfoundation/bb/integration/servlet/LinkToolsServlet.java (.../LinkToolsServlet.java) (revision dc6d71b150638292aaa1dd2f575e5978604a77a3) @@ -102,6 +102,10 @@ } else if (method.equals("openMonitorLinkTool")) { openMonitorLinkTool(request, response); + + //open LAMS course gradebook page + } else if (method.equals("openCourseGradebook")) { + openCourseGradebook(request, response); //Admin on BB side calls this servlet to clone old lesson that were copied to the new course. } else if (method.equals("cloneLessons")) { @@ -262,7 +266,41 @@ return sb.toString(); } } + + private void openCourseGradebook(HttpServletRequest request, HttpServletResponse response) + throws IOException, ServletException { + +// BbPersistenceManager bbPm = PersistenceServiceFactory.getInstance().getDbPersistenceManager(); +// Container bbContainer = bbPm.getContainer(); +// PkId courseId = new PkId(bbContainer, Course.DATA_TYPE, request.getParameter("course_id")); +// +// // find a teacher that will be assigned as lesson's author on LAMS side +// User teacher = BlackboardUtil.getCourseTeacher(courseId); + + Context ctx = null; + try { + // get Blackboard context + ContextManager ctxMgr = (ContextManager) BbServiceManager.lookupService(ContextManager.class); + ctx = ctxMgr.getContext(); + // construct Login Request URL for author LAMS Lessons (as it's the only possible method value to successfully pass authentication) + String courseGradebookUrl = LamsSecurityUtil.generateRequestURL(ctx, "author", null); + courseGradebookUrl += "&mode=gradebook"; +// courseGradebookUrl += "&courseid=" + cour; +// courseGradebookUrl += "&redirectUrl=/gradebook/gradebookMonitoring.do?dispatch=courseMonitor&organisationID=4"; +// https://translations.lamsinternational.com/lams/gradebook/gradebookMonitoring.do?dispatch=courseMonitor&organisationID=4 + response.sendRedirect(courseGradebookUrl); + } catch (InitializationException e) { + throw new ServletException(e); + } catch (BbServiceException e) { + throw new ServletException(e); + } catch (PersistenceException e) { + throw new ServletException(e); + } + + + } + /** * Admin on BB side calls this servlet to clone old lesson that were copied to the new course. * Index: lams_bb_integration/web/includes/javascript/openLamsPage.js =================================================================== diff -u -r76b78a2d0d0724e423fea866628a092a839a34c0 -rdc6d71b150638292aaa1dd2f575e5978604a77a3 --- lams_bb_integration/web/includes/javascript/openLamsPage.js (.../openLamsPage.js) (revision 76b78a2d0d0724e423fea866628a092a839a34c0) +++ lams_bb_integration/web/includes/javascript/openLamsPage.js (.../openLamsPage.js) (revision dc6d71b150638292aaa1dd2f575e5978604a77a3) @@ -40,4 +40,26 @@ alert("Pop-up windows have been blocked by your browser. Please allow pop-ups for this site and try again"); } } +} + +//Open LAMS course gradebook Window +function openCourseGradebook(courseId) { + var monitorUrl = '../LinkTools?method=openCourseGradebook&course_id=' + courseId; + if(courseGradebookWin && !courseGradebookWin.closed) { + try { + courseGradebookWin.focus(); + } catch(e) { + // popups blocked by a 3rd party + alert("Pop-up windows have been blocked by your browser. Please allow pop-ups for this site and try again"); + } + } else { + try { + courseGradebookWin = window.open(monitorUrl,'aWin','width=1280,height=720,resizable=1,scrollbars=yes'); + courseGradebookWin.opener = self; + courseGradebookWin.focus(); + } catch(e) { + // popups blocked by a 3rd party + alert("Pop-up windows have been blocked by your browser. Please allow pop-ups for this site and try again"); + } + } } \ No newline at end of file Index: lams_bb_integration/web/links/monitor.jsp =================================================================== diff -u -r8fc1a1bffe5907d6f05f859a8f1cb5b2b62709c4 -rdc6d71b150638292aaa1dd2f575e5978604a77a3 --- lams_bb_integration/web/links/monitor.jsp (.../monitor.jsp) (revision 8fc1a1bffe5907d6f05f859a8f1cb5b2b62709c4) +++ lams_bb_integration/web/links/monitor.jsp (.../monitor.jsp) (revision dc6d71b150638292aaa1dd2f575e5978604a77a3) @@ -36,6 +36,12 @@ <%-- Monitor Button --%>
+ +