/**
  * Short description of method buildResponseProcessing
  *
  * @access public
  * @author Joel Bout, <*****@*****.**>
  * @param  DOMElement data
  * @param  Item item
  * @return oat\taoQtiItem\model\qti\response\ResponseProcessing
  */
 protected function buildResponseProcessing(DOMElement $data, Item $item)
 {
     $returnValue = null;
     // try template
     try {
         $returnValue = $this->buildTemplateResponseProcessing($data);
         try {
             //warning: require to add interactions to the item to make it work
             $returnValue = TemplatesDriven::takeOverFrom($returnValue, $item);
             common_Logger::d('Processing is Template converted to TemplateDriven', array('TAOITEMS', 'QTI'));
         } catch (TakeoverFailedException $e) {
             common_Logger::d('Processing is Template', array('TAOITEMS', 'QTI'));
         }
     } catch (UnexpectedResponseProcessing $e) {
     }
     //try templatedriven
     if (is_null($returnValue)) {
         try {
             $returnValue = $this->buildTemplatedrivenResponse($data, $item->getInteractions());
             common_Logger::d('Processing is TemplateDriven', array('TAOITEMS', 'QTI'));
         } catch (UnexpectedResponseProcessing $e) {
         }
     }
     // build custom
     if (is_null($returnValue)) {
         try {
             $returnValue = $this->buildCustomResponseProcessing($data);
             common_Logger::d('ResponseProcessing is custom');
         } catch (UnexpectedResponseProcessing $e) {
             // not a Template
             common_Logger::e('custom response processing failed, should never happen', array('TAOITEMS', 'QTI'));
         }
     }
     if (is_null($returnValue)) {
         common_Logger::d('failled to determin ResponseProcessing');
     }
     return $returnValue;
 }