MDL-35868: quiz: Use correct attemptnumber when a last attempt exists.