moodle 2: better handle missing files and external references