plugin/exo/Serializer/Item/Type/ClozeQuestionSerializer.php
public function serialize(ClozeQuestion $clozeQuestion, array $options = [])
    {
        $serialized = [
            'text' => $clozeQuestion->getText(),
            'holes' => $this->serializeHoles($clozeQuestion),
        ];

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

        return $serialized;
    }
public function serialize(ClozeQuestion $clozeQuestion, array $options = [])
    {
        $serialized = [
            'text' => $clozeQuestion->getText(),
            'holes' => $this->serializeHoles($clozeQuestion),
        ];

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

        return $serialized;
    }
public function serialize ( ClozeQuestion $ clozeQuestion , array $ options = [ ] ) { $ serialized = [ 'text' => $ clozeQuestion -> getText ( ) , 'holes' => $ this -> serializeHoles ( $ clozeQuestion ) , ] ; if ( in_array ( Transfer :: INCLUDE_SOLUTIONS , $ options ) ) { $ serialized [ 'solutions' ] = $ this -> serializeSolutions ( $ clozeQuestion , $ options ) ; } return $ serialized ; }
Converts a Cloze question into a JSON-encodable structure.

@param ClozeQuestion $clozeQuestion
@param array         $options

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