Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add open responses card to page and resources #32589

Merged
merged 1 commit into from
Jul 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cms/envs/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -2706,6 +2706,7 @@
WIKI_HELP_URL = "https://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/en/latest/course_assets/course_wiki.html"
CUSTOM_PAGES_HELP_URL = "https://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/en/latest/course_assets/pages.html#adding-custom-pages"
COURSE_LIVE_HELP_URL = "https://edx.readthedocs.io/projects/edx-partner-course-staff/en/latest/course_assets/course_live.html"
ORA_SETTINGS_HELP_URL = "https://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/en/latest/course_assets/ora_settings.html"

# keys for big blue button live provider
COURSE_LIVE_GLOBAL_CREDENTIALS = {}
Expand Down
45 changes: 45 additions & 0 deletions lms/djangoapps/courseware/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,3 +267,48 @@ def get_allowed_operations(cls, course_key: CourseKey, user: Optional[User] = No
@staticmethod
def legacy_link(course_key: CourseKey):
return urls.reverse('tabs_handler', kwargs={'course_key_string': course_key})


class ORASettingsApp(CourseApp):
"""
Course App config for ORA app.
"""

app_id = "ora_settings"
name = _("Open Response Assessment Settings")
description = _("Course level settings for Open Response Assessment.")
documentation_links = {
"learn_more_configuration": settings.ORA_SETTINGS_HELP_URL,
}

@classmethod
def is_available(cls, course_key: CourseKey) -> bool:
"""
Open response is available for course with at least one ORA.
"""
oras = modulestore().get_items(course_key, qualifiers={'category': 'openassessment'})
return len(oras) > 0

@classmethod
def is_enabled(cls, course_key: CourseKey) -> bool:
"""
Get open response enabled status from course overview model.
"""
return True

@classmethod
def set_enabled(cls, course_key: CourseKey, enabled: bool, user: 'User') -> bool:
"""
Update open response enabled status in modulestore. Always enable to avoid confusion that user can disable ora.
"""
return True

@classmethod
def get_allowed_operations(cls, course_key: CourseKey, user: Optional[User] = None) -> Dict[str, bool]:
"""
Get allowed operations for open response app.
"""
return {
"enable": False,
"configure": True,
}
1 change: 1 addition & 0 deletions lms/envs/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -5211,6 +5211,7 @@ def _make_locale_paths(settings): # pylint: disable=missing-function-docstring
WIKI_HELP_URL = "https://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/en/latest/course_assets/course_wiki.html"
CUSTOM_PAGES_HELP_URL = "https://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/en/latest/course_assets/pages.html#adding-custom-pages"
COURSE_BULK_EMAIL_HELP_URL = "https://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/en/latest/manage_live_course/bulk_email.html"
ORA_SETTINGS_HELP_URL = "https://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/en/latest/course_assets/ora_settings.html"

################# Bulk Course Email Settings #################
# If set, recipients of bulk course email messages will be filtered based on the last_login date of their User account.
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
"wiki = lms.djangoapps.course_wiki.plugins.course_app:WikiCourseApp",
"custom_pages = lms.djangoapps.courseware.plugins:CustomPagesCourseApp",
"live = openedx.core.djangoapps.course_live.plugins:LiveCourseApp",
"ora_settings = lms.djangoapps.courseware.plugins:ORASettingsApp",
],
"openedx.course_tool": [
"calendar_sync_toggle = openedx.features.calendar_sync.plugins:CalendarSyncToggleTool",
Expand Down
Loading