Commit Graph

9300 Commits

Author SHA1 Message Date
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
pkulkark
a1bb42b385 Enable auto start for HLS if autoadvance is set 2019-12-16 11:54:57 +05:30
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
Jeremy Bowman
0e1881f525 Fixes for celery worker Python 3 bugs (#22479) 2019-12-10 14:07:27 -05:00
Diana Huang
5cc562b5b8 Use six to reraise a capa error. 2019-12-10 12:47:27 -05:00
Giovanni Cimolin da Silva
a78c21db10 Fix course export issue 2019-12-10 09:39:27 -03:00
Giovanni Cimolin da Silva
ba4de2f933 Upgrade pymongo and fix issues
This commit upgrades the version of pymongo from 2.x to 3.x, removing usages to deprecated functions usage and fixing tests where necessary.

This version of pymongo supports MongoDB 2.x all the way up to 4.2, and this ensures that the platform will be able to run on a supported MongoDB version in the next release.
2019-12-09 15:43:56 -03:00
Feanil Patel
01b6b19f2e Merge pull request #22454 from edx/feanil/handle_pickling_failure
Feanil/handle pickling failure
2019-12-09 11:44:14 -05:00
Feanil Patel
bf482f4989 Respond to code review. 2019-12-06 15:02:22 -05:00
DawoudSheraz
99d694c86c log exception for further context 2019-12-06 15:06:19 +05:00
Feanil Patel
684f254a77 Add error handling in course structure cache.
When going between python 2 and python 3.5 we can get pickeld course
structires that are incompatible no matter what we do do to the bug
linked in the comment.  In this case, handle the error and delete the
corrupt data from the cache.

Making this fairly generic because if we have any bad data in cache we
don't want it to blow up the whole process.  Just delete the bad data
and try again.
2019-12-05 17:06:12 -05:00
saadyousafarbi
a59363432c handle section link bug for staff-only units for learners. 2019-11-27 15:52:39 +05:00
DawoudSheraz
2ac5fa160c remove unnecessary logs 2019-11-14 16:33:07 +05:00
DawoudSheraz
e306bc74c0 avoid pretty printing of pre tags in course import 2019-11-12 13:57:25 +05:00
Dave St.Germain
0e4c04ed2e Merge pull request #21961 from edx/dcs/jumpnav
Improve navigation on Studio unit page
2019-11-08 10:32:43 -05:00
Feanil Patel
1a3f21080e The type of the attrib object wasn't actually a dict.
It was an internal class that we can't easily compare to. So I'm opting
to just make the xml output be more consistent and ordered.  I was
hoping to avoid this since the order shouldn't matter but the juggling
we have to do to validate the unorderd data is more complication than
it's worth.
2019-11-07 10:33:36 -05:00
Dave St.Germain
3e73ba3879 TNL-6929:
Improves navigation within Studio for Learning Sequences, speeding up authors who want to see how a learner progresses through content without needing to jump over to the LMS.

This adds a dropdown section navigator to the breadcrumbs on the unit page and copies the sequence navigator from LMS to the studio unit page.
2019-11-07 09:13:00 -05:00
Kyle McCormick
4f3262a40b Remove most references to old teams config scheme (#22238)
This is a follow up from MST-16, which was commited
in 3858036a4e.

Changes:
* Enrich course teams_configuration from a plain Dict
  to a custom XBlock field that uses the new TeamsConfig
  wrapper class.
* Remove teams_conf property from course, as the previous
  change made it redundant.
* Update teams_enabled implementation.
* Remove teams_max_size field from course, which is
  no longer semantically correct, as max team size
  is now defined on a teamset level.
* Remove teams_topics in order to discourage use of raw
  teams config dict.
* Add convenience properties teamsets and teamsets_by_id
  to course.
* Allow periods and spaces in teamset IDs to avoid breaking
  existing course teams.

Some parts of the code still use the old raw config data
(identifiable by searching "cleaned_data_old_format"),
which we expect to be slowly factored away as we build
new teams features. MST-40 has been created to remove any
remaining references if necessary.

MST-18

* fix: bokchoy test

* fix: remove pdb break
2019-11-06 20:43:32 -05:00
Feanil Patel
0078a6c1ca Parse transcripts json to compare logically.
This is to deal with a special issue in the video descriptor xml output.
The value of the transcript attribute of the video tag is a serialized
json string.  This can have comparison problems in python3 where the order
of the dictionary output is not gauranteed to be the same. So the strings
don't match equally.  We convert the parsed json instead so that the
comparison can be correct.
2019-11-06 11:37:06 -05:00
DawoudSheraz
3787dcd7fb added conditional logs for RCA 2019-11-06 18:35:06 +05:00
Manjinder Singh
cb186d94d3 Fixing test by using six.assertCountEqual (#22219)
* using six.assertCountEqual

* Fix type mismatches in css migrations
2019-11-04 09:29:32 -05:00
Awais Qureshi
076a2b5a7e BOM-998
Fixing decoding issue.
Fixing flaky unit test.
2019-11-01 15:54:23 +05:00
Awais Jibran
d891ae5522 Merge pull request #22192 from edx/aj/improve-logging-capa
Add error in logging
2019-11-01 11:25:28 +05:00
Jeremy Bowman
a6b8cbe627 Remove obsolete field type BOM-996 (#22203) 2019-10-31 15:23:58 -04:00
Awais Jibran
5e11708e11 Adding ContextualizeTextError. 2019-10-31 23:37:20 +05:00
Feanil Patel
9f9d904592 Update code to use the new rounding method.
See the commit that added round_away_from_zero for details.

IN the case of dashboard_data.py:

We don't first cast to decimal here because in python 2 this didn't do
anything.  The python 2 rounding method would just cast things to float
before doing the rounding anyway so it just wastes cpu cycles.  In
python 3 this causes some typing issues so just removing it.
2019-10-31 14:29:57 -04:00
Awais Jibran
cb2a24711e Add error in logging 2019-10-31 09:48:58 +05:00
Awais Jibran
38f296fa93 Merge pull request #22182 from edx/aj/improve-logging-capa
Improve logging when a CAPA problem fails to display HTML
2019-10-30 14:54:26 +05:00
Awais Jibran
c0a26e932d Improve logging when a CAPA problem fails to display HTML 2019-10-30 14:23:50 +05:00
Awais Jibran
3ee5969f73 fixed language issue and added test #2 2019-10-30 14:02:50 +05:00
Awais Jibran
a27bd563b4 Merge pull request #22102 from edx/as/bug/tinymce-add-image
JavaScript Error when inserting second image in Studio
2019-10-30 12:59:56 +05:00
Awais Jibran
222c74e855 JavaScript Error when inserting second image in Studio 2019-10-30 12:21:40 +05:00