This blog post was co-authored by OpenCraft team member Usman Khalid and edX team member Dave Ormsbee.

It is with great excitement that we're announcing that all the XModules in the Open edX platform have recently been converted into XBlocks.

What are XModules?

XModule was the original framework for course components in edx-platform, and the predecessor of the XBlock framework. When the XBlock framework was introduced into edx-platform in 2013, because of the numerous XModules in use, a compatibility layer was written to allow an incremental transition to the new framework. This compatibility layer allowed the XModule infrastructure to run XBlocks and for XBlocks to see the XModule infrastructure as the XBlock Runtime.

XModules and XBlocks had different life-cycle properties and in some cases different APIs for the same features. This transition state was dubbed “peak confusion” by the edX engineering team to express the idea that it would be an extremely confusing time for the courseware internals, but that we could eventually come down from that complexity once XModules were removed.

Transition

Over the years a number of lesser-used XModules were deprecated and removed. In 2015, the Vertical XModule was converted and in 2016 the Discussion XModule was converted.

When the Blockstore project was started, the decision was made that it would only support XBlocks and a new XBlock Runtime was written for it. As part of the work, the Video, HTML and Problem XModules were converted to XBlocks.

The remaining fifteen XModules have been converted to XBlocks through a months-long blended development effort by OpenCraft and the edX T&L team.

Why is this important?

With the system now only hosting XBlocks and not constrained by having to maintain backward compatibility with the old framework, it becomes possible to significantly simplify the courseware internals. This will make the system a lot more approachable for developers and significantly reduce the complexity of big jumps in capabilities of courseware.

We are looking forward to seeing these developments in the future!

Photo by Hunter Harritt on Unsplash

Introduction

One of the strengths of Open edX is its support for plugins called XBlocks that enable the creation of rich new kinds of content. Through XBlocks the Open edX platform can support interactive content that greatly expands the platform's capabilities. XBlocks have been used for all kinds of things, from adding a simple border around some content, to adding support for LTI to the platform. OpenCraft has had the opportunity to work on and create some great XBlocks, and we'll be taking a look at one of them in this post.

The Chatbot XBlock is perhaps one of the smaller and lesser known of the blocks we have developed, but we hope this highlight will bring to the attention of more people. The Chatbot XBlock describes itself as "an XBlock that allows learners to chat with a bot, where the bot follows a script and the learner can choose among possible responses."

Student Experience

The block is presented to students as a chat conversation with an interface that mimics the visual language of chat applications with bubbles of text pointing at different avatars. Students can pick from a number of pre-written responses. The simulated conversation will flow based on what response a student selects.

At a basic level the block allows you to create conversations by breaking them down into a series of individual interactions, or steps. Each interaction or step will support one or more messages along with select responses. If there are no responses, the conversation will automatically move on to the next step. If there are responses, the user can select one of them and the conversation will branch accordingly.

Conversation from the bot side can also include images, and feedback notes that can tell the user if their response was correct or not.

Authoring Experience

Course authors can use a a simple YAML-based syntax, to design complex, branching conversation with students which they can use to explore a subject in a more interactive way. For example, in a History course, a bot named "Churchill" asks a learner a few questions about World War II, and provides different pieces of information depending on the learner's answers. 

The syntax for designing these conversations supports a number of features that allow the conversation to seem more natural, and to split, merge and loop back if needed. For example, the syntax allows a number of more advanced features such as:

Currently, the only way to design these steps is through a special YAML-based syntax, however it follows a pretty straightforward format that should be easy to read and write. Here is a sample that uses most of the features (note any text following a # symbol is a comment):

- welcome-step:
    messages:
      - alice: "Hello my name is Alice!"
      - bob: "And I am Bob."
      - alice: "Today we will ask you a basic trivia question."
      - bob: "Would you like to continue?"
    responses:
      - "Yes": question-step
      - "No": exit-step
- question-step:
    messages:
      - alice: "Which is the highest mountain in the world."
    responses:
      - "Mount Everest": correct-step
      - K2: incorrect-step
      - "Mount Kea": incorrect-step
      - "Mariana Trench": incorrect-step
- correct-step:
    notice-text: "Correct answer"
    notice-type: correct
    messages:
      - alice: "Well Done!"
    responses:
      - Yay: exit-step
- incorrect-step:
    messages:
      - bob: Sorry, but that's the wrong answer.
      - alice: The correct answer is "Mount Everest".
      - bob: K2 is actually the second tallest mountain.
      - alice: Mount Kea extends underwater a lot, so by some measure it may be the tallest, but it isn't the highest.
      - bob: And "Mariana Trench" is a trench. The deepest one, but pretty much the opposite of a mountain.
      - alice: Would you like to try again?
    responses:
      - "Nah": exit-step
      - "Why not? I know the answer now.": question-step
- exit-step:
    messages:
      - ["Bye for now!", "Good bye", "That's it for now"]

The chat block can be a pretty useful tool in introducing concepts, asking questions, or giving feedback that are better done in a conversational format.

Final Words

You can find out more about the Chatbot XBlock, and get a detailed overview of the syntax by visiting its repository on GitHub.

We can also install the XBlock for you and provide support as needed. Write to us at contact@opencraft.com if you have any questions!

Get in touch

We'd love to hear from you! Send us a message and a member of our team will get back to you.
Contact us
Subscribe to our newsletter
© OpenCraft 2026
edX and Open edX® are trademarks of edX Inc
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram