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
a856c87d
Commit
a856c87d
authored
Jul 17, 2015
by
Tim Krones
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure dropdown excludes all choice fields (not just children of MRQs).
parent
4cc0b2e6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
18 deletions
+19
-18
problem_builder/instructor_tool.py
+19
-18
No files found.
problem_builder/instructor_tool.py
View file @
a856c87d
...
@@ -189,24 +189,25 @@ class InstructorToolBlock(XBlock):
...
@@ -189,24 +189,25 @@ class InstructorToolBlock(XBlock):
block_id
=
get_block_id
(
block
)
block_id
=
get_block_id
(
block
)
block_name
=
get_block_name
(
block
)
block_name
=
get_block_name
(
block
)
block_type
=
get_block_type
(
block
)
block_type
=
get_block_type
(
block
)
eligible
=
block_type
in
block_types
if
not
block_type
==
'pb-choice'
:
if
eligible
:
eligible
=
block_type
in
block_types
# If this block is a question whose answers we can export,
if
eligible
:
# we mark all of its ancestors as exportable too
# If this block is a question whose answers we can export,
if
ancestors
and
not
ancestors
[
-
1
][
"eligible"
]:
# we mark all of its ancestors as exportable too
for
ancestor
in
ancestors
:
if
ancestors
and
not
ancestors
[
-
1
][
"eligible"
]:
ancestor
[
"eligible"
]
=
True
for
ancestor
in
ancestors
:
new_entry
=
{
ancestor
[
"eligible"
]
=
True
"depth"
:
len
(
ancestors
),
"id"
:
block_id
,
new_entry
=
{
"name"
:
block_name
,
"depth"
:
len
(
ancestors
),
"eligible"
:
eligible
,
"id"
:
block_id
,
}
"name"
:
block_name
,
flat_block_tree
.
append
(
new_entry
)
"eligible"
:
eligible
,
if
block
.
has_children
and
not
block_type
==
'pb-mcq'
and
not
\
}
getattr
(
block
,
"has_dynamic_children"
,
lambda
:
False
)():
flat_block_tree
.
append
(
new_entry
)
for
child_id
in
block
.
children
:
if
block
.
has_children
and
not
getattr
(
block
,
"has_dynamic_children"
,
lambda
:
False
)():
build_tree
(
block
.
runtime
.
get_block
(
child_id
),
ancestors
=
(
ancestors
+
[
new_entry
]))
for
child_id
in
block
.
children
:
build_tree
(
block
.
runtime
.
get_block
(
child_id
),
ancestors
=
(
ancestors
+
[
new_entry
]))
root_block
=
self
root_block
=
self
while
root_block
.
parent
:
while
root_block
.
parent
:
...
...
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