Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Learn Renku
Teaching on Renku
Advanced teaching automation
Commits
4ceabd66
Commit
4ceabd66
authored
Mar 16, 2022
by
Cyril Matthey-Doret
Browse files
add example one-liners for group management
parent
6f3ed146
Pipeline
#329418
passed with stage
in 10 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
4ceabd66
...
...
@@ -113,9 +113,9 @@ python collect_forks.py \
"group": "demo-group",
"members": [
{
"username": "student
a
",
"name": "Student
A
",
"email": student.
a
@email.here
"username": "
smc
student",
"name": "Student
McStudent
",
"email": student.
mcstudent
@email.here
}
],
"commit": "0175894cf61fe820fdb84e5c52fc7ee0259a3c71",
...
...
@@ -162,6 +162,7 @@ After grading student assignments, the teacher may want to send student groups t
<details>
<summary>
<b>
Read more...
</b>
</summary>
script:
[
teach\_utils/send\_feedback.py
](
teach_utils/send_feedback.py
)
**usage**
:
...
...
docs/oneliners.md
View file @
4ceabd66
# Extracting group information with one liners
This document lists a few one liners to extract useful group information from the JSON output of
`collect_forks.json`
.
*
Find the number of groups
```
sh
$
jq
'length'
forks.json
20
```
*
Get all groups with fewer than 3 students
```
sh
$
jq
'
.[] \
| {"group": .group, "size": (.members | length)} \
| select(.size < 3)'
forks.json
{
"group"
:
"group-w"
,
"size"
: 1
}
```
*
Find all students present in multiple groups
```
sh
$
jq
'.[] | .members | map(.name) | .[]'
forks.json
\
|
sort
\
|
uniq
-dc
2
"Student McStudent"
```
*
Find students without group (using an external list of names)
```
sh
# 1. Get the list of students in groups, sort it
# 2. Sort the list of all enrolled students
# 3. Find names which are in enrolled students, but not grouped students
jq
'.[] | .members | map(.name) | .[]'
forks.json
\
|
sort
\
|
uniq
-d
\
|
sed
's/^ *//'
\
|
comm
-23
<
(
sort
enrolled_students.txt
)
-
"John Smith"
```
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment