public function serialize(GraphicQuestion $graphicQuestion, array $options = [])
    {
        $serialized = [
            'image' => $this->serializeImage($graphicQuestion),
            'pointers' => $graphicQuestion->getAreas()->count(),
            'pointerMode' => 'pointer', // the feature is not yet implemented, but the JSON schema already requires it
        ];

        if (in_array(Transfer::INCLUDE_SOLUTIONS, $options)) {
            $serialized['solutions'] = $this->serializeSolutions($graphicQuestion);
        }

        return $serialized;
    }
public function serialize(GraphicQuestion $graphicQuestion, array $options = [])
    {
        $serialized = [
            'image' => $this->serializeImage($graphicQuestion),
            'pointers' => $graphicQuestion->getAreas()->count(),
            'pointerMode' => 'pointer', // the feature is not yet implemented, but the JSON schema already requires it
        ];

        if (in_array(Transfer::INCLUDE_SOLUTIONS, $options)) {
            $serialized['solutions'] = $this->serializeSolutions($graphicQuestion);
        }

        return $serialized;
    }
public function serialize ( GraphicQuestion $ graphicQuestion , array $ options = [ ] ) { $ serialized = [ 'image' => $ this -> serializeImage ( $ graphicQuestion ) , 'pointers' => $ graphicQuestion -> getAreas ( ) -> count ( ) , 'pointerMode' => 'pointer' , // the feature is not yet implemented, but the JSON schema already requires it ] ; if ( in_array ( Transfer :: INCLUDE_SOLUTIONS , $ options ) ) { $ serialized [ 'solutions' ] = $ this -> serializeSolutions ( $ graphicQuestion ) ; } return $ serialized ; }
Converts a Graphic question into a JSON-encodable structure.

@param GraphicQuestion $graphicQuestion
@param array           $options

@return array
Converts a Graphic question into a JSON - encodable structure .