/**
  * Short description of method setTemplate
  *
  * @access public
  * @author Joel Bout, <*****@*****.**>
  * @param  Response response
  * @param  string template
  * @return boolean
  */
 public function setTemplate(ResponseDeclaration $response, $template)
 {
     $response->setHowMatch($template);
     $returnValue = true;
     return (bool) $returnValue;
 }
 public function testSimpleFeedbackCorrect()
 {
     $outcomeFeedback = new OutcomeDeclaration(array('identifier' => 'FEEDBACK'));
     $response2 = new ResponseDeclaration(array('identifier' => 'RESPONSE2'));
     $response2->setHowMatch(Template::MATCH_CORRECT);
     $modalFeedback3 = new ModalFeedback(array('identifier' => 'feedbackThree'));
     $feebackRuleB = new SimpleFeedbackRule($outcomeFeedback, $modalFeedback3);
     $feebackRuleB->setCondition($response2, 'correct');
     $output3 = $feebackRuleB->toQTI();
     $doc = new \DOMDocument();
     $doc->loadXML($output3);
     $data = simplexml_import_dom($doc);
     $patternFeedbackCorrect = '/responseCondition [count(./*) = 1 ] [name(./*[1]) = "responseIf" ] [count(./responseIf/*) = 2 ] [name(./responseIf/*[1]) = "match" ] [name(./responseIf/*[1]/*[1]) = "variable" ] [name(./responseIf/*[1]/*[2]) = "correct" ] [name(./responseIf/*[2]) = "setOutcomeValue" ] [name(./responseIf/setOutcomeValue/*[1]) = "baseValue" ]';
     $match = $data->xpath($patternFeedbackCorrect);
     $responseIdentifier = (string) $data->responseIf->match->variable['identifier'];
     $feedbackOutcomeIdentifier = (string) $data->responseIf->setOutcomeValue['identifier'];
     $feedbackIdentifier = (string) $data->responseIf->setOutcomeValue->baseValue;
     $this->assertEquals($responseIdentifier, 'RESPONSE2');
     $this->assertEquals($feedbackOutcomeIdentifier, 'FEEDBACK');
     $this->assertEquals($feedbackIdentifier, 'feedbackThree');
 }