Edit Course Format Settings

Edit Course Format Settings

by Tammy Snyder -
Number of replies: 8

Using Moodle 2.0 RC1.  We import course information from an SIS and therefore would like several course settings to be read-only.  I have been able to do this for Course Category, ID number, short name and full name by changing Role capabilities for Teacher.  

We would like to also make settings for Format, Number of Weeks and Course Start Date read-only.  Can you please let me know if this can be done without customizing core Moodle code?

Thanks for any help.

Attachment EditCourseSettings.png
Average of ratings: -
In reply to Tammy Snyder

Re: Edit Course Format Settings

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear Tammy,

Do you need them to be able to change the other fields?  If no, then just prevent them from being able to edit the course settings in the role capabilities I imagine.  If yes, then I'm not sure!

Cheers,

Gareth

In reply to Gareth J Barnard

Re: Edit Course Format Settings

by Tammy Snyder -

Hi Gareth - thanks for your suggestion, however I found that when I tried this, Moodle completely hid the option to edit course settings and we would like teachers to be able to change some settings and to be able to see the options they cannot change.

Seems like customizing core code will be required,

Thanks,

Tammy

 

In reply to Tammy Snyder

Re: Edit Course Format Settings

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear Tammy,

No worries.  I was curious so looked into how it could be done and discovered edit_form.php (http://xref.moodle.org/nav.html?course/edit_form.php.source.html#l9) and in reading that it appears not to check capabilities for the elements you wish to make read only.  But it looks like all you need to do is call 'hardFreeze' and 'setConstant'.

Cheers,

Gareth

In reply to Gareth J Barnard

Re: Edit Course Format Settings

by Jason O'Brien -

I'd recommend making a copy of the weeks format then editing to your liking.  This way you can safely upgrade moodle, then check for changes between the new weeks and your custom format.

In reply to Jason O'Brien

Re: Edit Course Format Settings

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear Jason,

With respect that will not work as the changes need to be made to 'edit_form.php' which is used across all of the course formats and is stored in '/course/' and not in each specific course format folder unless you know of a way of overriding it at the course format level.

Cheers,

Gareth

In reply to Gareth J Barnard

Re: Edit Course Format Settings

by Tammy Snyder -

Gareth,

Thanks very much for confirming the need for customizations and for pointing me in the right direction.

Tammy

In reply to Gareth J Barnard

Re: Edit Course Format Settings

by Jason O'Brien -

Whoops, you are correct.  This will affect all course formats.

 

Be sure to note what lines you change so it's easy to re-apply after an upgrade.