I take it you're not a parent? :p
It's 10:30pm. I've just got home from work (not unusual with my hours). I hear my children, still clearly awake when they should be asleep. I ask my partner "Have they slept tonight?"
Alternatively: I own a company which has been robbed, despite having nighttime security guards. I ask the head of security, somewhat irate, "Where were they? Have they been sleeping tonight?"
This does not make sense. Yes, "i natt" literally means "tonight" but we all know now that translating literally often does not work. It's not what they say in English. In English they'd say "last night" in this case. They most likely also would not use the present perfect. I get that these sentences are meant to teach the use of present perfect but it's the use of present perfect in Norwegian. In English they often use the simple past instead. Therefore "Did they sleep last night?" should be an accepted translation.
True, I give you that. So the question is, if you give this sentence to a Norwegian native - would they assume you want to ask whether they have slept that same night? Or would they think you are inquiring about the night before? If the Norwegian sentence clearly makes a Norwegian think you are inquiring about the same night then it is true that "tonight" is the only option. If it could be understood either way, "last night" would need to be accepted. I am German, and we would phrase it the same way Norwegians do, but we are also aware that it could be understood either way and therefore would accept both translations.
I wasn't aware that it could be understood to mean the previous night. Will need a native speaker to answer that one, though given the similarities of Norwegian and German I can understand where you're coming from now. I wasn't aware of the phrase being ambiguous that way in German either, but I don't know much German.