MDL-38489 SCORM: use course_get_format to obtain info
[moodle.git] / mod / scorm / view.js
CommitLineData
d5159fb8
DM
1M.mod_scormform = {};
2M.mod_scormform.init = function(Y) {
02ed0df5 3 var scormform = document.getElementById('scormviewform');
d5159fb8
DM
4 var cwidth = scormplayerdata.cwidth;
5 var cheight = scormplayerdata.cheight;
6 var poptions = scormplayerdata.popupoptions;
35cfa9e6
PH
7 var launch = scormplayerdata.launch;
8 var currentorg = scormplayerdata.currentorg;
9 var sco = scormplayerdata.sco;
10 var scorm = scormplayerdata.scorm;
11 var launch_url = M.cfg.wwwroot+"/mod/scorm/player.php?a="+scorm+"&currentorg="+currentorg+"&scoid="+sco+"&sesskey="+M.cfg.sesskey;
b98dcd7d 12 var course_url = scormplayerdata.courseurl;
35cfa9e6 13
d5159fb8
DM
14 if ((cwidth==100) && (cheight==100)) {
15 poptions = poptions+',width='+screen.availWidth+',height='+screen.availHeight+',left=0,top=0';
16 } else {
17 if (cwidth<=100) {
18 cwidth = Math.round(screen.availWidth * cwidth / 100);
19 }
20 if (cheight<=100) {
21 cheight = Math.round(screen.availHeight * cheight / 100);
22 }
23 poptions = poptions+',width='+cwidth+',height='+cheight;
24 }
35cfa9e6 25
812bdaeb
DM
26 if (launch == true) {
27 launch_url = launch_url+"&display=popup";
35cfa9e6
PH
28 window.open(launch_url,'Popup', poptions);
29 parent.window.location = course_url;
30 }
31 scormform.onsubmit = function() {window.open('', 'Popup', poptions); this.target='Popup'; parent.window.location = course_url;};
d5159fb8 32}