plugin/exo/Library/Attempt/PaperGenerator.php
private function generateStructure(Exercise $exercise, Paper $previousPaper = null)
    {
        // The structure of the previous paper if any
        $previousStructure = !empty($previousPaper) ? json_decode($previousPaper->getStructure(), true) : null;

        // Get JSON representation of the full exercise
        $structure = $this->exerciseSerializer->serialize($exercise);
        // Pick questions for each steps and generate structure
        $structure['steps'] = $this->pickSteps($exercise, $previousStructure);

        return $structure;
    }
private function generateStructure(Exercise $exercise, Paper $previousPaper = null)
    {
        // The structure of the previous paper if any
        $previousStructure = !empty($previousPaper) ? json_decode($previousPaper->getStructure(), true) : null;

        // Get JSON representation of the full exercise
        $structure = $this->exerciseSerializer->serialize($exercise);
        // Pick questions for each steps and generate structure
        $structure['steps'] = $this->pickSteps($exercise, $previousStructure);

        return $structure;
    }
private function generateStructure ( Exercise $ exercise , Paper $ previousPaper = null ) { // The structure of the previous paper if any $ previousStructure = ! empty ( $ previousPaper ) ? json_decode ( $ previousPaper -> getStructure ( ) , true ) : null ; // Get JSON representation of the full exercise $ structure = $ this -> exerciseSerializer -> serialize ( $ exercise ) ; // Pick questions for each steps and generate structure $ structure [ 'steps' ] = $ this -> pickSteps ( $ exercise , $ previousStructure ) ; return $ structure ; }
Generates the structure of the attempt based on Exercise and Steps parameters.

@param Exercise $exercise
@param Paper    $previousPaper

@return \stdClass
Generates the structure of the attempt based on Exercise and Steps parameters .