diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 160b466..2c490d0 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -16,6 +16,14 @@ Unreleased * +[0.3.0] - 2023-05-12 +******************** + +Changed +======= + +* New section-based courses are self-paced. + [0.2.0] - 2023-05-10 ******************** diff --git a/README.rst b/README.rst index 6df0fdd..e83675d 100644 --- a/README.rst +++ b/README.rst @@ -50,6 +50,24 @@ Then, in your ``devstack`` directory, run: cd /edx/src/section-to-course pip install -e . +Configuration (optional) +************************ + +New courses are self-paced. If you want to set relative deadlines in them, follow the next steps: + +#. Add the following `Waffle Flags`_ (with ``Everyone: Yes``) in Django admin: + + #. `studio.custom_relative_dates`_ + #. `course_experience.relative_dates`_ + #. `course_experience.relative_dates_disable_reset`_ +#. Go to `Django admin -> Course_Date_Signals -> Self paced relative dates`_ configs and add a config with ``Enabled: Yes``. + +.. _Waffle Flags: http://localhost:18000/admin/waffle/flag/ +.. _studio.custom_relative_dates: https://edx.readthedocs.io/projects/edx-platform-technical/en/latest/featuretoggles.html#featuretoggle-studio.custom_relative_dates +.. _course_experience.relative_dates: https://edx.readthedocs.io/projects/edx-platform-technical/en/latest/featuretoggles.html#featuretoggle-course_experience.relative_dates +.. _course_experience.relative_dates_disable_reset: https://edx.readthedocs.io/projects/edx-platform-technical/en/latest/featuretoggles.html#featuretoggle-course_experience.relative_dates_disable_reset +.. _Django admin -> Course_Date_Signals -> Self paced relative dates: http://localhost:18000/admin/course_date_signals/selfpacedrelativedatesconfig/ + Usage ***** @@ -58,6 +76,17 @@ Once installed, the plugin should automatically register itself within Django. B The admin views are in the Django admin, under the "Section to Course" section. From there, you can create a new section to course link, which will create a new course with the same content as the section you selected. You can also view the list of existing section to course links, refresh them, and delete them. +**Note:** The start date of a newly created course is in the future, so you will likely want to modify it in the "Schedule & Details" section in Studio. + +Relative due dates (optional) +============================= + +If you want to configure relative deadlines in your course, follow these steps: + +#. Mark a subsection in the newly created course as graded (otherwise, deadlines will be enforced but learners will not see these dates in the LMS). +#. Enter the number of weeks in the subsection's "Due in" field. +#. You may also want to adjust the new course's grading policy to change the weight of the section. + Refreshing a Course =================== diff --git a/section_to_course/__init__.py b/section_to_course/__init__.py index 0d39957..7bddbce 100644 --- a/section_to_course/__init__.py +++ b/section_to_course/__init__.py @@ -2,4 +2,4 @@ Factors sections from Open edX courses into their own new course. """ -__version__ = '0.2.0' +__version__ = '0.3.0' diff --git a/section_to_course/admin.py b/section_to_course/admin.py index 3434c87..197735f 100644 --- a/section_to_course/admin.py +++ b/section_to_course/admin.py @@ -252,6 +252,7 @@ def save(self, *args, **kwargs): number=number, run=run, display_name=cleaned_data['new_course_name'], + self_paced=True, ) return paste_from_template( destination_course_key=course.id, diff --git a/section_to_course/compat.py b/section_to_course/compat.py index b9a7b50..ee5aa27 100644 --- a/section_to_course/compat.py +++ b/section_to_course/compat.py @@ -16,6 +16,7 @@ def create_course( number: str, run: str, display_name: str, + self_paced: bool = False, ): """ Create a course to match a specific course key. @@ -27,7 +28,7 @@ def create_course( org=org, number=number, run=run, - fields={'display_name': display_name} + fields={'display_name': display_name, 'self_paced': self_paced}, ) diff --git a/section_to_course/tests/test_admin.py b/section_to_course/tests/test_admin.py index 66f40b5..116d2dd 100644 --- a/section_to_course/tests/test_admin.py +++ b/section_to_course/tests/test_admin.py @@ -122,6 +122,7 @@ def test_create_course(self): assert dest_course.org == org.short_name assert dest_course.number == 'NC101' assert dest_course.location.run == '2023' + assert dest_course.self_paced # Should not create a new link if it's already made. response = self.create_section_to_course_link(course, section, org) assert 'A course with this number, org, and run already exists.' in response.content.decode('utf-8')