jQuery inline like that only leads to problems and conflicts with other plugins such as themes, read this: https://docs.moodle.org/dev/jQuery
Courses and course formats
How to include javascript file in a new course format?
Keskustelu on lukittu, joten et voi enää vastata siihen.