Skip to content

Commit

Permalink
vfs: 選擇性加入「修課學生」資料夾
Browse files Browse the repository at this point in the history
CEIBA 已不再允許透過「友善列印」功能查詢未開放「修課學生」功能課程的修課
學生名單,因此我們不能再無條件加入「修課學生」資料夾,必須和其他功能一樣
先確認功能有開啟才能加入,否則會因為下載到空白檔案造成 lxml 發生錯誤。
  • Loading branch information
lantw44 committed Jan 27, 2022
1 parent 365e956 commit 4e90ee7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
3 changes: 1 addition & 2 deletions README.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -335,5 +335,4 @@ CEIBA 網站不會提供所有學生的帳號列表,因此「學生」資料
在已經存取過有開放查詢修課學生名單的「修課學生」資料夾以後,「學生」資料夾才會
有內容。如果想要下載不在修課學生名單中的學生資料,可以使用
`ceiba-dl get /課程/<學期>/<課程>/修課學生 /學生/<學號>` 。
其中 <課程> 表示有開放查詢修課學生名單的課程名稱。注意並非所有在 `ceiba-dl`
中顯示有「修課學生」資料夾的課程都有開放查詢修課學生名單。
其中 <課程> 表示有開放查詢修課學生名單的課程名稱。
12 changes: 8 additions & 4 deletions ceiba_dl/vfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -972,8 +972,10 @@ def fetch(self):
self.vfs, self, self._sn, result['teacher_info']))

# 修課學生
self.add(s['dir_course_students'], CourseRosterDirectory(
self.vfs, self, self._sn, self._name))
if ceiba_function_enabled(self.vfs.request, self._sn,
'student', '/modules/student/student.php'):
self.add(s['dir_course_students'], CourseRosterDirectory(
self.vfs, self, self._sn, self._name))

# 課程助教
course_list_row = self.vfs.root.courses.search_course_list(self._sn)
Expand Down Expand Up @@ -1077,8 +1079,10 @@ def fetch(self):
self.vfs, self, self._sn, []))

# 修課學生
self.add(s['dir_course_students'], CourseRosterDirectory(
self.vfs, self, self._sn, self._name))
if ceiba_function_enabled(self.vfs.request, self._sn,
'student', '/modules/student/student.php'):
self.add(s['dir_course_students'], CourseRosterDirectory(
self.vfs, self, self._sn, self._name))

# 課程助教
course_list_row = self.vfs.root.courses.search_course_list(self._sn)
Expand Down

0 comments on commit 4e90ee7

Please sign in to comment.