-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add course_home_url to course_api (#229)
- Loading branch information
Showing
7 changed files
with
53 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
eox_nelp/edxapp_wrapper/backends/course_experience_p_v1.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
"""Backend for course_experience module. | ||
This file contains all the necessary course_experience dependencies from | ||
https://github.com/openedx/edx-platform/blob/open-release/palm.master/openedx/features/course_experience/ | ||
""" | ||
from openedx.features.course_experience import course_home_url # pylint: disable=import-error | ||
|
||
|
||
def get_course_home_url(): | ||
"""Allow to get the course_home_url function from | ||
https://github.com/openedx/edx-platform/blob/open-release/palm.master/openedx/features/course_experience/__init__.py | ||
Returns: | ||
course_home_url function. | ||
""" | ||
return course_home_url |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
"""Wrapper course_experience. | ||
This contains all the required dependencies from course_experience. | ||
Attributes: | ||
backend: Imported module by using the plugin settings. | ||
course_experience: Module for openedx course_experience | ||
""" | ||
|
||
from importlib import import_module | ||
|
||
from django.conf import settings | ||
|
||
backend = import_module(settings.EOX_NELP_COURSE_EXPERIENCE_BACKEND) | ||
|
||
course_home_url = backend.get_course_home_url() |
9 changes: 9 additions & 0 deletions
9
eox_nelp/edxapp_wrapper/test_backends/course_experience_p_v1.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
"""Test backend for course_experience module.""" | ||
|
||
|
||
def get_course_home_url(): | ||
"""Return test function. | ||
Returns: | ||
string for testing basic home url | ||
""" | ||
return lambda course_key: f"http://testserver/learning/course/{course_key}/home" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters