Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
moodle
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
moodle
moodle
Commits
6fc462ad
Commit
6fc462ad
authored
Jan 12, 2021
by
Tim Hunt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDL-68597 qtype_essay: switch the form to consistently use hideIf
parent
d9b0da85
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
question/type/essay/edit_essay_form.php
question/type/essay/edit_essay_form.php
+9
-7
No files found.
question/type/essay/edit_essay_form.php
View file @
6fc462ad
...
...
@@ -48,12 +48,12 @@ class qtype_essay_edit_form extends question_edit_form {
$mform
->
addElement
(
'select'
,
'responserequired'
,
get_string
(
'responserequired'
,
'qtype_essay'
),
$qtype
->
response_required_options
());
$mform
->
setDefault
(
'responserequired'
,
1
);
$mform
->
disabled
If
(
'responserequired'
,
'responseformat'
,
'eq'
,
'noinline'
);
$mform
->
hide
If
(
'responserequired'
,
'responseformat'
,
'eq'
,
'noinline'
);
$mform
->
addElement
(
'select'
,
'responsefieldlines'
,
get_string
(
'responsefieldlines'
,
'qtype_essay'
),
$qtype
->
response_sizes
());
$mform
->
setDefault
(
'responsefieldlines'
,
15
);
$mform
->
disabled
If
(
'responsefieldlines'
,
'responseformat'
,
'eq'
,
'noinline'
);
$mform
->
hide
If
(
'responsefieldlines'
,
'responseformat'
,
'eq'
,
'noinline'
);
// Create a text box that can be enabled/disabled for max/min word limits options.
$wordlimitoptions
=
[
'size'
=>
'6'
,
'maxlength'
=>
'6'
];
...
...
@@ -64,7 +64,8 @@ class qtype_essay_edit_form extends question_edit_form {
$mform
->
addGroup
(
$mingrp
,
'mingroup'
,
get_string
(
'minwordlimit'
,
'qtype_essay'
),
' '
,
false
);
$mform
->
addHelpButton
(
'mingroup'
,
'minwordlimit'
,
'qtype_essay'
);
$mform
->
disabledIf
(
'minwordlimit'
,
'minwordenabled'
,
'notchecked'
);
$mform
->
hideIf
(
'mingroup'
,
'responserequired'
,
'0'
);
$mform
->
hideIf
(
'mingroup'
,
'responserequired'
,
'eq'
,
'0'
);
$mform
->
hideIf
(
'mingroup'
,
'responseformat'
,
'eq'
,
'noinline'
);
$maxgrp
[]
=
$mform
->
createElement
(
'text'
,
'maxwordlimit'
,
''
,
$wordlimitoptions
);
$mform
->
setType
(
'maxwordlimit'
,
PARAM_INT
);
...
...
@@ -73,7 +74,8 @@ class qtype_essay_edit_form extends question_edit_form {
$mform
->
addGroup
(
$maxgrp
,
'maxgroup'
,
get_string
(
'maxwordlimit'
,
'qtype_essay'
),
' '
,
false
);
$mform
->
addHelpButton
(
'maxgroup'
,
'maxwordlimit'
,
'qtype_essay'
);
$mform
->
disabledIf
(
'maxwordlimit'
,
'maxwordenabled'
,
'notchecked'
);
$mform
->
hideIf
(
'maxgroup'
,
'responserequired'
,
'0'
);
$mform
->
hideIf
(
'maxgroup'
,
'responserequired'
,
'eq'
,
'0'
);
$mform
->
hideIf
(
'maxgroup'
,
'responseformat'
,
'eq'
,
'noinline'
);
$mform
->
addElement
(
'select'
,
'attachments'
,
get_string
(
'allowattachments'
,
'qtype_essay'
),
$qtype
->
attachment_options
());
...
...
@@ -83,15 +85,15 @@ class qtype_essay_edit_form extends question_edit_form {
get_string
(
'attachmentsrequired'
,
'qtype_essay'
),
$qtype
->
attachments_required_options
());
$mform
->
setDefault
(
'attachmentsrequired'
,
0
);
$mform
->
addHelpButton
(
'attachmentsrequired'
,
'attachmentsrequired'
,
'qtype_essay'
);
$mform
->
disabled
If
(
'attachmentsrequired'
,
'attachments'
,
'eq'
,
0
);
$mform
->
hide
If
(
'attachmentsrequired'
,
'attachments'
,
'eq'
,
0
);
$mform
->
addElement
(
'filetypes'
,
'filetypeslist'
,
get_string
(
'acceptedfiletypes'
,
'qtype_essay'
));
$mform
->
addHelpButton
(
'filetypeslist'
,
'acceptedfiletypes'
,
'qtype_essay'
);
$mform
->
disabled
If
(
'filetypeslist'
,
'attachments'
,
'eq'
,
0
);
$mform
->
hide
If
(
'filetypeslist'
,
'attachments'
,
'eq'
,
0
);
$mform
->
addElement
(
'select'
,
'maxbytes'
,
get_string
(
'maxbytes'
,
'qtype_essay'
),
$qtype
->
max_file_size_options
());
$mform
->
setDefault
(
'maxbytes'
,
'0'
);
$mform
->
disabled
If
(
'maxbytes'
,
'attachments'
,
'eq'
,
0
);
$mform
->
hide
If
(
'maxbytes'
,
'attachments'
,
'eq'
,
0
);
$mform
->
addElement
(
'header'
,
'responsetemplateheader'
,
get_string
(
'responsetemplateheader'
,
'qtype_essay'
));
$mform
->
addElement
(
'editor'
,
'responsetemplate'
,
get_string
(
'responsetemplate'
,
'qtype_essay'
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment