Commit Graph

148 Commits

Author SHA1 Message Date
Usama Sadiq
82406e970a reafctor: ran pyupgrade on lms/djangoapps/courseware (#26739) 2021-03-12 14:43:44 +05:00
Aarif
0112339b20 replaced unittest assertions pytest assertions (#26543) 2021-02-19 11:58:27 +05:00
Jawayria
03e6a874d0 Applied pylint-amnesty to courseware 2021-02-03 21:56:24 +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
Aarif
98af9ce418 remove useless-supression warnings 2020-05-01 19:42:15 +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
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
9ed328879e BOM-861
Dictionaries are being rendered into the HTML but in different order between python2 and python3.
The function parses and sorts the dictionary so that we get ordered data that can be compared in tests cases.
2019-10-08 12:45:01 +05:00
Awais Qureshi
79b00c9af4 BOM-866
Dictionaries are being rendered into the HTML but in different order between python2 and python3 and failing tests in python3.
The function parses and sorts the dictionary so that we get ordered data that can be compared in tests cases.
2019-10-07 15:00:41 +05:00
aarif
1793de5cbb python 3 fixes
test fixes

python 3 fixes

test fixes

test fixes

quality fix

python 3 fixes

minor fixes
2019-09-26 14:50:14 +05:00
Feanil Patel
844acea50e Fix linting errors. 2019-09-19 17:05:02 -04:00
Jeremy Bowman
fc57bf9763 Use bytes with GridFS when not specifying an encoding - BOM-157 2019-09-19 11:17:01 -04:00
Ayub khan
8a95a8e520 BOM-95
assertItemsEqual with six.assertCountEqual
2019-08-21 17:01:40 +05:00
adeelehsan
3136b3ecd3 Removed google api key from github
Prod-349
2019-08-08 02:12:21 +05:00
Usman Khalid
0b27c62ca6 Convert VideoModule to VideoBlock.
Some deprecated functionality has been removed:

- Reading data field and transforms being applied in the init() method.
- The source field.
- The source_visible attribute.
2019-06-20 22:12:39 +05:00
alangsto
4a1346b068 INCR-265 Run python-modernize on lms/djangoapps/courseware/management and lms/djangoapps/courseware/tests (#20716)
* updated files according to INCR-265

* fixed docstring and line-length problems from quality test

* Revert "fixed docstring and line-length problems from quality test"

This reverts commit d050f55a4ecfaa38f46b80ec4bb85ff399a79a8c.

* fixed errors reported in quality report

* had error, fixed it

* reversed change

* fixed over/under indentation, and added line to import.py that Ned had suggested

* tried disabling pylint for this line

* testing new email

* testing email in different window

* re-added symlink and docstring
2019-05-31 14:07:18 -04:00
DawoudSheraz
6d137790a4 avoid video url rewrite for third party videos 2019-04-30 10:53:53 +05:00
Alan Zarembok
f9a5d93ce4 PROD-101: Do not rewrite URL for videos that do not have a video id. 2019-04-05 15:29:17 -04:00
Calen Pennington
78c8950ea3 Clean up a few remaining unicode format string errors 2019-02-20 15:28:14 -05:00
emma-green
cbf3f78325 Revert "WIP:Cache course runs to programs" 2019-02-20 12:03:07 -05:00
Emma Green
f2139bbe2f add courses to programs to cache 2019-02-19 15:17:23 -05:00
Michael Youngstrom
3221c2b91f Remove lms pytest shards 2019-02-12 11:03:46 -05:00
Matthew Piatetsky
6e81c84d8b fix unicode strings in lms/ part 1 2019-02-05 15:15:02 -05:00
Pooja Kulkarni
6f0e5d68d7 Make video contents visible to unenrolled users
This is based on PR #19284 and is part of the
series of work related to the proposal #18134.

Adds VideoModule.public_view() to enable
unenrolled and anonymous users to view the video
contents of a public course.
When an unenrolled or anonymous user accesses the
video content of a public course, the
public_view() introduced in the previous PR is
used instead of student_view() method.
2018-12-20 11:56:43 +05:30
Ned Batchelder
3353e7425e Remove unused imports 2018-11-03 16:07:05 -04:00
Nimisha Asthagiri
700a902b68 Cleanup and remove deprecated RequestCache Django app
ARCH-223
2018-09-12 14:39:11 -04:00
Qubad786
89925a96dc use waffle_flags from video pipeline and fix tests 2018-09-04 19:07:03 +05:00
muhammad-ammar
809175d4cf add support to enable/disable hls as primary playback
EDUCATOR-2714
2018-09-04 19:07:03 +05:00
Jeremy Bowman
39ccbe3c89 Merge pull request #18709 from edx/jmbowman/TE-2524
TE-2524 Stop using nose.plugins - LMS 2
2018-08-02 13:45:01 -04:00
Qubad786
f3cc03007f Bump edxval version 2018-08-02 15:16:54 +05:00
Jeremy Bowman
4e8668d3be TE-2524 Stop using nose.plugins - LMS 2 2018-08-01 13:54:06 -04:00
Feanil Patel
cd47b28339 Get rid of all code related to the CDN Experiments.
These were very early experiments by the old performance team
on using CDNs for videos and logging performance data.  No one
is looking at this data and it's just extra cruft on every page.
2018-06-25 18:03:33 -04:00
Qubad786
f9476ab4ff Update old transcripts metadata present in video xml with the new transcripts for backward compatibility. 2018-05-25 21:29:26 +05:00
Mushtaq Ali
f4b1da1f42 Merge pull request #17718 from edx/transcripts-phase-2
Transcripts phase 2
2018-05-07 12:42:50 +05:00
Stuart Young
1fd2167144 rebalance python unittests onto new shards 2018-05-03 11:16:05 -04:00
Qubad786
7afd3b6c21 remove sub from editable metadata fields 2018-04-23 17:37:15 +05:00
muhammad-ammar
9d7ed19b64 disable subs field syncying 2018-04-23 17:35:45 +05:00
muhammad-ammar
cda7fe9a29 update available translations retrieval interface
EDUCATOR-2384
2018-04-23 17:35:43 +05:00
muhammad-ammar
d0cd247d08 Deprecate Contentstore for Video Component Preview LMS/CMS
EDUCATOR-1756
2018-04-23 17:35:43 +05:00
Mushtaq Ali
5a9477af30 Import video transcripts - EDUCATOR-2173 2018-04-16 12:05:44 +05:00
Mushtaq Ali
36483f938d Export video transcripts - EDUCATOR-1789 2018-03-06 15:25:46 +05:00
Qubad786
c90aa33cb8 Integrate with the updated VAL api utils. 2018-02-16 19:06:44 +05:00
Qubad786
287f4836af update val version and clean external video export tests 2018-01-29 19:05:55 +05:00
Qubad786
4f422e37d9 Refactor transcript upload handler to add language-overwrite support - EDUCATOR-2022 2018-01-09 17:03:45 +05:00
Daniel Clemente
ecf01d1b52 Adds a course option to auto-advance videos.
If enabled for a course, as soon as the video ends, the next unit or subsection
will be loaded, and if it contains a single video, that video will be played.

Course authors can enable the setting for a course, but learners can toggle the
setting on or off once it's enabled on the course.
2017-12-21 21:06:05 +10:30
J. Cliff Dyer
1fc43bf60d Define custom completion for VideoModule
Update the VideoModule to publish a completion event when the player
reaches 95% complete, and submit a BlockCompletion when that event
occurs.

OC-3091
MCKIN-5897
2017-12-19 14:12:28 -05:00
Jillian Vogel
b43ac4e80e Merge pull request #16590 from open-craft/jill/video-block-all-sources
Adds all HTML5 sources to the returned video API data
2017-12-12 02:19:02 +10:30
Jillian Vogel
cdcb4be077 Adds "all_sources" field to Mobile API and video module Course Blocks
student_view_data.

Added to both places because the iOS app uses both APIs data to provide
downloadable videos.
2017-12-11 23:59:52 +10:30
John Eskew
b14d2e9cf7 Fix video transcript model import before Django initialization occurs. 2017-12-07 09:56:44 -05:00