Both "pupil" the student in school and the pupil of the eye derive from the same Latin word, but took quite diverging paths. The Latin word was pupillus which meant "child", but specifically an orphan child, one who was under the care of a guardian. This is what the word meant when it first entered English. In Wycliffe's translation of the Bible in 1382, for instance, people are adjured to "visit pupils and widows in their tribulacioun". Two hundred years later, in Shakespeare's time, the word was being used to mean a university student; by the 19th century it came to be restricted to schoolchildren.
Meanwhile, the original Latin word was also developing along other lines. The feminine form was pupilla, which, as well as meaning "female child", also meant "doll". The Romans used this word for the opening in the iris becasue if you look into the pupils, tiny reflected images can be seen. The word didn'tgbet borrowed into English in this sense till the 1500s; before that the pupil was called the "black of the eye", or the "sight" or "sight-hole", or, way back in Old English, "the apple of the eye". .The figurative use of "the apple of someone's eye" dates all the way back to King Alfred the Great's time.
Teachers will no doubt be entertained to learn that the word "student", defined in its first sense in the Oxford English Dictionary as "A person who is engaged in or addicted to study" ("addicted"??), is derived from the Latin word studēre (to be eager, zealous, or diligent at studying; to seek to be helpful). Although the language distinguished between students at university and pupils in lower education, starting in about 1900 in the US, the word "student" came to be used of all levels of instruction.
For the origin of the word "truant", see this post:
For the origin of the word "school", see this post:
P.S. If you liked this post, you might enjoy regular updates about English usage and word origins from Wordlady. Receive every new post delivered right to your inbox! Sign up here.
Follow me on twitter: @thewordlady on facebook: https://www.facebook.com/katherine.barber.37
If you find the English language fascinating, you should check out my entertaining history of the English language courses. More info here