<FIELDNAME="responseformat"TYPE="char"LENGTH="16"NOTNULL="true"DEFAULT="editor"SEQUENCE="false"COMMENT="The type of input area students should be given for their response."/>
<FIELDNAME="responserequired"TYPE="int"LENGTH="2"NOTNULL="true"DEFAULT="1"SEQUENCE="false"COMMENT="Nonzero if an online text response is optional"/>
<FIELDNAME="responsefieldlines"TYPE="int"LENGTH="4"NOTNULL="true"DEFAULT="15"SEQUENCE="false"COMMENT="Approximate height, in lines, of the input box the students should be given for their response."/>
<FIELDNAME="minwordlimit"TYPE="int"LENGTH="10"NOTNULL="false"SEQUENCE="false"COMMENT="Minimum number of words"/>
<FIELDNAME="maxwordlimit"TYPE="int"LENGTH="10"NOTNULL="false"SEQUENCE="false"COMMENT="Maximum number of words"/>
<FIELDNAME="attachments"TYPE="int"LENGTH="4"NOTNULL="true"DEFAULT="0"SEQUENCE="false"COMMENT="Whether, and how many, attachments a student is allowed to include with their response. -1 means unlimited."/>
<FIELDNAME="attachmentsrequired"TYPE="int"LENGTH="4"NOTNULL="true"DEFAULT="0"SEQUENCE="false"COMMENT="The number of attachments that should be required"/>
<FIELDNAME="graderinfo"TYPE="text"NOTNULL="false"SEQUENCE="false"COMMENT="Information shown to people with permission to manually grade the question, when they are grading."/>
$string['maxwordlimit_help']='If the response requires that students enter text, this is the maximum number of words that each student will be allowed to submit.';
$string['maxwordlimitboundary']='The required maximum word limit ({$a} words) has been exceeded for this essay. Please amend your response and try again.';
$string['minwordlimit']='Minimum word limit';
$string['minwordlimit_help']='If the response requires that students enter text, this is the minimum number of words that each student will be allowed to submit.';
$string['minwordlimitboundary']='The required minimum word limit ({$a} words) has not been reached for this essay. Please amend your response and try again.';
$string['mustattach']='When "No online text" is selected, or responses are optional, you must allow at least one attachment.';
$string['mustrequire']='When "No online text" is selected, or responses are optional, you must require at least one attachment.';
$string['mustrequirefewer']='You cannot require more attachments than you allow.';
And I navigate to "Question bank" in current page administration
@javascript
Scenario: Minimum/Maximum word limit are enabled but not set.
Given I choose "Edit question" action for "essay-min-max" in the question bank
When I set the field "minwordenabled" to "1"
And I click on "Save changes""button"
Then I should see "Minimum word limit is enabled but is not set"
@javascript
Scenario: Minimum/Maximum word limit cannot be set to a negative number.
Given I choose "Edit question" action for "essay-min-max" in the question bank
And I set the field "minwordenabled" to "1"
When I set the field "id_minwordlimit" to "-10"
And I click on "Save changes""button"
Then I should see "Minimum word limit cannot be a negative number"
@javascript
Scenario: Maximum word limit cannot be greater than minimum word limit.
Given I choose "Edit question" action for "essay-min-max" in the question bank
And I set the field "minwordenabled" to "1"
And I set the field "id_minwordlimit" to "500"
And I set the field "maxwordenabled" to "1"
When I set the field "id_maxwordlimit" to "450"
And I click on "Save changes""button"
Then I should see "Maximum world limit must be greater than minimum word limit"
@javascript
Scenario: Modify the question to see 'Minimum word limit' and 'Maximum word limit' are hidden when 'Require text' field is set to 'Text input is optional'
Given I choose "Edit question" action for "essay-min-max" in the question bank
And I should see "Minimum word limit"
And I should see "Maximum word limit"
When I set the field "Require text" to "Text input is optional"