There is certain gating logic around pre-reqs, timed exams, etc.
that happen at the SequenceModule level, and should be respected
when rendering descendant XBlocks (like individual problems) that
are in that Sequence. Rather than do a risky refactoring, I'm
keeping that logic where it is and having the render_xblock view
climb up through the ancestor list to call the SequenceModule for
that gating information.
We do _not_ check all descendants (so cousin leaf nodes in the
sequence) for cotent-type-based restrictions because sequences can
become very large (esp. when content libraries are used), and there
is a performance overhead.
If the enclosing sequence is gated in some way, we redirect to the
render_xblock view for that sequence, where hopefully some useful
messaging will be available. This is a stopgap. That redirect
should never happen because we should never be calling the leaf
XBlock for a sequence that is restricted in the MFE. But if somehow
we get there anyway, either by bug or by intrepid user fiddling,
it's better to redirect somewhere that an error _might_ be surfaced
rather than just failing.
This will actually be a little overzealous and lock things down
that should be made visible later. If there's a timed exam and the
exam is completed, it should be the case that content is visible
(just read-only). This commit will block the content before the exam
starts (this is right), open the content while the exam is live
(this is right), but make the content unavailable after the exam
period has finished (this is wrong).
But I am going to go forward with this even knowing it's wrong
because:
1. The render_xblock endpoint should never currently be used in
timed exams in an intentional way. Neither the mobile experience
nor the courseware MFE support it.
2. This fix will address security concerns for creative access
patterns, even if it goes too far.
3. We're going to need to do a lot of work to address both pluggable
access permissions handling and special exams in the courseware
MFE, and a better implementation can be done then.
4. I've had multiple failed attempts to get this to work without
breaking things on and off over the course of weeks, and this
is a relatively low risk way of doing it that doesn't involve
a major refactoring (though the bill for that will come due
when we bring timed exams to the MFE).
This method from the toggle legacy classes should not actually be
exposed to all. So we get rid of it by manually setting the cached
value. While we are at it, we convert the STORAGE_BACKING_FOR_CACHE
legacy waffle switch to its modern version. As the flag is not being
used elsewhere, this should not break anything.
We take the opportunity to modernize waffle switches from
block_structure.config: to do so we convert the INVALIDATE_CACHE_ON_PUBLISH and
RAISE_ERROR_WHEN_NOT_FOUND waffle switches from legacy classes to their modern
equivalents. These switches are not used outside of edx-platform, so this
change should not trigger any error.
simplified public keys
made migration
fixes for quality
added pylint fixes
fixed for pylint
added endpoint to retrieve user's receipt_ids
added tests for 404 with decryption error
fixed for quality
fixed for quality
updates for feedback
removed unnecessary method
fixed quality issue
updated tests
Updated status code and manage user func
update auth verification
Fixed auth condition
fixed test failuers
fixed style issues
fixed style issues
Created test for auth disabled use
Code refactor
Fixed form ain auth exchange
Fixed oauth apps with disabled user fail
applied quality fixes
Refactored tests
fixed quality issues
removed extra files
Fixed linter issues
Fixed linter issues
Blocks that were hidden by access checks would not be used when
calculating past due status for a unit. This adds in a check to
still look at those blocks, but will maintain not rendering them
when being accessed via the MFE
The honor enrollment mode is widely used in OpenEdx installations,
and recently it was not allowed for proctoring exam, but very anticipated.
Current PR makes it possible to start the proctoring exam in the honor enrollment
mode in case the provider is configured in that way.
While deleting a post, the number of comments are retrieved where API reports wrong number of total pages due to PY3 incompatible division:
response.data["pagination"]
{'previous': None, 'count': 3, 'num_pages': 1.02, 'next': 'http://apros.devstack.lms?ajax=1&page=2'}
Which results in PageNotFoundError:
is_thread)):
File "/edx/src/discussion-edx-platform-extensions/social_engagement/engagement.py", line 382, in _get_paginated_results
has_next = response.data["pagination"]["next"]
File "/edx/app/edxapp/edx-platform/lms/djangoapps/discussion/rest_api/views.py", line 526, in retrieve
form.cleaned_data["requested_fields"],
File "/edx/app/edxapp/edx-platform/lms/djangoapps/discussion/rest_api/api.py", line 1074, in get_response_comments
raise PageNotFoundError("Page not found (No results on this page).")
openedx.core.lib.exceptions.PageNotFoundError: Page not found (No results on this page).
Commit 7f59688 attempted to solve this using
`CourseOverview.course_exists`, but that check is case-
insensitive. This commit instead does a small refactor
to `lms.djangoapps.courseware.get_course` so that we can
handle a failed course lookup without broadly catching
a `ValueError`.
fixed quality issues
added comment
updated for comments
fixing test
removed typo
readded files
moved settings override
testing adding other keys
not overriding setting
The change to masquerade in the courseware view allows the proper
viewing of the xblock from the perspective of the masqueraded user.
In this case, it allows a staff user masquerading as a learner to see
their shift dates calls to action inside the MFE (the old view already
had this set up). The second change allows the staff user masquerading
to reset the schedule of the learner being masqueraded via the CTAs