I previously asked about indicating a question in writing, and I got interested in how questions were recognized in the first place. To know if a question mark would be used after a question, one should probably know whether or not such sentences were recognized in the first place. Certainly the concept of a question was known to the Romans, but I want to know whether they made a formal distinction between a declarative and interrogative sentence.
When did grammarians first recognize a question as a type of a sentence? Was it discussed from the very beginning of grammatical literature, or was such classification of sentences a later development?
I am interested in Latin, but if there is something relevant in Greek literature, feel free to share it.