diff --git a/src/qtism/data/AssessmentItem.php b/src/qtism/data/AssessmentItem.php index ffcd4f8b7..792fc903f 100644 --- a/src/qtism/data/AssessmentItem.php +++ b/src/qtism/data/AssessmentItem.php @@ -228,7 +228,7 @@ public function __construct($identifier, $title, $timeDependent, $lang = '') */ public function setIdentifier($identifier): void { - if (Format::isIdentifier($identifier, false)) { + if (Format::isNormalizedString($identifier)) { $this->identifier = $identifier; $this->notify(); } else { diff --git a/test/qtismtest/data/AssessmentItemTest.php b/test/qtismtest/data/AssessmentItemTest.php index 0a379fd42..3b13b4112 100644 --- a/test/qtismtest/data/AssessmentItemTest.php +++ b/test/qtismtest/data/AssessmentItemTest.php @@ -768,9 +768,9 @@ public function getResponseValidityConstraintsProvider(): array public function testCreateAssessmentItemWrongIdentifier(): void { $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage("The identifier argument must be a valid QTI Identifier, '999' given."); + $this->expectExceptionMessage("The identifier argument must be a valid QTI Identifier, '99\t9' given."); - $assessmentItem = new AssessmentItem('999', 'Nine Nine Nine', false); + $assessmentItem = new AssessmentItem("99\t9", 'Nine Nine Nine', false); } public function testCreateAssessmentItemWrongTitle(): void