Commit Graph

543 Commits

Author SHA1 Message Date
Usama Sadiq
859df03049 refactor: ran pyupgrade on lms/djangoapps/courseware (#26737) 2021-03-12 12:15:58 +05:00
Usman Khalid
62ed654b31 Convert LTIModule into LTIBlock. (#25713) 2021-02-16 09:09:13 -05:00
Jawayria
03e6a874d0 Applied pylint-amnesty to courseware 2021-02-03 21:56:24 +05:00
Usman Khalid
9e38b17202 Convert ErrorModule and NonStaffErrorModule to XBlocks. (#25570) 2021-01-07 10:51:33 -05:00
Dillon Dumesnil
e17e691d54 AA-501: Use hidden blocks to determine past due status
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
2021-01-06 14:11:03 +00: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
Kyle McCormick
151bd13666 Use full names for common.djangoapps imports; warn when using old style (#25477)
* Generate common/djangoapps import shims for LMS
* Generate common/djangoapps import shims for Studio
* Stop appending project root to sys.path
* Stop appending common/djangoapps to sys.path
* Import from common.djangoapps.course_action_state instead of course_action_state
* Import from common.djangoapps.course_modes instead of course_modes
* Import from common.djangoapps.database_fixups instead of database_fixups
* Import from common.djangoapps.edxmako instead of edxmako
* Import from common.djangoapps.entitlements instead of entitlements
* Import from common.djangoapps.pipline_mako instead of pipeline_mako
* Import from common.djangoapps.static_replace instead of static_replace
* Import from common.djangoapps.student instead of student
* Import from common.djangoapps.terrain instead of terrain
* Import from common.djangoapps.third_party_auth instead of third_party_auth
* Import from common.djangoapps.track instead of track
* Import from common.djangoapps.util instead of util
* Import from common.djangoapps.xblock_django instead of xblock_django
* Add empty common/djangoapps/__init__.py to fix pytest collection
* Fix pylint formatting violations
* Exclude import_shims/ directory tree from linting
2020-11-10 07:02:01 -05:00
Matthew Piatetsky
2153057142 Add XBlock service for content type gating
This is used in this commit to check if a timed exam contains any problems that have been gated by content type gating
REV-1510
2020-10-14 08:02:51 -04:00
Tim McCormack
f29e418264 Revert "Revert "ARCHBOM-1494: Refer to custom attributes, not metrics, especially with edx-django-utils (#25010)" (#25025)" (#25055)
This reverts commit 986a448d9e.
2020-09-28 13:53:57 +00:00
Ahtisham Shahid
986a448d9e Revert "ARCHBOM-1494: Refer to custom attributes, not metrics, especially with edx-django-utils (#25010)" (#25025)
This reverts commit ba9ee4e151.

Fixed Style lint issue
2020-09-21 13:48:00 +05:00
Tim McCormack
ba9ee4e151 ARCHBOM-1494: Refer to custom attributes, not metrics, especially with edx-django-utils (#25010)
This uses the new names introduced in edx-django-utils
3.8.0 (edx/edx-django-utils#59), which we're already using, as
well as updating a few other locations where we incorrectly refer
to New Relic custom metrics instead of custom attributes.

Includes a couple of unrelated lint fixes in a file I modified.
2020-09-18 13:33:50 +00:00
mariajgrimaldi
c23071defc Fix DeprecationWarning: The 'warn' method is deprecated, use 'warning' instead (#23909)
I wanted to make a byte-sized contribution but there were no Jira tickets so we decided, thanks to a conversation with @jmbowman through the Open Edx Community #incr (Slack) channel, to collaborate in the elimination of warnings listed in the Warnings Report at https://build.testeng.edx.org/job/edx-platform-python-pipeline-master/warning_5freport_5fall_2ehtml/

This PR contributes to the elimination of deprecation warnings, specifically the one mentioned above and reported in the Warnings Report.

Changed logger.warn to logger.warning in the following files:

    lms/djangoapps/experiments/utils.py

    lms/djangoapps/lti_provider/outcomes.py

    lms/djangoapps/courseware/module_render.py

This warning occurs due to deprecation in python 3.4+: https://docs.python.org/3.5/library/logging.html#logging.Logger.warning
2020-05-08 12:15:59 -04:00
David Ormsbee
5ea71beeb1 Make XBlock views/handlers non-atomic requests.
We're seeing slow commits on production for courseware_studentmodule
updates. Based on the slow queries during those times, we think it
might be because multiple worker processes are trying to update the
same rows from within long-running transactions (since courseware
is relatively slow).

The risk with this is that since the whole view execution is no
longer wrapped in a big implicit transaction, it's possible that
XBlock state will update and things that key off of that (e.g.
completion progress information or pre-req milestones) will fail
in a way that will leave the database in an unplanned-for state,
though this is already the case for those actions that trigger
asynchronous tasks like grades recalculation.

The query counts for the index view test were adjusted down
because save points count towards the total and we're no longer
setting them at the top level around the view as a whole.
2020-03-31 21:22:58 -04:00
Manjinder Singh
d7bd80a100 Renamed OAuth2Authentication to BearerAuthentication (#23128)
* Renamed OAuth2Authentication to BearerAuthentication
* Added back OAuth2Authentication name
-there are libraries such as edx-enterprise that still import OAuth2Authentication.  The OAuth2Authentication class should be fully removed when everything is importing BearerAuthentication correctly
2020-02-18 13:29:29 -05:00
Manjinder Singh
cce8cdd661 Replacing OAuth2Auth (#23067)
- Removing deprecated auth classes
- Replacing OAuth2AuthenticationAllowInactiveUserDeprecated with OAuth2AuthenticationAllowInactiveUser
- the old class was a child class of a deprecated class that we are removing and replacing.
2020-02-11 10:38:13 -05:00
Manjinder Singh
cea795b02e Added new auth class (#23018)
* Added new auth class

- Created new class called OAuth2AuthenticationAllowInactiveUser, which replaces old class with same name
- Renames previous  OAuth2AuthenticationAllowInactiveUser to  OAuth2AuthenticationAllowInactiveUserDeprecated
- Replaced all imports of  OAuth2AuthenticationAllowInactiveUser to call deprecated class instead
- testing new class in discussion(added flag based on django setting)
2020-02-06 10:37:27 -05:00
Feanil Patel
6e3fe00fff Fix all E303 pep8 errors. 2019-12-30 12:25:38 -05:00
Feanil Patel
9cf2f9f298 Run 2to3 -f future . -w
This will remove imports from __future__ that are no longer needed.

https://docs.python.org/3.5/library/2to3.html#2to3fixer-future
2019-12-30 10:35:30 -05:00
Awais Qureshi
5f6b2db31b BOM-1111
Updating User.is_authenticated and User.is_anonymous as properties
2019-12-23 17:51:27 +05:00
DawoudSheraz
5178256f3c add user state service in module render 2019-12-16 11:20:55 +05:00
julianajlk
6e0914ad5d add FPD banner to courseware (#22113)
REV-980
2019-10-23 09:33:11 -04:00
Braden MacDonald
5fc73468b3 Change completion API to work with any learning context 2019-10-22 14:04:31 -04:00
julianajlk
98f907f23c Revert "add first purchase discount to courseware (#22058)"
This reverts commit 059b619794.
2019-10-21 13:57:18 -04:00
julianajlk
059b619794 add first purchase discount to courseware (#22058)
REV-980.
* moved get_first_purchase_offer_banner_fragment to Discounts utils.py
* added banner wrapper method
* updated banner with time limit
2019-10-21 13:56:38 -04:00
Ayub khan
b3c062be1b BOM-848 Different Hash Values
hashlib produces different md5 hash in python3 against same values as
compared to python2.
2019-10-21 14:02:49 +05:00
Ned Batchelder
efba6e45e8 Finally import courseware properly everywhere to get rid of a warning 2019-09-26 09:40:15 -04:00
Aarif
072f878b90 Merge pull request #21637 from edx/BOM-446
BOM-446
2019-09-13 14:40:36 +05:00
aarif
9301ec38f3 python 3 fixes 2019-09-12 17:29:34 +05:00
aarif
dba8a23144 python 3 fixes
test fixes

changes made as suggested

updated the variable name
2019-09-12 15:32:19 +05:00
Dave St.Germain
267be29ab7 Added edx-when's FieldData
EDUCATOR-4554
This fixes a bug where extended due dates were visible in the outline but not reflected on the courseware pages, resulting in problems not being submittable past the due date.
In order for edx-when to work on courseware pages, it has to be more careful about field inheritance, which version 0.2 achieves.
2019-08-12 11:05:44 -04:00
uzairr
9276aac8d2 Restrict grading endpoints in LMS
Cuurently, grading endpoints in capa module are vulnerable as they
are not restricted.To avoid it, changes have been made so that
they are available only for logged-in users.

LEARNER-3761
2019-07-24 19:20:13 +05:00
aarif
64bd86c12c ran python-modernize and isort on files mentioned in INCR-435 2019-07-12 15:29:19 +05:00
Calen Pennington
755a5c7db6 Augment content_type_gating tests to detect the failure case from the original REVMI-34 implementation 2019-05-16 15:17:33 -04:00
Calen Pennington
7eeff8bf9a Re-resolve REVMI-34 to allow any access error to put a message in the courseware 2019-05-15 11:29:00 -04:00
Calen Pennington
8c0ad119ec Revert "Revert "Merge pull request #20272 from cpennington/revmi-34-recheck-access""
This reverts commit b64664932d.
2019-05-15 11:29:00 -04:00
Nimisha Asthagiri
eb0791ec89 Inter-app API cleanup for Grades 2019-05-04 11:35:06 -04:00
David Ormsbee
50a8360b1a Merge pull request #20023 from open-craft/symbolist/capa-xblock-1
CapaModule to ProblemBlock [SE-397]
2019-05-01 12:18:50 -04:00
Usman Khalid
41c6236e0a Convert CapaModule to ProblemBlock.
* Minimum possible changes were made to merge CapaModule & CapaDescriptor into
  one ProblemBlock class.
* There are no known changes in behavior.
* CapaModule and CapaDescriptor inherited from a number of classes which inherit
  from XModule or XModuleDescriptor but did not depend on them. For all these
  classes the methods were moved to mixins which did not inherit from either and
  then these mixins were added to ProblemBlock in the order which maintains MRO.
2019-05-01 20:08:36 +05:00
Matthew Piatetsky
b64664932d Revert "Merge pull request #20272 from cpennington/revmi-34-recheck-access"
This reverts commit 5d99714aed, reversing
changes made to 5424155cd0.
2019-04-26 13:19:13 -04:00
Dave St.Germain
b4ccd03740 This adds a new django app -- edx-when -- that will copy start and due dates to mysql and allow per-learner overrides in the instructor dashboard, using the existing IDDE interface.
It adds a data migration for existing IDDE data.
2019-04-24 12:26:19 -04:00
Calen Pennington
f18fc1e7aa Expose will_recheck_access further up the LMS xblock stack 2019-04-18 14:58:15 -04:00
Michael Youngstrom
bfe10720c6 Remove lettuce infrastructure 2019-04-18 09:58:21 -04:00
noraiz-anwar
eeb89c457d pass grade feeze info to xblocks 2019-04-10 19:21:26 +05:00
uzairr
881c8e035c Improve 403 error handling
Currently, ajax calls in courseware is handling 403 like 401.
In this PR, proper modifications have been done to make it
coherent with its intended behaviour.

LEARNER-7131
2019-03-06 20:22:37 +05:00
Farhanah Sheets
bc00313a9c Revert "Improve 403 error handling" 2019-02-27 11:28:14 -05:00
uzairr
aa39f2c438 Improve 403 error handling
Currently, ajax calls in courseware is handling 403 like 401.In this
PR, proper modifications have been done to make it coherent with its
intended behaviour.

LEARNER-7131
2019-02-26 19:05:48 +05:00
cclauss
c0c935b685 Old style exceptions --> new style for Python 3 2019-02-19 13:09:23 +01:00
Matthew Piatetsky
6e81c84d8b fix unicode strings in lms/ part 1 2019-02-05 15:15:02 -05:00
David Ormsbee
8b47763543 Merge pull request #19253 from open-craft/agrendalath/xblock-handle-oauth
Add OAuth2 and JWT support to XBlock handlers
2019-01-16 19:46:20 -05:00
Agrendalath
aa0e06a15e Add OAuth2 and JWT support to XBlock handlers
This adds OAuth2 and JWT API to call XBlock handlers. It is an alternative approach to #15940 - it reuses some DRF logic to handle this, but does not convert `handle_xblock_callback` to DRF view, which caused issues described in edx/XBlock#383.
2019-01-17 00:17:38 +01:00