Last active
November 24, 2020 14:44
-
-
Save erictroebs/ef3cb4db70ff8560d1721e8dac55c695 to your computer and use it in GitHub Desktop.
extract moodle course participants by group name
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(".cell.c4") // select every table cell in fourth column (group) | |
.filter((k, e) => $(e).text() !== "Gruppe 2") // filter participants not in specified group | |
.parent().find(".c1") // select table cell in first column (name) | |
.filter((k, e) => $(e).text()) // filter rows with empty names | |
.map((k, e) => "rm -rf " + $(e).text().trim().replaceAll(" ", "\\ ") + "_*") // map to linux rm command | |
.toArray() // convert to javascript array | |
.reduce((a, v) => a + v + "\n", "") // reduce to single string |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment