Exemplo n.º 1
0
 def handins(self):
     if not hasattr(self, '_handins'):
         r = session.get(
             route.course(self.course_id).homework_handin_list(self.uid))
         is_group = self.detail['extra']['屬性'] == '分組作業'  # or '個人作業'
         self._handins = ItemContainer(
             parser.parse_homework_handin_list(r, is_group), Handin, {
                 'course_id': self.course_id,
                 'is_group': is_group
             })
     return self._handins
Exemplo n.º 2
0
 def get_group_list(self):
     resp = session.get(route.course(self.uid).forum() + '&page=%d' % page)
     return parser.parse_group_list(resp.text)
Exemplo n.º 3
0
 def get_materials(self, download=False):
     r = session.get(route.course(self.uid).document())
     self.materials = ItemContainer(parser.parse_material_list(r), Material,
                                    {'course_id': self.uid})
     return self.materials
Exemplo n.º 4
0
 def get_homeworks(self):
     r = session.get(route.course(self.uid).homework())
     self.homeworks = ItemContainer(parser.parse_homework_list(r), Homework,
                                    {'course_id': self.uid})
     return self.homeworks
Exemplo n.º 5
0
 def detail(self):
     if not hasattr(self, '_detail'):
         r = session.get(route.course(self.course_id).document(self.uid))
         self._detail = parser.parse_material_detail(r)
     return self._detail
Exemplo n.º 6
0
 def detail(self):
     if not hasattr(self, '_detail'):
         r = session.get(route.course(self.course_id).homework(self.uid))
         self._detail = parser.parse_homework_detail(r)
     return self._detail