The structure 'told someone to do something' or 'told someone not to do something' is used to give instructions or advice. Here, the teacher is instructing the class not to touch anything. Therefore, 'not to touch' is the correct construction.
7. B not to