Skip to content

Conversation

@xitij2000
Copy link
Contributor

@xitij2000 xitij2000 commented Oct 21, 2021

Description

The new discussion configuration system links discussion topics directly to the course structure. This change adds a new task that sends a discussion update signal if there are any changes to the course. This signal includes all the context needed to update the configuration of the course.

The handler for this new event will create a new entry for each unit that needs a topic in the database. In the future this will be used to see the topics in the course.

Dependencies

This PR build on a few other PRs:

The relevant commit is currently: 11de31553ca4e0f1dc816ae88235e41160e1d5f3

Supporting information

Testing instructions

  • For any existing course, change any setting and publish.
  • You should see new DiscussionTopicLink objects, one for each general topic and one for each unit.
  • If there are any graded discussions they will not be included.
  • Try changing the settings and make sure that the behaviour in the ADR is matched.
  • Try importing and exporting the course. The settings should be retained.
  • Try exporting a course and importing it as a new course. The discussion config model should be created to match the original settings.

Deadline

"None"

@openedx-webhooks
Copy link

Thanks for the pull request, @xitij2000! I've created BLENDED-987 to keep track of it in Jira. More details are on the BD-38 project page.

When this pull request is ready, tag your edX technical lead.

@openedx-webhooks openedx-webhooks added blended PR is managed through 2U's blended developmnt program needs triage labels Oct 21, 2021
@xitij2000 xitij2000 force-pushed the kshitij/tnl-8623/discussons-signals branch 3 times, most recently from 0d0fd11 to 11de315 Compare October 22, 2021 15:40
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if it's a comment or code commented out.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now I'm leaving this comment out since we don't have the new discussion provider set up or usable. The idea is to only send this signal if the provider needs it.

In this case I think we can just move this logic to inside the task.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If a course_wide topic is deleted we need to handle moving all content from that topic to the general topic which can't be deleted.

For this we can introduce a new signal: topic_deleted here: https://github.com/edx/edx-platform/blob/master/openedx/core/djangoapps/django_comment_common/signals.py

The signal handler for this can then execute a query to move over all content.

Note for future: Might be useful to also have events for topic_created and topic_edited though I'm not sure if we should just have this code send signal and move the logic to signal handlers, since it seems inefficient, and I don't have a real use case other than delete yet.

Comment on lines 132 to 159
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is meant to be for the new discussions experience. It will share most code with the legacy experience.

Comment on lines +544 to +584
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't really need a group right now since we don't have different topic ids across cohorts. This makes it easier to merge them since you can just stop filtering for group_id if cohorting is disabled.

However, a future in-context external provider might need this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If preferable, we can remove this for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The APIs and other mechanism already make sure that changes applied are in sync across the course structure and the models.

@xitij2000 xitij2000 force-pushed the kshitij/tnl-8623/discussons-signals branch 3 times, most recently from 6d33b98 to d6d3dd4 Compare October 26, 2021 18:26
@Cup0fCoffee
Copy link
Contributor

👍

  • I tested this: followed the testing steps
  • I read through the code
  • Includes documentation

@xitij2000 xitij2000 force-pushed the kshitij/tnl-8623/discussons-signals branch 5 times, most recently from 3afc4df to b508fb3 Compare November 1, 2021 09:18
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to be triggered every time? Or should it be triggered only if the course has in-context discussions enabled?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't want to add that logic to a generic place. So that logic is in the task itself. Additionally, there may be other things that this code can do which apply to providers that don't support in-context discussions as well.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this external_id used for?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The external_id is what will store the commentable id that is used by cs_comments_service. In the future, if we are dealing with another provider that supports in-context discussions, this can be used for them as well.

@asadazam93
Copy link
Contributor

@xitij2000 Can you please resolve the conflicts on this PR?

The new discussion configuration system links discussion topics directly to the course structure. This change adds a new task that sends a discussion update signal if there are any changes to the course. This signal includes all the context needed to update the configuration of the course.

The handler for this new event will create a new entry for each unit that needs a topic in the database. In the future this will be used to see the topics in the course.
@xitij2000 xitij2000 force-pushed the kshitij/tnl-8623/discussons-signals branch from 98b18d6 to 7d2bab5 Compare November 12, 2021 06:20
@xitij2000
Copy link
Contributor Author

@xitij2000 Can you please resolve the conflicts on this PR?

Done.

@edx-status-bot
Copy link

Your PR has finished running tests. There were no failures.

@asadazam93
Copy link
Contributor

@xitij2000 Is this ready to be merged?

@xitij2000
Copy link
Contributor Author

@xitij2000 Is this ready to be merged?

Yes.

@asadazam93 asadazam93 merged commit 285e2c4 into openedx:master Nov 12, 2021
@openedx-webhooks
Copy link

@xitij2000 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future.

@Agrendalath Agrendalath deleted the kshitij/tnl-8623/discussons-signals branch November 12, 2021 14:16
@edx-pipeline-bot
Copy link
Contributor

EdX Release Notice: This PR has been deployed to the staging environment in preparation for a release to production.

@edx-pipeline-bot
Copy link
Contributor

EdX Release Notice: This PR has been deployed to the production environment.

Comment on lines +133 to +141
'openedx': {
'features': [
Features.BASIC_CONFIGURATION.value,
Features.PRIMARY_DISCUSSION_APP_EXPERIENCE.value,
Features.QUESTION_DISCUSSION_SUPPORT.value,
Features.COMMUNITY_TA_SUPPORT.value,
Features.REPORT_FLAG_CONTENT_TO_MODERATORS.value,
Features.AUTOMATIC_LEARNER_ENROLLMENT.value,
Features.ANONYMOUS_POSTING.value,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this provider was added? this actually breaks the discussions app on stage/prod.
https://course-authoring.stage.edx.org/course/course-v1:UBCx+Water201x_2+2T2015/pages-and-resources/discussion/settings

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@awaisdar001 I think I mentioned this on one of the calls. It's the provider for the new experience.

I have a PR ready to add support for it in the MFE here: openedx/frontend-app-authoring#217

I think I should have gotten that merged first, or included this change with a separate PR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xitij2000 the mentioned PR is not ready yet, can you suggest how we can address this "bad user experience" in the short term? Maybe only revert the provide change in a separate PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@awaisdar001 I will make a PR that removes this provider right now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @xitij2000

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blended PR is managed through 2U's blended developmnt program merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants