Commit Graph

448 Commits

Author SHA1 Message Date
David Ormsbee
6ba9cd2140 Merge pull request #22035 from open-craft/blockstore-assets
APIs for XBlock static asset files in Blockstore
2019-11-08 15:28:59 -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
Braden MacDonald
7dafda6168 Support for storing an XBlock's static asset files in Blockstore
This PR introduces some backend python + REST APIs for storing static
asset files along with an XBlock in a content library. It also updates
the new runtime to be able to load such static asset files.

Example use cases:
* Store an image file with an HTML block and then use the image inline
  in the HTML block.
* Store a PDF file with an HTML block and provide a link in the HTML for
  the learner to download the PDF.
* Store .srt files or even video .mp4 files that belong to a video
  XBlock.

Within the bundle, these static asset files are stored in a "static/"
subfolder of the folder that contains the OLX file. Extending an
existing LMS/Studio convention, a static asset file such as "image.png"
is referenced within the OLX as "/static/image.png" and the URL will be
rewritten by the runtime.
2019-11-06 10:19:42 -08:00
Ned Batchelder
eab54563dc Merge pull request #22212 from edx/nedbat/more-rounding-tests
Add more tests of the new round()
2019-11-01 12:46:32 -04:00
Diana Huang
6fb40586fb Move LoginSessionView from user_api to user_authn 2019-11-01 08:19:55 -04:00
Ned Batchelder
0fc8bb5e4b Add more tests of the new round() 2019-11-01 07:47:12 -04:00
Feanil Patel
ab40748b5a Add an implementation of python2 style round.
Python 3 has no way to access this implementation of rounding in the
standard library.  We implement it here so that we can continue to use
it for grades calculation to keep regrading consistent.

Currently we can't be confident that if we change the rounding behaviour
we won't impact students.  We can't be sure that students that were
previously passing wouldn't suddenly no longer be passing.  Given this,
it's lower risk to just implement the old rounding strategy here and use
it when we are rounding to calculate grades.
2019-10-31 14:29:57 -04:00
Kyle McCormick
3858036a4e Expand and refactor teams configuration on course. (#22168)
Wrap CourseModule.teams_configuration in TeamsConfig
class, centralizing parsing, validation, error handling,
etc. Wrapped object is exposed on 'teams_conf' field.

Old code still uses 'teams_configuration' dict;
we should change this in the future (MST-18).

MST-16
2019-10-29 16:10:19 -04:00
Braden MacDonald
5fc73468b3 Change completion API to work with any learning context 2019-10-22 14:04:31 -04:00
Ayub khan
b3c062be1b BOM-848 Different Hash Values
hashlib produces different md5 hash in python3 against same values as
compared to python2.
2019-10-21 14:02:49 +05:00
Feanil Patel
05ab349c88 Merge pull request #22068 from edx/feanil/get_out_of_a_pickle
Create a custom Pickle Serializer
2019-10-18 14:48:24 -04:00
Feanil Patel
bfc02dc3ab Create custom pickle serializer.
We need to do this because when I tride to go to the JSON serializer a
bunch of tests started failing because various parts of our code are
putting things into the session that are not JSON serializable.

We can't keep using the default pickle serializer because it defaluts to
using the highest available protocol and that will cause issues with the
python 2 to 3 upgrade since both will be running in production at the
same time.  We need to use a version of the pickle protocol that both
can use interchangably.

We also need to make sure we read with latin1 encoding to make datetimes
work correctly between the two versions of python.
2019-10-18 13:46:47 -04:00
Feanil Patel
59b0554c37 Update encoding to be latin1 when loading pickled data to be able to read python 2 datettimes. 2019-10-18 13:04:19 -04:00
Feanil Patel
29cc071edd Set cache pickle protocol to 2.
HIGHEST_PROTOCOL will cause it to change when we move from python 2 to 3
and this may cause issues as older machines try to read objects pickeld
with a version of the protocol they don't know.

During deploys, and if we have to roll back are two examples.
2019-10-18 10:43:04 -04:00
aarif
d176957708 Updated the tests to fix the string/bytes input
changes made to pass tests with python 2 and other minor changes

Updated the tests to fix the string/bytes input

changes made to pass tests with python 2 and other minor changes

made some changes as suggested

made changes as suggested

changes made as suggested
2019-10-14 18:47:18 +05:00
Awais Qureshi
ae9dcdef8a BOM-917
Fix encoding issue.
2019-10-11 20:12:34 +05:00
jinder1s
2c6b2f32dd converting unicode to byte where necessary 2019-10-04 11:13:11 -04:00
jinder1s
3dc35dc09c Explicity creating byte strings 2019-10-01 13:43:45 -04:00
noraiz-anwar
67af4b8eb1 fix course import issue 2019-09-26 18:00:21 +05:00
Jeremy Bowman
23870802c6 Replace usage of UUID.get_hex() - BOM-672 2019-09-19 10:32:23 -04:00
edx-pipeline-bot
38cc1f0ab7 Merge pull request #21586 from edx/private_to_public_f98c819
Mergeback PR from private to public.
2019-09-06 12:32:38 +05:00
Awais Jibran
f98c819f74 Merge pull request #160 from edx/aj/add-noopener-to-new-window-urls
Update hyperlinks in platfrom
2019-09-06 11:43:38 +05:00
Alex Dusenbery
6917a29e84 PROD-287 | Add an optional treat_undefined_as_zero flag to the helper functions is_score_higher_or_equal() and compare_scores(), which defaults to False, that we call with value True from SubsectionGradeFactory.update(), which occassionally deals with invalid subsection scores containing zero as the denominator. 2019-09-05 09:31:23 -04:00
aarif
929d73bd88 python 3 fixes 2019-09-03 20:33:22 +05:00
Braden MacDonald
d3f6ed09d8 Learning Contexts, New XBlock Runtime, Blockstore API Client + Content Libraries
https://github.com/edx/edx-platform/pull/20645

This introduces:
* A new XBlock runtime that can read and write XBlocks that are persisted using
  Blockstore instead of Modulestore. The new runtime is currently isolated so
  that it can be tested without risk to the current courseware/runtime.
* Content Libraries v2, which store XBlocks in Blockstore not modulestore
* An API Client for Blockstore
* "Learning Context" plugin API. A learning context is a more abstract concept
  than a course; it's a collection of XBlocks that serves some learning purpose.
2019-08-30 10:31:15 -07:00
Awais Jibran
1a4eb7d2e8 Pervent reverse tabnabbing in edx platform 2019-08-28 16:08:34 +05:00
noraiz-anwar
1c4f9da92d improved quality of multiple files 2019-08-22 12:47:08 +05:00
Ayub khan
8a95a8e520 BOM-95
assertItemsEqual with six.assertCountEqual
2019-08-21 17:01:40 +05:00
Feanil Patel
68933ec089 Fix quality issues. 2019-08-19 11:51:30 -04:00
David Ormsbee
9a1385585f Convert response bytes to str before JSON parsing. (#21375)
Convert response bytes to str before JSON parsing.
2019-08-19 11:01:55 -04:00
Nimisha Asthagiri
b80fd1f843 Fix for 'UUID' object has no attribute 'get_hex' in openedx/core/lib/xblock_utils/__init__.py 2019-08-19 10:36:43 -04:00
Feanil Patel
269a57445d Fix a few issues we run into when running the discussion tests. 2019-08-19 10:14:29 -04:00
Feanil Patel
f5f875401a Fix some of the common test collection issues. (#21340)
* Remove old  performance tests that we haven't been running.

As far as I can tell, these tests to capture HAR files were created 5
years ago and not being run as a part of our suite?  They capture HAR
data that we do nothing with so even if they were running we should
remove them until we're ready to care about consuming this kind of
information.

* Update password test unicode string.
* Add ugettext translation helper function.
* Fix lambda syntax that is not valid in python 3.
* Fix ur raw strings which his not valid in python 3
* Use edx_six.get_gettext instead of ugettext.
* Fix a few other encoding issues.
* Don't use old form of sorted funciton.

This form which uses a 'cmp' method is not available in python 3.
2019-08-16 11:31:36 -04:00
arbisoft
9d87c3c83b python 2 and 3 compatible method. 2019-08-07 17:01:30 +05:00
Michael Roytman
77dc0fa9f0 add number of total users and number of filtered users to the gradebook API 2019-07-24 23:02:04 -04:00
Ayub khan
80f89dc982 INCR-379 python 3 compatibility 2019-07-10 15:13:26 +05:00
usama sadiq
7a5f0b7d24 Pylint Warning Supression Removed 2019-06-27 12:15:06 +05:00
Jeremy Bowman
5eac6aa049 Upgrade to django-pipeline 1.6.14 (#20449) 2019-05-07 16:01:37 -04:00
Nimisha Asthagiri
eb0791ec89 Inter-app API cleanup for Grades 2019-05-04 11:35:06 -04:00
Alex Dusenbery
403fb52e93 Add a GET endpoint to list ProgramCourseEnrollment data. 2019-05-03 13:39:10 -04:00
Nimisha Asthagiri
e160b23903 Move django_comment_client to discussion/ 2019-05-03 12:09:46 -04:00
Nimisha Asthagiri
ef0e06cc0a Revert "Discussions consolidation" 2019-05-02 14:59:56 -04:00
Nimisha Asthagiri
db89a64d06 Move django_comment_client to discussion/ 2019-05-01 19:13:10 -04:00
David Ormsbee
50a8360b1a Merge pull request #20023 from open-craft/symbolist/capa-xblock-1
CapaModule to ProblemBlock [SE-397]
2019-05-01 12:18:50 -04:00
Alex Dusenbery
20f0bc03d4 Add a GET API endpoint for program enrollments. 2019-05-01 11:35:38 -04:00
Usman Khalid
41c6236e0a Convert CapaModule to ProblemBlock.
* Minimum possible changes were made to merge CapaModule & CapaDescriptor into
  one ProblemBlock class.
* There are no known changes in behavior.
* CapaModule and CapaDescriptor inherited from a number of classes which inherit
  from XModule or XModuleDescriptor but did not depend on them. For all these
  classes the methods were moved to mixins which did not inherit from either and
  then these mixins were added to ProblemBlock in the order which maintains MRO.
2019-05-01 20:08:36 +05:00
David Ormsbee
e2ec126d0d Initial README for Discussion 2019-04-25 15:13:59 -04:00
Michael Youngstrom
bfe10720c6 Remove lettuce infrastructure 2019-04-18 09:58:21 -04:00
Andrés González
26b3a40133 INCR-108 (#20058)
* INCR-108: Run python-modernize on openedx/core/lib

* Fixed urlencode import

* Fixed diff quality warnings and six.string_types error

* Fixed pickle import

* Fixed iteritems import

* Fixed ungrouped imports

* Fixed six.moves import issues
2019-04-02 10:26:00 -04:00
Alex Dusenbery
3848e86ce9 EDUCATOR-4222 | Let the gating API read persistent grade information. 2019-03-29 16:13:56 -04:00