fix fatal error during add/update 

Fix for fatal error caused by: https://github.com/RusticiSoftware/SCORMCloud_MoodleModule/pull/21