/** * Marshall a QTI directedPair datatype into its PCI JSON Representation. * * @param \qtism\common\datatypes\DirectedPair $directedPair * @return array */ protected function marshallDirectedPair(QtiDirectedPair $directedPair) { return array('base' => array('directedPair' => array($directedPair->getFirst(), $directedPair->getSecond()))); }
private function assertDirectPair(QtiDirectedPair $pair, $expectedFirstValue, $expectedSecondValue) { $this->assertEquals($expectedFirstValue, $pair->getFirst()); $this->assertEquals($expectedSecondValue, $pair->getSecond()); }
/** * Write a DirectedPair in the current binary stream. * * @param \qtism\common\datatypes\DirectedPair $directedPair A DirectedPair object. * @throws \qtism\runtime\storage\binary\QtiBinaryStreamAccessException */ public function writeDirectedPair(QtiDirectedPair $directedPair) { try { $this->writeString($directedPair->getFirst()); $this->writeString($directedPair->getSecond()); } catch (BinaryStreamAccessException $e) { $msg = "An error occured while writing a directedPair."; throw new QtiBinaryStreamAccessException($msg, $this, QtiBinaryStreamAccessException::DIRECTEDPAIR, $e); } }