Esempio n. 1
0
 def best(self):
     best = []
     l = filterMethod(self.students.entities.keys(),
                      lambda x: not self.totalAvg(x) == 0)
     l = shellSort(l, lambda x, y: self.totalAvg(x) > self.totalAvg(y))
     for x in l:
         best.append((x, self.students.findByID(x), self.totalAvg(x)))
     return best
Esempio n. 2
0
 def topDisc(self):
     topDisc = []
     l = filterMethod(self.disciplines.entities.keys(),
                      lambda x: not self.avgByDisciplineID(x) == 0)
     l = shellSort(
         l,
         lambda x, y: self.avgByDisciplineID(x) > self.avgByDisciplineID(y))
     for x in l:
         topDisc.append(
             (x, self.disciplines.findByID(x), self.avgByDisciplineID(x)))
     return topDisc
Esempio n. 3
0
 def sortStudsDesc(self, disciplineID):
     studs = []
     l = filterMethod(self.listOfStudEnrolledAt(disciplineID),
                      lambda x: not self.avg(x, disciplineID) == 0)
     l = shellSort(
         l,
         lambda x, y: self.avg(x, disciplineID) > self.avg(y, disciplineID))
     for x in l:
         studs.append(
             (x, self.students.findByID(x), self.avg(x, disciplineID)))
     return studs
Esempio n. 4
0
 def deEnrollDiscipline(self, disciplineID):
     self.enrolled[:] = filterMethod(self.enrolled,
                                     lambda x: not x[1] == disciplineID)
Esempio n. 5
0
 def deEnrollStudent(self, studentID):
     self.enrolled[:] = filterMethod(self.enrolled,
                                     lambda x: not x[0] == studentID)
Esempio n. 6
0
 def removeGradeByDisciplineID(self, disciplineID):
     self.__grades[:] = filterMethod(
         self.__grades, lambda x: not x.disciplineID == disciplineID)
Esempio n. 7
0
 def removeGradeByStudentID(self, studentID):
     self.__grades[:] = filterMethod(self.__grades,
                                     lambda x: not x.studentID == studentID)