Skip to content

Instantly share code, notes, and snippets.

@mlincoln
Created June 21, 2019 22:45
Show Gist options
  • Save mlincoln/ca61630ca8f5cd02dcc20c389d1b0096 to your computer and use it in GitHub Desktop.
Save mlincoln/ca61630ca8f5cd02dcc20c389d1b0096 to your computer and use it in GitHub Desktop.
import urllib.request
import urllib.parse
assignments = [7870656,7876997,7876996,7881004,7884519,7887905,7870657,7874404,7876813,7876859,7876998,7876999,7880604,7881005,7882360,7884520,7885175,7886389]
graders = [5443385,5379638,5480325,5444723,5018300,5442526,5204810,5444723,5355971,5416114,5361451,5444041,5443022,5019751,5173849,4877780]
#change date range to number of days in month plus 1
days = range(1,29)
token = yourkeyhere
o = open('feb-grade-data-all.txt','w+');
#o = open('mar-grade-data-all.txt','w+');
#o = open('apr-grade-data-all.txt','w+');
for grader in graders:
for assignment in assignments:
for day in days:
#change month to correct numeric value
url = str("https://ucberkeley.instructure.com/api/v1/courses/1469272/gradebook_history/2018-02-"+str(day)+"/graders/"+str(grader)+"/assignments/"+str(assignment)+"/submissions?access_token="+token)
f = urllib.request.urlopen(url)
o.write(f.read().decode('utf-8'));
o.close();
#repeat for march and april, changing date range and output file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment