MDL-46236 mod_scorm : Setting lauch options for scorm in popup

This commit is contained in:
Nobelium
2014-07-28 06:41:40 +00:00
parent cc1dc858c0
commit 568e9560af
+9
View File
@@ -65,6 +65,7 @@ M.mod_scormform.init = function(Y) {
}
if (launch == true) {
setlaunchoptions();
winobj = window.open(launch_url,'Popup', poptions);
this.target='Popup';
scormredirect(winobj);
@@ -72,10 +73,18 @@ M.mod_scormform.init = function(Y) {
// Listen for view form submit and generate popup on user interaction.
if (scormform) {
Y.on('submit', function(e) {
setlaunchoptions();
winobj = window.open(launch_url, 'Popup', poptions);
this.target='Popup';
scormredirect(winobj);
e.preventDefault();
}, scormform);
}
var setlaunchoptions = function() {
var mode = Y.one('#scormviewform input[name=mode]:checked').get('value');
launch_url += '&mode=' + (mode ? mode : 'normal');
var newattempt = Y.one('#scormviewform #a');
launch_url += (newattempt && newattempt.get('checked') ? '&newattempt=on' : '');
}
}