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
df419f31
Commit
df419f31
authored
Jun 21, 2012
by
Victor Shnayder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make the LMS check_course command work again.
parent
9a0213bf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
1 deletions
+19
-1
lms/djangoapps/courseware/management/commands/check_course.py
+19
-1
No files found.
lms/djangoapps/courseware/management/commands/check_course.py
View file @
df419f31
...
...
@@ -14,6 +14,10 @@ import mitxmako.middleware as middleware
middleware
.
MakoMiddleware
()
def
check_names
(
user
,
course
):
'''
Complain if any problems have alphanumeric names.
TODO (vshnayder): there are some in 6.002x that don't. Is that actually a problem?
'''
all_ok
=
True
print
"Confirming all problems have alphanumeric names"
for
problem
in
course
.
xpath
(
'//problem'
):
...
...
@@ -53,7 +57,10 @@ def check_sections(user, course):
print
"Checking all section includes are valid XML"
for
f
in
os
.
listdir
(
sections_dir
):
sectionfile
=
sections_dir
+
'/'
+
f
print
sectionfile
#print sectionfile
# skip non-xml files:
if
not
sectionfile
.
endswith
(
'xml'
):
continue
try
:
etree
.
parse
(
sectionfile
)
except
Exception
as
ex
:
...
...
@@ -69,12 +76,23 @@ class Command(BaseCommand):
help
=
"Does basic validity tests on course.xml."
def
handle
(
self
,
*
args
,
**
options
):
all_ok
=
True
# TODO (vshnayder): create dummy user objects. Anon, authenticated, staff.
# Check that everything works for each.
# The objects probably shouldn't be actual django users to avoid unneeded
# dependency on django.
# TODO: use args as list of files to check. Fix loading to work for other files.
sample_user
=
User
.
objects
.
all
()[
0
]
print
"Attempting to load courseware"
course
=
course_file
(
sample_user
)
to_run
=
[
check_names
,
# TODO (vshnayder) : make check_rendering work (use module_render.py),
# turn it on
# check_rendering,
check_sections
,
]
...
...
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