try so but it gives absolutely all the lessons
if (CModule::IncludeModule("learning")) { echo $COURSE_ID; $res = CLesson::GetList( Array("SORT" => "ASC"), Array("ACTIVE" => "Y", "ID" => $COURSE_ID) ); while ($arLesson = $res->GetNext()) { echo "Lesson name: " . $arLesson["LESSON_ID"] . "<br>"; } } following the example https://dev.1c-bitrix.ru/api_help/learning/classes/clesson/getlist.php