Commit Graph

7928 Commits

Author SHA1 Message Date
Shadi Naif
7142d55b1a Missing translation function call 2020-05-07 14:32:50 +03:00
Simon Chen
262574b815 Move all the upgrade display logic into courseware.utils 2020-05-05 17:54:22 -04:00
Simon Chen
f8cc58618a Create a new plugin manager called DynamicPartitionGenerators to remove the dependency of openedx.features.content_type_gating by xmodule.partition_services 2020-05-04 11:16:26 -04:00
Samuel Walladge
71fcf6e725 Fix issues with xss linters
Improve accuracy of javascript-escape linter: Previously this would
match on FOOescape() and FOO.escape calls, but neither are the global
escape function we are worried about.

The regex probably isn't 100% accurate; there may be still false
positives (javascript allows a large range of characters in identifiers,
some of which may not be covered by [\w.$]). The main thing is to avoid
false negatives here though - this will definitely catch any use of
`escape()` or `window.escape()`.

Also remove javascript-interpolate lint - this was deemed unecessary.
StringUtils.interpolate is not in fact safe (it does no html escaping),
so the results of this lint are misleading.
2020-05-04 09:27:18 +09:30
Aarif
98af9ce418 remove useless-supression warnings 2020-05-01 19:42:15 +05:00
Michael Terry
0f81765ac7 Show graded icons in more places
In the course outline, if a subsection has any graded content,
show a graded icon (the pencil icon).

Also, show the graded icon for LTI xmodule units (xblocks is a
different repo, but will get same treatment).

AA-75
2020-04-24 14:16:32 -04:00
SaadYousaf
d361634067 fix getargspec() DeprecationWarning for inspect. 2020-04-15 15:15:31 +05:00
Waheed Ahmed
ec747e4c27 Fix some submission error message related bugs.
During another bug investigation I figured there are some
issues related to showing error messages to learners upon
submission.

PROD-1431
2020-04-10 17:01:56 +05:00
Tehreem Sadat
eef904bfef fix broken tests (#23680)
Tests were failing due to the "404 Error" Response from an API that fetches specific asset (video transcript data) from YouTube.

I have changed it by using a mocked API response instead of direct API call to the Youtube server.
2020-04-09 16:05:13 -04:00
Alan Zarembok
5371be1c60 Skip tests that are failing due to missing youtube content. 2020-04-09 11:05:10 -04:00
Aarif
6ee2089077 fixed warnings for wrong-import-order 2020-04-08 23:43:06 +05:00
Zachary Hancock
2cbc248a63 prevent empty string passing proctoring provider validation (#23610) 2020-04-06 09:45:10 -04:00
Ali Akbar
358b181bdf Merge pull request #23481 from edx/aakbar/demandhint-static-link-fix
add static links re-write for demnadhint tag
2020-03-31 15:04:33 +05:00
Adam Butterworth
d53ab876e2 Fix public view of video xmodule (#23518)
TNL-7092 Properly include video javascripts for the video public view
2020-03-30 11:03:48 -04:00
Ned Batchelder
136003fcff Merge pull request #23015 from Abstract-Tech/fix/non-admin-error-descriptor
Add xblock.v1 and xmodule.v1 entrypoints for NonStaffErrorDescriptor
2020-03-27 17:43:16 -04:00
Ahtisham Shahid
42ccc5564c Merge pull request #23498 from edx/ahtisham/PROD-1232
Fixed \n escape issue in import-export
2020-03-27 18:39:29 +05:00
Ahtisham Shahid
f264e5dd03 fixed \n escape issue in import
updated test

updated test
2020-03-27 12:29:32 +05:00
asadazam93
fc3e63714e Fixed comparison mismatch 2020-03-26 14:11:31 +05:00
Waheed Ahmed
ccbd353201 Revert "Allow Block Structures Collect to work in Studio" 2020-03-26 13:22:10 +05:00
Ali-D-Akbar
3359928520 add static links re-write for demnadhint tag 2020-03-24 15:08:44 +05:00
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
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
Guruprasad Lakshmi Narayanan
fad200f81b Pass the referer from the client to the YouTube API
This fixes the errors when the API key is configured to require a
referer for all the requests.
2020-03-03 22:51:46 +05:30
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
asadazam93
364e534cf8 Fixed duplicate asset on creating rerun 2020-02-27 15:50:01 +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
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
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
Silvio Tomatis
99bdb23375 Add xblock.v1 and xmodule.v1 entrypoints for NonStaffErrorDescriptor
If an error occurs while rendering an xmodule, the LMS chokes with the
following error if accessed by a non admin user.

In the admin user case the existing line that registers ErrorDescriptor
ensures that everything works. But for the non admin case we need this
additional directive.

Traceback (most recent call last):
  File "/openedx/edx-platform/lms/djangoapps/courseware/views/index.py", line 153, in get
    return self.render(request)
  File "/openedx/edx-platform/lms/djangoapps/courseware/views/index.py", line 217, in render
    return render_to_response('courseware/courseware.html', self._create_courseware_context(request))
  File "/openedx/edx-platform/lms/djangoapps/courseware/views/index.py", line 468, in _create_courseware_context
    courseware_context['fragment'] = self.section.render(self.view, section_context)
  File "/usr/local/lib/python2.7/site-packages/xblock/core.py", line 202, in render
    return self.runtime.render(self, view, context)
  File "/openedx/edx-platform/common/lib/xmodule/xmodule/x_module.py", line 1914, in render
    return self.__getattr__('render')(block, view_name, context)
  File "/openedx/edx-platform/common/lib/xmodule/xmodule/x_module.py", line 1335, in render
    return super(MetricsMixin, self).render(block, view_name, context=context)
  File "/usr/local/lib/python2.7/site-packages/xblock/runtime.py", line 831, in render
    frag = view_fn(context)
  File "/openedx/edx-platform/common/lib/xmodule/xmodule/seq_module.py", line 262, in student_view
    return self._student_or_public_view(context, prereq_met, prereq_meta_info, banner_text)
  File "/openedx/edx-platform/common/lib/xmodule/xmodule/seq_module.py", line 343, in _student_or_public_view
    items = self._render_student_view_for_items(context, display_items, fragment, view) if prereq_met else []
  File "/openedx/edx-platform/common/lib/xmodule/xmodule/seq_module.py", line 485, in _render_student_view_for_items
    rendered_item = item.render(view, context)
  File "/usr/local/lib/python2.7/site-packages/xblock/core.py", line 202, in render
    return self.runtime.render(self, view, context)
  File "/openedx/edx-platform/common/lib/xmodule/xmodule/x_module.py", line 1914, in render
    return self.__getattr__('render')(block, view_name, context)
  File "/openedx/edx-platform/common/lib/xmodule/xmodule/x_module.py", line 1335, in render
    return super(MetricsMixin, self).render(block, view_name, context=context)
  File "/usr/local/lib/python2.7/site-packages/xblock/runtime.py", line 831, in render
    frag = view_fn(context)
  File "/openedx/edx-platform/common/lib/xmodule/xmodule/vertical_block.py", line 118, in student_view
    return self._student_or_public_view(context, STUDENT_VIEW)
  File "/openedx/edx-platform/common/lib/xmodule/xmodule/vertical_block.py", line 85, in _student_or_public_view
    rendered_child = child.render(view, child_block_context)
  File "/usr/local/lib/python2.7/site-packages/xblock/core.py", line 202, in render
    return self.runtime.render(self, view, context)
  File "/openedx/edx-platform/common/lib/xmodule/xmodule/x_module.py", line 1914, in render
    return self.__getattr__('render')(block, view_name, context)
  File "/openedx/edx-platform/common/lib/xmodule/xmodule/x_module.py", line 1335, in render
    return super(MetricsMixin, self).render(block, view_name, context=context)
  File "/usr/local/lib/python2.7/site-packages/xblock/runtime.py", line 831, in render
    frag = view_fn(context)
  File "/openedx/edx-platform/common/lib/xmodule/xmodule/library_content_module.py", line 314, in student_view
    rendered_child = displayable.render(STUDENT_VIEW, child_context)
  File "/usr/local/lib/python2.7/site-packages/xblock/core.py", line 202, in render
    return self.runtime.render(self, view, context)
  File "/openedx/edx-platform/common/lib/xmodule/xmodule/x_module.py", line 1914, in render
    return self.__getattr__('render')(block, view_name, context)
  File "/openedx/edx-platform/common/lib/xmodule/xmodule/x_module.py", line 1335, in render
    return super(MetricsMixin, self).render(block, view_name, context=context)
  File "/usr/local/lib/python2.7/site-packages/xblock/runtime.py", line 835, in render
    updated_frag = self.wrap_xblock(block, view_name, frag, context)
  File "/openedx/edx-platform/common/lib/xmodule/xmodule/x_module.py", line 1287, in wrap_xblock
    frag = wrapper(block, view, frag, context)
  File "/openedx/edx-platform/openedx/core/lib/xblock_utils/__init__.py", line 155, in wrap_xblock
    add_webpack_to_fragment(frag, class_name)
  File "/openedx/edx-platform/common/lib/xmodule/xmodule/util/xmodule_django.py", line 28, in add_webpack_to_fragment
    for chunk in webpack_loader.utils.get_files(bundle_name, extension, config):
  File "/usr/local/lib/python2.7/site-packages/webpack_loader/utils.py", line 31, in get_files
    return list(_get_bundle(bundle_name, extension, config))
  File "/usr/local/lib/python2.7/site-packages/webpack_loader/utils.py", line 23, in _get_bundle
    bundle = get_loader(config).get_bundle(bundle_name)
  File "/usr/local/lib/python2.7/site-packages/webpack_loader/loader.py", line 83, in get_bundle
    raise WebpackBundleLookupError('Cannot resolve bundle {0}.'.format(bundle_name))
WebpackBundleLookupError: Cannot resolve bundle NonStaffErrorModule.
2020-02-04 16:12:57 +01: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