Commit Graph

660 Commits

Author SHA1 Message Date
Nathan Sprenkle
c97932fa99 fix: add missing protocol to web link for assets (#27220)
* fix: add missing protocol to web link for assets

* test: fix asset path test

* refactor: update asset web URL to use urljoin
2021-04-02 11:13:57 -04:00
alangsto
736e399cde MST-643 prevent errors for escalation email if proctoring is disabled (#27166) 2021-03-30 08:33:48 -04:00
M. Zulqarnain
41e5403f4e BOM-2369 (D): pyupgrade on contentstore/views (#26767)
* pyupgrade on contentstore/views

* Apply suggestions from code review

Co-authored-by: Usama Sadiq <usama.sadiq@arbisoft.com>

Co-authored-by: Usama Sadiq <usama.sadiq@arbisoft.com>
2021-03-05 14:55:14 +05:00
Usman Khalid
dd96a2aa72 Convert Course, Section and Sequence XModules to XBlocks. (#25965) 2021-03-02 10:29:33 -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
usamasadiq
7bbde8f0f5 Applied pylint-amnesty 2021-02-08 13:00:22 +05:00
David Ormsbee
1d028c9baa Merge pull request #25572 from open-craft/raul/import-export-boto3-support
[SE-3530] Adds Boto3 support for Import/Export functionality
2021-01-19 13:08:04 -05:00
Usman Khalid
75391262da [BD-04] Convert SplitTest XModule to XBlock. (#25696) 2021-01-05 09:55:14 -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
Farhaan Bukhsh
aa18d88fa9 Fix test with updated ORA template
Signed-off-by: Farhaan Bukhsh <farhaan@opencraft.com>
2020-12-08 00:58:23 +05:30
Farhaan Bukhsh
4c61ba28bc Added the condition for the first template to be blank assessment.
Signed-off-by: Farhaan Bukhsh <farhaan@opencraft.com>
2020-12-07 14:36:03 -03:00
Farhaan Bukhsh
92a561e085 Removed unnecessary checks in test case
Signed-off-by: Farhaan Bukhsh <farhaan@opencraft.com>
2020-12-07 14:36:02 -03:00
Farhaan Bukhsh
9c434cc8b2 Changed the order of the button
Signed-off-by: Farhaan Bukhsh <farhaan@opencraft.com>
2020-12-07 14:36:02 -03:00
Farhaan Bukhsh
95a219f395 Added improved comments
Signed-off-by: Farhaan Bukhsh <farhaan@opencraft.com>
2020-12-07 14:36:01 -03:00
Farhaan Bukhsh
48595cd38d Added tests for ORA button
Signed-off-by: Farhaan Bukhsh <farhaan@opencraft.com>
2020-12-07 14:36:00 -03:00
Kyle McCormick
d4026382a5 [BD-14] Ensure new content libraries map to valid organizations (#25752)
If ORGANIZATIONS_AUTOCREATE, this will create a new
org in the case that the organization is missing.

If !ORGANIZATIONS_AUTOCREATE, this will raise a
validation error in the case that the organization is
missing.

TNL-7646
2020-12-04 09:29:45 -05: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
Kyle McCormick
4dda73d797 [BD-14] Migrate all environments to use database-backed organizations (#25153)
* Install `organizations` app into LMS and Studio non-optionally.
* Add toggle `ORGANIZATIONS_AUTOCREATE` to Studio.
* Remove the `FEATURES["ORGANIZATIONS_APP"]` toggle.
* Use the new `organizations.api.ensure_organization` function to
  either validate or get-or-create organizations, depending
  on the value of `ORGANIZATIONS_AUTOCREATE`,
  when creating course runs and V2 content libraries.
  We'll soon use it for V1 content libraries as well.
* Remove the `util.organizations_helpers` wrapper layer
  that had to exist because `organizations` was an optional app.
* Add `.get_library_keys()` method to the Split modulestore.
* Add Studio management command for backfilling organizations tables
  (`backfill_orgs_and_org_courses`).

For full details, see
https://github.com/edx/edx-organizations/blob/master/docs/decisions/0001-phase-in-db-backed-organizations-to-all.rst

TNL-7646
2020-12-02 13:58:40 -05:00
David Ormsbee
2086f11a22 Merge pull request #24838 from open-craft/symbolist/convert-conditional-module-to-xblock
[BD-04] Convert Conditional XModule to XBlock
2020-11-12 13:04:26 -05:00
Raul Gallegos
236d5d7b78 Adds Boto3 support for Import/Export functionality 2020-11-10 22:33:08 -05: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
Usman Khalid
f62b5de6b1 Convert ConditionalModule to ConditionalBlock. 2020-11-07 20:02:02 +05:00
Alan Zarembok
e4befb1926 Add new generate_video_upload_link api. 2020-11-05 12:04:45 -05:00
Syed Muhammad Dawoud Sheraz Ali
1723da959f Merge pull request #25519 from edx/dsheraz/PROD-2198
update devstack video upload authentication mechanism
2020-11-05 13:02:37 +05:00
Kyle McCormick
d1a775d3cd Use full names for lms.djangoapps imports (#25401)
* Use full LMS imports paths in LMS settings and urls modules
* Use full LMS import paths in Studio settings and urls modules
* Import from lms.djangoapps.badges instead of badges
* Import from lms.djangoapps.branding instead of branding
* Import from lms.djangoapps.bulk_email instead of bulk_email
* Import from lms.djangoapps.bulk_enroll instead of bulk_enroll
* Import from lms.djangoapps.ccx instead of ccx
* Import from lms.djangoapps.course_api instead of course_api
* Import from lms.djangoapps.course_blocks instead of course_blocks
* Import from lms.djangoapps.course_wiki instead of course_wiki
* Import from lms.djangoapps.courseware instead of courseware
* Import from lms.djangoapps.dashboard instead of dashboard
* Import from lms.djangoapps.discussion import discussion
* Import from lms.djangoapps.email_marketing instead of email_marketing
* Import from lms.djangoapps.experiments instead of experiments
* Import from lms.djangoapps.gating instead of gating
* Import from lms.djangoapps.grades instead of grades
* Import from lms.djangoapps.instructor_analytics instead of instructor_analytics
* Import form lms.djangoapps.lms_xblock instead of lms_xblock
* Import from lms.djangoapps.lti_provider instead of lti_provider
* Import from lms.djangoapps.mobile_api instead of mobile_api
* Import from lms.djangoapps.rss_proxy instead of rss_proxy
* Import from lms.djangoapps.static_template_view instead of static_template_view
* Import from lms.djangoapps.survey instead of survey
* Import from lms.djangoapps.verify_student instead of verify_student
* Stop suppressing EdxPlatformDeprecatedImportWarnings
2020-11-04 08:48:33 -05:00
DawoudSheraz
84d2a690bf update devstack video upload authentication mechanism 2020-11-04 14:47:33 +05:00
Régis Behmo
4586002956 Import waffle classes from edx_toggles instead of waffle_utils
Those classes were ported to edx_toggles. The imports remain in
waffle_utils.__init__ for backward compatibility.
2020-11-03 19:25:37 +01:00
Régis Behmo
3b127f8c92 Deprecate WaffleSwitch.override* methods
This allows us to get rid of the custom WaffleSwitch and
WaffleSwitchNamespace classes from waffle_utils in favour of
edx_toggles.toggles classes.
2020-11-03 19:25:37 +01:00
Régis Behmo
2307dff4c9 Deprecate WaffleFlag.override method
This allows us to get rid of waffle_utils' custom WaffleFlag method.
2020-11-03 19:25:37 +01:00
Robert Raposa
39a7c6498c remove internal references to edx_django_utils
Tests were referring to internal implementation
details of edx-django-utils. This comment removes
those references to free the library up to be
refactored.

ARCHBOM-1584
2020-11-02 16:46:11 -05:00
David Ormsbee
0c61b0d4e2 Re-enable refreshing from library only on initial insertion of lib (#25347)
If the library content block is already in the course, then don't
refresh the children when we re-import it. This lets us address
TNL-7507 (Randomized Content Block Settings Lost in Course Import)
while still avoiding AA-310, where the IDs of the children for an
existing library_content block might be altered, losing student
user state.

When importing, we only copy the default values from content
in a library the first time that library_content block is created.
Future imports ignore what's in the library so as not to disrupt
course state. You can still update to the library via the Studio
UI for updating to the latest version of a library for this block.
2020-10-21 10:49:32 -04:00
Kyle McCormick
a3deb6e317 Sort imports in cms/
Command: `isort --recursive cms/`
2020-10-19 09:34:31 -04:00
Kyle McCormick
538dbf696b Import CMS code using fully qualified module names
or, using proper the proper Python 3 relative imports
(e.g., 'from .views import x') which are standard and
unambiguous.
2020-10-19 09:34:31 -04:00
Kyle McCormick
7538691484 Patch CMS app code in tests using fully qualified names 2020-10-19 09:34:31 -04:00
DawoudSheraz
b80fefdbdd remove VEDA reference from platform 2020-09-28 10:14:32 +05:00
Zachary Hancock
33f6d77f31 Alert banner for proctoring settings error (#24960) 2020-09-17 14:15:34 -04:00
Régis Behmo
ba18d48ac3 Get rid of lepl deprecation warning by removing rfc6266 dependency (#24059)
The LEPL dependency was triggering a lot of deprecation warnings of the
form:

    venv/lib/python3.5/site-packages/lepl/matchers/support.py:497:
    DeprecationWarning: inspect.getargspec() is deprecated, use
    inspect.signature() instead
    argspec = getargspec(func)

It turns out that LEPL was only used by the rfc6266_parser package, which
itself was only used in one place to generate utf8-compliant
Content-Disposition headers.

This issue was noticed here:
https://github.com/SWW13/python-rfc6266-parser/issues/2
Unfortunately it is quite difficult to extract LEPL from the
rfc6266-parser package.

The rfc6266-parser package (https://pypi.org/project/rfc6266-parser/) is
itself a fork of the now-unmaintained rfc6266 package
(https://pypi.org/project/rfc6266/). Thus, it became high time to get
rid of this package. The FileResponse object can appropriately set the
Content-Disposition header, and thus replace the rfc6266 functionality,
since Django 2.0: https://code.djangoproject.com/ticket/16470

In our testing, the FileResponse object correctly set the
`filename*=utf-8''` value, following the RFC. The only difference is
that it does not provide "filename" fallback value, as expressed in the
RFC: https://tools.ietf.org/html/rfc6266#appendix-D

With rfc6266_parser:

    >> import rfc6266_parser
    >> rfc6266_parser.build_header("my_file_é.csv", filename_compat="video_urls.csv")
    b"attachment; filename=video_urls.csv; filename*=utf-8''my_file_%C3%A9.csv"

With FileResponse we have:

    >> from django.http import FileResponse
    >> import io
    >> response = FileResponse(io.StringIO(), as_attachment=True, filename="my_file_é.csv", content_type="text/csv")
    >> response.get("Content-Disposition")
    "attachment; filename*=utf-8''my_file_%C3%A9.csv"

We consider that this is a sufficiently minor difference, that will
impact very few browsers.
2020-08-31 09:30:27 -04:00
Dillon Dumesnil
79e96af197 Disable updating Library Content children during import 2020-08-20 07:26:27 -07:00
DawoudSheraz
12f2e6eb2b remove percentage field from VEM pipeline config model 2020-08-07 10:25:52 +05:00
uzairr
fb9ba90efe PROD-1236: Do not expose user id with certificate URL. 2020-07-17 22:59:34 +05:00
Sid Verma
c609451d2e [BD-14] Limit number of blocks allowed in content libraries (#24276)
* Enforce limit on number of blocks allowed in library (blockstore)

* Enforce limit on number of blocks allowed in library (modulestore)

* Changes from review feedback
2020-07-13 15:49:47 -04:00
alangsto
90d6b18711 Add link to exam settings page from studio (#24405)
* testing

* updates to drop down

* unit tests. env changes were copied based on other MFEs in LMS

* added exam settings link to other course settings pages

* fixed pylint errors

* updates for requested changes

* updates for requested changes, as well as changes for xss linter
2020-07-09 10:13:18 -04:00
Zainab Amir
0b80987ba0 Add vem_enabled_courses_percentage (#24294)
Add a field to VEM config model that will decide the percentage of
courses allowed to go to VEM pipeline. The courses that don't meet the
criteria will go to VEDA.

PROD-1722
2020-06-26 14:30:42 +05:00
Kyle McCormick
4857bd5d1e Disable changing special exam type after release date (#24118)
* Disable changing special exam type after release date

Do some client-side validation to make sure that exams
that *are* or *ever were* special may not be changed
to a special exam type (other than the current one)
after release date.

MST-258

Co-authored-by: Zach Hancock <zhancock@edx.org>
2020-06-11 10:45:04 -04:00
Zainab Amir
cdc1c91980 Integrate Video Encode Manager (#24093)
* Add VEMPipelineIntegration config model
* Add course waffle flag to enable vem pipeline selectively

PROD-1636
2020-06-04 11:45:34 +05:00
asadazam93
86d7725f26 fixed visibility state for self paced 2020-06-03 14:06:54 +05:00
Kyle McCormick
7e3470db42 Expose was_ever_proctored_exam dict entry on xblock_info (#24040)
In a follow-up PR, this entry will be used to validate
on the client-side that a block that *is* or *ever was*
a proctored/practice/onboarding exam cannot be configured
as a different proctored/practice/onboarding exam, as that
has led to problematic exam configuration states between
edX and proctoring providers.

MST-258
2020-06-02 09:44:12 -04:00
Zainab Amir
bfd95c7fbb Remove transcript credential saving in VAL (#24066) 2020-05-27 18:38:01 +05:00
Ahtisham Shahid
675721aa0e fixed linter issue 2020-05-20 15:04:08 +05:00
Ahtisham Shahid
7110b45e85 fixed linter issue 2020-05-20 14:40:56 +05:00