In the site where you are restoring, do you have permission to create category-level questions? If you do, it should create the questions there. If not they are created in the course instead.
I think.
This area of code is complex, and I can't 100% remember how it is supposed to work.