estimate students grade level
This commit is contained in:
2 files changed
+13
-2
No files matched your search
@@ -3,9 +3,9 @@ import json
|
|||||||
|
|
||||||
# Get students
|
# Get students
|
||||||
try:
|
try:
|
||||||
with open("../output/students.json") as studentFile: students = json.load(studentFile)
|
with open("../output/students.json", 'r') as studentFile: students = json.load(studentFile)
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
with open("./output/students.json") as studentFile: students = json.load(studentFile)
|
with open("./output/students.json", 'r') as studentFile: students = json.load(studentFile)
|
||||||
|
|
||||||
flex = ("XAT--12A-S", "XAT--12B-S")
|
flex = ("XAT--12A-S", "XAT--12B-S")
|
||||||
|
|
||||||
@@ -24,3 +24,9 @@ if __name__ == '__main__':
|
|||||||
# Define students grade level
|
# Define students grade level
|
||||||
for student in students:
|
for student in students:
|
||||||
student["gradelevel"] = getEstimatedGrade(student)
|
student["gradelevel"] = getEstimatedGrade(student)
|
||||||
|
try:
|
||||||
|
with open('../output/students.json', 'w') as studentFile:
|
||||||
|
json.dump(students, studentFile, indent=2)
|
||||||
|
except FileNotFoundError:
|
||||||
|
with open('./output/students/json', 'w') as studnetFile:
|
||||||
|
json.dump(students, studentFile, indent=2)
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
import json
|
import json
|
||||||
import csv
|
import csv
|
||||||
|
from estimateGrade import getEstimatedGrade
|
||||||
|
|
||||||
flex= ("XAT--12A-S", "XAT--12B-S")
|
flex= ("XAT--12A-S", "XAT--12B-S")
|
||||||
|
|
||||||
@@ -52,6 +53,10 @@ def getSampleStudents(data_dir: str, log: bool = False) -> list[dict]:
|
|||||||
}
|
}
|
||||||
mockStudents.append(newStudent)
|
mockStudents.append(newStudent)
|
||||||
|
|
||||||
|
# Estimate student grades
|
||||||
|
for student in mockStudents:
|
||||||
|
student["gradelevel"] = getEstimatedGrade(student)
|
||||||
|
|
||||||
if log:
|
if log:
|
||||||
with open("./output/students.json", "w") as outfile:
|
with open("./output/students.json", "w") as outfile:
|
||||||
json.dump(mockStudents, outfile, indent=2)
|
json.dump(mockStudents, outfile, indent=2)
|
||||||
|
|||||||
Reference in new issue
Block a user