diff --git a/course/editcategory_form.php b/course/editcategory_form.php
index dc1fc5a..d115de5 100755
--- a/course/editcategory_form.php
+++ b/course/editcategory_form.php
@@ -15,10 +15,39 @@ class editcategory_form extends moodleform {
             // Editing an existing category.
             make_categories_list($options, $parents, 'moodle/category:manage', $category->id);
             $strsubmit = get_string('savechanges');
-        } else {
+        } 
+
+
+	//Ravi => to remove the multiple ways of creating categories and sub-categories
+
+	/* This customisation takes care of 4 action which basically falls under 2 functionalities
+	 * 1. Create new and 2. Edit existing
+	 *
+	 * 1. Create new
+	 *     i) Category => here user dosent have any choice for except to go with the top level selection in parent field
+	 *    ii) Sub-category => user has all parent category and sub-category in list to choose except for top level
+	 *
+	 *
+	 * 2. Edit existing
+	 *     i) Category => user sees the moodles default choices(all sub and parent categories) in menu so he can push the existing category to sub
+	 *    ii) Sub-category => user sees the moodles default choices(all sub and parent categories) in menu so he can push the existing category to sub-sub or viceversa.
+	 *
+	 */
+	//--------------------------------------------------------------------------------
+
+	else {
             // Making a new category
-            make_categories_list($options, $parents, 'moodle/category:manage');
-            $strsubmit = get_string('createcategory');
+	  if ($category->parent == 0){
+	    //  make_categories_list($options, $parents, 'moodle/category:manage');
+	   $strsubmit = get_string('create');
+	   }
+	  else{
+	    $options = array();
+	   make_categories_list($options, $parents, 'moodle/category:manage');
+	   $strsubmit = get_string('create');
+	   }
+	//--------------------------------------------------------------------------------
+
         }
 
         $mform->addElement('select', 'parent', get_string('parentcategory'), $options);
