protected function slot_fraction($tablerow, $slot) {
        $qa = $this->get_question_attempt($tablerow->usageid, $slot);
        $submissionsteps = $qa->get_steps_with_submitted_response_iterator();
        $step = $submissionsteps[$tablerow->try];
        if ($step === null) {
            return null;
        }
        if ($this->is_last_try($tablerow, $slot, $tablerow->try)) {
            // If this is the last try then the step with the try data does not contain the correct fraction. We need to
            // use the last step's fraction, after the attempt has been finished.
            return $qa->get_fraction();
        }
        return $step->get_fraction();
    }