public function testMarshallMaximal() { $assessmentSection1 = new ExtendedAssessmentSection('section1', 'My Section 1', true); $assessmentSection2 = new ExtendedAssessmentSection('section2', 'My Section 2', true); $preCondition = new PreCondition(new BaseValue(BaseType::BOOLEAN, true)); $branching = new BranchRule(new BaseValue(BaseType::BOOLEAN, true), 'EXIT_TESTPART'); $itemSessionControl = new ItemSessionControl(); $itemSessionControl->setShowSolution(true); $timeLimits = new TimeLimits(null, new QtiDuration('PT1M40S')); $p = new P(); $p->setContent(new InlineCollection(array(new TextRun('Prima!')))); $testFeedback = new TestFeedback('feedback1', 'show', new FlowStaticCollection(array($p))); $testFeedback->setTitle('hello!'); $testFeedback->setAccess(TestFeedbackAccess::AT_END); $testFeedback->setShowHide(ShowHide::SHOW); $testFeedbackRef = new TestFeedbackRef('feedback1', 'show', TestFeedbackAccess::AT_END, ShowHide::SHOW, './TF01.xml'); $assessmentSections = new AssessmentSectionCollection(array($assessmentSection1, $assessmentSection2)); $preConditions = new PreConditionCollection(array($preCondition)); $branchings = new BranchRuleCollection(array($branching)); $testFeedbacks = new TestFeedbackCollection(array($testFeedback)); $testFeedbackRefs = new TestFeedbackRefCollection(array($testFeedbackRef)); $extendedTestPart = new ExtendedTestPart('part1', $assessmentSections); $extendedTestPart->setPreConditions($preConditions); $extendedTestPart->setBranchRules($branchings); $extendedTestPart->setItemSessionControl($itemSessionControl); $extendedTestPart->setTimeLimits($timeLimits); $extendedTestPart->setTestFeedbacks($testFeedbacks); $extendedTestPart->setTestFeedbackRefs($testFeedbackRefs); $factory = new CompactMarshallerFactory(); $element = $factory->createMarshaller($extendedTestPart)->marshall($extendedTestPart); $dom = new DOMDocument('1.0', 'UTF-8'); $element = $dom->importNode($element, true); $this->assertEquals('<testPart identifier="part1" navigationMode="linear" submissionMode="individual"><preCondition><baseValue baseType="boolean">true</baseValue></preCondition><branchRule target="EXIT_TESTPART"><baseValue baseType="boolean">true</baseValue></branchRule><itemSessionControl maxAttempts="1" showFeedback="false" allowReview="true" showSolution="true" allowComment="false" allowSkipping="true" validateResponses="false"/><timeLimits maxTime="100" allowLateSubmission="false"/><assessmentSection identifier="section1" required="false" fixed="false" title="My Section 1" visible="true" keepTogether="true"/><assessmentSection identifier="section2" required="false" fixed="false" title="My Section 2" visible="true" keepTogether="true"/><testFeedback access="atEnd" outcomeIdentifier="show" showHide="show" identifier="feedback1" title="hello!"><p>Prima!</p></testFeedback><testFeedbackRef identifier="feedback1" outcomeIdentifier="show" access="atEnd" showHide="show" href="./TF01.xml"/></testPart>', $dom->saveXML($element)); }