original_string: 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();
      }
code: 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();
      }
code_tokens: 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 ( ) ; }
docstring: The grade for this slot after this try.
  
  @param object $tablerow attempt data from db.
  @param int $slot Slot number.
  @return float The fraction.
docstring_tokens: The grade for this slot after this try .