edx-platform XBlock extraction

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

Github Issue for the Work: https://github.com/openedx/edx-platform/issues/34827

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

Direction

Tag(s)

Class

Known couplings, challenges

Real component blocks. Extract these Listed in increasing order of expected difficulty.

poll_question

xmodule.poll_block:PollBlock

 

 

 

 

ResourceTemplates

EditingMixin

EmptyRawDataMixin

XmlMixin

XModuleMixin

XModuleToXBlockMixin

add_webpack_js_to_fragment

add_webpack_sass_to_fragment

shim_xmodule_js

JS couplings

Comprehensive theming (Sass)

 

Note: This is replaced by poll . New courses should not use the old poll_question block, but we must keep it in the platform for backwards compatibility with old content.

word_cloud

xmodule.word_cloud_block:WordCloudBlock

 

annotatable

xmodule.annotatable_block:AnnotatableBlock

 

lti

xmodule.lti_block:LTIBlock

 

 

Note: This is replaced by lti_consumer . New courses should not use the old lti block, but we must keep it in the platform for backwards compatibility with old content.

html, and variants

  • about

  • course_info

  • static_tab

xmodule.html_block:HtmlBlock, and variants:

  • xmodule.html_block:AboutBlock

  • xmodule.html_block:CourseInfoBlock

  • xmodule.html_block:StaticTabBlock

 

discussion

xmodule.discussion_block:DiscussionXBlock

 

Note: This is replaced by the new in-unit discussion feature. New courses should not use the discussion block, but we must keep it in the platform for backwards compatibility with old content.

problem

xmodule.capa_block:ProblemBlock

 

video, videoalpha

xmodule.video_block.video_block.VideoBlock

 

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:

  • book

  • discuss

  • image

  • slides

  • videodev

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

  • Needs to stay in edx-platform

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

  • Not a focus for extraction because we’ll be re-implementing them in learning core.

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

  • Not a focus for extraction because we’ll be re-implementing them in learning core.

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

shim_xmodule_js