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
def get_group_list(self): resp = session.get(route.course(self.uid).forum() + '&page=%d' % page) return parser.parse_group_list(resp.text)
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
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
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
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