Adds a step to the Exercise.

@param Step $step

@return $this
8354
public function addStep(Step $step)
    {
        if (!$this->steps->contains($step)) {
            $step->setOrder($this->steps->count());
            $this->steps->add($step);
            $step->setExercise($this);
        }

        return $this;
    }
753943
function executeSteps( $steps )
    {
        $stepNum = 1;
        foreach( $steps as $step )
        {
            $this->execFunction( $step );

            if( $this->lastErrorCode() !== eZSiteInstaller::ERR_OK )
            {
                $res = $this->handleError();
                if( $res === false )
                    $res = $this->defaultErrorHandler();

                if( $res === eZSiteInstaller::ERR_ABORT )
                {
                    $this->reportError( "Aborting execution on step number $stepNum: '". $step['_function'] ."'", 'eZSiteInstaller::postInstall' );
                    break;
                }
            }

            ++$stepNum;
        }
    }
1335668
protected function addStepNextStates(Definition $step, $stepsNextStates, $processName)
    {
        foreach ($stepsNextStates as $stateName => $data) {
            if (NextStateInterface::TYPE_STEP === $data['type']) {
                $step->addMethodCall('addNextState', array(
                    $stateName,
                    $data['type'],
                    new Reference(sprintf('lexik_workflow.process.%s.step.%s', $processName, $data['target']))
                ));

            } elseif (NextStateInterface::TYPE_STEP_OR === $data['type']) {
                $targets = array();

                foreach ($data['target'] as $stepName => $condition) {
                    $serviceId = null;
                    $method = null;

                    if (!empty($condition)) {
                        list($serviceId, $method) = explode(':', $condition);
                    }

                    $targets[] = array(
                        'target'           => new Reference(sprintf('lexik_workflow.process.%s.step.%s', $processName, $stepName)),
                        'condition_object' => null !== $serviceId ? new Reference($serviceId) : null,
                        'condition_method' => $method,
                    );
                }

                $step->addMethodCall('addNextStateOr', array($stateName, $data['type'], $targets));

            } elseif (NextStateInterface::TYPE_PROCESS === $data['type']) {
                $step->addMethodCall('addNextState', array(
                    $stateName,
                    $data['type'],
                    new Reference(sprintf('lexik_workflow.process.%s', $data['target']))
                ));

            } else {
                throw new \InvalidArgumentException(sprintf('Unknown type "%s", please use "step" or "process"', $data['type']));
            }
        }
    }
761570
public function getNext(int $step = 1) : Token {
      $position = ($this->position + $step);
      return $this->items[$position] ?? new Token();
    }
653219
public function setStep($step)
    {
        if (is_int($step)) {
            $this->step = $step;
        } else {
            $msg = "'Step' must be an integer, '" . gettype($step) . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }
1151481
public function addPreviousStep(\Amulen\ShopBundle\Entity\ProductOrderStatus $previousStep = null)
    {
        $this->previousSteps[] = $previousStep;

        return $this;
    }
329865
public static function nextStep($step)
    {
        $steps = self::getSteps();
        $key = self::getStepIndex($step) + 1;
        if (key_exists($key, $steps)) {
            return $steps[$key];
        } else {
            return null;
        }
    }
100671
public AddStepsRequest withStep(StepConfig step) {
        if (this.steps == null) {
            this.steps = new ArrayList<StepConfig>();
        }
        this.steps.add(step);
        return this;
    }
650121
public function advanceTo(int $step): void
    {
        if ($this->maxSteps && $step > $this->maxSteps) {
            $this->maxSteps = $step;
        } elseif ($step < 0) {
            $step = 0;
        }

        $prevPeriod = (int)($this->step / $this->redrawFreq);
        $currPeriod = (int)($step / $this->redrawFreq);
        $this->step = $step;
        $this->percent = $this->maxSteps ? (float)$this->step / $this->maxSteps : 0;

        if ($prevPeriod !== $currPeriod || $this->maxSteps === $step) {
            $this->display();
        }
    }
380869
protected function invokeStep(Step $step, Bootstrap $bootstrap)
    {
        $bootstrap->getSignalSlotDispatcher()->dispatch(__CLASS__, 'beforeInvokeStep', [$step, $this->identifier]);
        $identifier = $step->getIdentifier();
        $step($bootstrap);
        $bootstrap->getSignalSlotDispatcher()->dispatch(__CLASS__, 'afterInvokeStep', [$step, $this->identifier]);
        if (isset($this->steps[$identifier])) {
            foreach ($this->steps[$identifier] as $followingStep) {
                $this->invokeStep($followingStep, $bootstrap);
            }
        }
    }
1284423
public function _beforeStep(Step $step)
    {
        if ($step->getAction() === 'click') {
            $this->debug('Waiting for nprogress to hide...');
            $this->getModule('WebDriver')->waitForElementNotVisible('#nprogress', 10);
        }
    }
231652
public function decrement($table, $column, $step = 1)
    {
        $this->queryBuilder->decrement($table, $column, $step);
        return $this;
    }
1021085
protected function add_step(question_attempt_step $step) {
        $this->steps[] = $step;
        end($this->steps);
        $this->observer->notify_step_added($step, $this, key($this->steps));
    }
659960
protected function getStep( $step )
    {
        $store      = $this->getStore();
        $formSrv    = $this->getServiceLocator()
                           ->get( 'Form' );

        if ( $step == $this->startStep )
        {
            $form  = $formSrv->get( 'Grid\Paragraph\CreateWizard\Start' );
            $model = new StartStep( array(
                'textDomain' => 'paragraph',
            ) );
        }
        else
        {
            $store['type'] = $step;
            $form   = new Form;
            $create = $formSrv->get( 'Grid\Paragraph\Meta\Create' );
            $model  = new WizardStep( array(
                'textDomain'    => 'paragraph',
            ), array(
                'finish'        => true,
                'next'          => 'finish',
            ) );

            if ( $create->has( $step ) )
            {
                foreach ( $create->get( $step ) as $element )
                {
                    $form->add( $element );
                }
            }
            else
            {
                $edit = $formSrv->get( 'Grid\Paragraph\Meta\Edit' );

                if ( $edit->has( $step ) )
                {
                    foreach ( $edit->get( $step ) as $element )
                    {
                        $form->add( $element );
                    }
                }
                else
                {
                    $model->setOption( 'skip', true );
                }
            }
        }

        return $model->setStepForm( $form );
    }
1000833
public void add(MaterialStep step) {
        this.add((Widget) step);
        step.setAxis(getAxis());
        registerHandler(step.addSelectionHandler(this));
        totalSteps++;
    }
124701
public function increment($table, $column, $step = 1)
    {
        $this->queryBuilder->increment($table, $column, $step);
        return $this;
    }
1293882
protected function createStep($step)
    {
        if ( ! $this->stepExist($step))
        {
            throw new \Exception("Step <comment>{$step}</comment> doesn't exist.");
        }

        $class = $this->steps[$step];
        $step  = new $class($this);

        if ( ! ($step instanceof AbstractStep))
        {
            throw new \Exception("Step class <comment>{$class}</comment> should be an instance of AbstractStep.");
        }

        return $step;
    }