Language teachers usually ask this when something indicates that a student didn’t understand (e.g. verbal response “huh?” or non-verbal response deer-in-headlights expression on face, etc.). If this event has already happened, asking the question serves no purpose. In fact, it might even make the matter worse by putting the student on the spot. The student will likely answer “yes, I understand” just to get their teacher to move on to someone else. Here are some comprehension check alternatives:
1) Did I just say/ask X?
2) Did I just say/ask X or Y?
3) I just said/asked ____.
4) What did I just say/ask? -or- Who can tell me what I just said/asked?
The alternatives above are arranged by questioning level from low to high (i.e. yes/no, either/or, fill-in-blank, open-ended). The questions could certainly be asked in the target language, but one popular strategy is to ask, in English/native, “what did I just say/ask?” to a so-called barometer student, who would be one with the slowest processing speed. This popular strategy is interesting because that kind of question is technically harder to answer than “did I just say/ask X?” It’s probably a non-issue because we’re dealing with the native language, but for the sake of variety, or if you find that your barometer students are struggling, you could start asking those lower level comprehension checks in English/native as well the classic “what did I just say/ask?”