-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathauto_grader.py
More file actions
33 lines (30 loc) · 1.18 KB
/
auto_grader.py
File metadata and controls
33 lines (30 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from student import Student as S
from classroom import Classroom as C
from assignment_grader import AssignmentGrader as AG
class AutoGrader:
"""
A Class that represents the automatic_grader for the entire folder.
Holds the folder's class' professor as well.
"""
def __init__(self, assignments_path, expecteds_path, prof):
"""
A constructor that takes in the folder of assignment's path (String),
the expected in/outputs path (String), and the Professor linked to this grader.
"""
self.assignments_path = assignments_path
self.expecteds_path = expecteds_path
self.prof = prof
self.grader = self.generate_grader()
def generate_grader(self):
"""
Create an assignment grader object that will iterate through
the students and assignments together, modifying the classroom's
grades as it goes.
"""
return AG(self.expecteds_path, self.prof.classroom)
def generate_grades(self):
"""
Calls the previously made assignment grader to grade the assignments at the
inputted folder directory.
"""
self.grader.grade_assignments()