MDL-37524 SCORM: use function to get mode and remove some old code