<commit_before>Discussion XBlock
=================

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](https://github.com/edx-solutions/edx-platform) and
[cs_comments_service](https://github.com/edx-solutions/cs_comments_service). The
patches are in the process of being merged upstream, so this will
eventually not be required anymore.

Installation
------------

From the xblock-discussion repository, and within the Python virtual
environment you used to setup the XBlock workbench or the LMS, install
the requirements:

```bash
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.

Enabling in Studio
------------------

You can enable the discussion xblock in studio through the advanced
settings:

1. From the main page of a specific course, click on *Settings*,
   *Advanced Settings* in the top menu.
2. Check for the *advanced_modules* policy key, and add
   `"discussion-forum"` in the policy value list. Note that the use of
   `discussion-forum` instead of `discussion` is currently a limitation
   because `discussion` is reserved to the xmodule, which is still
   supported.

3. Click on the *Save changes* button.

To also use the xblock for the course discussion:

1. Add `"discussion-course"` to *advanced_modules* the same way as
   described above.
2. Create a new section with the name *DISCUSSION_TAB*.
3. Under the new secion -- after creating subsections -- add a new
   *Advanced... discussion-course* unit.
4. Publish changes.

Usage
-----

To add the discussion block to a unit, choose *Discussion* from the
*Advanced Components* list in the studio.

![Studio View](https://raw.githubusercontent.com/mtyaka/xblock-discussion/readme-doc/doc/img/studio-view.png)

Clicking the *Edit* button opens up a form that will let you change some
basic settings:

![Edit View](https://raw.githubusercontent.com/mtyaka/xblock-discussion/readme-doc/doc/img/edit-view.png)

The students will be able to post comments on the unit:

![Student View Initial](https://raw.githubusercontent.com/mtyaka/xblock-discussion/readme-doc/doc/img/student-view-1.png)

![Student View Post](https://raw.githubusercontent.com/mtyaka/xblock-discussion/readme-doc/doc/img/student-view-2.png)

![Student View List](https://raw.githubusercontent.com/mtyaka/xblock-discussion/readme-doc/doc/img/student-view-3.png)

Development
-----------

Node.js and npm are required to be able to compile the coffeescript
files into javascript.

Install the node.js coffeescript module:

```bash
npm install
```

When needed, re-compile the javascript files:

```bash
./scripts/coffee.sh
```
<commit_msg>Link to images in edx-solutions repository.<commit_after>Discussion XBlock
=================

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](https://github.com/edx-solutions/edx-platform) and
[cs_comments_service](https://github.com/edx-solutions/cs_comments_service). The
patches are in the process of being merged upstream, so this will
eventually not be required anymore.

Installation
------------

From the xblock-discussion repository, and within the Python virtual
environment you used to setup the XBlock workbench or the LMS, install
the requirements:

```bash
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.

Enabling in Studio
------------------

You can enable the discussion xblock in studio through the advanced
settings:

1. From the main page of a specific course, click on *Settings*,
   *Advanced Settings* in the top menu.
2. Check for the *advanced_modules* policy key, and add
   `"discussion-forum"` in the policy value list. Note that the use of
   `discussion-forum` instead of `discussion` is currently a limitation
   because `discussion` is reserved to the xmodule, which is still
   supported.

3. Click on the *Save changes* button.

To also use the xblock for the course discussion:

1. Add `"discussion-course"` to *advanced_modules* the same way as
   described above.
2. Create a new section with the name *DISCUSSION_TAB*.
3. Under the new secion -- after creating subsections -- add a new
   *Advanced... discussion-course* unit.
4. Publish changes.

Usage
-----

To add the discussion block to a unit, choose *Discussion* from the
*Advanced Components* list in the studio.

![Studio View](https://raw.githubusercontent.com/edx-solutions/xblock-discussion/aad91f12b37c47728bd545ffc63e8de79d421aa3/doc/img/studio-view.png)

Clicking the *Edit* button opens up a form that will let you change some
basic settings:

![Edit View](https://raw.githubusercontent.com/edx-solutions/xblock-discussion/aad91f12b37c47728bd545ffc63e8de79d421aa3/doc/img/edit-view.png)

The students will be able to post comments on the unit:

![Student View Initial](https://raw.githubusercontent.com/edx-solutions/xblock-discussion/aad91f12b37c47728bd545ffc63e8de79d421aa3/doc/img/student-view-1.png)

![Student View Post](https://raw.githubusercontent.com/edx-solutions/xblock-discussion/aad91f12b37c47728bd545ffc63e8de79d421aa3/doc/img/student-view-2.png)

![Student View List](https://raw.githubusercontent.com/edx-solutions/xblock-discussion/aad91f12b37c47728bd545ffc63e8de79d421aa3/doc/img/student-view-3.png)

Development
-----------

Node.js and npm are required to be able to compile the coffeescript
files into javascript.

Install the node.js coffeescript module:

```bash
npm install
```

When needed, re-compile the javascript files:

```bash
./scripts/coffee.sh
```

{'fraction_non_alphanumeric': 0.10123734533183353, 'fraction_numerical': 0.02169371685682147, 'mean_word_length': 4.319658119658119, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 14, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6970554', 'n_tokens_mistral': 1957, 'n_tokens_neox': 1804, 'n_words': 689}