MDL-35870 SCORM: add some more default values and move some php code to the top