D
D
des1roer2016-05-13 06:46:27
1C-Bitrix
des1roer, 2016-05-13 06:46:27

How to get all lessons by course id in bitrix?

I try like this. but 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...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman, 2016-05-13
@r_zaycev

Из дока:

ID - идентификатор урока;
...
COURSE_ID - идентификатор курса;

Ну и метод-то deprecated, попробуйте CLearnLesson::GetList

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question