Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
problem-builder
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
OpenEdx
problem-builder
Commits
4dcb2aa4
Commit
4dcb2aa4
authored
Jul 07, 2015
by
Jonathan Piacenti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle missing children gracefully.
parent
472a3130
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletions
+6
-1
problem_builder/tasks.py
+6
-1
No files found.
problem_builder/tasks.py
View file @
4dcb2aa4
...
@@ -9,6 +9,7 @@ from instructor_task.models import ReportStore
...
@@ -9,6 +9,7 @@ from instructor_task.models import ReportStore
from
opaque_keys
import
InvalidKeyError
from
opaque_keys
import
InvalidKeyError
from
opaque_keys.edx.keys
import
UsageKey
,
CourseKey
from
opaque_keys.edx.keys
import
UsageKey
,
CourseKey
from
xmodule.modulestore.django
import
modulestore
from
xmodule.modulestore.django
import
modulestore
from
xmodule.modulestore.exceptions
import
ItemNotFoundError
from
.mcq
import
MCQBlock
,
RatingBlock
from
.mcq
import
MCQBlock
,
RatingBlock
from
problem_builder
import
AnswerBlock
from
problem_builder
import
AnswerBlock
...
@@ -56,7 +57,11 @@ def export_data(course_id, source_block_id_str, block_types, user_id, get_root=T
...
@@ -56,7 +57,11 @@ def export_data(course_id, source_block_id_str, block_types, user_id, get_root=T
blocks_to_include
.
append
(
block
)
blocks_to_include
.
append
(
block
)
elif
block
.
has_children
:
elif
block
.
has_children
:
for
child_id
in
block
.
children
:
for
child_id
in
block
.
children
:
scan_for_blocks
(
block
.
runtime
.
get_block
(
child_id
))
try
:
scan_for_blocks
(
block
.
runtime
.
get_block
(
child_id
))
except
ItemNotFoundError
:
# Blocks may refer to missing children. Don't break in this case.
pass
scan_for_blocks
(
root
)
scan_for_blocks
(
root
)
...
...
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