Change into indirect speech: The teacher said, "Did you do your homework, Ali?"
The teacher asked Ali whether he had done his homework.
The teacher asked Ali did he do his homework.
The teacher asked Ali whether he did his homework yesterday?
The teacher asked Ali that whether he had done his homework.