private function generateLearnosityToQtiDocumentation() { $questionTypeDocumentation = []; $responsesSchemas = $this->schemasService->getResponsesSchemas(); foreach ($responsesSchemas as $questionType => $data) { if (in_array($questionType, QtiExportConstant::$supportedQuestionTypes)) { /** @var QuestionTypeDocumentationInterface $mapperClass */ $mapperClass = 'LearnosityQti\\Processors\\QtiV2\\Out\\Documentation\\QuestionTypes\\' . ucfirst($questionType) . 'Documentation'; $documentation = $mapperClass::getDocumentation(); foreach (array_keys($this->generateAtributeTable($data['attributes'])) as $flattenedAttributeName) { // TODO: Need to check new or non-existing attribute name in case our schemas change if (!in_array($flattenedAttributeName, array_keys($documentation))) { $documentation[$flattenedAttributeName] = LearnosityDoc::none(); } } // TODO: Hack here, hide all the `validation` attributes $documentationToDisplay = []; foreach ($documentation as $attributeName => $doc) { if (!StringUtil::startsWith($attributeName, 'validation')) { $documentationToDisplay[$attributeName] = $doc; } } $questionTypeDocumentation[$questionType] = ['mapping' => $documentationToDisplay, 'introduction' => $mapperClass::getIntroductionNotes()]; } } return ['questionTypes' => $questionTypeDocumentation, 'unsupportedQuestionTypes' => array_keys(array_diff_key($responsesSchemas, $questionTypeDocumentation))]; }