Avans-ATGM / infrastructure

ATGM Infrastructure Repository
0 stars 2 forks source link

Cocalc Homework retrieval code #36

Closed Dirowa closed 2 years ago

Dirowa commented 2 years ago

Donny's usefull coding job for Helena

if one of the toas has some free time I'd like to request a quick program. Probably a 2h project for an experienced python person.

given an input file name

loop over every project in the /data/cocalc directory find files matching that name ending in .ipynb

Use Case:

I want to see what all the students wrote in their homework without 1) opening each notebook individually, 2) knowing which student wrote what.****

Dirowa commented 2 years ago

@hexylena , is it all solutions or only the ones of the homework?

hexylena commented 2 years ago

Ahh thanks for making a nice issue :)

If it accepts any 'search term' then we could find anything, homework or during-class exercises, which I think is optimal. I think it should be run approximately like:

python script.py Day-2/data-science-math-loop

where the first argument is used to search through the entire path of discovered files.

Dirowa commented 2 years ago

@hexylena do you perhaps know where i could find the names of the projects? so you do have a name of each homework instead of a project code

hexylena commented 2 years ago
root@cocalc:/home/hexylena# find /data/cocalc/ -name '2-counting*.ipynb'
/data/cocalc/d0b82df0-e647-4ef2-bd4f-96de8928239a/Homework-02/2-counting-nucleotides.ipynb
/data/cocalc/22ebb457-fa71-440e-ad58-e9d688e833a3/Homework-02/2-counting-nucleotides.ipynb
/data/cocalc/c4bbd7d1-7dfe-41de-ad19-eac18bd124d9/Homework-02/2-counting-nucleotides.ipynb
/data/cocalc/63aff93e-3d4e-4173-871d-d51dfad85533/Homework-02/2-counting-nucleotides.ipynb
/data/cocalc/9affc397-6cef-4c1c-a05e-2c707ebd64d6/Homework-02/2-counting-nucleotides.ipynb
/data/cocalc/d2c61a00-6766-42b3-aaf8-d379c2885a2f/Homework-02/2-counting-nucleotides.ipynb
/data/cocalc/1b84c1e9-9edc-4211-a25c-a19bd0f491b8/Homework-02/2-counting-nucleotides.ipynb
/data/cocalc/ca2b2e83-d4e3-4d8a-a5ae-7f11dddcb319/Homework-02/2-counting-nucleotides.ipynb
Dirowa commented 2 years ago

sorry if i was unclear. but i was more looking into the get_username function to retrieve the acual user name of the project

hexylena commented 2 years ago

[discussed out of band, magic sql query solves everything]

Dirowa commented 2 years ago

Finisht script is in /Courses/bin/collect_solutions.py

Current problem with code: will not use previous created functions. ( example in trimming you create the function mean. ) Some students also use it by other homework problems, with the active homework it works)

Other bug. more misuse. is when the metadata of the cells are the otherway around