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

Use DB configured canvas assignments in launches #3127

Merged
merged 1 commit into from
Oct 19, 2021

Conversation

marcospri
Copy link
Member

@marcospri marcospri commented Sep 20, 2021

Without #3126 this PR should still show not behavior changes.

The new canvas_db_configured_basic_lti_launch will handle newly configured assigments, existing ones and the ones that need merging.

Note that in this PR (pending the merging of the fronted part) canvas assignment are both url and db configured, that's why we needed to explicitly exclude db_configured ones from the url_conifgured predicate.

The rationale here is to merge this, start storing all assignment in the DB and later stop sending canvas the URL, file id, group set... and have a legacy_canvas_assignment (with params from the URL) and switch the canvas_db_configured_basic_lti_launch to pick the params from the DB.

@marcospri marcospri force-pushed the ext_lti_assignment_id-column-launches branch from 702f42b to a2e93ea Compare September 20, 2021 10:19
@marcospri marcospri force-pushed the ext_lti_assignment_id-column-frontend branch 2 times, most recently from 057dae5 to 48a4c00 Compare September 20, 2021 13:37
@marcospri marcospri force-pushed the ext_lti_assignment_id-column-frontend branch 2 times, most recently from 39f14dc to d6b01f8 Compare September 23, 2021 12:00
@marcospri marcospri force-pushed the ext_lti_assignment_id-column-launches branch from a2e93ea to a7a096a Compare September 23, 2021 12:31
@marcospri marcospri force-pushed the ext_lti_assignment_id-column-frontend branch from d6b01f8 to d1f91f9 Compare September 23, 2021 12:41
@marcospri marcospri force-pushed the ext_lti_assignment_id-column-launches branch from a7a096a to ff32a99 Compare September 23, 2021 12:42
@marcospri marcospri force-pushed the ext_lti_assignment_id-column-frontend branch from d1f91f9 to 196834c Compare September 23, 2021 13:31
@marcospri marcospri force-pushed the ext_lti_assignment_id-column-launches branch from ff32a99 to d442cb8 Compare September 23, 2021 13:34
@marcospri marcospri force-pushed the ext_lti_assignment_id-column-frontend branch from 196834c to d46b786 Compare September 27, 2021 15:25
@marcospri marcospri force-pushed the ext_lti_assignment_id-column-launches branch from d442cb8 to cba0950 Compare September 27, 2021 15:26
@marcospri marcospri changed the base branch from ext_lti_assignment_id-column-frontend to ext_lti_assignment_id-column-view September 28, 2021 13:07
@marcospri marcospri force-pushed the ext_lti_assignment_id-column-launches branch from 0752227 to 667b97b Compare September 28, 2021 14:13
@marcospri marcospri force-pushed the ext_lti_assignment_id-column-view branch 3 times, most recently from 932e114 to 2d38f0f Compare September 29, 2021 08:37
@marcospri marcospri force-pushed the ext_lti_assignment_id-column-launches branch from 667b97b to a0612b0 Compare September 29, 2021 09:41
@marcospri marcospri marked this pull request as ready for review September 29, 2021 09:58
lms/views/basic_lti_launch.py Outdated Show resolved Hide resolved
@marcospri marcospri force-pushed the ext_lti_assignment_id-column-view branch 6 times, most recently from c97d799 to 90b224e Compare October 11, 2021 14:03
Base automatically changed from ext_lti_assignment_id-column-view to master October 11, 2021 14:17
@marcospri marcospri force-pushed the ext_lti_assignment_id-column-launches branch 3 times, most recently from e73b33e to 70794ef Compare October 13, 2021 09:24
tool_consumer_instance_guid = request.params.get("tool_consumer_instance_guid")

return (
assignment_svc.exists(tool_consumer_instance_guid, resource_link_id)
assignment_svc.exists(
Copy link
Member Author

Choose a reason for hiding this comment

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

This will find assignments created by the new API (once the FE part is merged) but not yet launched

name = "canvas_file"

def __call__(self, context, request):
return ("canvas_file" in request.params) == self.value
return ("canvas_file" in request.params) == self.value and self.db_configured(
Copy link
Member Author

Choose a reason for hiding this comment

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

Exclude db_configured ones

def __call__(self, context, request):
return ("url" in request.params) == self.value
return ("url" in request.params) == self.value and self.db_configured(
Copy link
Member Author

Choose a reason for hiding this comment

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

Exclude db_configured ones

@marcospri marcospri changed the base branch from master to via-url October 18, 2021 15:12
@@ -93,16 +93,18 @@ def store_lti_data(self):
@view_config(canvas_file=True)
def canvas_file_basic_lti_launch(self):
"""
Respond to a Canvas file assignment launch.
Respond to a Canvas file assignment launch which is not db_configured.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we rename this view to legacy_canvas_file_basic_lti_launch()?

#
# We need to merge the two assignments into one.

# order is guaranteed by the query's `order by`
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
# order is guaranteed by the query's `order by`

I think we should remove the comment as it's unclear that the query refers to (since it refers to a SQLAlchemy query in another file). It's part of get_for_canvas_launch()'s contract/docstring that if it returns two assignments it'll be the old one first:

The assignment with the resource_link_id will always be first in the sequence.

Base automatically changed from via-url to master October 19, 2021 07:59
@marcospri marcospri force-pushed the ext_lti_assignment_id-column-launches branch from 70794ef to c0cdab2 Compare October 19, 2021 08:51
@marcospri marcospri merged commit 2996cef into master Oct 19, 2021
@marcospri marcospri deleted the ext_lti_assignment_id-column-launches branch October 19, 2021 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants