Native XBlocks Morning Session


API Example: https://github.com/open-craft/problem-builder/blob/master/doc/Native%20APIs.md

Part of the Course Blocks API

What is in the XBlock API - Student View State

  • Student View Data API
    • Provides all the data needed to render the View
    • Example of this in the Video API
  • Student View User state API
    • Provides all the data for the user
    • Call right before loading
    • Call the Xblock handler to save/submit the users state

Example - New video xblock

  • Implement Student View Data 
    • Returns all the data you need to render the API
    • Render the mobile UX from this
  • Implement Student View User State to retrieve the current state


Offline mode is still a challenge

  • Answers are not available to API calls are required in both directions to submit answers and grade
  • Can we encrypt the answers on the device?
  • Could we use JavaScript to render xBlocks rather than the Native languages?


Example / Recommended Xblock: Poll

Braden recommends if someone wants to try implementing a native (iOS or Anroid) XBlock frontend, do it for poll or survey:

Code: https://github.com/open-craft/xblock-poll

Native API docs: https://github.com/open-craft/xblock-poll#api-for-native-mobile-frontends

Current APIs available for xBlocks

Drag and Drop: https://github.com/edx-solutions/xblock-drag-and-drop-v2


What we worked on 

OpenCraft's repository: demo-courses

  • this contains repos with courses for xblock demos

XBlock Internationalization

Now it works!

How: