public function testInvalidResponseProcessingTemplate()
 {
     $itemBody = $this->buildItemBodyWithSingleInteraction();
     $responseDeclarations = new QtiComponentCollection();
     $responseDeclarations->attach(ResponseDeclarationBuilder::buildWithMapping('testIdentifierOne', ['Sydney' => [2, false], 'sydney' => [1, false]]));
     $mapper = new MergedTextEntryInteractionMapper('dummyReference', $itemBody, $responseDeclarations, ResponseProcessingTemplate::getFromTemplateUrl(''));
     $question = $mapper->getQuestionType();
     $this->assertNotNull($question);
     $this->assertNull($question->get_validation());
     $this->assertCount(1, LogService::read());
 }
 public function testInvalidResponseProcessingTemplate()
 {
     $interaction = new \qtism\data\content\interactions\TextEntryInteraction('testIdentifier');
     $mapper = new TextEntryInteractionMapper($interaction, null, ResponseProcessingTemplate::getFromTemplateUrl(''));
     $question = $mapper->getQuestionType();
     $this->assertCount(1, LogService::read());
 }
Example #3
0
 private function getResponseProcessingTemplate(ResponseProcessing $responseProcessing = null)
 {
     if ($responseProcessing === null) {
         return ResponseProcessingTemplate::none();
     }
     if ($responseProcessing->getResponseRules()->count()) {
         LogService::log('Does not support custom response processing on <responseProcessing>. Ignoring <responseProcessing>');
         return ResponseProcessingTemplate::unsupported();
     }
     if (!empty($responseProcessing->getTemplateLocation())) {
         LogService::log('Does not support \'templateLocation\' on <responseProcessing>. Ignoring <responseProcessing>');
         return ResponseProcessingTemplate::unsupported();
     }
     if (!empty($responseProcessing->getTemplate())) {
         return ResponseProcessingTemplate::getFromTemplateUrl($responseProcessing->getTemplate());
     }
     return ResponseProcessingTemplate::none();
 }