I think I found it: quiz_calculate_best_attempt in locallib.php.
Jacob
Quiz
Where in the code is a quiz grade calculated?
Dán digaštallan lea giddejuvvon, it don sáhte šat vástidit dasa.