plugin/exo/Serializer/Item/Type/OpenQuestionSerializer.php
public function serialize(OpenQuestion $openQuestion, array $options = [])
    {
        $serialized = [
            'contentType' => 'text',
            'maxLength' => $openQuestion->getAnswerMaxLength(),
        ];

        if (in_array(Transfer::INCLUDE_SOLUTIONS, $options)) {
            $serialized['solutions'] = [];
        }

        return $serialized;
    }
public function serialize(OpenQuestion $openQuestion, array $options = [])
    {
        $serialized = [
            'contentType' => 'text',
            'maxLength' => $openQuestion->getAnswerMaxLength(),
        ];

        if (in_array(Transfer::INCLUDE_SOLUTIONS, $options)) {
            $serialized['solutions'] = [];
        }

        return $serialized;
    }
public function serialize ( OpenQuestion $ openQuestion , array $ options = [ ] ) { $ serialized = [ 'contentType' => 'text' , 'maxLength' => $ openQuestion -> getAnswerMaxLength ( ) , ] ; if ( in_array ( Transfer :: INCLUDE_SOLUTIONS , $ options ) ) { $ serialized [ 'solutions' ] = [ ] ; } return $ serialized ; }
Converts a Open question into a JSON-encodable structure.

@param OpenQuestion $openQuestion
@param array        $options

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