Set the template identifier of the choice.

@param string $templateIdentifier An empty string if no identifier is provided or a QTI identifier.
@throws \InvalidArgumentException If the given $templateIdentifier is not a valid QTI identifier.
774814
public function setTemplateIdentifier($templateIdentifier)
    {
        if (is_string($templateIdentifier) === true && (empty($templateIdentifier) === true) || Format::isIdentifier($templateIdentifier, false) === true) {
            $this->templateIdentifier = $templateIdentifier;
        } else {
            $msg = "The 'templateIdentifier' must be an empty string or a valid QTI identifier, '" . gettype($templateIdentifier) . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }
1210760
public function setIdentifier($identifier)
    {
        if (Format::isIdentifier($identifier, false) === true) {
            $this->identifier = $identifier;
        } else {
            $msg = "The 'identifier' argument must be a valid QTI identifier, '" . $identifier . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }
473610
public function setDomainValidator(
        ValidatorInterface $domainValidator,
        array $options = []
    ) {
        $this->domainValidator = get_class($domainValidator);
        $this->domainValidatorOptions = $options;
    }
985710
public function setTemplateIdentifier($templateIdentifier)
    {
        if (!is_string($templateIdentifier) && !$templateIdentifier instanceof \Closure) {
            throw new InvalidArgumentType('templateIdentifier', 'string or \Closure', $templateIdentifier);
        }

        $this->templateIdentifier = $templateIdentifier;
    }
570132
public function setPreRelease(array $identifiers)
    {
        foreach ($identifiers as $identifier) {
            if (!Validator::isIdentifier($identifier)) {
                throw new InvalidIdentifierException($identifier);
            }
        }

        $this->preRelease = $identifiers;

        return $this;
    }
162803
protected function validateTemplatePath()
    {
        array_walk($this->templatePath, function($val, $key) {
            if (!is_dir($val)) {
                throw new \InvalidArgumentException(sprintf('Invalid template path: %s', $val));
            }
        });
    }
581049
public function setTemplate($templateId)
    {
        if ($template = $this->getTemplate($templateId)) {
            $this->subject = $template['gctt_subject'];
            $this->bodyBb = $template['gctt_body'];
            $this->setTemplateId($templateId);
        }
    }
596956
public function setIdent($ident)
    {
        if ($ident === null) {
            $this->ident = null;
            return $this;
        }

        if (!is_string($ident)) {
            throw new InvalidArgumentException(
                'Ident needs to be a string'
            );
        }

        $this->ident = $ident;

        return $this;
    }
909781
public function getFromPageIdentifier( PageIdentifier $pageIdentifier ) {
		if ( !$pageIdentifier->identifiesPage() ) {
			throw new InvalidArgumentException( '$pageIdentifier does not identify a page' );
		}

		if ( !is_null( $pageIdentifier->getId() ) ) {
			return $this->getFromPageId( $pageIdentifier->getId() );
		} else {
			return $this->getFromTitle( $pageIdentifier->getTitle() );
		}
	}
275389
public function setResponseIdentifier($responseIdentifier)
    {
        if (is_string($responseIdentifier) === false || empty($responseIdentifier) === true) {
            throw new InvalidArgumentException(
                "The 'responseIdentifier' argument must be a non-empty string."
            );
        }
        
        $this->responseIdentifier = $responseIdentifier;
    }
1287058
protected function setIdAttr($value)
    {
        if (!is_null($value) && !preg_match('/^[0-9]+$/D', $value)) {
            throw new InvalidIdException('Invalid id: ' . $value);
        }

        $this->id = $value;
    }
304129
public function setControllerIdent($ident)
    {
        if (class_exists($ident)) {
            $this->controllerIdent = $ident;

            return $this;
        }

        if (substr($ident, -9) !== '-template') {
            $ident .= '-template';
        }

        $this->controllerIdent = $ident;

        return $this;
    }
828462
public static function setIdentifierName(string $identifier): void
    {
        if (empty($identifier)) {
            throw new InvalidArgumentException("Identifier shouldn't be empty.");
        } elseif (\in_array($identifier, ['password'])) {
            throw new InvalidArgumentException("Identifier [{$identifier}] is not allowed!");
        }

        static::$identifier = $identifier;
    }
741013
public function setTemplate($template)
    {
        if (empty($template)) {
            $this->template = null;
            return $this;
        }

        if (!is_string($template)) {
            throw new InvalidArgumentException(
                'Handler view template must be a string identifier.'
            );
        }

        $this->template = $template;
        return $this;
    }
1044219
public function setResponseIdentifier($responseIdentifier)
    {
        if (Format::isIdentifier($responseIdentifier, false) === true) {
            $this->responseIdentifier = $responseIdentifier;
        } else {
            $msg = "The 'responseIdentifier' argument must be a valid QTI identifier.";
            throw new InvalidArgumentException($msg);
        }
    }
1360968
protected function setIdentifier($identifier)
    {
        if (Utils::isValidVariableIdentifier($identifier)) {
            $this->identifier = $identifier;
        } else {
            $msg = "The identifier '${identifier}' is not a valid QTI Variable Name Identifier.";
            throw new InvalidArgumentException($msg);
        }
    }
505951
public function setIdentifier($identifier)
    {
        if (is_string($identifier) === false || empty($identifier) === true) {
            throw new InvalidArgumentException(
                "The 'identifier' argument must be a non-empty string."
            );
        }
        
        $this->identifier = $identifier;
    }