protected function buildResponseDeclaration($responseIdentifier, $validation) { /** @var mcq_validation $validation */ $responseDeclaration = new ResponseDeclaration($responseIdentifier); $responseDeclaration->setCardinality($this->isMultipleResponse ? Cardinality::MULTIPLE : Cardinality::SINGLE); $responseDeclaration->setBaseType(BaseType::IDENTIFIER); $correctResponseBuilder = new QtiCorrectResponseBuilder(); $responseDeclaration->setCorrectResponse($correctResponseBuilder->buildWithBaseTypeIdentifier($validation, $this->valueIdentifierMap)); return $responseDeclaration; }
protected function buildResponseDeclaration($responseIdentifier, $validation) { /** @var tokenhighlight_validation $validation */ $responseDeclaration = new ResponseDeclaration($responseIdentifier, BaseType::IDENTIFIER); $answersCount = count($validation->get_valid_response()->get_value()); $responseDeclaration->setCardinality($answersCount <= 1 ? Cardinality::SINGLE : Cardinality::MULTIPLE); $correctResponseBuilder = new QtiCorrectResponseBuilder(); $responseDeclaration->setCorrectResponse($correctResponseBuilder->buildWithBaseTypeIdentifier($validation, $this->indexIdentifierMap)); return $responseDeclaration; }
protected function buildResponseDeclaration($responseIdentifier, $validation) { /** @var orderlist_validation $validation */ $responseDeclaration = new ResponseDeclaration($responseIdentifier); $responseDeclaration->setCardinality(Cardinality::ORDERED); $responseDeclaration->setBaseType(BaseType::IDENTIFIER); $correctResponseBuilder = new QtiCorrectResponseBuilder(); $responseDeclaration->setCorrectResponse($correctResponseBuilder->buildWithBaseTypeIdentifier($validation, $this->indexIdentifiersMap)); return $responseDeclaration; }
protected function buildResponseDeclaration($responseIdentifier, $validation) { $responseDeclaration = new ResponseDeclaration($responseIdentifier); $responseDeclaration->setCardinality(Cardinality::SINGLE); $responseDeclaration->setBaseType(BaseType::STRING); $correctResponseBuilder = new QtiCorrectResponseBuilder(); $responseDeclaration->setCorrectResponse($correctResponseBuilder->build($validation)); $mappingResponseBuilder = new QtiMappingBuilder(); $mapping = $mappingResponseBuilder->build($validation); $responseDeclaration->setMapping($mapping); foreach ($mapping->getMapEntries() as $mapEntry) { /** @var MapEntry $mapEntry */ $mapEntry->setCaseSensitive($this->isCaseSensitive); } return $responseDeclaration; }