I'm not quite sure what you mean terminology-wise -your 'modules' are Moodle courses, I get that -but it is not possible to restrict the view of other categories in Moodle even if you are not enrolled in any courses in them. It shouldn't matter as long as the student is not enrolled in the courses in that category or the courses in that term. (By default in most Moodle sites anyone can see all the categories anyway from yoursite/course/index.php) However, if that is what you want (restrict view of categories) then I suggest you do a search on these forums. People have come up with complex workarounds (using hidden categories/permissions, which I'm not convinced about) or they might have suggested other developments.