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?
Arutelu on lukustatud, seetõttu ei saa te sellele enam vastata.