Load scorm - own function

Load scorm - own function

by Winsally Skellington -
Number of replies: 0
Good afternoon , first of all I apologize for my English smile 


I would like load a scorm with own function , I get to load the newly selected sco me but immediately thereafter reloaded the sco displayed above. 

This is my code :

var content = $('#scorm_content');
var old = $('#scorm_object');
if (old) {
    $(old).remove();
    old = null;
 }

var url_prefix = M.cfg.wwwroot + '/mod/scorm/loadSCO.php?';
var el_old_api = $('#scormapi123');
if (el_old_api) {
    el_old_api.remove();
}

var obj = document.createElement('iframe');
obj.setAttribute('id', 'scorm_object');
obj.setAttribute('type', 'text/html');
obj.setAttribute('src', url_prefix + a='+scormid+'&scoid='+scoid+'¤torg=&mode=&attempt=1"');

$(content).prepend(obj);

If for example I have loaded the scoid = 499 and will load the 500, call this script. 

load the scoid = 500 and then immediately reloaded 499

Any idea?


Average of ratings: -