public function getCsvAnswers(AbstractItem $item, Answer $answer)
    {
        $data = json_decode($answer->getData(), true);
        $answers = [];

        foreach ($item->getChoices() as $choice) {
            if (is_array($data) && in_array($choice->getUuid(), $data)) {
                $answers[] = $choice->getData();
            }
        }

        $compressor = new ArrayCompressor();

        return [$compressor->compress($answers)];
    }
public function getCsvAnswers(AbstractItem $item, Answer $answer)
    {
        $data = json_decode($answer->getData(), true);
        $answers = [];

        foreach ($item->getChoices() as $choice) {
            if (is_array($data) && in_array($choice->getUuid(), $data)) {
                $answers[] = $choice->getData();
            }
        }

        $compressor = new ArrayCompressor();

        return [$compressor->compress($answers)];
    }
public function getCsvAnswers ( AbstractItem $ item , Answer $ answer ) { $ data = json_decode ( $ answer -> getData ( ) , true ) ; $ answers = [ ] ; foreach ( $ item -> getChoices ( ) as $ choice ) { if ( is_array ( $ data ) && in_array ( $ choice -> getUuid ( ) , $ data ) ) { $ answers [ ] = $ choice -> getData ( ) ; } } $ compressor = new ArrayCompressor ( ) ; return [ $ compressor -> compress ( $ answers ) ] ; }
Exports choice answers.

@param ChoiceQuestion $item
@param Answer         $answer
Exports choice answers .