add moodle internal checks

Just for some added security.
Merge pull request #120 from ds125v/moodle_internal

add moodle internal checks