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
5a4c0fb9
Commit
5a4c0fb9
authored
Jan 29, 2013
by
Chris Dodge
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
imports should have a marketing video. Treat it as a warning as every course might not have one.
parent
a0ccba6b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
common/lib/xmodule/xmodule/modulestore/xml_importer.py
+11
-4
No files found.
common/lib/xmodule/xmodule/modulestore/xml_importer.py
View file @
5a4c0fb9
...
...
@@ -247,7 +247,7 @@ def remap_namespace(module, target_location_namespace):
return
module
def
validate_category_hierarcy
(
module_store
,
course_id
,
parent_category
,
expected_child_category
):
def
validate_category_hierarc
h
y
(
module_store
,
course_id
,
parent_category
,
expected_child_category
):
err_cnt
=
0
parents
=
[]
...
...
@@ -324,11 +324,18 @@ def perform_xlint(data_dir, course_dirs,
for
course_id
in
module_store
.
modules
.
keys
():
# constrain that courses only have 'chapter' children
err_cnt
+=
validate_category_hierarcy
(
module_store
,
course_id
,
"course"
,
"chapter"
)
err_cnt
+=
validate_category_hierarc
h
y
(
module_store
,
course_id
,
"course"
,
"chapter"
)
# constrain that chapters only have 'sequentials'
err_cnt
+=
validate_category_hierarcy
(
module_store
,
course_id
,
"chapter"
,
"sequential"
)
err_cnt
+=
validate_category_hierarc
h
y
(
module_store
,
course_id
,
"chapter"
,
"sequential"
)
# constrain that sequentials only have 'verticals'
err_cnt
+=
validate_category_hierarcy
(
module_store
,
course_id
,
"sequential"
,
"vertical"
)
err_cnt
+=
validate_category_hierarchy
(
module_store
,
course_id
,
"sequential"
,
"vertical"
)
# check for a presence of a course marketing video
location_elements
=
course_id
.
split
(
'/'
)
if
Location
([
'i4x'
,
location_elements
[
0
],
location_elements
[
1
],
'about'
,
'video'
,
None
])
not
in
module_store
.
modules
[
course_id
]:
print
"WARN: Missing course marketing video. It is recommended that every course have a marketing video."
warn_cnt
+=
1
print
"
\n\n
------------------------------------------
\n
VALIDATION SUMMARY: {0} Errors {1} Warnings
\n
"
.
format
(
err_cnt
,
warn_cnt
)
...
...
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