On the output/rendering side, you could do this with a TeX to HTML translator such as:
The appropriate place to do this is after the following line in qa_post_html_fields(...) in qa-app-format.php:
After installing the Tex to HTML tool on your web server as an executable, the PHP code should:
a) Detect TeX code within $post['content'] (to make this easier, perhaps ask your students to start and finish with a special character sequence).
b) Pass the detected TeX code through to the translator executable using one of PHP's program execution functions (the most appropriate one will depend on exactly how the tool does input and output):
c) Substitute what you get back from the executable into $post['content'].