Skip to content

Commit

Permalink
Merge pull request #400 from oat-sa/feat/AUT-3705/update-item-qti-ide…
Browse files Browse the repository at this point in the history
…ntifer

Feat/aut 3705/update item qti identifer
  • Loading branch information
bartlomiejmarszal authored Jul 3, 2024
2 parents 4621e1f + 6bc47c3 commit 28b6382
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/qtism/data/AssessmentItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions test/qtismtest/data/AssessmentItemTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 28b6382

Please sign in to comment.