plugin/exo/Serializer/Item/Type/BooleanQuestionSerializer.php
public function serialize(BooleanQuestion $question, array $options = [])
    {
        // Serializes choices
        $choices = $this->serializeChoices($question, $options);

        if (in_array(Transfer::SHUFFLE_ANSWERS, $options)) {
            shuffle($choices);
        }

        $serialized = ['choices' => $choices];

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

        return $serialized;
    }
public function serialize(BooleanQuestion $question, array $options = [])
    {
        // Serializes choices
        $choices = $this->serializeChoices($question, $options);

        if (in_array(Transfer::SHUFFLE_ANSWERS, $options)) {
            shuffle($choices);
        }

        $serialized = ['choices' => $choices];

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

        return $serialized;
    }
public function serialize ( BooleanQuestion $ question , array $ options = [ ] ) { // Serializes choices $ choices = $ this -> serializeChoices ( $ question , $ options ) ; if ( in_array ( Transfer :: SHUFFLE_ANSWERS , $ options ) ) { shuffle ( $ choices ) ; } $ serialized = [ 'choices' => $ choices ] ; if ( in_array ( Transfer :: INCLUDE_SOLUTIONS , $ options ) ) { $ serialized [ 'solutions' ] = $ this -> serializeSolutions ( $ question ) ; } return $ serialized ; }
Converts a Boolean question into a JSON-encodable structure.

@param BooleanQuestion $question
@param array           $options

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