Skip to content

Commit

Permalink
Merge branch 'm26_MDL-46961' of https://github.com/danmarsden/moodle
Browse files Browse the repository at this point in the history
…into MOODLE_26_STABLE
  • Loading branch information
Damyon Wiese committed Sep 1, 2014
2 parents bb5b3ee + 892eb5d commit dea12fe
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions mod/scorm/view.js
Expand Up @@ -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);
Expand All @@ -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' : '');
}
}

0 comments on commit dea12fe

Please sign in to comment.