This post can be deleted or closed. I decided to also make a post in the General Developer Forum, because on second thought that seemed the better place. With help of some reactions there, I managed to make the right adjustments. For anyone interested, please see: https://moodle.org/mod/forum/discuss.php?d=410241#p1654781.