completion javascript in moodle from iPad

Hoping someone from the community has run across something like this.  We have been using javascript to send completion to Moodle and to call for a certificate for quite some time. 

Here is the javascript;

alert("You have completed this module. You will now be directed to your certificate in a new window. You can print it now, save it as a pdf, or come back later to retrieve it.!");
SetStatus("completed");
window.open('http://training.mdambulance.com/moodle2/mod/certificate/view.php?id=702&action=get');

I am not aware of any issues in previous modules but perhaps people did not use ipads or other challenged computers for that one.  This time I have had 3 people contact me that the completion is not showing up and they cant get their certificate from Moodle (conditional to completion).  I log in as them from my Macbook from home and complete with no issue.  I can see that all of the required work is done but their completion is not going through.  If I redo that last section then the completion takes for me.  One person told me they were using an iPad so i tried that and I was unable to complete either with an iPad.  The javascript is running as the new page tries to open but the certificate says not available because the completion status is not getting through.  this is happening for maybe 5 people of 140 doing this section.  One on an iPad, one on a macbook with no flash enabled and one on a pc that I dont know anything about.  If it never worked it would be easy to troubleshoot but these intermittent things are a challenge.  it is not the scorm package as it is working 95% of the time.

Any troubleshooting advice?

Thanks

Tim

6 Replies
Tim Hillier

Brian/Dennis;

thanks for this advice and I will try it. 

I don have one concern that popped into my head as I was telling someone about this.  if there is a timing issue will it block the completion from ever setting properly?  When I go in a day later the completion status is still "incomplete".  The description you are giving me seems to be that the call for the page comes before the completion occurs so the completion will get there after the page call.  What I am seeing is the completion status is never changing to "complete" in these few cases.

sorry if I am not explaining this well.

Tim

Tim Hillier

Thanks Phil;

What I am thinking is to see if I can put in a 5 second delay and put that in the alert box "your cert will open in a new window in 5 seconds.  If you dont see then click this link..."kind of thing

Or as you said I could send the completion when the final page loads rather than when they click the proper button as they cant get off that page without getting the right answer anyway.

I am willing to try anything right now.

Are iPads more susceptible? Or more problems with calling another page to open? I dont remember this issue previously with iPads but maybe I was just not being told about it.