Turn off mathescape.
A code listing should be treated as verbatim with high-lighting. Enabling LaTeX commands makes the exam-print-script susceptible to faulty LaTeX code the student may have added to his code. (For example to make his plots look fancy.) Additionally I'd prefer to see the code. Not how the code would be rendered if one ran it through LaTeX.
Showing with 1 addition and 1 deletion