Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRAFT: BB-2798 LTI plugin for piazza discussions #232

Conversation

pcockwell
Copy link

@pcockwell pcockwell commented Aug 4, 2020

Please note that this PR is NEVER intended to be merged. It has been created to facilitate discussion on the code while https://github.com/edx/edx-platform/pull/24584/ waits to be merged upstream. This PR builds on (and is compared directly against) https://github.com/open-craft/edx-platform/tree/kshitij/discussion-plugin-api.

** Testing Instructions **:

  1. Pull this branch to your localhost
  2. Open your LMS shell and run pip install -e .
  3. Open the discussion configs admin panel and add a discussion config with the values listed below. Of particular importance are the oauth credentials in the private config
    discussion_config_1
    discussion_config_2
  4. Open the learning context discussion configs admin panel and add a configuration with the values listed below
    learning_context_discussion_config
  5. Run make lms-restart
  6. Open the discussion panel for the demo course. It will redirect you to https://piazza.com/connect and indicate the oauth credentials used

Add Discussion model
Added discussions app
Added model to link course and discusion
Added API to access configuration options for a course
Added API to access active configuration for a course
Add new discussions app to test settings
Added tests for apis and fix existing tests
Fix bugs
Fix docs
name should never be blank
provider should be indexed and never blank
configs should never be blank and should default to an empty dict
@pcockwell pcockwell force-pushed the patrick/BB-2798-make-basic-lti-based-plugin-for-piazza branch from 3132844 to 98e9d1a Compare August 7, 2020 11:11
Copy link
Member

@xitij2000 xitij2000 left a comment

Choose a reason for hiding this comment

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

This PR is just for testing so not approving it yet. I've set up a sandbox based on this.

Comment on lines +36 to +50
HTML(
lti_embed(
html_element_id='piazza-discussion-lti-embed',
lti_launch_url=self.LTI_LAUNCH_URL,
oauth_key=discussion_config.private_config["oauth_key"],
oauth_secret=discussion_config.private_config["oauth_secret"],
resource_link_id=resource_link_id,
user_id=user_id,
roles='Student', # TODO Use API for this when available
context_id=course_id, # TODO Use API for this when available
context_title=course.display_name_with_default,
context_label=course.display_org_with_default,
result_sourcedid=result_sourcedid
)
)
Copy link
Member

Choose a reason for hiding this comment

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

It would be nice if we could be put this in an iframe. But it's OK for testing.

Comment on lines +1 to +4
# IMPORTANT: Do not import anything in this file in the top level of any
# file that is required by classes that are themselves DiscussionApps, as it
# will cause a circular import issue. Instead, import it only at the last moment

Copy link
Member

Choose a reason for hiding this comment

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

Thanks for pointing this out. I'll try to reduce these interdependencies.

from openedx.core.djangoapps.discussions.discussions_apps import DiscussionApp

Copy link
Member

Choose a reason for hiding this comment

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

Avoid unnecessary diffs, in this case it's OK since it's just to test.

@xitij2000 xitij2000 force-pushed the kshitij/discussion-plugin-api branch from ff81a85 to e22d5b4 Compare August 7, 2020 21:21
@xitij2000 xitij2000 force-pushed the kshitij/discussion-plugin-api branch 3 times, most recently from 40f8a53 to 303662a Compare October 23, 2020 14:16
@xitij2000 xitij2000 force-pushed the kshitij/discussion-plugin-api branch 8 times, most recently from 80be2d4 to 604d51e Compare October 30, 2020 13:27
@xitij2000 xitij2000 force-pushed the kshitij/discussion-plugin-api branch 2 times, most recently from 0cc328f to c5e85c7 Compare November 10, 2020 11:38
@xitij2000 xitij2000 closed this Nov 12, 2020
xitij2000 pushed a commit that referenced this pull request Aug 3, 2021
@bradenmacdonald bradenmacdonald deleted the patrick/BB-2798-make-basic-lti-based-plugin-for-piazza branch January 12, 2022 01:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants