This is an initial prototype for redesigning Discussion. This project is in the early stages of development and is not ready for general use. The XBlock currently only works with the edx-solutions' forks of edx-platform and cs_comments_service. The patches are in the process of being merged upstream, so this will eventually not be required anymore.
From the xblock-discussion repository, and within the Python virtual environment you used to setup the XBlock workbench or the LMS, install the requirements:
pip install -r requirements.txt
Since XBlock and xblock-discussion are both in development, it is
recommended to use the XBlock revision specified in the workbench/LMS
requirements.txt
file. The main XBlock repository is not always
ready to use in edx-platform and you might experience some issues.
You can enable the discussion xblock in studio through the advanced settings:
-
From the main page of a specific course, click on Settings, Advanced Settings in the top menu.
-
Check for the advanced_modules policy key, and add
"discussion-forum"
in the policy value list. Note that the use ofdiscussion-forum
instead ofdiscussion
is currently a limitation becausediscussion
is reserved to the xmodule, which is still supported. -
Click on the Save changes button.
To also use the xblock for the course discussion:
- Add
"discussion-course"
to advanced_modules the same way as described above. - Create a new section with the name DISCUSSION_TAB.
- Under the new secion -- after creating subsections -- add a new Advanced... discussion-course unit.
- Publish changes.
To add the discussion block to a unit, choose Discussion from the Advanced Components list in the studio.
Clicking the Edit button opens up a form that will let you change some basic settings:
The students will be able to post comments on the unit:
Node.js and npm are required to be able to compile and combine the coffeescript files into a single minified javascript file.
Install the node.js coffeescript module:
npm install
When needed, re-compile the javascript files:
./scripts/buildjs.sh
This will produce a new minified file under
discussion_app/static/discussion-xblock.$SHA.min.js
, where $SHA
is
the SHA hash of the file's contents.
When you re-compile the javascript files, you need to update the value
of the JS_SHA
variable in discussion_app/views.py
.
If you add new JavaScript/CoffeeScript files, you need to add them to
the list in scripts/buildjs.sh
in order to include them in the
compiled file.
Note that the code doesn't pass pylint at the moment. Will be fixed soon.
Install pylint:
pip install pylint==0.28.0
Check for quality violations:
pylint apps
Disable quality violations on a line or file:
# pylint: disable=W0123,E4567
The code in this repository is licensed under version 3 of the AGPL unless otherwise noted.
Please see LICENSE
for details.
Please do not report security issues in public. Please email [email protected].
You can discuss this code on the
edx-code Google Group
or in the #edx-code
IRC channel on Freenode.