Skip to content

Instantly share code, notes, and snippets.

@kevinlin1
Created March 3, 2023 17:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kevinlin1/0e299a00117c17d63f16c357f6232065 to your computer and use it in GitHub Desktop.
Save kevinlin1/0e299a00117c17d63f16c357f6232065 to your computer and use it in GitHub Desktop.
Randomly select a Canvas group from the instructor-side page listing all available Canvas groups. Hides the unassigned students sidebar and scrolls the randomly-selected team into view.
javascript:(() => {
document.querySelector('.unassigned-students').remove();
document.querySelector('.groups').classList.remove('span9');
document.querySelectorAll('[aria-expanded="true"].toggle-group.group-heading').forEach(e => e.click());
const groups = document.getElementsByClassName('toggle-group group-heading');
const randomGroup = groups[Math.floor(Math.random() * groups.length)];
randomGroup.click();
randomGroup.scrollIntoView();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment