A pivottable can't do this - the value field in a pivottable MUST use one of the aggregation functions SUM, COUNT, MIN, AVERAGE etc., so it is always a number.
If you create a table with the pupils' names in the first column and the subjects in the top row, you can use formulas to retrieve the grades.
Let's say that your table is in A1:C51 (with headers in A1:C1), and that you enter the pupils' names in E2, E3, ... and the subjects in F1, G1, ...
In F2, enter the following array formula, confirmed with Ctrl+Shift+Enter, not just Enter:
=INDEX($C$2:$C$51,MATCH($E2&F$1,$A$2:$A$51&$B$2:$B$51,0))
Fill this formula down to the last pupil, then right to the last subject.