Python script to make directory structure of feedback files from the offline grading worksheet in Moodle Assignments
#!/opt/local/bin/python | |
# mkdirfb.py | |
# make directories to be zipped for feedback files | |
# from offline grading worksheet | |
# of Assignment activity in Moodle | |
# Usage: cat offlinegradingworksheet.csv | python mkdirfb.py | |
# Saburo Higuchi | |
# Time-stamp "2017-08-02 Wed 16:47 JST hig" | |
import csv | |
import sys | |
import re | |
import os | |
reader = csv.reader(sys.stdin, delimiter=',',quotechar='"') | |
header=next(reader) # skip the header | |
# Assume: | |
# row[0] internal participant ID | |
# row[1] Fullname | |
for row in reader: | |
partid=int(re.match(r'^[^\d]*(\d.*)$',row[0]).group(1)) | |
fullname=row[1] | |
dirname="%s_%s_assignsubmission_file_" % (fullname,partid) | |
print(dirname) | |
# note no error checking | |
os.mkdir(dirname) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment