Beispiel #1
0
 protected function getTemplateQtiVariables()
 {
     $variables = parent::getTemplateQtiVariables();
     $variables['stylesheets'] = '';
     foreach ($this->stylesheets as $stylesheet) {
         $variables['stylesheets'] .= $stylesheet->toQTI();
     }
     $variables['responses'] = '';
     foreach ($this->responses as $response) {
         $variables['responses'] .= $response->toQTI();
     }
     $variables['outcomes'] = '';
     foreach ($this->outcomes as $outcome) {
         $variables['outcomes'] .= $outcome->toQTI();
     }
     $variables['feedbacks'] = '';
     foreach ($this->modalFeedbacks as $feedback) {
         $variables['feedbacks'] .= $feedback->toQTI();
     }
     $namespaces = $this->getNamespaces();
     // remove standard namespaces
     unset($namespaces['']);
     unset($namespaces['xml']);
     unset($namespaces['xsi']);
     $variables['namespaces'] = $namespaces;
     // render the responseProcessing
     $renderedResponseProcessing = '';
     $responseProcessing = $this->getResponseProcessing();
     if (isset($responseProcessing)) {
         if ($responseProcessing instanceof TemplatesDriven) {
             $renderedResponseProcessing = $responseProcessing->buildQTI();
         } else {
             $renderedResponseProcessing = $responseProcessing->toQTI();
         }
     }
     $variables['renderedResponseProcessing'] = $renderedResponseProcessing;
     return $variables;
 }
Beispiel #2
0
 protected function getTemplateQtiVariables()
 {
     $variables = parent::getTemplateQtiVariables();
     $variables['stylesheets'] = '';
     foreach ($this->stylesheets as $stylesheet) {
         $variables['stylesheets'] .= $stylesheet->toQTI();
     }
     $variables['responses'] = '';
     foreach ($this->responses as $response) {
         $variables['responses'] .= $response->toQTI();
     }
     $variables['outcomes'] = '';
     foreach ($this->outcomes as $outcome) {
         $variables['outcomes'] .= $outcome->toQTI();
     }
     $variables['feedbacks'] = '';
     foreach ($this->modalFeedbacks as $feedback) {
         $variables['feedbacks'] .= $feedback->toQTI();
     }
     $variables['namespaces'] = $this->getNamespaces();
     $schemaLocations = '';
     foreach ($this->getSchemaLocations() as $uri => $url) {
         $schemaLocations .= $uri . ' ' . $url . ' ';
     }
     $variables['schemaLocations'] = trim($schemaLocations);
     $nsXsi = $this->getNamespace('http://www.w3.org/2001/XMLSchema-instance');
     $variables['xsi'] = $nsXsi ? $nsXsi . ':' : 'xsi:';
     // render the responseProcessing
     $renderedResponseProcessing = '';
     $responseProcessing = $this->getResponseProcessing();
     if (isset($responseProcessing)) {
         if ($responseProcessing instanceof TemplatesDriven) {
             $renderedResponseProcessing = $responseProcessing->buildQTI();
         } else {
             $renderedResponseProcessing = $responseProcessing->toQTI();
         }
     }
     // move item CSS class to itemBody
     $variables['class'] = $this->getAttributeValue('class');
     unset($variables['attributes']['class']);
     $variables['renderedResponseProcessing'] = $renderedResponseProcessing;
     $variables['apipAccessibility'] = $this->getApipAccessibility();
     return $variables;
 }