Skip to content

Commit

Permalink
feat: mark new courses as self-paced
Browse files Browse the repository at this point in the history
  • Loading branch information
Agrendalath authored May 15, 2023
1 parent 1007357 commit da4dda6
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 2 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
********************

Expand Down
29 changes: 29 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
*****
Expand All @@ -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
===================

Expand Down
2 changes: 1 addition & 1 deletion section_to_course/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
Factors sections from Open edX courses into their own new course.
"""

__version__ = '0.2.0'
__version__ = '0.3.0'
1 change: 1 addition & 0 deletions section_to_course/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion section_to_course/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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},
)


Expand Down
1 change: 1 addition & 0 deletions section_to_course/tests/test_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit da4dda6

Please sign in to comment.