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
fa3961d4
Commit
fa3961d4
authored
Mar 05, 2013
by
Arthur Barrett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merged openended and advanced categories per discussion at today's standup
parent
ef9f963f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
cms/djangoapps/contentstore/views.py
+6
-5
No files found.
cms/djangoapps/contentstore/views.py
View file @
fa3961d4
...
@@ -70,8 +70,7 @@ log = logging.getLogger(__name__)
...
@@ -70,8 +70,7 @@ log = logging.getLogger(__name__)
COMPONENT_TYPES
=
[
'customtag'
,
'discussion'
,
'html'
,
'problem'
,
'video'
]
COMPONENT_TYPES
=
[
'customtag'
,
'discussion'
,
'html'
,
'problem'
,
'video'
]
ADVANCED_COMPONENT_TYPES
=
{
ADVANCED_COMPONENT_TYPES
=
{
'openended'
:
[
'combinedopenended'
,
'peergrading'
],
'advanced'
:
[
'annotatable'
,
'combinedopenended'
,
'peergrading'
]
'advanced'
:
[
'annotatable'
],
}
}
ADVANCED_COMPONENT_POLICY_KEY
=
'advanced_modules'
ADVANCED_COMPONENT_POLICY_KEY
=
'advanced_modules'
...
@@ -293,12 +292,14 @@ def edit_unit(request, location):
...
@@ -293,12 +292,14 @@ def edit_unit(request, location):
course_metadata
=
CourseMetadata
.
fetch
(
course
.
location
)
course_metadata
=
CourseMetadata
.
fetch
(
course
.
location
)
course_advanced_keys
=
course_metadata
.
get
(
ADVANCED_COMPONENT_POLICY_KEY
,
[])
course_advanced_keys
=
course_metadata
.
get
(
ADVANCED_COMPONENT_POLICY_KEY
,
[])
#First try to parse with json
# check if the keys are in JSON format, or perhaps a literal python expression
if
isinstance
(
course_advanced_keys
,
basestring
):
# Are you JSON?
try
:
try
:
course_advanced_keys
=
json
.
loads
(
course_advanced_keys
)
course_advanced_keys
=
json
.
loads
(
course_advanced_keys
)
except
:
except
:
log
.
error
(
"Cannot json
decode course advanced policy: {0}"
.
format
(
course_advanced_keys
))
log
.
error
(
"Cannot JSON
decode course advanced policy: {0}"
.
format
(
course_advanced_keys
))
#It may be that it is not a json object, but can be evaluated as a python literal
# Not JSON? How about Python?
try
:
try
:
#This is a safe evaluation. See docs for ast
#This is a safe evaluation. See docs for ast
course_advanced_keys
=
ast
.
literal_eval
(
course_advanced_keys
)
course_advanced_keys
=
ast
.
literal_eval
(
course_advanced_keys
)
...
...
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