1

I'm using moodle 3.0. While creating user, it displays too many extra fields like SkypeID, AimID etc. So is there any way to edit or delete these fields ?

Also I want to add user profile fields in Grader report.Like, If I created 'Roll_No' field then it should be in the grader report.

Kartikesh
  • 11
  • 2
  • 5

3 Answers3

2

Currently, there is no way (that I am aware of) to remove these fields from the user profile form using settings within the front-end of Moodle. Your two options would be to 1. hack the code that creates the user form to remove these - not recommended! 2. Use some css in your theme to hide these fields in the form. While this does not remove them completely and is dependant on your theme (ie if you enable users to swap themes then that may allow them to reappear), it does mean less potential problems in the case of some other code in another part of Moodle referring to items that you have removed from the profile form.

Example: Add the examples below to your customcss theme setting (I have used Clean theme to test)

    #page-user-edit fieldset#id_moodle_optional {display:none;} // Will hide the entire 'Optional' section
    #page-user-edit div#fitem_id_country {display:none;} // Will remove just the 'Country' setting

You can find the appropriate css IDs for the fieldsets or form items using a tool such as firebug or Chrome developer tools to inspect the elements.

0

For hiding the fields you can use user policy

https://docs.moodle.org/30/en/User_policies#Hide_user_fields

Go to site admin -> users -> permissions -> user policies

Then select the fields you want to hide in hiddenuserfields

For the grader report, there is an option to include custom fields in the export.

Go to site admin -> grades -> general settings - then enter the custom fields in grade_export_customprofilefields

Russell England
  • 9,436
  • 1
  • 27
  • 41
  • Sir, I want to delete the default fields like Department,Institution etc that are displayed while creating new user. In short I want to delete all the default fields & options that moodle provides. – Kartikesh Jun 24 '16 at 16:23
0

I'm using moodle 3.0 I found a useful way to disable the additional fields,this will edit the form from the code, so simple go to moodle/user/editlib.php and comment these lines:

to disable discription:

  // $mform->addElement('editor', 'description_editor', get_string('userdescription'), null, $editoroptions);
// $mform->setType('description_editor', PARAM_RAW);
// $mform->addHelpButton('description_editor', 'userdescription');

to disable user pic:

 // $mform->addElement('header', 'moodle_picture', get_string('pictureofuser'));
    // $mform->setExpanded('moodle_picture', true);

    // $mform->addElement('checkbox', 'deletepicture', get_string('deletepicture'));
    // $mform->setDefault('deletepicture', 0);

    // $mform->addElement('filemanager', 'imagefile', get_string('newpicture'), '', $filemanageroptions);
    // $mform->addHelpButton('imagefile', 'newpicture');

    // $mform->addElement('text', 'imagealt', get_string('imagealt'), 'maxlength="100" size="30"');
    // $mform->setType('imagealt', PARAM_TEXT);

and to disable additional names:

// $mform->addElement('header', 'moodle_additional_names',get_string('additionalnames'));

        // $mform->addElement('text', $allname, get_string($allname), 'maxlength="100" size="30"' . $purpose);
        // $mform->setType($allname, PARAM_NOTAGS);

to disable interests:

// if (core_tag_tag::is_enabled('core', 'user') and empty($USER->newadminuser)) {
//     $mform->addElement('header', 'moodle_interests', get_string('interests'));
//     $mform->addElement('tags', 'interests', get_string('interestslist'),
//         array('itemtype' => 'user', 'component' => 'core'));
//     $mform->addHelpButton('interests', 'interestslist');
// }

to disable optional contact:

// $mform->addElement('header', 'moodle_optional', get_string('optional', 'form'));

// $mform->addElement('text', 'url', get_string('webpage'), 'maxlength="255" size="50"');
// $mform->setType('url', core_user::get_property_type('url'));

// $mform->addElement('text', 'icq', get_string('icqnumber'), 'maxlength="15" size="25"');
// $mform->setType('icq', core_user::get_property_type('icq'));
// $mform->setForceLtr('icq');

// $mform->addElement('text', 'skype', get_string('skypeid'), 'maxlength="50" size="25"');
// $mform->setType('skype', core_user::get_property_type('skype'));
// $mform->setForceLtr('skype');

// $mform->addElement('text', 'aim', get_string('aimid'), 'maxlength="50" size="25"');
// $mform->setType('aim', core_user::get_property_type('aim'));
// $mform->setForceLtr('aim');

// $mform->addElement('text', 'yahoo', get_string('yahooid'), 'maxlength="50" size="25"');
// $mform->setType('yahoo', core_user::get_property_type('yahoo'));
// $mform->setForceLtr('yahoo');

// $mform->addElement('text', 'msn', get_string('msnid'), 'maxlength="50" size="25"');
// $mform->setType('msn', core_user::get_property_type('msn'));
// $mform->setForceLtr('msn');

// $mform->addElement('text', 'idnumber', get_string('idnumber'), 'maxlength="255" size="25"');
// $mform->setType('idnumber', core_user::get_property_type('idnumber'));

// $mform->addElement('text', 'institution', get_string('institution'), 'maxlength="255" size="25"');
// $mform->setType('institution', core_user::get_property_type('institution'));

// $mform->addElement('text', 'department', get_string('department'), 'maxlength="255" size="25"');
// $mform->setType('department', core_user::get_property_type('department'));

// $mform->addElement('text', 'phone1', get_string('phone1'), 'maxlength="20" size="25"');
// $mform->setType('phone1', core_user::get_property_type('phone1'));
// $mform->setForceLtr('phone1');

// $mform->addElement('text', 'phone2', get_string('phone2'), 'maxlength="20" size="25"');
// $mform->setType('phone2', core_user::get_property_type('phone2'));
// $mform->setForceLtr('phone2');

// $mform->addElement('text', 'address', get_string('address'), 'maxlength="255" size="25"');
// $mform->setType('address', core_user::get_property_type('address'));