public function setMaxChoices($maxChoices)
    {
        if (is_int($maxChoices) === true && $maxChoices > 0 || $maxChoices === -1) {

            if ($this->hasMinChoices() === true && $maxChoices > count($this->getSimpleChoices())) {
                $msg = "The 'maxChoices' argument cannot exceed the number of available choices.";
                throw new InvalidArgumentException($msg);
            }

            $this->maxChoices = $maxChoices;
        } else {
            $msg = "The 'maxChoices' argument must be a strictly positive (> 0) integer or -1, '" . gettype($maxChoices) . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }
public function setMaxChoices($maxChoices)
    {
        if (is_int($maxChoices) === true && $maxChoices > 0 || $maxChoices === -1) {

            if ($this->hasMinChoices() === true && $maxChoices > count($this->getSimpleChoices())) {
                $msg = "The 'maxChoices' argument cannot exceed the number of available choices.";
                throw new InvalidArgumentException($msg);
            }

            $this->maxChoices = $maxChoices;
        } else {
            $msg = "The 'maxChoices' argument must be a strictly positive (> 0) integer or -1, '" . gettype($maxChoices) . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }
public function setMaxChoices ( $ maxChoices ) { if ( is_int ( $ maxChoices ) === true && $ maxChoices > 0 || $ maxChoices === - 1 ) { if ( $ this -> hasMinChoices ( ) === true && $ maxChoices > count ( $ this -> getSimpleChoices ( ) ) ) { $ msg = "The 'maxChoices' argument cannot exceed the number of available choices." ; throw new InvalidArgumentException ( $ msg ) ; } $ this -> maxChoices = $ maxChoices ; } else { $ msg = "The 'maxChoices' argument must be a strictly positive (> 0) integer or -1, '" . gettype ( $ maxChoices ) . "' given." ; throw new InvalidArgumentException ( $ msg ) ; } }
Set the maximum number of choices that the candidate may select and order when responding to the interaction.

@param integer $maxChoices A strictly positive (> 0) integer or -1 if no value is specified for the attribuite.
@throws \InvalidArgumentException If $maxChoices is not a strictly positive integer nor -1.
Set the maximum number of choices that the candidate may select and order when responding to the interaction .