ENGLISH·COURSE API
    Preparing search index...
    • Derives a module's route from its lessons and the learner's progress.

      Parameters

      • lessons: readonly RouteLesson[]

        The module's lessons, in any order

      • progress: LearnerProgress

        The completion marks, playback positions and last opened lesson read from the browser

      Returns ModuleRoute

      The steps in sequence order, and the module's finished count and time left

      The current lesson is the module's continue target, picked by findContinueTarget — the single rule every continue surface shares (the continue-target capability). In short: anchor on the last opened lesson of this module, or the furthest lesson with progress; keep it when unfinished, otherwise move to the first unfinished lesson after it, or to the first unfinished lesson at all. A module whose lessons are all finished has no current step.

      "Finished" is the shared completion rule from watch-progress: marked complete, or watched past the finish threshold.

      findContinueTarget

      const route = deriveModuleRoute(lessons, { completedLessonIds, positions, lastOpenedLessonId });
      route.steps.find((step) => step.state === "current");