-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Library Content - Filter library content by CAPA problem type #6346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
53f7eca
9345228
13c19ac
31440f4
f632d69
cf4fb86
6ad8b07
5d190dc
3acdf72
e6e7f91
f15a94f
95bec64
3b1c5de
7c7be22
c294286
4c89f2c
2f8a5e6
af1b085
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,10 +2,12 @@ | |
| import json | ||
| import logging | ||
| import sys | ||
| from lxml import etree | ||
|
|
||
| from pkg_resources import resource_string | ||
|
|
||
| from .capa_base import CapaMixin, CapaFields, ComplexEncoder | ||
| from capa import responsetypes | ||
| from .progress import Progress | ||
| from xmodule.x_module import XModule, module_attr | ||
| from xmodule.raw_module import RawDescriptor | ||
|
|
@@ -172,6 +174,13 @@ def non_editable_metadata_fields(self): | |
| ]) | ||
| return non_editable_fields | ||
|
|
||
| @property | ||
| def problem_types(self): | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Make sure there is unit test coverage for this. Also, I'm confused about how this works. How are registered_tags specified? Is there some documentation that I can read about xblocks registry/registered_tags?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @cahrens there's |
||
| """ Low-level problem type introspection for content libraries filtering by problem type """ | ||
| tree = etree.XML(self.data) | ||
| registered_tags = responsetypes.registry.registered_tags() | ||
| return set([node.tag for node in tree.iter() if node.tag in registered_tags]) | ||
|
|
||
| # Proxy to CapaModule for access to any of its attributes | ||
| answer_available = module_attr('answer_available') | ||
| check_button_name = module_attr('check_button_name') | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need a TNL technical debt story to change our display of problem categories to use these human_names? The human_names are possibly now different from what Studio is showing in the Problem component button, correct?
If so, please create the technical debt story.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cahrens I don't think so, as it's not one-to-one relationship between problem categories and response types. E.g. "Custom Javascript/Python" and "Drag and Drop" problem templates are all processed by
CustomResponse.