Skip to content

Commit d307c15

Browse files
authored
Course request: Set description as mandatory field in course request form
Author: @nosolored
1 parent cbab6d8 commit d307c15

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

main/create_course/add_course.php

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,17 @@ function setFocus(){
8585
$form->applyFilter('title', 'html_filter');
8686
$form->addRule('title', get_lang('ThisFieldIsRequired'), 'required');
8787

88+
if ($course_validation_feature) {
89+
// Description of the requested course.
90+
$form->addElement(
91+
'textarea',
92+
'description',
93+
get_lang('Description'),
94+
['rows' => '3']
95+
);
96+
$form->addRule('description', get_lang('ThisFieldIsRequired'), 'required');
97+
}
98+
8899
if (!api_get_configuration_value('course_creation_form_set_course_category_mandatory')) {
89100
$form->addButtonAdvancedSettings('advanced_params');
90101
$form->addElement(
@@ -171,14 +182,6 @@ function setFocus(){
171182
// The teacher
172183
$titular = &$form->addElement('hidden', 'tutor_name', '');
173184
if ($course_validation_feature) {
174-
// Description of the requested course.
175-
$form->addElement(
176-
'textarea',
177-
'description',
178-
get_lang('Description'),
179-
['rows' => '3']
180-
);
181-
182185
// Objectives of the requested course.
183186
$form->addElement(
184187
'textarea',

0 commit comments

Comments
 (0)