getMaterials method

  1. @override
Future<List<MaterialRefDto>> getMaterials(
  1. ISchoolCourseDto course
)
override

Fetches the list of course materials for the specified course.

Returns references to all files and materials posted to I-School Plus for the given course.

The course should be obtained from getCourseList.

Each material reference includes a title and SCORM resource identifier (href) that can be passed to getMaterial to obtain download information.

Materials are extracted from the course's SCORM manifest XML. Folder/directory items without actual files are automatically excluded.

Implementation

@override
Future<List<MaterialRefDto>> getMaterials(ISchoolCourseDto course) async {
  if (materialsResult case final result?) return result;

  final c = course.courseNumber.isNotEmpty
      ? course
      : (courseNumber: '324647', internalId: '10090205');

  return [
    (
      course: c,
      title: 'Python-6-2023-0913',
      href: 'jtaYElDtPEXlaW8_Qv2wxWqssM7ith',
    ),
    (
      course: c,
      title: '教育大數據微學程-學習護照',
      href: 'NgOBKdDO8dL8A5Sh3Vz3SkTZ9sT58i',
    ),
    (
      course: c,
      title: '[錄] 09131025',
      href: 'nr8-YzItjO1YRyoQbiPCmGhHXJuk4z',
    ),
    (
      course: c,
      title: 'Blockly_Maze',
      href: 'hC-BrNCI2-Ho25bmCleEcQ,,',
    ),
    (
      course: c,
      title: 'Chap 01-認識 Python-richwang',
      href: 'j5Joz_BH8cT2xM8vTOrQOE1VSrL5TL',
    ),
    (
      course: c,
      title: 'Chap 02-資料型別、變數與運算子-richwang',
      href: 'bSIzva1DuyYTy1TSPRLdwIOJW9g_kd',
    ),
    (
      course: c,
      title: '[錄] 10041011',
      href: 'nr8-YzItjO13lC_MUisMuPLEaPOrok',
    ),
    (
      course: c,
      title: 'Python-6-Seat-Portrait',
      href: 'jtaYElDtPEUbt8OK0bTJuahHaVTpl6',
    ),
  ];
}