-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
26 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License | ||
|
@@ -17,7 +19,7 @@ | |
* | ||
* Copyright (c) 2013-2020 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT); | ||
* | ||
* @author Jérôme Bogaerts <[email protected]> | ||
* @author Jérôme Bogaerts <[email protected]> | ||
* @license GPLv2 | ||
*/ | ||
|
||
|
@@ -47,7 +49,7 @@ class ExtendedTextInteraction extends BlockInteraction implements StringInteract | |
* If the string interaction is bound to a numeric response variable then the base attribute | ||
* must be used to set the number base in which to interpret the value entered by the candidate. | ||
* | ||
* @var int | ||
* @var int | ||
* @qtism-bean-property | ||
*/ | ||
private $base = 10; | ||
|
@@ -59,7 +61,7 @@ class ExtendedTextInteraction extends BlockInteraction implements StringInteract | |
* entered by the candidate can also be captured by binding the interaction to a second | ||
* response variable (of base-type string). | ||
* | ||
* @var string | ||
* @var string | ||
* @qtism-bean-property | ||
*/ | ||
private $stringIdentifier = ''; | ||
|
@@ -72,7 +74,7 @@ class ExtendedTextInteraction extends BlockInteraction implements StringInteract | |
* use the value of this attribute to set the size of the response box, where applicable. | ||
* This is not a validity constraint. | ||
* | ||
* @var int|null | ||
* @var int|null | ||
* @qtism-bean-property | ||
*/ | ||
private $expectedLength; | ||
|
@@ -87,7 +89,7 @@ class ExtendedTextInteraction extends BlockInteraction implements StringInteract | |
* responses is required for progression through a test. This could be done by providing | ||
* an illustrative sample response in the prompt, for example. | ||
* | ||
* @var string | ||
* @var string | ||
* @qtism-bean-property | ||
*/ | ||
private $patternMask = ''; | ||
|
@@ -102,7 +104,7 @@ class ExtendedTextInteraction extends BlockInteraction implements StringInteract | |
* default placeholder text when this is required. Implementors should be aware of the | ||
* issues concerning the use of default values described in the section on Response Variables. | ||
* | ||
* @var string | ||
* @var string | ||
* @qtism-bean-property | ||
*/ | ||
private $placeholderText = ''; | ||
|
@@ -115,7 +117,7 @@ class ExtendedTextInteraction extends BlockInteraction implements StringInteract | |
* to control the maximum number of separate strings accepted from the candidate. When | ||
* multiple strings are accepted, expectedLength applies to each string. | ||
* | ||
* @var int | ||
* @var int | ||
* @qtism-bean-property | ||
*/ | ||
private $maxStrings = -1; | ||
|
@@ -131,7 +133,7 @@ class ExtendedTextInteraction extends BlockInteraction implements StringInteract | |
* non-empty string to form a valid response. More complex constraints on the form of | ||
* the string can be controlled with the patternMask attribute. | ||
* | ||
* @var int | ||
* @var int | ||
* @qtism-bean-property | ||
*/ | ||
private $minStrings = 0; | ||
|
@@ -144,7 +146,7 @@ class ExtendedTextInteraction extends BlockInteraction implements StringInteract | |
* Engine should use the value of this attribute to set the size of the response box, | ||
* where applicable. This is not a validity constraint. | ||
* | ||
* @var int|null | ||
* @var int|null | ||
* @qtism-bean-property | ||
*/ | ||
private $expectedLines; | ||
|
@@ -157,22 +159,19 @@ class ExtendedTextInteraction extends BlockInteraction implements StringInteract | |
* interpreted by response processing engines and also controls the way it should be | ||
* captured in the delivery engine. | ||
* | ||
* @var int | ||
* @var int | ||
* @qtism-bean-property | ||
*/ | ||
private $format = TextFormat::PLAIN; | ||
|
||
// This option disable also validation for patternMask | ||
private $isDisabledMaxWordValidation = false; | ||
|
||
/** | ||
* Create a new ExtendedTextInteraction object. | ||
* | ||
* @param string $responseIdentifier The identifier of the associated response variable. | ||
* @param string $id The id of the bodyElement. | ||
* @param string $class The class of the bodyElement. | ||
* @param string $lang The lang of the bodyElement. | ||
* @param string $label The label of the bodyElement. | ||
* @param string $responseIdentifier The identifier of the associated response variable. | ||
* @param string $id The id of the bodyElement. | ||
* @param string $class The class of the bodyElement. | ||
* @param string $lang The lang of the bodyElement. | ||
* @param string $label The label of the bodyElement. | ||
* @throws InvalidArgumentException If any of the arguments is invalid. | ||
*/ | ||
public function __construct($responseIdentifier, $id = '', $class = '', $lang = '', $label = '') | ||
|
@@ -184,7 +183,7 @@ public function __construct($responseIdentifier, $id = '', $class = '', $lang = | |
* If the interaction is bound to a numeric response variable, get the number base in which | ||
* to interpret the value entered by the candidate. | ||
* | ||
* @param int $base A positive (>= 0) integer. | ||
* @param int $base A positive (>= 0) integer. | ||
* @throws InvalidArgumentException If $base is not a positive integer. | ||
*/ | ||
public function setBase($base): void | ||
|
@@ -213,7 +212,7 @@ public function getBase(): int | |
* plain text entered by the candidate will be stored. If $stringIdentifier is an empty string, it means that | ||
* there is no value for the stringIdentifier attribute. | ||
* | ||
* @param string $stringIdentifier A QTI Identifier or an empty string. | ||
* @param string $stringIdentifier A QTI Identifier or an empty string. | ||
* @throws InvalidArgumentException If $stringIdentifier is not a valid QTIIdentifier nor an empty string. | ||
*/ | ||
public function setStringIdentifier($stringIdentifier): void | ||
|
@@ -252,7 +251,7 @@ public function hasStringIdentifier(): bool | |
* Set the hint to the candidate about the expected overall length of its | ||
* response. A null value unsets expectedLength. | ||
* | ||
* @param int|null $expectedLength A non-negative integer (>= 0) or null to unset expectedLength. | ||
* @param int|null $expectedLength A non-negative integer (>= 0) or null to unset expectedLength. | ||
* @throws InvalidArgumentException If $expectedLength is not a non-negative integer nor null. | ||
*/ | ||
public function setExpectedLength($expectedLength): void | ||
|
@@ -294,7 +293,7 @@ public function hasExpectedLength(): bool | |
* Set the pattern mask specifying an XML Schema 2 regular expression that the candidate response must | ||
* match with. If $patternMask is an empty string, it means that there is no value defined for patternMask. | ||
* | ||
* @param string $patternMask An XML Schema 2 regular expression or an empty string. | ||
* @param string $patternMask An XML Schema 2 regular expression or an empty string. | ||
* @throws InvalidArgumentException If $patternMask is not a string value. | ||
*/ | ||
public function setPatternMask($patternMask): void | ||
|
@@ -333,7 +332,7 @@ public function hasPatternMask(): bool | |
* Set a placeholder text. If $placeholderText is an empty string, it means that no value is defined | ||
* for the placeholderText attribute. | ||
* | ||
* @param string $placeholderText A placeholder text or an empty string. | ||
* @param string $placeholderText A placeholder text or an empty string. | ||
* @throws InvalidArgumentException If $placeholderText is not a string value. | ||
*/ | ||
public function setPlaceholderText($placeholderText): void | ||
|
@@ -371,7 +370,7 @@ public function hasPlaceholderText(): bool | |
* If the interaction is bound to a numeric response variable, get the number of separate strings | ||
* accepted from the candidate. If $maxStrings is -1, it means no value is defined for the attribute. | ||
* | ||
* @param int $maxStrings A strictly positive (> 0) integer or -1. | ||
* @param int $maxStrings A strictly positive (> 0) integer or -1. | ||
* @throws InvalidArgumentException If $maxStrings is not a strictly positive integer nor -1. | ||
*/ | ||
public function setMaxStrings($maxStrings): void | ||
|
@@ -408,7 +407,7 @@ public function hasMaxStrings(): bool | |
/** | ||
* Set the minimum separate (non-empty) strings required from the candidate. | ||
* | ||
* @param string $minStrings A positive (>= 0) integer. | ||
* @param string $minStrings A positive (>= 0) integer. | ||
* @throws InvalidArgumentException If $minStrings is not a positive integer. | ||
*/ | ||
public function setMinStrings($minStrings): void | ||
|
@@ -435,7 +434,7 @@ public function getMinStrings(): int | |
* Set the hint to the candidate about the expected number of lines of its | ||
* response. A null value unsets expectedLines. | ||
* | ||
* @param int|null $expectedLines A non-negative integer (>= 0) or null. | ||
* @param int|null $expectedLines A non-negative integer (>= 0) or null. | ||
* @throws InvalidArgumentException If $expectedLines is not a non-negative integer nor null. | ||
*/ | ||
public function setExpectedLines($expectedLines): void | ||
|
@@ -476,7 +475,7 @@ public function hasExpectedLines(): bool | |
/** | ||
* Set the format of the text entered by the candidate. | ||
* | ||
* @param int $format A value from the TextFormat enumeration. | ||
* @param int $format A value from the TextFormat enumeration. | ||
* @throws InvalidArgumentException If $format is not a value from the TextFormat enumeration. | ||
*/ | ||
public function setFormat($format): void | ||
|