Commit Graph

169 Commits

Author SHA1 Message Date
Régis Behmo
7f80c1afa1 fix: adequate course key type in forum v2 (#36022)
When checking whether forum v2 is enabled, the course waffle flag
argument should be a CourseKey, not a str.
2024-12-12 16:11:53 +05:00
Régis Behmo
065adf398e feat: reapply forum v2 changes (#36002)
* feat: Reapply "Integrate Forum V2 into edx-platform"

This reverts commit 818aa343a2.

* feat: make it possible to globally disable forum v2 with setting

We introduce a setting that allows us to bypass any course waffle flag
check. The advantage of such a setting is that we don't need to find the
course ID: in some cases, we might not have access to the course ID, and
we need to look for it... in forum v2.

See discussion here: https://github.com/openedx/forum/issues/137

* chore: bump openedx-forum to 0.1.5

This should fix an issue with index creation on edX.org.
2024-12-12 12:18:33 +05:00
Diana Huang
818aa343a2 Revert "feat: Integrate Forum V2 into edx-platform"
This reverts commit 70b60ff256.
2024-12-06 11:19:06 -05:00
Muhammad Faraz Maqsood
70b60ff256 feat: Integrate Forum V2 into edx-platform
This commit introduces the new Forum V2 application, allowing users to choose between the legacy Forum V1 and the new Forum V2 at the course level.

Key Changes:
- Added waffle flag `discussions.enable_forum_v2` to enable Forum V2 for selected courses, allowing coexistence with Forum V1.
- Default data storage for Forum V2 is set to MongoDB, with an option to switch to MySQL using the waffle flag `forum_v2.enable_mysql_backend`.
- Introduced management command `forum_migrate_course_from_mongodb_to_mysql` for per-course data migration from MongoDB to MySQL.

Note: This PR does not include all unit tests for the Forum V2 native API due to ongoing migration efforts. Further updates will follow to ensure full test coverage before final release.

Co-authored-by: [Muhammad Faraz Maqsood] <faraz.maqsood@arbisoft.com>
Co-authored-by: [Ali Salman] <ali.salman@arbisoft.com>
2024-12-03 11:00:51 -05:00
Brian Mesick
e478975105 chore: Add missing PII annotations, update safelist
PII Annotations are very out of date, this commit adds most that were
missing in edx-platform, and some additional annotations to the
safelist. It is not comprehensive, several other upstream Open edX
packages also need to be updated. It also does not include removing
annotations that have been moved upstream, or been removed entirely.
Those are separate follow-on tasks.
2024-11-05 12:58:36 -05:00
Muhammad Anas
8f7496d00e fix: DiscussionsConfigurations admin error 2024-07-22 09:08:49 -04:00
Kyle McCormick
11626148d9 refactor: switch from mock to unittest.mock (#34844)
As of Python 3.3, the 3rd-party `mock` package has been subsumed into the
standard `unittest.mock` package. Refactoring tests to use the latter will
allow us to drop `mock` as a dependency, which is currently coming in
transitively through requirements/edx/paver.in.

We don't actually drop the `mock` dependency in this PR. That will happen
naturally in:

* https://github.com/openedx/edx-platform/pull/34830
2024-05-22 13:52:24 -04:00
ayesha waris
53270f17b3 chore: removed and merged multiple flags into enable_discussions_mfe flag (#33983) 2024-01-12 15:07:00 +05:00
Ahtisham Shahid
c287e0a8a8 fix: do not show legacy in case openedx discussion provider is selected (#33906)
* fix: do not show legacy in case openedx discussion provider is selected
2023-12-19 13:18:57 +05:00
Ahtisham Shahid
3c50f3e029 fix: update CourseOverviewTab while changing discussions settings (#33605) 2023-10-27 15:14:31 +05:00
Ahtisham Shahid
aec8fcd559 fix: use disabled as default for posting_restrictions (#33159) 2023-09-05 15:44:10 +05:00
Ahtisham Shahid
62718f2ed3 fix: removed redundant unit update from task (#33017) 2023-08-16 19:33:13 +05:00
Usama Sadiq
87216d360d fix: fix django4 deprecation warnings (#32978) 2023-08-16 17:07:09 +05:00
Muhammad Adeel Tajamul
4e5d3f9210 fix: update discussion enabled if true (#33008) 2023-08-15 14:27:15 +05:00
Muhammad Adeel Tajamul
a7f9770cc1 fix: set isPublish as True when creating topics in incontext discussion (#32953) 2023-08-10 13:23:08 +05:00
Awais Qureshi
4da29d914d chore: adding migrations related with django-history. (#32935) 2023-08-08 16:04:06 +05:00
ayesha waris
abac77e106 feat: adds ability to disable posting in discussions indefinitely (#32171)
* feat: adds ability to disable posting in discussions indefinitely

* test: fixed ffailing test cases

* test: added new model field in test cases

* refactor: removes unnecessary migrations

* refactor: removed previous migrations and adds new field in discussions api

* refactor: added docstring and changed method name

---------

Co-authored-by: ayesha waris <73840786+ayeshoali@users.noreply.github.com>
2023-05-23 15:08:06 +05:00
Ahtisham Shahid
fae6ece427 fix: added check for empty list in discussions settings task (#32105)
* fix: added check for empty list in discussions settings task
2023-04-25 12:44:26 +05:00
Ahtisham Shahid
bbcd3124a6 fix: added delay of 30sec to update_discussions_settings_from_course_task (#32038)
* fix: added delay of 30sec to update_discussions_settings_from_course_task

* fix: resolved linter issues
2023-04-07 15:09:04 +05:00
Ahtisham Shahid
0815d7a0cd fix: skip update_discussions_settings_from_course_task if rerun is not completed (#32036) 2023-04-06 18:30:45 +00:00
Ahtisham Shahid
906744e86b fix: added delay in topic creation task (#32008) 2023-03-30 14:57:31 +05:00
Ahtisham Shahid
87eedbc6c6 fix: resolved issue with topic creation in rerun (#31993) 2023-03-29 14:16:53 +05:00
Ahtisham Shahid
2bb71390e5 fix: resolved discussions data issue in course re-run (#31953)
* fix: resolved disucssions data issue in corse re-run

* fix: resolved linter issues

* refactor: added comment in task
2023-03-24 11:49:43 +05:00
Ahtisham Shahid
33dc8e1f21 feat: added user messages and backed now uses discussion_enabled flag (#31716)
* refactor: simplified tasks.py for discussions

* fix: do not create a topic for the unpublished unit

* feat: added user messages and backed now uses discussion_enabled flag

* fix: update default for discussion_enabled flag

* feat: removed redundant tests and fixes
2023-02-22 12:41:02 +05:00
Arunmozhi
d417a7561f refactor: rename ItemFactory to BlockFactory 2023-01-23 14:47:47 +01:00
0x29a
007e02cd76 refactor: xmodule/html_module.py -> xmodule/html_block.py 2022-12-19 17:48:49 +01:00
0x29a
0df1411636 refactor: xmodule/course_module.py -> xmodule/course_block.py 2022-12-19 17:48:49 +01:00
Kshitij Sobti
de0b132f10 fix: delay creation of course topics after course publish (#31307)
When running in a sharded MongoDB setup it's possible that querying the
modulestore right after the course publish signal will not return the
latest data.

This commit adds a delay similar to the one used in other places in the
codebase for a similar reason.
2022-11-18 16:49:29 +05:00
Kshitij Sobti
4fc9eb8324 fix: Change approach to processing course topics (#31200)
Course topics are now created by traversing the entire course structure from top to bottom instead of starting at the sequential level and then moving up or down as needed.

This also introduces a lot of debug logs to pontetially find the reason why under some circumstances new units don't get processed and end up without a discussions topic.
2022-11-01 14:31:27 +05:00
Kshitij Sobti
acbd424270 docs: Document the discussions app (#31045)
This change documents some of the workings of the discussions app for reference.
2022-10-19 17:15:07 +05:00
Kshitij Sobti
346257dadf fix: discussion topic links not created in some cases (#31032)
This commit attempts to fix cases where dicussion topic links aren't created
during a provider change.

It does so by eliminating areas where there could be desynchronisation between
the configuration the course configuration in Mogo and the discussion config
in MySQL.

The topic creation code now uses the database version of the config which is
more recent.
2022-09-29 17:16:03 +05:00
Kshitij Sobti
a923cfc32e feat: Add mechanism to migrate discussion blocks to discussion flag (#30931)
The new mechanism for marking that a unit has discussions is to use the
discussion_enabled flag instead of adding a discussion block. This change
adds code that is run during the course rerun process to mark any existing
units that have a discussion block as discussible using the new mechanism.
It doesn't touch the existing discussion blocks.

If the new discussions configuration experience is globally enabled, this
will also switch from the legacy provider to the new provider. It analyses
the course for any discussion blocks that have been added to graded
subsections, and if that is the case, it also automatically enables
discussions in graded subsections (which are otherwise disabled for new
courses by default).
2022-09-19 16:56:50 +05:00
Kshitij Sobti
6ebc9b3888 feat: Track additional discussion context for better deletion handling (#30140)
Tracks a discussion topics' section and subsection in a new context field so that we have access to that information when the topic's section/subsection/unit has been deleted. This is then used when a topic is deleted to append the section and subsection name to the topic title.

ADR: https://github.com/openedx/edx-platform/pull/29928
2022-09-13 16:01:25 +05:00
Kshitij Sobti
3cd3c60b59 feat: enable unit-level control over discussions by default (#30903)
This PR changes the default behaviour of the discussions experience by making the previous "unit-level
visibility" the default mechanism for configuring discussions.

Prior to this PR, under the new discussions configuration experience, all units would automatically get
assigned a discussion topic and have discussions enabled for them (other than units in graded or exam
subsections). However, if authors wanted they could enabled a custom visibility mode which would allow
toggling discussions on or off on a per-unit level.

This PR makes this custom visibility mode the standard behaviour (and eventually, only behaviour)
and enables discussion for all units by default. This replicates the behaviour that already existed,
however, now gives authors control over disabling discussions for individual units by default.

It also removes the ability to disable discussions for all units (while still keeping course-wide
discussions) enabled.
2022-09-07 16:41:17 +05:00
AsadAzam
21e9490c66 fix: hide new provider if flag disabled (#30925) 2022-08-31 18:29:53 +05:00
Kshitij Sobti
c2326f0399 fix: change conditions for showing new and legacy discussion providers (#30818)
The current logic for showing discussion providers makes it hard to switch
from the legacy to the new provider. This commit changes the conditions in
which different providers are shown, and which provider is used as default.

Before this commit, the new provider would be hidden if the legacy provider
was in use and vice-versa. So both would only be shown if neither legacy
nor the new provider were in use (i.e. an LTI provider was in use).

Now, all providers are always displayed to global staff. If the waffle
flag for the new provider is set
(`discussions.enable_new_structure_discussions`), then new provider is
always displayed, and the legacy provider is hidden unless it's currently
in use.

If flag is not set, then the new provider is always hidden unless it is
used by a course.

Finally, the default provider now depends on the flag above. If it is
set globally, then the default provider is the new provider, otherwise
the legacy provider remains the default provider.
2022-08-25 04:00:18 -07:00
Saad Yousaf
067ebd79ce fix: fix inIframe query param for discussion MFE link (#30846)
Co-authored-by: SaadYousaf <saadyousaf@A006-00314.local>
2022-08-12 15:13:06 +05:00
SaadYousaf
a948f535c1 feat: add flag to pass inIframe query_param for discussions MFE. 2022-08-03 15:39:02 +05:00
Mohammad Ahtasham ul Hassan
44fa09eba5 refactor: refactor discussions_xblock (#30636)
JIRA: https://openedx.atlassian.net/browse/BOM-2580
This PR aims at refactoring the discussion xblock sub project and moving it within the xmodule directory effectively removing its position as a sub project within edx-platform
2022-06-27 17:11:56 +05:00
Muhammad Umar Khan
a389a9ff10 Revert "Revert "refactor: move xmodule folder to root"" 2022-06-20 18:20:06 +05:00
Muhammad Umar Khan
d890f06507 Revert "refactor: move xmodule folder to root" 2022-06-20 16:03:48 +05:00
M Umar Khan
a91df0c40f refactor: move xmodule folder to root
- Moving xmodule folder to root as we're dissolving sub-projects of common folder in edx-platform
    - More info: https://openedx.atlassian.net/browse/BOM-2579
- -e common/lib/xmodule has been removed from the requirements as xmodule has itself become the part of edx-platform and not being installed through requirements
- The test files common/lib/xmodule/test_files/ have been removed as they are not being used anymore
2022-06-20 14:33:45 +05:00
Kshitij Sobti
a63d023fb6 fix: Run course discussion settings update task when settings change (#30520)
When discussion settings change in a course, call the discussion settings update task so that topics are updated automatically.
2022-06-02 11:04:11 +05:00
Eugene Dyudyunov
b4fecd620b refactor: rename toggle_warnings to toggle_warning (#30458)
Rename toggle_warnings to toggle_warning for consistency with setting_warning.
2022-05-24 11:47:31 -04:00
Muhammad Adeel Tajamul
93dbb03984 Revert "feat: removed piazza from discussion providers" 2022-05-11 13:27:38 +05:00
Eugene Dyudyunov
655e4a344f refactor!: update CourseWaffleFlag (#30351)
BREAKING: get rid of the LegacyWaffle-based CourseWaffleFlag.
Both CourseWaffleFlag and FutureCourseWaffleFlag now use the modern
WaffleFlag as parent class. FutureCourseWaffleFlag left to support ORA
transition to modern waffle.

Switch to the ORA version which supporting new Waffles.
2022-05-10 15:08:59 -04:00
adeel.tajamul
0b69c7b638 feat: removed piazza from discussion providers 2022-05-10 12:28:07 +05:00
Eugene Dyudyunov
8bd43207ca refactor!: switch from LegacyWaffle* to modern waffles (#30330)
This is a first stage for removing the LegacyWaffle* classes.

LegacyWaffleFlag usage replaced with WaffleFlag;
LegacyWaffleSwitche usage replaced with WaffleSwitch;
New CourseWaffleFlag added to the temporary module __future__ as FutureCourseWaffleFlag;
Updated all the imports to use CourseWaffleFlag from the __future__ module;

BREAKING CHANGE: A number of toggle related constants (e.g. ENABLE_ACCESSIBILITY_POLICY_PAGE)
changed types. They were strings, and are now toggle instances (e.g. WaffleSwitch). Although the entire
refactor should be self-contained in edx-platform, if any plugins or dependencies were directly
using these constants, they will break. If this is the case, try to find a better publicized way of
exposing those toggles.
2022-05-05 12:03:10 -04:00
SaadYousaf
149ca028d7 feat: update discussion settings API to handle changes reported_content_email_notification field 2022-04-13 15:10:48 +05:00
SaadYousaf
098f1223f4 docs: ADR for reported content email notification for moderators 2022-04-06 12:24:53 +05:00