getCourseTable method
- required String username,
- required SemesterDto semester,
override
Fetches the course schedule table for a specific student and semester.
Returns a list of course offerings enrolled by the student, including:
- Course details (name, credits, hours)
- Schedule information (days, periods, classroom)
- Teacher and class information
- Enrollment status and remarks
The username should be a student ID, and semester should be obtained
from getCourseSemesterList.
Throws an Exception if no courses are found for the given semester.
Implementation
@override
Future<List<ScheduleDto>> getCourseTable({
required String username,
required SemesterDto semester,
}) async {
return courseTableResult ??
[
(
number: '352204',
course: (
id: '3604174',
nameZh: '邊緣運算',
nameEn: 'Edge Computing',
),
phase: 1,
credits: 3.0,
hours: 3,
type: '選',
teacher: (
id: '12245',
nameZh: '賴建宏',
nameEn: 'Chien-Hung Lai',
),
classes: [
(id: '2788', nameZh: '電子四甲', nameEn: '4EN4A'),
(id: '2789', nameZh: '電子四乙', nameEn: '4EN4B'),
],
schedule: [
(
day: .monday,
period: .second,
classroom: (id: '353', name: '綜科104'),
),
(
day: .monday,
period: .third,
classroom: (id: '353', name: '綜科104'),
),
(
day: .monday,
period: .fourth,
classroom: (id: '353', name: '綜科104'),
),
],
status: null,
language: null,
syllabusId: '12245',
remarks: '電子大四合開',
),
(
number: '348337',
course: (
id: '3602012',
nameZh: '電路學(一)',
nameEn: 'Circuit Theory (I)',
),
phase: 1,
credits: 3.0,
hours: 3,
type: '必',
teacher: (
id: '11678',
nameZh: '陳晏笙',
nameEn: 'Yen-Sheng Chen',
),
classes: [
(id: '3022', nameZh: '電子二甲', nameEn: '4EN2A'),
],
schedule: [
(
day: .monday,
period: .seventh,
classroom: (id: '561', name: '先鋒501'),
),
(
day: .monday,
period: .eighth,
classroom: (id: '561', name: '先鋒501'),
),
(
day: .thursday,
period: .eighth,
classroom: (id: '561', name: '先鋒501'),
),
],
status: null,
language: '英語',
syllabusId: '11678',
remarks: '半導體二和電子二甲合開',
),
(
number: '352205',
course: (
id: '3604052',
nameZh: '計算機網路',
nameEn: 'Computer Networks',
),
phase: 1,
credits: 3.0,
hours: 3,
type: '選',
teacher: (
id: '10459',
nameZh: '段裘慶',
nameEn: 'CHYON-CHING TUAN',
),
classes: [
(id: '2788', nameZh: '電子四甲', nameEn: '4EN4A'),
(id: '2789', nameZh: '電子四乙', nameEn: '4EN4B'),
],
schedule: [
(
day: .tuesday,
period: .fifth,
classroom: (id: '52', name: '三教402'),
),
(
day: .tuesday,
period: .sixth,
classroom: (id: '52', name: '三教402'),
),
(
day: .tuesday,
period: .seventh,
classroom: (id: '52', name: '三教402'),
),
],
status: null,
language: null,
syllabusId: '10459',
remarks: '電子大四合開',
),
(
number: '352828',
course: (
id: '1001002',
nameZh: '體育',
nameEn: 'Physical Education',
),
phase: 3,
credits: 0.0,
hours: 2,
type: '必',
teacher: (
id: '24595',
nameZh: '黃庭婷',
nameEn: 'HUANG TING-TING',
),
classes: [
(id: '2037', nameZh: '體育專項(十)', nameEn: 'PE courses-10'),
],
schedule: [
(
day: .thursday,
period: .sixth,
classroom: null,
),
(
day: .thursday,
period: .seventh,
classroom: null,
),
],
status: null,
language: null,
syllabusId: '24595',
remarks: '肢體美學C',
),
(
number: '352902',
course: (
id: '1410145',
nameZh: '智慧財產權',
nameEn: 'Intellectual Property',
),
phase: 1,
credits: 2.0,
hours: 2,
type: '通',
teacher: (
id: '24534',
nameZh: '陳慧貞',
nameEn: 'HUIJEN CHEN',
),
classes: [
(id: '2648', nameZh: '博雅課程(三)', nameEn: 'Core Curriculum (III)'),
],
schedule: [
(
day: .monday,
period: .fifth,
classroom: (id: '562', name: '先鋒502'),
),
(
day: .monday,
period: .sixth,
classroom: (id: '562', name: '先鋒502'),
),
],
status: null,
language: null,
syllabusId: '24534',
remarks: '社會與法治向度',
),
(
number: '353181',
course: (
id: '0199998',
nameZh: '生成式AI文字與圖像生成原理實務',
nameEn:
'Generative AI: Text and Image Synthesis Principles and Practice',
),
phase: 1,
credits: 3.0,
hours: 3,
type: '選',
teacher: (
id: '11551',
nameZh: '黃正民',
nameEn: 'Huang Cheng-Ming',
),
classes: [
(id: '450', nameZh: '遠距教學(大)', nameEn: 'Distance Education (U)'),
],
schedule: [
(
day: .friday,
period: .second,
classroom: (id: '561', name: '先鋒501'),
),
(
day: .friday,
period: .third,
classroom: (id: '561', name: '先鋒501'),
),
(
day: .friday,
period: .fourth,
classroom: (id: '561', name: '先鋒501'),
),
],
status: null,
language: null,
syllabusId: '11551',
remarks: null,
),
];
}