Can you disable the edit profile option for students?

Can you disable the edit profile option for students?

by ztechguy Z -
Number of replies: 12
New to moodle, and want to know if there is anyway to disable the "edit profile" option that shows up when the students go to their courses.  I konw that the teacher can make it not show up by closing the little eye when they leave the administration block, but is there a better way.  I just don't want students to be able to change their e-mail addresses and logins.  I am dealing with a k-8 school, mainly middle school users. : )

ztechguy
Average of ratings: -
In reply to ztechguy Z

Re: Can you disable the edit profile option for students?

by Iñaki Arenaza -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers
You can lock selected fields in the profile. Go to Administration >> Users >> Authentication and set the fields you want to lock as 'locked' and save the changes.

Saludos. Iñaki.
In reply to Iñaki Arenaza

Re: Can you disable the edit profile option for students?

by Craig Grimmer -
I have done this with Moodle 1.9.2 but I find that there are still fields that can be edited in the user profile (in both the "General" section and the "Optional" section). My Moodle site shows two buttons "Show Advanced" on the user profile page and many of these fields are unlocked and not listed in the Admin > Users > Authentication section.

Is there a way to lock/disable the fields that are revealed by the "Advanced" button? Or, is there a way to prevent students (but not admins) from accessing the "Advanced" section altogether?

Also, is there a way to disable the "Interests" field of the profile?

Thanks.
Craig.
In reply to Craig Grimmer

Re: Can you disable the edit profile option for students?

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Yes, remove the 'Edit own user profile' capability from the Autenticated User role.
Average of ratings: Useful (1)
In reply to Tim Hunt

Re: Can you disable the edit profile option for students?

by Craig Grimmer -
Thanks, Tim. Much appreciated.
In reply to Craig Grimmer

Re: Can you disable the edit profile option for students?

by Alan Zaitchik -
Can one disable the ability to edit just the Department field, short of removing it from the advanced form altogether? What I am asking, I suppose, is where (if anywhere) the "locked down" status of such a field is maintained in the code that processes the form.
Thanks,
Alan
In reply to Alan Zaitchik

Re: Can you disable the edit profile option for students?

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
If Department is a custom field, then yes you can, in the admin section, under Users -> Accounts -> User profile fields. Other fields can be locked under Admin -> Authentication -> Manage authentication, then click on the settings link next to the authentication system you are using.
In reply to Tim Hunt

Adding a anchor to edit advanced

by Timothy Kane -


I want to put an anchor link on the advance edit page where Registering Students put in the custom data about themselves.


Page screenshot

I know html but lost in php. I don't want to mess up the php code.
Any ideas on how or where I put in the anchor on the editadvance.php or editadvance_form.php page?

It would be nice if there was an add anchor option when you set up custom fields.

Timothy Kane
training@nvabc.com
In reply to Tim Hunt

Re: Can you disable the edit profile option for students?

by Jason Hollowell -
I know this thread is over a year old but was just trying to figure out how to lock down the option profile fields. The solution provided here by Tim only works for fields outside of the "Optional" category (oddly, except for the webpage field..?). I'd like to leave the ability to edit profiles open but lock the Optional fields. It's starting to look like that isn't possible via the current setup. Am I wrong?

Thanks,

Jason
In reply to Jason Hollowell

Re: Can you disable the edit profile option for students?

by Tim Huiner -
I was wondering the same question here. Is it possible to turn off the "Optional" fields so that users cannot update them?
In reply to Tim Huiner

Re: Can you disable the edit profile option for students?

by Attila Paksi -
I just editing profile fields in a Moodle 1.9.9.
The user/editlib.php is responsible for print out (and set default values) for user fields. So you just need to comment out some fields that you don't want to use, or just make them hidden:

The field won't show up, and is not in using:

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

The field won't show up, but it is in use just hidden, and passing default values to the database:

$choices = array();
$choices['1'] = get_string('autosubscribeyes');
$choices['0'] = get_string('autosubscribeno');
// $mform->addElement('select', 'autosubscribe', get_string('autosubscribe'), $choices);
$mform->addElement('hidden', 'autosubscribe', get_string('autosubscribe'), $choices);
$mform->setDefault('autosubscribe', 1);
$mform->setAdvanced('autosubscribe');

The commented line is the original, under it is the new one. Changed the field type from 'select' to 'hidden'. Then at the 'setDefault' you can set the value of this field.

Cheers
In reply to Attila Paksi

Re: Can you disable the edit profile option for students?

by Daniel Lombardo -

Thanks, that helped me. Moodle 2.3

I actually want to export each students' group name when I export grades from the grader report. A work around I figure from your advice here is to use the now unused Department as a place to store it, however, it would be better to change the grade_export_xls.php file to query the database for that information directly. My level of Moodle knowledge is too limited to know how to tell that file where to find it. I tried replacing 'department' with 'group,' it updated the column correctly, but it mustn't be the associated field because it exported null in each cell.

Find the advice I used in GB export to excel doesn't include all mandatory fields

'city' worked and pulled the city name from the profiles,

groupname, group1, and several others did not work.

It would also be useful to export some custom user profile fields but they appear as profile_field_section or *whatever surrounded by square brackets in the column heading instead of the field name; as with 'idnumber' appears as ID Number, 'department' appears as Department, 'group' appeared as Group, etc.

In reply to Iñaki Arenaza

Re: Can you disable the edit profile option for students?

by Les Culver -
How do I get the optional field of "Mobile Phone" to be accessed? In this document: http://docs.moodle.org/23/en/Add_a_new_user it says that the field exists, but I cannot upload a user's mobile phone, only "phone1". It's a hassle to have to go in and manually edit each participant. Thanks.