Commit Graph

9029 Commits

Author SHA1 Message Date
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
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
Feanil Patel
70294b0ad2 Run 2to3 -f asserts . -w on edx-platform.
https://docs.python.org/3.5/library/2to3.html#2to3fixer-asserts
2019-12-30 10:22:19 -05:00
Jeremy Bowman
63574e12b8 Remove pytest version constraint (#22626)
Fix the issue that was preventing us from upgrading pytest.  pytest does some manipulation of test packages that prevents `pkg_resources` from loading resources from them, but used to contain a workaround for the problem.  That workaround was [removed](https://github.com/pytest-dev/pytest/issues/5392) in 4.6.0 as a performance enhancement when pytest switched from `pkg_resources` to `importlib-metadata` for its own entrypoint handling.  This tripped up one of our test modules which defined classes that loaded templates from inside a test package.  Moving these resources to the parent package fixes the problem.

More and more, `pkg_resources` is being abandoned in favor of `importlib-metadata` and `importlib_resources` as they have a simpler design with much better performance.  However, `importlib_resources` doesn't support loading files from any directory which isn't itself a Python package (and doesn't allow direct use of paths including directories within the package).  Jinja2 chose a [different approach](https://github.com/pallets/jinja/pull/1082) that we may want to emulate in our resource handling.

Also fixed usage of a removed `pytest.raises()` parameter and a bug in our configuration of the `common/lib` tests that became a problem after the upgrade.
2019-12-30 09:10:57 -05:00
Zainab Amir
257c635a68 Fix Targeted Feedback HTML (#22606)
etree.tostring returns bytes instead of string which when converted
back to XML, to be rendered as etree element, presents stray
characters.

PROD-1116
2019-12-30 15:06:02 +05:00
Feanil Patel
f359c9cd8f Merge pull request #21197 from open-craft/giovanni/upgrade-pymongo
BB-1744: Bump pymongo version and fix course export issue
2019-12-26 11:16:15 -05:00
Andytr1
b1b5403041 Merge pull request #22559 from edx/andytr1/studio_teamsconfiguration_svc
EDUCATOR-4846 - added team config service for xblocks.
2019-12-20 10:46:04 -05:00
atesker
e0d57fe1a7 EDUCATOR-4846 - added team config service for xblocks.
Quality / encoding

Remove comments

remove debug

Changed service implementation to make unit testing easier

Corrected service

code style

unit test cleanup

Clean up imports
2019-12-20 09:57:30 -05:00
Braden MacDonald
f31dc19887 Support anonymous users in the Blockstore-based XBlock runtime
Implementation details:
* Anonymous users are assigned a unique ID (like 
  `anon42c08f9996194e2a9339`) which gets stored in the django session.
  `block.scope_ids.user_id` and `block.runtime.anonymous_student_id`
  will both return this value.
* User state for anonymous users is stored in the django cache and
  automatically expires as the cache gets pruned. Because user state is
  stored, anonymous users can use interactive blocks like capa problems.
* There is no mechanism for upgrading to a registered account and
  keeping user state since the user state store for anonymous users
  (EphemeralKeyValueStore) is completely different than the one for
  registered users (DjangoKeyValueStore/"CSM"), and has no "list all
  keys" functionality.
* "User State Summary" field values are shared among [recently active]
  anonymous users but are not shared with registered users.
* Anonymous users can only access the `public_view` of XBlocks, not the
  regular `student_view`.
2019-12-19 16:12:24 -08:00
David Ormsbee
a09c4e160b Merge pull request #22538 from open-craft/blockstore-video-transcripts
Support transcript files for video XBlocks in Blockstore
2019-12-19 11:24:27 -05:00
Braden MacDonald
e4eac68e9f Support transcript files for video XBlocks in Blockstore 2019-12-15 12:35:03 -08:00
Diana Huang
217228dffc Standardize input into SubRipFile. 2019-12-13 13:28:27 -05:00
Feanil Patel
617e8519d9 Merge pull request #22499 from edx/feanil/no-exception-to-re-raise
Re-raise issue was in codejail.
2019-12-11 14:56:10 -05:00
Jeremy Bowman
ca1265a679 Make XModuleDescriptor hashable again (#22501) 2019-12-11 14:37:07 -05:00
Feanil Patel
f52a0f6b98 Re-raise issue was in codejail.
- Undo the previous change.
- Pull in the version of codejail with the fix for the issue.
2019-12-11 11:50:20 -05:00
Jeremy Bowman
86186e2026 Fix graph traversal under Python 3 (#22484) 2019-12-10 15:52:26 -05:00
Diana Huang
5d095b3a7b Merge pull request #22477 from edx/diana/reraise-capa
Use six to reraise a capa error.
2019-12-10 14:50:48 -05:00