Commit Graph

1898 Commits

Author SHA1 Message Date
Feanil Patel
ba4d98898e Merge pull request #27231 from edx/feanil/more_safe_sessions_updates
fix: Reduce safe-sessions false alarms.
2021-04-02 14:45:22 -04:00
Feanil Patel
4f725aa152 test: Add a test for setup_masquerade.
Test to verify the side-effects of calling this function since we now
rely on one of them in the SafeSessionMiddleware.
2021-04-02 14:19:10 -04:00
Asad Iqbal
d5e13195b7 Fix: Find the submission history using learner's email address along with username (#25642)
Co-authored-by: asadiqbal <aiqbal@edx.org>
Co-authored-by: asadiqbal08 <asad.iqbal@arbisoft.com>
2021-03-31 08:46:55 -04:00
Michael Terry
5d9e7e9fe5 fix: don't count hierarchy blocks as complete for assignments
When considering whether a subsection is complete as an assignment,
skip any "hierarchy" types (sequential, vertical, etc) that don't
have children. If the user can't see the content, don't risk
marking it as complete.

AA-726
2021-03-29 16:06:11 -04:00
edX requirements bot
41c1d237eb Python Requirements Update (#27094)
* Updating Python Requirements

* fix proctoring test

Co-authored-by: Zulqarnain <muhammad.zulqarnain@arbisoft.com>
2021-03-22 15:15:46 +05:00
Bianca Severino
557029b0db Revert edx-proctoring to 3.7.12 2021-03-19 09:38:43 -04:00
Bianca Severino
3af3f5bc11 Update edx-proctoring to 3.7.13 2021-03-17 13:18:16 -04:00
David Ormsbee
bebcbef3dd Merge pull request #26973 from open-craft/symbolist/convert-to-xblock
[BD-04] Create CustomTagTemplateBlock, convert TranslateCustomTagDescriptor to XBlock and remove RawDescriptor
2021-03-12 09:17:59 -05:00
Usama Sadiq
82406e970a reafctor: ran pyupgrade on lms/djangoapps/courseware (#26739) 2021-03-12 14:43:44 +05:00
Usman Khalid
78cd8be24d XMLModuleStore should use HiddenDescriptor instead of RawDescriptor.
In https://github.com/edx/edx-platform/pull/25955 `HiddenDescriptor`
(which was a subclass of `RawDescriptor` with a custom `student_view()`)
was converted to an XBlock. It is used as the `default_class` by the
`CachingDescriptorSystem` classes. However `RawDescriptor` is still
being used by `XMLModuleStore`. This has been replaced by
`HiddenDescriptor` as well.
2021-03-11 22:20:33 +05:00
Kyle McCormick
9b37e7d0fe refactor: centralize checks for canonical courseware experience & URL (#26815)
Centralize the logic for choosing between
MFE and Legacy-frontend courseware within
three new functions:
* courseware_mfe_is_active
* courseware_mfe_is_visible
* courseware_legacy_is_visible

This allows us to create another new function:
* get_courseware_url
which can be called anywhere in LMS/Studio
to get the canonical URL to courseware
content (whether it be MFE or Legacy).

In future commits we we begin using
get_courseware_url throughout the platform.

TNL-7796
2021-03-08 15:24:16 -05:00
Kyle McCormick
e792242b5f refactor!: remove redundant ENABLE_COURSEWARE_MICROFRONTEND toggle (#26792)
The Django setting
FEATURES['ENABLE_COURSEWARE_MICROFRONTEND']
has been an additional gate to activating
usage of the Learning MFE for an Open edX
instance.

The toggle is redundant with the
`courseware.courseware_mfe`
Waffle flag. By removing it, we simplify our config
and simplify our path towards making the Learning MFE
the default courseware experience.

TNL-7796
2021-03-02 11:36:43 -05:00
Usman Khalid
dd96a2aa72 Convert Course, Section and Sequence XModules to XBlocks. (#25965) 2021-03-02 10:29:33 -05:00
Kyle McCormick
558d2eb52c refactor: centralize learning MFE URL-building logic (#26689)
In preparation for switching LMS/Studio over
from serving legacy courseware URLs in certain
places (for example, resume_course_url) to serving
learning micro-frontend URLs.

TNL-7796
2021-02-24 08:50:15 -05:00
Michael Terry
23f34031d1 Merge pull request #26663 from edx/mikix/enable-schedules
feat: turn on schedule creation by default
2021-02-23 14:34:11 -05:00
Michael Terry
74887aa216 feat: turn on schedule creation by default
This commit removes several waffle toggles that have been enabled
on edx.org for years. It's time to remove the rollout gating for
these features and enable them by default.

This doesn't directly change any behavior. But it does create new
database objects by default now and allows for enabling other
schedule based features more easily.

Specifically, the following toggles were affected.

schedules.create_schedules_for_course
- Waffle flag removed as always-enabled
- We now always create a schedule when an enrollment is created

schedules.send_updates_for_course
- Waffle flag removed as always-enabled
- Course update emails are sent as long as the ScheduleConfig
  allows it.
- This is not a change in default behavior, because ScheduleConfig
  is off by default.

dynamic_pacing.studio_course_update
- Waffle switch removed as always-enabled
- Course teams can now always edit course updates directly in Studio

ScheduleConfig.create_schedules
ScheduleConfig.hold_back_ratio
- Model fields for rolling out the schedules feature
- Schedules are now always created
- This commit only removes references to these fields, they still
  exist in the database. A future commit will remove them entirely

This commit also adds a new has_highlights field to CourseOverview.
This is used to cache whether a course has highlights, used to
decide which course update email behavior they get. Previously every
enrollment had to dig into the modulestore to determine that.
2021-02-23 12:34:02 -05:00
Jawayria
0e621d3289 Merge pull request #26538 from edx/jawayria/bom-2352-3
BOM-2352: Removed unused imports from lms/djangoapps/{course_blocks, …
2021-02-23 16:09:22 +05:00
Jawayria
a383845b01 BOM-2352: Removed unused imports from lms/djangoapps/{course_blocks, course_goals, course_home_api, courseware} 2021-02-22 21:44:42 +05:00
Michael Roytman
71456cb2a4 feat: Install version 3.6.0 of the edx_proctoring library into edx-platform.
This release adds a new permission check when rendering the practice proctored exam view. If a learner is not in a paid enrollment track, the learner will no longer be able to use proctoring software in a practice proctored exam. As with other proctored exams, learners not in a paid enrollment track will see the exam content. This uses the 'can_take_proctored_exam' permission.
2021-02-22 10:23:36 -05:00
Aarif
0112339b20 replaced unittest assertions pytest assertions (#26543) 2021-02-19 11:58:27 +05:00
Usman Khalid
62ed654b31 Convert LTIModule into LTIBlock. (#25713) 2021-02-16 09:09:13 -05:00
David Ormsbee
691472e475 [feat]: Don't use Mathjax if an HTMLBlock has no math. (#26478)
Mobile apps load HTML (and other) XBlocks individually using the
render_xblock endpoint. This is an attmept to reduce the number
of requests and JS processing needed to do so by detecting when
we have math content in HTMLBlocks and only adding the Mathjax
resources when necessary.

This is controlled by the "courseware.optimized_render_xblock"
CourseWaffleFlag. For maximum safety, we currently only optimize
in this way when directly hitting HTMLBlocks, and not for
ProblemBlock or VerticalBlock.

This was made as part of edX's Hackathon XXV.
2021-02-11 13:31:17 -05:00
alangsto
9104983369 update edx-proctoring version (#26472)
updated for quality
2021-02-10 13:41:17 -05:00
Manjinder Singh
cd60646926 fix: Switch anonymous user ID hash from md5 to shake (#26198)
Now that we always return an existing value from the DB rather than trusting that ID generation is deterministic and constant over time, we're free to change the generation algorithm.

Our long term goal is to switch to random IDs, but we need to first investigate the uses of save=False. In the meantime, this is a good opportunity to move away from MD5, which has a number of cryptographic weaknesses. None of the known vulnerabilities are considered exploitable in this location, given the limited ability to control the input to the hash, but we should generally be moving away from it everywhere for consistency.

This change should not be breaking even for save=False callers, since those calls are extremely rare (1 in 100,000) and should only occur after a save=True call, at which point they'll use the stored value. Even if this were not true, for a save=False/True pair of calls to result in a mismatch in output, the first of the calls would have to occur around the time of the deploy of this code.

Co-authored-by: Tim McCormack <tmccormack@edx.org>
 
Co-authored-by: Tim McCormack <tmccormack@edx.org>
2021-02-10 07:37:27 -05:00
Bianca Severino
54505b82c4 Merge pull request #26436 from edx/bseverino/proctoring-check-fix
[MST-645] Account for no enrollment in courseware rules
2021-02-08 13:39:40 -05:00
Bianca Severino
4fb36709a5 Account for no enrollment in courseware rules 2021-02-08 13:12:52 -05:00
Carla Duarte
8d2d78dc61 AA-650: block deprecated keys from course home MFE 2021-02-08 13:00:36 -05:00
Matthew Piatetsky
b91f720b7e Merge pull request #26293 from edx/AA-613
[AA-613] Return content type gate for staff users when masquerading as the Learner in Audit or Learner in Limited Access Roles
2021-02-05 09:18:34 -05:00
Matthew Piatetsky
ae7d0a1ed8 Return content type gate for staff users when masquerading as the Learner in Audit or Learner in Limited Access Roles
This is necessary to display the content type gate in the UI
AA-613
2021-02-04 17:34:16 -05:00
Jawayria
03e6a874d0 Applied pylint-amnesty to courseware 2021-02-03 21:56:24 +05:00
Bianca Severino
902ab02357 Send proctoring requirements email when enrolled in relevant course mode 2021-02-01 09:44:30 -05:00
Matthew Piatetsky
84fb4679c9 Add contains_content_type_gated_content attribute to display items in the Sequence Metadata API. This attribute is used to display the content type gating paywall in frontend-app-learning.
Also, refactor existing timed exam code that checks for content_type_gated_content in a sequence to make it try with the new code
AA-613
2021-01-28 12:00:53 -05:00
Manjinder Singh
2723e0e2bd [ARCHBOM-1645] Modifying anonymous_id_for_user() to handly SECRET_KEY rotation (#26162)
These changes were initially made to make it easier to do SECRET_KEY rotations.  Along the way, we found it made sense to refractor the code as well.

Changes made:
- changed get_to_create to create because now the code should only get to this block when a write is necessary
- added a lookup for anonymous_user_id. This is to return an existing anonymous_user_id rather than calculating. This will mitigate the results of SECRET_KEY rotation.
- Added monitoring to help us make better decisions: should we not sue SECRET_KEY, performance considerations...
- put old function behind toggle in case something goes wrong in production with new code
- refractoring function structure for better understanding
2021-01-27 07:23:19 -05:00
Kyle McCormick
9d317c5c52 Fix patch of deprecated course_modes import path
The correct path is `common.djangoapps.course_modes...`
2021-01-21 10:49:47 -05:00
Kshitij Sobti
6769a280a9 Added a new LTI-based course tab, and LtiDiscussion tab
This PR lays the groundwork for a an LTI tab that can embed any LTI1.1-based
tool as an course tab. It also adds another tab based on this LTI Tab that
offers special support for embedding LTI-based discussion tools in a course
tab. If enabled this will replace the existing discussion tab.
2021-01-20 16:24:55 +05:30
David Ormsbee
098e047fce Merge pull request #25987 from edx/ormsbee/tnl-7636-xblock-access
Check sequence-level gating in render_xblock (TNL-7636)
2021-01-13 09:35:56 -05:00
David Ormsbee
5f94a082ce Check sequence-level gating in render_xblock (TNL-7636).
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).
2021-01-12 12:57:22 -05:00
Michael Terry
1482755bbd Show discount deadline in a timezone-aware way
Also, fix it and the access expiration deadline to not hardcode
the date presentation in an American way.
2021-01-08 13:56:18 -05:00
Usman Khalid
9e38b17202 Convert ErrorModule and NonStaffErrorModule to XBlocks. (#25570) 2021-01-07 10:51:33 -05:00
Igor Degtiarov
acbefd1079 Extend appropriate proctoring exam modes if provider allows it. (#25927)
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.
2021-01-05 13:20:35 -05:00
Robert Raposa
de16529ab6 Merge pull request #25885 from regisb/regisb/fix-deprecated-waffle-usage
[BD-21] Fix deprecated waffle usage
2020-12-17 12:41:40 -05:00
Régis Behmo
f29e415353 Fix deprecated usage of WaffleFlag.namespaced_flag_name
As of edx-toggles==1.2.0, the `WaffleFlag.namespaced_flag_name`
attribute is deprecated in favour of `WaffleFlag.name`.
2020-12-15 12:28:57 +01:00
Michael Terry
eef72b5ab7 TNL-7185: Send data, not rendered HTML to the learning MFE
Specifically, send data versions of course_expired_message and
offer_html.

The rendered HTML is still being sent for now, until the learning
MFE is updated to consume the data objects.
2020-12-14 13:41:03 -05:00
Kyle McCormick
643fbe82a0 Downgrade REDIRECT_TO_COURSEWARE_MICROFRONTEND to CourseWaffleFlag (#25815)
The toggle was previously an ExperimentWaffleFlag,
which allows stable A/B testing but increases the toggle's
complexity. Since we do not plan an doing any more A/B
tests as part of the MFE rollout, we can 'downgrade' this
toggle to a CourseWaffleFlag, which still allows us to do
phased rollout and course-run-specific overrides.
2020-12-09 13:48:47 -05:00
Régis Behmo
d13a1fb5f5 Upgrade completion
This is required because edx-platform uses the waffle API from
completion, which itself depends on edx-toggles. So if we change
edx-toggles import paths, we also need to upgrade our usage of
completion here.
2020-12-03 16:06:15 +01:00
Régis Behmo
a16cd71046 Start waffle namespace deprecation
By explicitly importing the legacy namespace classes, we make it clear
that we are using soon-to-be-deprecated classes. We will then be able to
start removing the legacy classes, one module at a time.
2020-12-03 16:06:14 +01:00
Michael Terry
181cb70149 Merge pull request #25670 from edx/mikix/as-user-timezone
AA-459: Respect user's timezone in access-expiration message
2020-12-01 09:13:45 -05:00
Simon Chen
00ad36839d MST-542 Roll out Accounts MFE IDV workflow (#25613)
* MST-542 remove the IDV redirect to Account MFE waffle flag to permanently redirect learners to new IDV workflow. This completes the rollout process on edx-platform
2020-12-01 09:08:12 -05:00
Michael Terry
e8d9a254bd AA-459: Respect user's timezone in access-expiration message
Before, it would just always use UTC.
2020-11-24 12:02:19 -05:00
0x29a
c83a505635 Replace 'multi_db = True' with 'databases = {alias for alias in connections}'
Check this ticket for details: https://code.djangoproject.com/ticket/29513
2020-11-19 14:06:51 +01:00