Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
035e495c
Commit
035e495c
authored
Aug 04, 2014
by
Christina Roberts
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4512 from Stanford-Online/dcadams/refactor_advanced_component_types
Refactor ADVANCED_COMPONENT_TYPES
parents
8e1bd42e
9e45e8f9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
31 deletions
+48
-31
cms/djangoapps/contentstore/views/component.py
+7
-29
cms/djangoapps/contentstore/views/course.py
+3
-2
cms/envs/aws.py
+5
-0
cms/envs/common.py
+33
-0
No files found.
cms/djangoapps/contentstore/views/component.py
View file @
035e495c
...
...
@@ -43,44 +43,22 @@ log = logging.getLogger(__name__)
# NOTE: unit_handler assumes this list is disjoint from ADVANCED_COMPONENT_TYPES
COMPONENT_TYPES
=
[
'discussion'
,
'html'
,
'problem'
,
'video'
]
SPLIT_TEST_COMPONENT_TYPE
=
'split_test'
# Constants for determining if these components should be enabled for this course
SPLIT_TEST_COMPONENT_TYPE
=
'split_test'
OPEN_ENDED_COMPONENT_TYPES
=
[
"combinedopenended"
,
"peergrading"
]
NOTE_COMPONENT_TYPES
=
[
'notes'
]
if
settings
.
FEATURES
.
get
(
'ALLOW_ALL_ADVANCED_COMPONENTS'
):
ADVANCED_COMPONENT_TYPES
=
sorted
(
set
(
name
for
name
,
class_
in
XBlock
.
load_classes
())
-
set
(
COMPONENT_TYPES
))
else
:
ADVANCED_COMPONENT_TYPES
=
[
'annotatable'
,
'textannotation'
,
# module for annotating text (with annotation table)
'videoannotation'
,
# module for annotating video (with annotation table)
'imageannotation'
,
# module for annotating image (with annotation table)
'word_cloud'
,
'graphical_slider_tool'
,
'lti'
,
# XBlocks from pmitros repos are prototypes. They should not be used
# except for edX Learning Sciences experiments on edge.edx.org without
# further work to make them robust, maintainable, finalize data formats,
# etc.
'concept'
,
# Concept mapper. See https://github.com/pmitros/ConceptXBlock
'done'
,
# Lets students mark things as done. See https://github.com/pmitros/DoneXBlock
'audio'
,
# Embed an audio file. See https://github.com/pmitros/AudioXBlock
SPLIT_TEST_COMPONENT_TYPE
,
# Adds A/B test support
'recommender'
# Crowdsourced recommender. Prototype by dli&pmitros. Intended for roll-out in one place in one course.
]
+
OPEN_ENDED_COMPONENT_TYPES
+
NOTE_COMPONENT_TYPES
ADVANCED_COMPONENT_TYPES
=
settings
.
ADVANCED_COMPONENT_TYPES
ADVANCED_COMPONENT_CATEGORY
=
'advanced'
ADVANCED_COMPONENT_POLICY_KEY
=
'advanced_modules'
# Specify xblocks that should be treated as advanced problems. Each entry is a tuple
# specifying the xblock name and an optional YAML template to be used.
ADVANCED_PROBLEM_TYPES
=
[
{
'component'
:
'openassessment'
,
'boilerplate_name'
:
None
}
]
ADVANCED_PROBLEM_TYPES
=
settings
.
ADVANCED_PROBLEM_TYPES
@require_GET
@login_required
...
...
@@ -358,7 +336,7 @@ def get_component_templates(course):
"type"
:
category
,
"templates"
:
templates_for_category
,
"display_name"
:
component_display_names
[
category
]
})
})
# Check if there are any advanced modules specified in the course policy.
# These modules should be specified as a list of strings, where the strings
...
...
cms/djangoapps/contentstore/views/course.py
View file @
035e495c
...
...
@@ -52,6 +52,7 @@ from .component import (
NOTE_COMPONENT_TYPES
,
ADVANCED_COMPONENT_POLICY_KEY
,
SPLIT_TEST_COMPONENT_TYPE
,
ADVANCED_COMPONENT_TYPES
,
)
from
.tasks
import
rerun_course
...
...
@@ -722,7 +723,7 @@ def _config_course_advanced_components(request, course_module):
component_types
=
tab_component_map
.
get
(
tab_type
)
found_ac_type
=
False
for
ac_type
in
component_types
:
if
ac_type
in
request
.
json
[
ADVANCED_COMPONENT_POLICY_KEY
][
"value"
]:
if
ac_type
in
request
.
json
[
ADVANCED_COMPONENT_POLICY_KEY
][
"value"
]
and
ac_type
in
ADVANCED_COMPONENT_TYPES
:
# Add tab to the course if needed
changed
,
new_tabs
=
add_extra_panel_tab
(
tab_type
,
course_module
)
# If a tab has been added to the course, then send the
...
...
@@ -1150,7 +1151,7 @@ def group_configurations_list_handler(request, course_key_string):
if
'text/html'
in
request
.
META
.
get
(
'HTTP_ACCEPT'
,
'text/html'
):
group_configuration_url
=
reverse_course_url
(
'group_configurations_list_handler'
,
course_key
)
course_outline_url
=
reverse_course_url
(
'course_handler'
,
course_key
)
split_test_enabled
=
SPLIT_TEST_COMPONENT_TYPE
in
course
.
advanced_modules
split_test_enabled
=
SPLIT_TEST_COMPONENT_TYPE
in
ADVANCED_COMPONENT_TYPES
and
SPLIT_TEST_COMPONENT_TYPE
in
course
.
advanced_modules
configurations
=
GroupConfiguration
.
add_usage_info
(
course
,
store
)
...
...
cms/envs/aws.py
View file @
035e495c
...
...
@@ -284,3 +284,8 @@ X_FRAME_OPTIONS = ENV_TOKENS.get('X_FRAME_OPTIONS', X_FRAME_OPTIONS)
##### ADVANCED_SECURITY_CONFIG #####
ADVANCED_SECURITY_CONFIG
=
ENV_TOKENS
.
get
(
'ADVANCED_SECURITY_CONFIG'
,
{})
################ ADVANCED COMPONENT/PROBLEM TYPES ###############
ADVANCED_COMPONENT_TYPES
=
ENV_TOKENS
.
get
(
'ADVANCED_COMPONENT_TYPES'
,
ADVANCED_COMPONENT_TYPES
)
ADVANCED_PROBLEM_TYPES
=
ENV_TOKENS
.
get
(
'ADVANCED_PROBLEM_TYPES'
,
ADVANCED_PROBLEM_TYPES
)
cms/envs/common.py
View file @
035e495c
...
...
@@ -645,3 +645,36 @@ ADVANCED_SECURITY_CONFIG = {}
### External auth usage -- prefixes for ENROLLMENT_DOMAIN
SHIBBOLETH_DOMAIN_PREFIX
=
'shib:'
OPENID_DOMAIN_PREFIX
=
'openid:'
################ ADVANCED_COMPONENT_TYPES ###############
ADVANCED_COMPONENT_TYPES
=
[
'annotatable'
,
'textannotation'
,
# module for annotating text (with annotation table)
'videoannotation'
,
# module for annotating video (with annotation table)
'imageannotation'
,
# module for annotating image (with annotation table)
'word_cloud'
,
'graphical_slider_tool'
,
'lti'
,
# XBlocks from pmitros repos are prototypes. They should not be used
# except for edX Learning Sciences experiments on edge.edx.org without
# further work to make them robust, maintainable, finalize data formats,
# etc.
'concept'
,
# Concept mapper. See https://github.com/pmitros/ConceptXBlock
'done'
,
# Lets students mark things as done. See https://github.com/pmitros/DoneXBlock
'audio'
,
# Embed an audio file. See https://github.com/pmitros/AudioXBlock
'recommender'
,
# Crowdsourced recommender. Prototype by dli&pmitros. Intended for roll-out in one place in one course.
'split_test'
,
'combinedopenended'
,
'peergrading'
,
'notes'
,
]
# Specify xblocks that should be treated as advanced problems. Each entry is a tuple
# specifying the xblock name and an optional YAML template to be used.
ADVANCED_PROBLEM_TYPES
=
[
{
'component'
:
'openassessment'
,
'boilerplate_name'
:
None
,
}
]
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment