Commit a856c87d by Tim Krones

Make sure dropdown excludes all choice fields (not just children of MRQs).

parent 4cc0b2e6
...@@ -189,6 +189,7 @@ class InstructorToolBlock(XBlock): ...@@ -189,6 +189,7 @@ 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)
if not block_type == 'pb-choice':
eligible = block_type in block_types eligible = block_type in block_types
if eligible: if eligible:
# If this block is a question whose answers we can export, # If this block is a question whose answers we can export,
...@@ -196,6 +197,7 @@ class InstructorToolBlock(XBlock): ...@@ -196,6 +197,7 @@ class InstructorToolBlock(XBlock):
if ancestors and not ancestors[-1]["eligible"]: if ancestors and not ancestors[-1]["eligible"]:
for ancestor in ancestors: for ancestor in ancestors:
ancestor["eligible"] = True ancestor["eligible"] = True
new_entry = { new_entry = {
"depth": len(ancestors), "depth": len(ancestors),
"id": block_id, "id": block_id,
...@@ -203,8 +205,7 @@ class InstructorToolBlock(XBlock): ...@@ -203,8 +205,7 @@ class InstructorToolBlock(XBlock):
"eligible": eligible, "eligible": eligible,
} }
flat_block_tree.append(new_entry) flat_block_tree.append(new_entry)
if block.has_children and not block_type == 'pb-mcq' and not \ if block.has_children and not getattr(block, "has_dynamic_children", lambda: False)():
getattr(block, "has_dynamic_children", lambda: False)():
for child_id in block.children: for child_id in block.children:
build_tree(block.runtime.get_block(child_id), ancestors=(ancestors + [new_entry])) build_tree(block.runtime.get_block(child_id), ancestors=(ancestors + [new_entry]))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment