Skip to content

Commit

Permalink
docs: Match docs on thumbs.js with the actual code in the xblock sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
sarina authored and feanil committed Dec 19, 2023
1 parent bb3f43d commit 9323c50
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/xblock-tutorial/anatomy/javascript.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ This section of the tutorial walks through the JavaScript file, `thumbs.js`_,
that is part of the Thumbs XBlock in the XBlock SDK.

If you completed the steps in :ref:`Build an XBlock Quick Start`, you can find
this file locally at ``xblock_development/xblock-sdk/sample_xblocks/thumbs/static/js/source/thumbs.js``.
this file locally at ``xblock_development/xblock-sdk/sample_xblocks/thumbs/static/js/src/thumbs.js``.

In the XBlock JavaScript file, you define code that manages user interaction
with the XBlock. The code is added to a :ref:`fragment <XBlock
Fragments>`.

The XBlocks JavaScript uses the runtime handler, and can use the ``children``
The XBlock's JavaScript uses the runtime handler, and can use the ``children``
and ``childMap`` functions as needed.

The JavaScript references the XBlock :ref:`fields <XBlock Fields>`
Expand All @@ -29,7 +29,7 @@ Note the following details about the JavaScript file.
* The function ``ThumbsBlock`` initializes the XBlock. A JavaScript function to
initialize the XBlock is required.

* The ``ThumbsBlock`` function maps to the contstructor in the :ref:`XBlock
* The ``ThumbsBlock`` function maps to the constructor in the :ref:`XBlock
Python file <The XBlock Python File>` and provides access to its methods and
fields.

Expand All @@ -39,7 +39,7 @@ Note the following details about the JavaScript file.
var handlerUrl = runtime.handlerUrl(element, 'vote');
* The ``ThumbsBlock`` function includes the ``Post`` commands to increase the up
* The ``ThumbsBlock`` function includes the ``POST`` commands to increase the up
and down votes in the XBlock.

The XBlock JavaScript code can also use the ``children`` and ``childMap``
Expand Down

0 comments on commit 9323c50

Please sign in to comment.