示例#1
0
 /**
  * Marshall a QTI file datatype into its PCI JSON Representation.
  *
  * @param \qtism\common\datatypes\File $file
  * @return array
  */
 protected function marshallFile(QtiFile $file)
 {
     $data = array('base' => array('file' => array('mime' => $file->getMimeType(), 'data' => base64_encode($file->getData()))));
     if ($file->hasFilename() === true) {
         $data['base']['file']['name'] = $file->getFilename();
     }
     return $data;
 }