UNPKG

unserver-unify

Version:

29 lines (27 loc) 1.27 kB
angular.module('bamboo.course').controller('Scorm1.2ChapterCtrl', function($sce, ScormService, $stateParams, ApiService) { // console.log(loginService.user._id); var self = this; var courseid = $stateParams.cid; var mvId=$stateParams.id; self.ResUrl = ApiService.SHOST + '/lcourse/'; this.init = function(chapter,successCallBack) { self.chapter = chapter; self.lmsready = false; var api = ScormService.scormLocal(courseid,mvId, self.chapter._id, null,successCallBack, function() { self.lmsready = true; }); window.API = ScormService.API; var mediaUrl = self.ResUrl; if (ApiService.MEDIAPATH) { mediaUrl = ApiService.MEDIAPATH + "/lcourse/"; } // pdfViewService.setpdfUrl(self.ResUrl + (self.chapter.rid || self.chapter.cid) + "/resources/" + self.chapter.content); var indexHtml = 'index_lms_html5.html'; if (self.chapter.indexHtml) { indexHtml = self.chapter.indexHtml; } var _tempurl = mediaUrl + (self.chapter.rid || self.chapter.cid) + "/resources/" + self.chapter.content + '/' + indexHtml; self.chapter.fullurl=self.fullurl = $sce.trustAsResourceUrl(encodeURI(_tempurl)); //self.fullurl = $sce.trustAsResourceUrl(encodeURI(_tempurl)); } });