Study of contextual similarity of sentences

Hi

I am trying to do a study on the contextual similarity models. The setting is in the classroom, and we wish to determine if a student’s response is relevant to the teacher’s speech.

For example,
Teacher: " whats your favorite sport"
Student: ‘I like pizza’

This means the answer is deviated.

Whats the best way to approach this, Q&A or Semantic Textual Similarity?