public function import_hints($qo, $questionxml, $withparts = false,
            $withoptions = false, $defaultformat = 'html') {
        if (!isset($questionxml['#']['hint'])) {
            return;
        }

        foreach ($questionxml['#']['hint'] as $hintxml) {
            $hint = $this->import_hint($hintxml, $defaultformat);
            $qo->hint[] = $hint->hint;

            if ($withparts) {
                $qo->hintshownumcorrect[] = $hint->shownumcorrect;
                $qo->hintclearwrong[] = $hint->clearwrong;
            }

            if ($withoptions) {
                $qo->hintoptions[] = $hint->options;
            }
        }
    }
public function import_hints($qo, $questionxml, $withparts = false,
            $withoptions = false, $defaultformat = 'html') {
        if (!isset($questionxml['#']['hint'])) {
            return;
        }

        foreach ($questionxml['#']['hint'] as $hintxml) {
            $hint = $this->import_hint($hintxml, $defaultformat);
            $qo->hint[] = $hint->hint;

            if ($withparts) {
                $qo->hintshownumcorrect[] = $hint->shownumcorrect;
                $qo->hintclearwrong[] = $hint->clearwrong;
            }

            if ($withoptions) {
                $qo->hintoptions[] = $hint->options;
            }
        }
    }
public function import_hints ( $ qo , $ questionxml , $ withparts = false , $ withoptions = false , $ defaultformat = 'html' ) { if ( ! isset ( $ questionxml [ '#' ] [ 'hint' ] ) ) { return ; } foreach ( $ questionxml [ '#' ] [ 'hint' ] as $ hintxml ) { $ hint = $ this -> import_hint ( $ hintxml , $ defaultformat ) ; $ qo -> hint [ ] = $ hint -> hint ; if ( $ withparts ) { $ qo -> hintshownumcorrect [ ] = $ hint -> shownumcorrect ; $ qo -> hintclearwrong [ ] = $ hint -> clearwrong ; } if ( $ withoptions ) { $ qo -> hintoptions [ ] = $ hint -> options ; } } }
Import all the question hints

@param object $qo the question data that is being constructed.
@param array $questionxml The xml representing the question.
@param bool $withparts whether the extra fields relating to parts should be imported.
@param bool $withoptions whether the extra options field should be imported.
@param string $defaultformat the text format to assume for hints that do not specify.
@return array of objects representing the hints in the file.
Import all the question hints