CSS or JavaScript Code to Disable Instructor Ability to Change Course Image
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2024
07:18 AM
We want to remove the ability for instructors to edit and change the course image. Does anyone have any code (CSS or JavaScript) that would do this?
Thank you in advance for any assistance you can provide.
Solved! Go to Solution.
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2024
12:40 PM
Hi @casey_eubank,
Try this:
if ((/^\/courses\/[0-9]+\/settings$/.test(window.location.pathname)) && (!ENV.current_user_roles.includes('root_admin'))) {
let courseImageChangeButtons=document.querySelectorAll('.CourseImageSelector__Button, .CourseImageSelector > button');
for (let i = 0; i < courseImageChangeButtons.length; i++)
courseImageChangeButtons[i].style.display='none';
}
-Chris