Merge pull request #17385 from mitodl/hack18_instructor_django_plugin
Changed 'instructor' django app to follow plugin pattern
This commit is contained in:
@@ -5,14 +5,34 @@ Instructor Application Configuration
|
||||
from django.apps import AppConfig
|
||||
from django.conf import settings
|
||||
from edx_proctoring.runtime import set_runtime_service
|
||||
from openedx.core.constants import COURSE_ID_PATTERN
|
||||
from openedx.core.djangoapps.plugins.constants import ProjectType, SettingsType, PluginURLs, PluginSettings
|
||||
|
||||
|
||||
class InstructorConfig(AppConfig):
|
||||
"""
|
||||
Default configuration for the "lms.djangoapps.instructor" Django application.
|
||||
Application Configuration for Instructor.
|
||||
"""
|
||||
name = u'lms.djangoapps.instructor'
|
||||
|
||||
plugin_app = {
|
||||
PluginURLs.CONFIG: {
|
||||
ProjectType.LMS: {
|
||||
PluginURLs.NAMESPACE: u'',
|
||||
PluginURLs.REGEX: u'courses/{}/instructor/api/'.format(COURSE_ID_PATTERN),
|
||||
PluginURLs.RELATIVE_PATH: u'views.api_urls',
|
||||
}
|
||||
},
|
||||
PluginSettings.CONFIG: {
|
||||
ProjectType.LMS: {
|
||||
SettingsType.DEVSTACK: {PluginSettings.RELATIVE_PATH: u'settings.devstack'},
|
||||
SettingsType.AWS: {PluginSettings.RELATIVE_PATH: u'settings.aws'},
|
||||
SettingsType.COMMON: {PluginSettings.RELATIVE_PATH: u'settings.common'},
|
||||
SettingsType.TEST: {PluginSettings.RELATIVE_PATH: u'settings.test'},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
def ready(self):
|
||||
if settings.FEATURES.get('ENABLE_SPECIAL_EXAMS'):
|
||||
from .services import InstructorService
|
||||
|
||||
0
lms/djangoapps/instructor/settings/__init__.py
Normal file
0
lms/djangoapps/instructor/settings/__init__.py
Normal file
20
lms/djangoapps/instructor/settings/aws.py
Normal file
20
lms/djangoapps/instructor/settings/aws.py
Normal file
@@ -0,0 +1,20 @@
|
||||
"""AWS environment variables unique to the instructor plugin."""
|
||||
import warnings
|
||||
|
||||
|
||||
def plugin_settings(settings):
|
||||
"""Settings for the instructor plugin."""
|
||||
# Analytics Dashboard
|
||||
settings.ANALYTICS_DASHBOARD_URL = settings.ENV_TOKENS.get(
|
||||
"ANALYTICS_DASHBOARD_URL", settings.ANALYTICS_DASHBOARD_URL
|
||||
)
|
||||
settings.ANALYTICS_DASHBOARD_NAME = settings.ENV_TOKENS.get(
|
||||
"ANALYTICS_DASHBOARD_NAME", settings.ANALYTICS_DASHBOARD_NAME
|
||||
)
|
||||
# Backward compatibility for deprecated feature names
|
||||
if 'ENABLE_S3_GRADE_DOWNLOADS' in settings.FEATURES:
|
||||
warnings.warn(
|
||||
"'ENABLE_S3_GRADE_DOWNLOADS' is deprecated. Please use 'ENABLE_GRADE_DOWNLOADS' instead",
|
||||
DeprecationWarning,
|
||||
)
|
||||
settings.FEATURES['ENABLE_GRADE_DOWNLOADS'] = settings.FEATURES['ENABLE_S3_GRADE_DOWNLOADS']
|
||||
42
lms/djangoapps/instructor/settings/common.py
Normal file
42
lms/djangoapps/instructor/settings/common.py
Normal file
@@ -0,0 +1,42 @@
|
||||
"""Common environment variables unique to the instructor plugin."""
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
|
||||
def plugin_settings(settings):
|
||||
"""Settings for the instructor plugin."""
|
||||
### Analytics Dashboard (Insights) settings
|
||||
settings.ANALYTICS_DASHBOARD_URL = ""
|
||||
settings.ANALYTICS_DASHBOARD_NAME = _('Your Platform Insights')
|
||||
settings.FEATURES.update({
|
||||
# Enable display of enrollment counts in instructor dash, analytics section
|
||||
'DISPLAY_ANALYTICS_ENROLLMENTS': True,
|
||||
|
||||
# Display the 'Analytics' tab in the instructor dashboard for CCX courses.
|
||||
# Note: This has no effect unless ANALYTICS_DASHBOARD_URL is already set,
|
||||
# because without that setting, the tab does not show up for any courses.
|
||||
'ENABLE_CCX_ANALYTICS_DASHBOARD_URL': False,
|
||||
|
||||
# Disable instructor dash buttons for downloading course data
|
||||
# when enrollment exceeds this number
|
||||
'MAX_ENROLLMENT_INSTR_BUTTONS': 200,
|
||||
|
||||
# Grade calculation started from the instructor dashboard will write grades
|
||||
# CSV files to the configured storage backend and give links for downloads.
|
||||
'ENABLE_GRADE_DOWNLOADS': False,
|
||||
|
||||
# Give course staff unrestricted access to grade downloads (if set to False,
|
||||
# only edX superusers can perform the downloads)
|
||||
'ALLOW_COURSE_STAFF_GRADE_DOWNLOADS': False,
|
||||
|
||||
# Show a section in the membership tab of the instructor dashboard
|
||||
# to allow an upload of a CSV file that contains a list of new accounts to create
|
||||
# and register for course.
|
||||
'ALLOW_AUTOMATED_SIGNUPS': False,
|
||||
|
||||
# Batch-Generated Certificates from Instructor Dashboard
|
||||
'CERTIFICATES_INSTRUCTOR_GENERATION': False,
|
||||
|
||||
# Whether to check the "Notify users by email" checkbox in the batch enrollment form
|
||||
# in the instructor dashboard.
|
||||
'BATCH_ENROLLMENT_NOTIFY_USERS_DEFAULT': True,
|
||||
})
|
||||
8
lms/djangoapps/instructor/settings/devstack.py
Normal file
8
lms/djangoapps/instructor/settings/devstack.py
Normal file
@@ -0,0 +1,8 @@
|
||||
"""Devstack environment variables unique to the instructor plugin."""
|
||||
|
||||
|
||||
def plugin_settings(settings):
|
||||
"""Settings for the instructor plugin."""
|
||||
# Set this to the dashboard URL in order to display the link from the
|
||||
# dashboard to the Analytics Dashboard.
|
||||
settings.ANALYTICS_DASHBOARD_URL = None
|
||||
8
lms/djangoapps/instructor/settings/test.py
Normal file
8
lms/djangoapps/instructor/settings/test.py
Normal file
@@ -0,0 +1,8 @@
|
||||
"""Test suite environment variables unique to the instructor plugin."""
|
||||
|
||||
|
||||
def plugin_settings(settings):
|
||||
"""Settings for the instructor plugin."""
|
||||
# Enable this feature for course staff grade downloads, to enable acceptance tests
|
||||
settings.FEATURES['ENABLE_GRADE_DOWNLOADS'] = True
|
||||
settings.FEATURES['ALLOW_COURSE_STAFF_GRADE_DOWNLOADS'] = True
|
||||
Reference in New Issue
Block a user