protected function appendAttributes(DOMDocumentFragment $fragment, QtiComponent $component, $base = '') { parent::appendAttributes($fragment, $component, $base); $this->additionalClass('qti-inlineInteraction'); $this->additionalClass('qti-textEntryInteraction'); $fragment->firstChild->setAttribute('type', 'text'); }
protected function appendAttributes(DOMDocumentFragment $fragment, QtiComponent $component, $base = '') { parent::appendAttributes($fragment, $component, $base); $this->additionalClass('qti-blockInteraction'); $this->additionalClass('qti-extendedTextInteraction'); $fragment->firstChild->setAttribute('data-min-strings', $component->getMinStrings()); $fragment->firstChild->setAttribute('data-format', TextFormat::getNameByConstant($component->getFormat())); if ($component->hasMaxStrings() === true) { $fragment->firstChild->setAttribute('data-max-strings', $component->getMaxStrings()); } if ($component->hasExpectedLines() === true) { $fragment->firstChild->setAttribute('data-expected-lines', $component->getExpectedLines()); } }