Skip to content

MA-722 Render xBlock API - #8240

Merged
nasthagiri merged 1 commit into
masterfrom
mobile/render_xblock
Jun 5, 2015
Merged

MA-722 Render xBlock API#8240
nasthagiri merged 1 commit into
masterfrom
mobile/render_xblock

Conversation

@nasthagiri

Copy link
Copy Markdown
Contributor

https://openedx.atlassian.net/browse/MA-722

This PR encompasses the following:

  • Creates a new render_xblock endpoint under a feature flag for now.
  • Refactors LTI's, now deleted, render_courseware method in favor of a common render_xblock endpoint.
  • Replaces LTI's mock unit tests in favor of commonly shared semantically-testing unit tests created in TestRenderXBlockMixin.
  • Changes has_access so all enrollment checks are consolidated in get_course_with_access, instead of the responsibility shared between multiple places. This removes the need for can_load_forum.
  • Introduces a new disable_staff_debug_info parameter to disable rendering of Staff debug information in staff_problem_info.html.

Reviewers:

@nasthagiri nasthagiri changed the title refactor code for reusability and clarity. MA-722 Render xBlock API May 28, 2015
@nasthagiri
nasthagiri force-pushed the mobile/render_xblock branch 7 times, most recently from 88430c1 to 3875427 Compare May 29, 2015 15:43
@nasthagiri nasthagiri changed the title MA-722 Render xBlock API WIP: MA-722 Render xBlock API May 29, 2015
@nasthagiri
nasthagiri force-pushed the mobile/render_xblock branch 5 times, most recently from d112ab4 to ef84032 Compare June 2, 2015 22:50

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Note to reviewers: get_opt_course_with_access was removed since there were no callers. Must be an old function.

@nasthagiri
nasthagiri force-pushed the mobile/render_xblock branch 9 times, most recently from 1d30ece to 1efddd5 Compare June 3, 2015 15:27
@nasthagiri nasthagiri changed the title WIP: MA-722 Render xBlock API MA-722 Render xBlock API Jun 3, 2015

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Note to reviewers: Checking for enrollment was originally done in can_load_mobile in access.py. But now, all enrollment checks are consolidated in get_course_with_access.

@mcgachey

mcgachey commented Jun 3, 2015

Copy link
Copy Markdown
Contributor

I'd also suggest bringing in @cpennington and @simultech (Andrew Decker from UQ), since they're exploring some refactoring around the courseware template.

@nasthagiri

Copy link
Copy Markdown
Contributor Author

There are currently LTI failures caused by merge conflicts with the latest LtiConsumer changes. I'll need to take a look at those.

@nasthagiri
nasthagiri force-pushed the mobile/render_xblock branch 2 times, most recently from 871d90c to 0b68e5e Compare June 3, 2015 17:12
@nasthagiri
nasthagiri force-pushed the mobile/render_xblock branch from 3b914ad to d80f1d8 Compare June 4, 2015 04:46
Comment thread lms/djangoapps/courseware/views.py Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why disable_staff_debug_info?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

When viewing just an xBlock does it make sense to display other LMS-view related data, like "Submission History" and "Staff Debug Info"?
For Mobile, we don't want this information. It currently renders a UX-unfriendly pop-up with debug information.
May I assume the same requirements for LTI as well?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would have thought it would be convenient, particularly in the LTI use case, since the staff may not interact regularly with the LMS. @mcgachey: any thoughts on this?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

With the way we have things set up now, everybody's going to be viewing content as a student, so it doesn't make a lot of difference for that. My only major concern if we ever did have people use staff access would be that if a staff member viewed a chromeless template, is there a danger that they could escape into areas of the platform that we don't want them to access (at least in the LTI iframe), potentially ending up with recursive chrome?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yeah, good point. Given that, we may want to keep it safe and not expose staff information for now.

@ormsbee

ormsbee commented Jun 4, 2015

Copy link
Copy Markdown
Contributor

Done with my first pass.

@ormsbee

ormsbee commented Jun 4, 2015

Copy link
Copy Markdown
Contributor

Once the feature flag name is changed and you've confirmed that this doesn't explode access check or modulestore queries on your local dev, I'm 👍

@nasthagiri
nasthagiri force-pushed the mobile/render_xblock branch 4 times, most recently from edb4200 to e5a12cf Compare June 5, 2015 01:16
@nasthagiri

Copy link
Copy Markdown
Contributor Author

@BenjiLee @Mekkz @ormsbee The PR has been updated based on your comments. Ready for next round of review, before I squash and merge. Thanks.

@ormsbee

ormsbee commented Jun 5, 2015

Copy link
Copy Markdown
Contributor

👍

1 similar comment
@kdmccormick

Copy link
Copy Markdown
Member

👍

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What a useless block :)

@BenjiLee

BenjiLee commented Jun 5, 2015

Copy link
Copy Markdown
Contributor

One nitpick comment, otherwise 👍

@nasthagiri
nasthagiri force-pushed the mobile/render_xblock branch from e5a12cf to d240785 Compare June 5, 2015 15:18
nasthagiri added a commit that referenced this pull request Jun 5, 2015
@nasthagiri
nasthagiri merged commit 65bcc50 into master Jun 5, 2015
@nasthagiri
nasthagiri deleted the mobile/render_xblock branch June 5, 2015 16:13
mcgachey referenced this pull request in mcgachey/edx-platform Jun 9, 2015
…tent

Change https://github.com/edx/edx-platform/pull/8240 refactored the LTI
provider template rendering code and introduced an issue where a user was
required to be enrolled in a course before that course's content could be
accessed over LTI. According to the LTI design spec:
    https://docs.google.com/document/d/185hdPvIxcKtiDOLjb4sTGovA_WYXWz5Cd79gCzQwBms
we delegate access control over LTI content to the LTI consumer, rather
than requiring that users enroll in edX courses explicitly (and that admins
keep edX and LTI provider enrollemnts consistent when students add or drop
courses).

This change fixes the immediate issue, which is disrupting the LTI Provider
pilot currently running at Harvard.
@simultech

Copy link
Copy Markdown
Contributor

👍

Looks like this will work well with the chromeless refactoring.
Apologies for the delay, I'm at WWDC and wifi was overloaded.

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.

7 participants