original_string: protected function initialise_question_instance(question_definition $question, $questiondata) {
          $question->id = $questiondata->id;
          $question->category = $questiondata->category;
          $question->contextid = $questiondata->contextid;
          $question->parent = $questiondata->parent;
          $question->qtype = $this;
          $question->name = $questiondata->name;
          $question->questiontext = $questiondata->questiontext;
          $question->questiontextformat = $questiondata->questiontextformat;
          $question->generalfeedback = $questiondata->generalfeedback;
          $question->generalfeedbackformat = $questiondata->generalfeedbackformat;
          $question->defaultmark = $questiondata->defaultmark + 0;
          $question->length = $questiondata->length;
          $question->penalty = $questiondata->penalty;
          $question->stamp = $questiondata->stamp;
          $question->version = $questiondata->version;
          $question->hidden = $questiondata->hidden;
          $question->idnumber = $questiondata->idnumber;
          $question->timecreated = $questiondata->timecreated;
          $question->timemodified = $questiondata->timemodified;
          $question->createdby = $questiondata->createdby;
          $question->modifiedby = $questiondata->modifiedby;
  
          // Fill extra question fields values.
          $extraquestionfields = $this->extra_question_fields();
          if (is_array($extraquestionfields)) {
              // Omit table name.
              array_shift($extraquestionfields);
              foreach ($extraquestionfields as $field) {
                  $question->$field = $questiondata->options->$field;
              }
          }
  
          $this->initialise_question_hints($question, $questiondata);
      }
code: protected function initialise_question_instance(question_definition $question, $questiondata) {
          $question->id = $questiondata->id;
          $question->category = $questiondata->category;
          $question->contextid = $questiondata->contextid;
          $question->parent = $questiondata->parent;
          $question->qtype = $this;
          $question->name = $questiondata->name;
          $question->questiontext = $questiondata->questiontext;
          $question->questiontextformat = $questiondata->questiontextformat;
          $question->generalfeedback = $questiondata->generalfeedback;
          $question->generalfeedbackformat = $questiondata->generalfeedbackformat;
          $question->defaultmark = $questiondata->defaultmark + 0;
          $question->length = $questiondata->length;
          $question->penalty = $questiondata->penalty;
          $question->stamp = $questiondata->stamp;
          $question->version = $questiondata->version;
          $question->hidden = $questiondata->hidden;
          $question->idnumber = $questiondata->idnumber;
          $question->timecreated = $questiondata->timecreated;
          $question->timemodified = $questiondata->timemodified;
          $question->createdby = $questiondata->createdby;
          $question->modifiedby = $questiondata->modifiedby;
  
          // Fill extra question fields values.
          $extraquestionfields = $this->extra_question_fields();
          if (is_array($extraquestionfields)) {
              // Omit table name.
              array_shift($extraquestionfields);
              foreach ($extraquestionfields as $field) {
                  $question->$field = $questiondata->options->$field;
              }
          }
  
          $this->initialise_question_hints($question, $questiondata);
      }
code_tokens: protected function initialise_question_instance ( question_definition $ question , $ questiondata ) { $ question -> id = $ questiondata -> id ; $ question -> category = $ questiondata -> category ; $ question -> contextid = $ questiondata -> contextid ; $ question -> parent = $ questiondata -> parent ; $ question -> qtype = $ this ; $ question -> name = $ questiondata -> name ; $ question -> questiontext = $ questiondata -> questiontext ; $ question -> questiontextformat = $ questiondata -> questiontextformat ; $ question -> generalfeedback = $ questiondata -> generalfeedback ; $ question -> generalfeedbackformat = $ questiondata -> generalfeedbackformat ; $ question -> defaultmark = $ questiondata -> defaultmark + 0 ; $ question -> length = $ questiondata -> length ; $ question -> penalty = $ questiondata -> penalty ; $ question -> stamp = $ questiondata -> stamp ; $ question -> version = $ questiondata -> version ; $ question -> hidden = $ questiondata -> hidden ; $ question -> idnumber = $ questiondata -> idnumber ; $ question -> timecreated = $ questiondata -> timecreated ; $ question -> timemodified = $ questiondata -> timemodified ; $ question -> createdby = $ questiondata -> createdby ; $ question -> modifiedby = $ questiondata -> modifiedby ; // Fill extra question fields values. $ extraquestionfields = $ this -> extra_question_fields ( ) ; if ( is_array ( $ extraquestionfields ) ) { // Omit table name. array_shift ( $ extraquestionfields ) ; foreach ( $ extraquestionfields as $ field ) { $ question -> $ field = $ questiondata -> options -> $ field ; } } $ this -> initialise_question_hints ( $ question , $ questiondata ) ; }
docstring: Initialise the common question_definition fields.
  @param question_definition $question the question_definition we are creating.
  @param object $questiondata the question data loaded from the database.
docstring_tokens: Initialise the common question_definition fields .