original_string: public function initialise_for_subq($step, $variant = null) {
          $newsubqstat = new calculated_for_subquestion($step, $variant);
          if ($variant === null) {
              $this->subquestionstats[$step->questionid] = $newsubqstat;
          } else {
              $this->subquestionstats[$step->questionid]->variantstats[$variant] = $newsubqstat;
          }
      }
code: public function initialise_for_subq($step, $variant = null) {
          $newsubqstat = new calculated_for_subquestion($step, $variant);
          if ($variant === null) {
              $this->subquestionstats[$step->questionid] = $newsubqstat;
          } else {
              $this->subquestionstats[$step->questionid]->variantstats[$variant] = $newsubqstat;
          }
      }
code_tokens: public function initialise_for_subq ( $ step , $ variant = null ) { $ newsubqstat = new calculated_for_subquestion ( $ step , $ variant ) ; if ( $ variant === null ) { $ this -> subquestionstats [ $ step -> questionid ] = $ newsubqstat ; } else { $ this -> subquestionstats [ $ step -> questionid ] -> variantstats [ $ variant ] = $ newsubqstat ; } }
docstring: Set up a calculated_for_subquestion instance ready to store a randomly selected question's stats.
  
  @param object     $step
  @param int|null   $variant Is this to keep track of a variant's stats? If so what is the variant, if not null.
docstring_tokens: Set up a calculated_for_subquestion instance ready to store a randomly selected question s stats .