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?
Гэтае абмеркаваньне было заблакавана, таму вы болей ня можаце адказваць на яго.