Prevent users from changing activity or resource names

Prevent users from changing activity or resource names

by Jose Pablo Pedrosa Dantas -
Number of replies: 9

Is there a way to prevent any user(other than administrators) from changing the name of activity or resource in a course? i searched in role capabilities but didn't find anything related to that.

Average of ratings: -
In reply to Jose Pablo Pedrosa Dantas

Re: Prevent users from changing activity or resource names

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators
Don't give them editing teacher permissions in the course - give them the Non-editing teacher role
Average of ratings: Useful (1)
In reply to Mary Cooch

Re: Prevent users from changing activity or resource names

by Jose Pablo Pedrosa Dantas -
This option also blocks editing mode, is there a way to block name editing without block editing mode?
In reply to Jose Pablo Pedrosa Dantas

Re: Prevent users from changing activity or resource names

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
You essentially want people to be able to edit activities and resources but *specifically* don't want them to be able to change the name once it's been created? I hope you can see that's a pecularly niche requirement. There's no way to do that.
Average of ratings: Useful (1)
In reply to Howard Miller

Re: Prevent users from changing activity or resource names

by Jose Pablo Pedrosa Dantas -
Thanks for your time

I am thinking about developing a plugin that change the date of an activity for each course on moodle, the problem is the some courses have the same kind of activity but with different date(two or tree foruns, each one with its own date), for example, there is 4 courses on moodle, each one has 3 assignments, each one has a different date, so i wanted to change one assignment on each course without changing the other two ones, and i was thinking about using the activity name as a identifier, the problem is that if the name of an assignments is changed, it won't work.

there is certaintly a better way to implement this but i'm not very experient in programing, i just want to make a little plugin to help me a little on moodle(i work on a server with at least 75 courses), changing dates is kinda difficult task.
In reply to Jose Pablo Pedrosa Dantas

Re: Prevent users from changing activity or resource names

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
What do you mean by the date of an activity?
In reply to Marcus Green

Re: Prevent users from changing activity or resource names

by Jose Pablo Pedrosa Dantas -
Due date, i'm sorry my english is a little bad.
In reply to Jose Pablo Pedrosa Dantas

Re: Prevent users from changing activity or resource names

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Looks to me like your English is very good actuallysmile Activities in a course have a module id that will stay the same even if the name is changed.
So if you view an assignment and look at the url bar you will see a thing like this...
mod/assign/view.php?id=37
And that is the course_module id record.
Scroll to the bottom of this page

https://www.examulator.com/er/output/tables/course.html

and look for the course_modules table. Creating a plugin to do this is quite complex. Unless your intention is to learn Moodle development, I suggest you investigate a command line thing called moosh to see if that can be made to do it.
https://moosh-online.com/
Average of ratings: Useful (2)
In reply to Marcus Green

Re: Prevent users from changing activity or resource names

by Jose Pablo Pedrosa Dantas -
Thanks, i still new to moodle development but i will try something to see if i can do it, when you talk about course_modules table you are talking about moodle database right? to one in phpmyadmin page.