Create a new course with restricted course access

CaseyV
Community Member

Greetings,

I would like to create a canvas course via the API and restrict course access based on the course start_date and end_date. 

I can successfully create the course with start_date and end_date, however, the course isn't published and the checkbox to "Restrict students from viewing course before course start date" is not checked".

To "publish" the course, I set the "offer" parameter as true. Now when I create a course, the course is published but the "Restrict students from viewing course before course start date" is not checked" is still unchecked. Here is an example of the payload in the api request:

data: {
      course: {
        name,
        start_at,
        end_at,
        license: 'private',
        sis_course_id,
        allow_student_forum_attachments: true,
        timezone,
        course_format: 'online',
        restrict_enrollments_to_course_dates: true
      },
      enable_sis_reactivation: true,
      // offer: true
    }

 

From my understanding, when I create a course with start_date, end_date, and restrict_enrollments_to_course_dates, when the course is published, students should not be able to engage in the course until the start date. I don't know how to update this payload to reflect that behavior.

 

0 Likes