protected function getTemplateQtiVariables()
 {
     $variables = parent::getTemplateQtiVariables();
     $variables['typeIdentifier'] = $this->typeIdentifier;
     $variables['markup'] = $this->markup;
     return $variables;
 }
Esempio n. 2
0
 protected function getTemplateQtiVariables()
 {
     $variables = parent::getTemplateQtiVariables();
     if (!is_null($this->alt)) {
         if ($this->alt instanceof Object) {
             $variables['_alt'] = $this->alt->toQTI();
         } else {
             $variables['_alt'] = (string) $this->alt;
         }
     }
     return $variables;
 }
Esempio n. 3
0
 /**
  * Get the variables for the qti template rendering
  * 
  * @return array
  */
 protected function getTemplateQtiVariables()
 {
     $variables = parent::getTemplateQtiVariables();
     $tag = static::$qtiTagName;
     //search existing mathML ns declaration:
     $ns = $this->getXIncludeNamespace();
     if (empty($ns)) {
         //add one!
         $relatedItem = $this->getRelatedItem();
         if (!is_null($relatedItem)) {
             $ns = 'xi';
             $relatedItem->addNamespace($ns, 'http://www.w3.org/2001/XInclude');
         }
     }
     if (!empty($ns)) {
         //proceed to ns addition:
         $tag = $ns . ':' . $tag;
     }
     $variables['tag'] = $tag;
     return $variables;
 }
 protected function getTemplateQtiVariables()
 {
     $variables = parent::getTemplateQtiVariables();
     // remove the identifier attribute to comply with the standard, it is used interally to manage multiple interactions within a single item.
     unset($variables['attributes']['identifier']);
     $variables['choices'] = '';
     foreach ($this->getChoices() as $choice) {
         $variables['choices'] .= $choice->toQTI();
     }
     return $variables;
 }