overview/notes
Good XBlock example: https://github.com/openedx/DoneXBlock/blob/master/done/done.py#L93-L98
Compre side-by-side, edx-platform XBlocks vs independent XBlocks
Just in time updates/questions: https://openedx.slack.com/archives/C0GF6FTHA
Why?
assets can be precompiled outside of edx-platform, so edx-platform can be frontend-free
simpler edx-platform, easier to refactor
testing independently
edx-platform built-in blocks
Direction | Tag(s) | Class | Known couplings, challenges |
---|---|---|---|
Real component blocks. Extract these Listed in increasing order of expected difficulty. | poll | xmodule.poll_block:PollBlock |
EditingMixin EmptyRawDataMixin XmlMixin XModuleMixin XModuleToXBlockMixin add_webpack_js_to_fragment add_webpack_sass_to_fragment shim_xmodule_js |
word_cloud | xmodule.word_cloud_block:WordCloudBlock | ||
annotatable | xmodule.annotatable_block:AnnotatableBlock | ||
html, and variants
| xmodule.html_block:HtmlBlock, and variants:
| ||
problem | xmodule.capa_block:ProblemBlock | ||
video, videoalpha | xmodule.video_block.video_block.VideoBlock | ||
Blocks that have replacements. Deprecate and remove? | lti discussion | xmodule.lti_block:LTIBlock xmodule.discussion_block:DiscussionXBlock | |
Template blocks. I don’t fully understand these, but Dave says they are very extractable. Need to follow up on this. | customtag custom_tag_template several custom tags:
| xmodule.template_block:CustomTagBlock xmodule.template_block:CustomTagTemplateBlock xmodule.template_block:TranslateCustomTagBlock | |
Special case blocks. These should stay put in edx-platform. | hidden error wrapper | xmodule.hidden_block:HiddenBlock xmodule.error_block:ErrorBlock xmodule.wrapper_block:WrapperBlock |
|
Structural blocks. Leave them alone for now. Long term, these will be replaced with Learning Core. | library course chapter sequential unit vertical | xmodule.library_root_xblock:LibraryRoot xmodule.course_block:CourseBlock xmodule.seq_block:SectionBlock xmodule.seq_block:SequenceBlock xmodule.unit_block:UnitBlock xmodule.vertical_block:VerticalBlock |
|
Dynamic blocks. Leave them alone for now. Long term, these will be replaced with Learning Core. | split_test conditional library_content randomize | xmodule.split_test_block:SplitTestBlock xmodule.conditional_block:ConditionalBlock xmodule.library_content_block:LibraryContentBlock xmodule.randomize_block:RandomizeBlock |
|
Decoupling strategies
ResourceTemplates
Points the runtime to yaml files that allow author to add pre-written versions of blocks. For example, a “multiple choice” template for ProblemBlock. I believe they are all in xmodule/templates.
for each class, is templates_dir_name defined?
No → Easy-- no templates! Safe to remove the ResourceTemplates mixin.
Yes → Harder. ??
Open question: Do the React editors use these?
EditingMixin
Seem very simple. Just add data
, override non_editable_metadata_fields
, override get_context
…
EmptyRawDataMixin
XmlMixin
…
XModuleToXBlockMixin
…
XBlockMixin
…
add_sass_to_fragment
…
add_webpack_js_to_fragment
…