Exemple #1
0
 def _get_students(self, path):
     """ Student detail are read using file reading gen and added to dictionary """
     for cwid, name, major in file_reader(path, 3, sep='\t', header=True):
         if major not in self._majors:
             print(f"Student {cwid} '{name}' has unknown major '{major}'")
         else:
             self._students[cwid] = Student(cwid, name, self._majors[major])
Exemple #2
0
 def student_details(self, path: str) -> None:
     """ Student detail are put in dictionary with file reader """
     for cwid, name, major in file_reader(path, 3, sep=';', header=True):
         if major not in self.major:
             print(f"Student {cwid} '{name}' has unknown major '{major}'")
         else:
             self.student[cwid] = Student(cwid, name, self.major[major])
Exemple #3
0
    def _get_grades(self, path):
        """Grades are read using file reading gen and assigned to student and instructor """
        for std_cwid, course, grade, instructor_cwid in file_reader(
                path, 4, sep='\t', header=True):
            if std_cwid in self._students:
                self._students[std_cwid].add_course(course, grade)
            else:
                print(f'Grades for student is {std_cwid}')

            if instructor_cwid in self._instructors:
                self._instructors[instructor_cwid].add_student(course)
            else:
                print(f'Grades for instructor is {instructor_cwid}')
Exemple #4
0
    def grade_details(self, path):
        """Grades are put in dictionary with file reader """
        for std_cwid, course, grade, instructor_cwid in file_reader(
                path, 4, sep='|', header=True):
            if std_cwid in self.student:
                self.student[std_cwid].add_course(course, grade)
            else:
                print(f'Student Grade is {std_cwid}')

            if instructor_cwid in self.instructor:
                self.instructor[instructor_cwid].add_student(course)
            else:
                print(f'Instructor Grade is {instructor_cwid}')
    def grade_details(self, path: str) -> None:
        """Grades are added using file reader """
        for std_cwid, course, grade, instructor_cwid in file_reader(
                path, 4, sep='|', header=False):
            if std_cwid in self.student:
                self.student[std_cwid].add_course(course, grade)
            else:
                print(f'Student grade is {std_cwid}')

            if instructor_cwid in self.instructor:
                self.instructor[instructor_cwid].add_student(course)
            else:
                print(f'Instructor grade is {instructor_cwid}')
Exemple #6
0
 def _get_instructors(self, path):
     """ Instructor detail are read using file reading gen and added to dictionary """
     for cwid, name, dept in file_reader(path, 3, sep='\t', header=True):
         self._instructors[cwid] = Instructor(cwid, name, dept)
Exemple #7
0
 def _get_majors(self, path):
     """Major details are read using file reading gen and added to dictionary"""
     for major, flag, course in file_reader(path, 3, sep='\t', header=True):
         if major not in self._majors:
             self._majors[major] = Major(major)
         self._majors[major].add_course(course, flag)
Exemple #8
0
 def instructor_details(self, path):
     """ Instructor detail are put in dictionary with file reader """
     for cwid, name, dept in file_reader(path, 3, sep='|', header=True):
         self.instructor[cwid] = Instructor(cwid, name, dept)
Exemple #9
0
 def major_details(self, path: str) -> None:
     """Major detail are put in dictionary with file reader"""
     for major, flag, course in file_reader(path, 3, sep='\t', header=True):
         if major not in self.major:
             self.major[major] = Major(major)
         self.major[major].add_course(course, flag)
 def student_details(self, path: str) -> None:
     """ Student detail are put in dictionary with file reader """
     for cwid, name, major in file_reader(path, 3, sep=';', header=False):
         self.student[cwid] = Student(cwid, name, major)