What data is available about posts, to design analytics to understand student engagement and understanding?

You can customise Discourse to your hearts content with plugins, the main constraints being time :mantelpiece_clock: and money :moneybag: (though some things are harder than others of course)

However, have you thought about coming at this from the other direction?

What do you actually want?

There are quite a lot of analytics at your disposal out of the box. Something might already exist that in some way meets your requirement …

Also make sure you make the explicit distinction between Topics and Posts in whatever you specify.