original_string: protected function recode_legacy_response_data($question, $qsession, $qstates) {
          $qsession->questionid = $question->id;
  
          foreach ($qstates as &$state) {
              $state->question = $question->id;
              $state->answer = $this->restore_recode_legacy_answer($state, $question->qtype);
          }
  
          return array($qsession, $qstates);
      }
code: protected function recode_legacy_response_data($question, $qsession, $qstates) {
          $qsession->questionid = $question->id;
  
          foreach ($qstates as &$state) {
              $state->question = $question->id;
              $state->answer = $this->restore_recode_legacy_answer($state, $question->qtype);
          }
  
          return array($qsession, $qstates);
      }
code_tokens: protected function recode_legacy_response_data ( $ question , $ qsession , $ qstates ) { $ qsession -> questionid = $ question -> id ; foreach ( $ qstates as & $ state ) { $ state -> question = $ question -> id ; $ state -> answer = $ this -> restore_recode_legacy_answer ( $ state , $ question -> qtype ) ; } return array ( $ qsession , $ qstates ) ; }
docstring: Recode any ids in the response data
  @param object $question the question data
  @param object $qsession the question sessions.
  @param array $qstates the question states.
docstring_tokens: Recode any ids in the response data