Is it possible to get some more detailed examples of how to use the LMS API?

Below is an example of dealing with a course for
o creating a course with a start and end date
o adding teachers to it
o adding students to it

More examples can be found in the downloaded SDK package. Please check the below example:


Course course = LMSContext.Current.Organization.Courses.Add("Course title",
    "Course description",
    "/sites/courseurl",
    "DOMAIN\\username",
    "User Name",
    "user@domain",
    1033,
    null);

course.Published = true;                       
course.StartDate = StartDateTime; // set start date
course.EndDate = EndDateTime; // set end date

course. AddTeacher(userName); // add one teacher by user name
course.SetTeachers(userNamesList); // or add a few teachers
course.SetLearners(userNamesList); // add learners

course.Update();

LMSContext.AllCourses are all courses on the current web application.

To create a new course you need to add it to the specified organization and use the course collection of the organization: Organization.Courses.

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

Article is closed for comments.

Powered by Zendesk