Commit Graph

9045 Commits

Author SHA1 Message Date
Adeel Khan
5cbcd0e952 Reducing play button opacity to improve viewing experience.
This patch lowers the opacity for play button
enabling learners unhindered learning experience
when on video pause.

PROD_1231
2020-03-20 23:39:07 +05:00
Awais Jibran
9f74ea044b Fix DeprecationWarning 2020-03-19 14:23:46 +05:00
Awais Jibran
ebd6494af2 Merge pull request #23380 from edx/logs-cleanup
Remove unnecessary logs.
2020-03-12 16:38:54 +05:00
Awais Jibran
084b409662 Unnecessary logs. 2020-03-12 15:15:22 +05:00
Waheed Ahmed
f54b9a42e7 Disallow NaN value for speed key.
The VideoBlock `handle_ajax` is allowing NaN values for speed key
and causing videos to not load. Also added a data migration to fix
the data for learners.

PROD-1148
2020-03-11 18:45:49 +05:00
Ahtisham Shahid
ef40efae9b update added workaround for csv error 2020-03-09 17:35:12 +05:00
Ahtisham Shahid
4efcfca34a created logs to capture capa problem errors
Update logs

updated logger
2020-03-05 12:54:04 +05:00
Awais Jibran
44199c3f72 Workaround the error in find_question_label. (#23247)
* Workaround the error in find_question_label.

This is a temporary log, which will give us information and unblock the course team.
PROD-1326

* raise exception after logging it.
2020-03-04 17:55:35 +05:00
Michael Terry
b96efcf71b Merge pull request #23258 from edx/mikix/experiment-flag
Add ExperimentWaffleFlag
2020-03-03 15:01:16 -05:00
Michael Terry
e724a4bcb7 Add ExperimentWaffleFlag
This is a helpful class when running an experiment, to help
bucket users and keep track of which enrollments to consider
as part of the experiment.

AA-53
2020-03-03 14:39:02 -05:00
David Ormsbee
9d3f4985ed Allow Block Structures Collect to work in Studio
Block Structures were meant to be gathered using the LMS process,
as it's meant to be an optimized store for the LMS to use. But
there's an argument to be made for at least the Collect side of
the Collect + Transform could be a Studio concern, because it
explicitly needs to avoid user-awareness.

In either event, collect() was broken on devstack before this
commit because Studio's runtime does not permit handler_url
invocation on "thirdparty" XBlocks. Since VideoBlock is not
really third-party (and it's questionable whether there's any
benefit to making the distinction these days), I'm just making
this change to allow Studio to run collect() without error in
the Studio process. This will fix devstack, which does not
properly route these collect() calls to the LMS process (because
celery runs in-proc by default).
2020-03-03 10:52:46 -05:00
Alex Dusenbery
530cabd003 Remove the auth_source kwarg in connect_to_mongodb, since we're now relying on authsource (no underscore) and the pymongo Database init does not expect and will not tolerate an auth_source kwarg. 2020-03-02 15:20:50 -05:00
Luis Moreno
ae0c051e9e Use authsource instead of auth_source for compatibilities with pymongo 2020-03-02 13:31:07 -05:00
Awais Jibran
18e21f374e Merge pull request #23216 from edx/fix-capa-promot-error-mit
Workaround Error in find_question_label.
2020-02-27 17:07:14 +05:00
asadazam93
364e534cf8 Fixed duplicate asset on creating rerun 2020-02-27 15:50:01 +05:00
Awais Jibran
9032562cbd Fix Error in find_question_label. 2020-02-27 10:55:18 +05:00
Jeff LaJoie
fa3b1cd835 AA-6: Adds in dates tab and dates dashboard view to courseware 2020-02-25 10:48:45 -05:00
Luis Moreno
73c6a90bb3 Do not hide all the elements of the units with problems to anonymous users:
Right now the units of a public course are hidden if there is at least a graded activity in them. This is done due to a change(69eeca61d8) that was done before the implementation of public_view mechanism for unenrolled users.

Since we use public_view now and by default it restricts the unit rendering for anonymous users we do not need to limit the access at this way for anonymous users.
2020-02-21 21:00:55 -04:00
uzairr
2f080e8cd9 Add five seconds step to video slider
Currently, video is moving one second ahead or behind on each right
and left arrow key respectively.In order to make it compliant with
the industry standards like Youtube,its step is adjusted to five
seconds.

PROD-159
2020-02-19 13:34:54 +05:00
Jansen Kantor
0e0b488fb5 EDUCATOR-4876: Correctly handle 'None' as a valid max_team_size (#23038)
add default max team sizes, change ui to not show max for managed teams
2020-02-18 16:44:20 -05:00
Manjinder Singh
2274cd09b4 Added options to pytest calls (#23083)
- added more default options to pytest calls in setup.cfg and pytest.ini files.
- pytest-json-report's plugin name in pluggy has changed, so added option for multiple names
2020-02-18 08:58:44 -05:00
Ahtisham Shahid
728f7d2c71 Updated Trascript functionality
removed extras

fixed initial state of transcript

Fixed js tests

fixed js tests

created and fixed tests

Updated Trascript functionality

updated v name

fixed spacing
2020-02-17 11:48:28 +05:00
Awais Jibran
eaaebc6d93 Merge pull request #169 from edx/aj/sec-fix-capa
SECURITY FIX : Fix CAPA Problems
2020-02-13 13:52:29 +05:00
saadyousafarbi
dd994657ac use xpath instead of tag to get all matches from subtree instead of subelements. 2020-02-11 18:59:24 +05:00
Adam Butterworth
53c1d2a0da Hide display titles for vertical blocks embedded in microfrontends (#23006)
Relates to TNL-7048. Since bookmarking is handled in the courseware microfrontend, it needs to also manage the display of a unit title.
2020-02-10 13:32:08 -05:00
Jeremy Bowman
59768e7498 Fix more deprecation warnings (#23061) 2020-02-10 13:17:25 -05:00
Feanil Patel
4422fb36cf Merge pull request #23037 from edx/feanil/bom-939
BOM-939 Update pickle procotol version.
2020-02-10 11:36:20 -05:00
DawoudSheraz
0b1c7db967 add multiple correct values check for Dropdown problems 2020-02-10 11:36:28 +05:00
Feanil Patel
9f42b5edfe BOM-939 Update pickle procotol version.
Updating to the current highest number instead of making it the default
which is highest know by the language.  This is beacuse when we update
between python versions if there is a new proctocol version, we don't
want that to cause cache thrashing as we try to load things from the
various caches.  We can get into a situation where new machines pickle
things with a newer versions of the procotocl, put them in the cache and
then break older machines that don't know about the new protocol
version.
2020-02-06 16:55:18 -05:00
Calen Pennington
b1d5ad8dcb Merge pull request #23024 from cpennington/fix-edx-when-date-ingest
Correctly wire in signal the new course_date_signals app so that it a…
2020-02-06 09:56:08 -05:00
Jeremy Bowman
e38a100418 Fix most frequent deprecation warnings (#23023)
Fixed the most frequently occurring deprecation warnings, which were causing over half of the 34,140 deprecation warnings raised during the unit tests:

* `Use of .. or absolute path in a resource path is not allowed and will raise exceptions in a future release` - most of these were due to a single mis-configured resource path with a leading slash.
* `count is deprecated. Use Collection.count_documents instead.` - I added a handful of simple workarounds for this pymongo deprecation that shouldn't increase the query counts

Also did some cleanup of unused code in pavelib after the recent split of the new `i18n_compilejs` command from `i18n_dummy`. (This had caused a diff-quality failure on the first commit.)
2020-02-06 09:27:53 -05:00
Calen Pennington
4901dde748 Clean up pylint errors to get diff-quality to pass 2020-02-06 09:18:30 -05:00
Awais Jibran
bcb2038843 Fix CAPA Problems 2020-02-04 17:51:18 +05:00
Dave St.Germain
5528adccb1 Include bookmark info in sequence metadata. 2020-02-03 13:54:03 -05:00
Adam Butterworth
48d20e338b fix: video fullscreen must not assume resizer exists (#22935)
Otherwise it fails to go fullscreen before playback
2020-01-24 14:59:49 -05:00
Adam Butterworth
f0aa3daa87 Use Fullscreen API for video XBlock full screen mode (#22896)
[TNL-7051] Clicking a video XBlock's fullscreen button now takes the video fullscreen instead of full window.

Gracefully fallback to full window if fullscreen apis are absent
2020-01-24 09:48:41 -05:00
DawoudSheraz
63d1b2bc9c modify URL generation in tinymce editor 2020-01-24 11:57:01 +05:00
David Ormsbee
0800f5f226 Merge pull request #22837 from open-craft/youtube-metadata-new-runtime
Add way to get YouTube metadata that doesn't require a session cookie
2020-01-17 11:02:05 -05:00
Braden MacDonald
c7d5efb796 Add way to get YouTube metadata that doesn't require a session cookie
The Video Player XBlock will sometimes make API calls to /couses/yt_video_metadata, a REST API endpoint that in turn loads video metadata from YouTube using the configured settings.YOUTUBE_API_KEY.

However, in the Blockstore-based XBlock runtime, we are running XBlocks in a secure sandbox, and the user's browser cannot pass session cookies when calling REST API endpoints. So currently, the video XBlock tries to request YouTube metadata from that API endpoint, but it fails if run within such a sandbox.

The existing API also doesn't work for anonymous users (users who are allowed to see video XBlocks but who have not logged in to an LMS user account).

This commit updates the Video XBlock so that it can use a handler to load the data from YouTube instead of a generic REST API. This works well in the new runtime, because it has code to support calling handlers within the sandbox, including by anonymous users.

I also fixed a bug where on a default devstack, the endpoint will try calling YouTube using PUT_YOUR_API_KEY_HERE as an API key, and get a "bad request" error from YouTube.

The code could be re-organized by moving things around, but I've left everything as-is for now to keep the diff as small as possible.
2020-01-16 13:25:16 -08:00
David Ormsbee
b3e2a8ef55 Merge pull request #22858 from open-craft/video-field-parsing-fix
Fix: KeyError: 'source' when parsing HTML5 videos
2020-01-15 14:32:44 -05:00
Braden MacDonald
d39421d947 Fix: KeyError: 'source' when parsing HTML5 videos
This fixes a bug that causes the video XBlock parsing to break in the new XBlock runtime if:
* the html5_sources field is set, and
* the download_video field is not set

The error is:

  File "/edx/app/edxapp/edx-platform/openedx/core/djangoapps/xblock/rest_api/views.py", line 52, in render_block_view
    block = load_block(usage_key, request.user)
  File "/edx/app/edxapp/edx-platform/openedx/core/djangoapps/xblock/api.py", line 84, in load_block
    return runtime.get_block(usage_key)
  File "/edx/app/edxapp/edx-platform/openedx/core/djangoapps/xblock/runtime/blockstore_runtime.py", line 70, in get_block
    block = block_class.parse_xml_new_runtime(xml_node, runtime=self, keys=keys)
  File "/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/video_module/video_module.py", line 620, in parse_xml_new_runtime
    setattr(video_block, key, cls.fields[key].from_json(val))
  KeyError: 'source'

The reason for the error is that parse_video_xml() will sometimes return a 'source' attribute in its field_data return value, even though source is not a video field (anymore). This then causes an error when trying to look up cls.fields['source']

A workaround in the meantime is to add download_video="false" to the OLX.
2020-01-15 10:26:55 -08:00
Dave St.Germain
20235bcf56 Added subsection id to gated metadata. 2020-01-14 10:01:07 -05:00
Dave St.Germain
507b85ee3d Return sequence metadata from an ajax handler endpoint, to support the new courseware micro-frontend. 2020-01-13 11:26:02 -05:00
Christian Clauss
69f286c90c from xmodule.modulestore.exceptions import MultipleLibraryBlocksFound
Undefined name: __MultipleLibraryBlocksFound__ is raised on line 1096 but is never defined or imported.
2020-01-02 23:49:32 +01:00
Manjinder Singh
6c69b6d435 Adding code to output pytest warnings. (#22570)
* Added pytest-json-report plugin
	- modifying app-opts in setup.cfg
	- adding hook to all conftest.py files in repo
	- setting report to be saved to test_root/log/warnings.json
	- Writing custom logic to save json report to avoid overwrite if pytest called twice
This was created to allow us to easily parse through test warnings in jenkins
2020-01-02 10:01:52 -05:00
David Ormsbee
2cb2265ffe Add request caching to reduce ORM queries
This adds request caching to the following places:
* course expiration wrapper (displayed in Units)
* offer banner generation (displayed in Units)
* get_enrollment
* user_by_anonymous_id
* youtube_disabled_for_course

On a sample course with edx-val enabled, this reduced the queries
for a large sequence from 450 to 155.
2019-12-30 16:19:25 -05:00
Feanil Patel
046feb0cf0 Merge pull request #22649 from edx/feanil/fix_pep8
Fix all E303 pep8 errors.
2019-12-30 13:32:26 -05:00
Feanil Patel
6e3fe00fff Fix all E303 pep8 errors. 2019-12-30 12:25:38 -05:00
Feanil Patel
2df8b8226b Merge pull request #22643 from edx/feanil/2to3_asserts
Run `2to3 -f asserts . -w` on edx-platform.
2019-12-30 12:13:42 -05:00
Feanil Patel
39d3a7ca17 Fix pep8 issues caused by the fixer. 2019-12-30 11:42:04 -05:00