Commit Graph

164 Commits

Author SHA1 Message Date
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
Juan David Buitrago
860dfde5b2 refactor: modified the imports to use openedx-events library (#29930)
* refactor: modified the imports to use openedx-events library

* chore: upgrade openedx-events to latest version

* fix: ran isort to avoid style errors

Co-authored-by: Maria Grimaldi <maria.grimaldi@edunext.co>
2022-03-07 19:42:13 +05:00
Kshitij Sobti
4431aaa012 docs: ADR for adding context to discussion topic links (#29928)
Discussion topic links don't contain enough useful information if the unit they
are linked to is deleted. This ADR proposes storing more information for each
discussion topic to overcome this limitation.
2022-03-07 11:16:15 +05:00
AsadAzam
60a21ad664 fix: add separate flag for new structure discussions (#29962)
* fix: add separate flag for new structure discussions

* fix: fixed tests
2022-02-23 10:57:19 +05:00
Kshitij Sobti
ce456db4b7 fix: discussion configuration not saved to course for new provider (#29863)
This fixes an issue where updating settings for the new discussion provider using the API doesn't save them to the course.
2022-02-21 19:38:01 +05:00
Ahtisham Shahid
75d8448ef5 refactor: Moved ProgramDiscussion/Live Configuration Models to program's app (#29871)
refactor: Moved ProgramDiscussion/Live Configuration Models to program's app
2022-02-09 15:43:22 +05:00