/**
  * Write a DirectedPair in the current binary stream.
  * 
  * @param DirectedPair $directedPair A DirectedPair object.
  * @throws QtiBinaryStreamAccessException
  */
 public function writeDirectedPair(DirectedPair $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);
     }
 }
Beispiel #2
0
 /**
  * Marshall a QTI directedPair datatype into its PCI JSON Representation.
  *
  * @param \qtism\common\datatypes\DirectedPair $directedPair
  * @return array
  */
 protected function marshallDirectedPair(DirectedPair $directedPair)
 {
     return array('base' => array('directedPair' => array($directedPair->getFirst(), $directedPair->getSecond())));
 }