Hi @jo_keith ,
We had the same issue - we have the default 'Student' role managed by our SIS system and did not allow faculty to add students to courses. After some push back from faculty not being able to add students to courses, we created a 'Non-SIS Student' role based on the default Student role. But, there isn't a way to allow faculty to add one role to a course and not the other. So, we turned on the add student permission for faculty, and then hid the default Student role (and others) via custom java script:
function addpeople_magic() { if (new_magic === true) { $("#addpeople_next").hide(); //hide Next button. $("#peoplesearch_select_role").prepend('<option value="0" disabled selected="selected">Select One...</option>'); //Prepend non-selectable dummy option telling user Select One $("#peoplesearch_select_role option[value='3']").remove(); //remove student role from add users. $("#peoplesearch_select_role option[value='4']").remove(); //remove Teacher role $("#peoplesearch_select_role option[value='5']").remove(); //remove TA role $("#peoplesearch_select_role").on('change', function () { //wait for selected item to change $("#addpeople_next").show(); //reveal Next button. }) } if (new_magic === false) { //if running after back button is pressed the next button shouldn't be hidden and prepended option shouldn't be selected. $("#peoplesearch_select_role").prepend('<option value="0" disabled>Select One...</option>'); //Prepend non-selectable dummy option telling user Select One $("#peoplesearch_select_role option[value='3']").remove(); //remove student role from add users. $("#peoplesearch_select_role option[value='4']").remove(); //remove Teacher role $("#peoplesearch_select_role option[value='5']").remove(); //remove TA role } } //End Functions if (/courses\/[0-9]+\/users$/.test(window.location.pathname)) { $(document).ready(function () { //edit role changes $(document).on('click', '[data-event="editRoles"]', function () { $("#role_id option[value='3']").remove(); //remove student role from edit user role. $("#role_id option[value='4']").remove(); //remove Teacher role $("#role_id option[value='5']").remove(); //remove TA role }); //add people changes // create an observer instance var observer = new MutationObserver(function (mutations) { var addpeople = document.getElementById('peoplesearch_select_role'); var backbutton = document.getElementById('addpeople_back'); var panel = document.getElementById('addpeople_panelDescription'); if (observer_state === true) { if (addpeople) { addpeople_magic(); observer_state = false; } } if (backbutton) { //if it detects back button it resets state to true so it will continue to look for existence of role select box if ($('span:contains("Start Over")').length) { observer_state = true; new_magic = true; } if ($('span:contains("Back")').length) { observer_state = true; new_magic = false; } } if (!panel) { //if add people window goes away the observer state is set back to true so if will detect the role select box (if it reappears) observer_state = true new_magic = true } }) var target = document.body //have to monitor body because span is direct child of body. var config = { childList: true, subtree: true } // pass in the target node, as well as the observer options observer.observe(target, config); }); };
This discussion post is outdated and has been archived. Please use the Community question forums and official documentation for the most current and accurate information.