Index: lams_learning/web/includes/javascript/learnerPage.js =================================================================== diff -u -r72bf0041a18e7e902404c65e55e167bf6ff84269 -r1f6e357f9932435e8c97e005196baa2f23909191 --- lams_learning/web/includes/javascript/learnerPage.js (.../learnerPage.js) (revision 72bf0041a18e7e902404c65e55e167bf6ff84269) +++ lams_learning/web/includes/javascript/learnerPage.js (.../learnerPage.js) (revision 1f6e357f9932435e8c97e005196baa2f23909191) @@ -10,7 +10,36 @@ cache : false, dataType : 'json', success : function(result){ - $('#lesson-name').text(result.lessonName); + $('.component-page-wrapper .component-page-content #lesson-name').text(result.lessonName); + let progressBarItems = $('.component-page-wrapper .component-sidebar #progress-bar-items').empty(); + + for (var activityIndex = 0; activityIndex < result.activities.length; activityIndex++) { + let activityData = result.activities[activityIndex], + activityItem = $('
  • ').text(activityData.name).appendTo(progressBarItems); + if (activityData.status === 0) { + activityItem.addClass('progress-bar-item-current') + .prepend(''); + } else if (activityData.status === 1) { + activityItem.addClass('progress-bar-item-complete') + .prepend(''); + if (activityData.url) { + activityItem.addClass('progress-bar-item-openable').click(function () { + window.open(activityData.url, "_blank"); + }); + } + } else { + activityItem.addClass('progress-bar-item-incomplete') + .prepend(''); + } + } } }); +} + +function nextActivity(){ + let contentFrame = $('#learner-page-content-frame'); + contentFrame.on('load', function (){ + location.href = contentFrame[0].contentDocument.URL; + }); + contentFrame[0].contentWindow.submitForm('finish'); } \ No newline at end of file