organize course list
This commit is contained in:
parent
d2b94f1c92
commit
164541d826
34
stats.py
34
stats.py
|
|
@ -500,6 +500,39 @@ def reorganize_grades_student():
|
||||||
output.writerow(row)
|
output.writerow(row)
|
||||||
|
|
||||||
|
|
||||||
|
def all_course_names():
|
||||||
|
cc = json.loads(codecs.open('cache/courses/courses_built.json','r','utf-8').read())
|
||||||
|
courses = {}
|
||||||
|
for C in cc.values():
|
||||||
|
name = C['dept'] + C['number']
|
||||||
|
#print(name)
|
||||||
|
courses[ name ] = C
|
||||||
|
|
||||||
|
#co = codecs.open('cache/courses/names.json','w','utf-8')
|
||||||
|
#for c in sorted(courses.keys()):
|
||||||
|
# co.write(c + "\n")
|
||||||
|
|
||||||
|
cr = codecs.open('cache/courses/names.json','r','utf-8')
|
||||||
|
|
||||||
|
|
||||||
|
from_data = codecs.open('cache/courses_student_scores.csv','r','utf-8').readlines()
|
||||||
|
unknown = {}
|
||||||
|
for line in from_data:
|
||||||
|
parts = line.split(',')
|
||||||
|
stu_id = parts[0]
|
||||||
|
ea = parts[1:]
|
||||||
|
for C in ea:
|
||||||
|
each = C.split('|')
|
||||||
|
name = each[0]
|
||||||
|
if not name in courses:
|
||||||
|
unknown[name] = name
|
||||||
|
#data_courses[each[0]] += 1
|
||||||
|
for c in sorted(unknown.keys()):
|
||||||
|
print(c)
|
||||||
|
|
||||||
|
#co.write( json.dumps( {'unknown':unknown, 'coursenames':courses}, indent=2 ))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -511,6 +544,7 @@ if __name__ == "__main__":
|
||||||
4: ['test shortname parse',nametest] ,
|
4: ['test shortname parse',nametest] ,
|
||||||
5: ['test sem codes',codetest] ,
|
5: ['test sem codes',codetest] ,
|
||||||
6: ['get student data from orientations', get_student_orientations],
|
6: ['get student data from orientations', get_student_orientations],
|
||||||
|
7: ['manage course master list', all_course_names]
|
||||||
}
|
}
|
||||||
print ('')
|
print ('')
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue