mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
MDL-46961 SCORM: JavaScript Hoisting issue.
This commit is contained in:
parent
e609e6cf02
commit
ae72469da9
@ -64,6 +64,20 @@ M.mod_scormform.init = function(Y) {
|
||||
}}, 800);
|
||||
}
|
||||
|
||||
// Set mode and newattempt correctly.
|
||||
var setlaunchoptions = function() {
|
||||
var mode = Y.one('#scormviewform input[name=mode]:checked');
|
||||
if (mode) {
|
||||
var modevalue = mode.get('value');
|
||||
launch_url += '&mode=' + (modevalue ? modevalue : 'normal');
|
||||
} else {
|
||||
launch_url += '&mode=normal';
|
||||
}
|
||||
|
||||
var newattempt = Y.one('#scormviewform #a');
|
||||
launch_url += (newattempt && newattempt.get('checked') ? '&newattempt=on' : '');
|
||||
}
|
||||
|
||||
if (launch == true) {
|
||||
setlaunchoptions();
|
||||
winobj = window.open(launch_url,'Popup', poptions);
|
||||
@ -80,17 +94,4 @@ M.mod_scormform.init = function(Y) {
|
||||
e.preventDefault();
|
||||
}, scormform);
|
||||
}
|
||||
|
||||
var setlaunchoptions = function() {
|
||||
var mode = Y.one('#scormviewform input[name=mode]:checked');
|
||||
if (mode) {
|
||||
var modevalue = mode.get('value');
|
||||
launch_url += '&mode=' + (modevalue ? modevalue : 'normal');
|
||||
} else {
|
||||
launch_url += '&mode=normal';
|
||||
}
|
||||
|
||||
var newattempt = Y.one('#scormviewform #a');
|
||||
launch_url += (newattempt && newattempt.get('checked') ? '&newattempt=on' : '');
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user