Skip to content

Instantly share code, notes, and snippets.

@bradenmacdonald
Created July 28, 2016 23:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bradenmacdonald/b576c59e46af8df9949fa84b3bc7a4b6 to your computer and use it in GitHub Desktop.
Save bradenmacdonald/b576c59e46af8df9949fa84b3bc7a4b6 to your computer and use it in GitHub Desktop.
Status of XBlock fields in edx-platform runtime

Status of the existing edx-platform implementation of fields, as of 2016-07-28:

Scope.content (UserScope.NONE, BlockScope.DEFINITION):

  • Studio student_view: read-only in student view.
  • Studio studio_view: read/write. Stored in modulestore.
  • LMS: read-only

Scope.settings (UserScope.NONE, BlockScope.USAGE):

  • Studio student_view: read-only in student view.
  • Studio studio_view: read/write. Stored in modulestore.
  • LMS: read-only

Scope.user_state (UserScope.ONE, BlockScope.USAGE):

  • Studio student_view: read/write in student view. Stored temporarily in user's session only.
  • Studio studio_view: not supported, but returns default value.
  • LMS: read/write

Scope.user_state_summary (UserScope.ALL, BlockScope.USAGE):

  • Studio student_view: read/write. stored temporarily in user's session only.
  • Studio studio_view: not supported, but returns default value.
  • LMS: read/write

Scope.user_info (UserScope.ONE, BlockScope.ALL):

  • Studio student_view: read/write. stored temporarily in user's session only. Shared across courses.
  • Studio studio_view: not supported, but returns default value.
  • LMS: read/write. Shared across courses. Shared regardless of XBlock type as expected.

Scope.preferences (UserScope.ONE, BlockScope.TYPE):

  • Studio student_view: read/write. stored temporarily in user's session only. Shared across courses.
  • Studio studio_view: not supported, but returns default value.
  • LMS: read/write. Shared across courses. Restricted to one XBlock type as expected.

Other scopes: Merely attempting to define other types of fields or even a Scope like Scope(UserState.ONE, BlockScope.Usage) will cause errors (e.g. InvalidScopeError when split modulestore iterates over all fields to see which ones are dirty before saving, even if the field in question is not modfied)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment