Commit Graph

1325 Commits

Author SHA1 Message Date
DawoudSheraz
3787dcd7fb added conditional logs for RCA 2019-11-06 18:35:06 +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
Feanil Patel
c009d4550a Pass back the answer html as a string instead of bytes.
We did this already for the 'get_html' function for a capa problem but
there wasn't a test to ensure this works correctly for the
get_question_answer function that powers the show answer button.

I ran into it while doing a quick smoke test on the python 3 sandbox.
2019-10-24 09:46:26 -04:00
Jeremy Bowman
d4b0968e3a Fix JSON parsing in edxnotes.helpers BOM-990 (#22122) 2019-10-22 17:57:01 -04:00
Manjinder Singh
936e1d48a3 BOM-928: Fixing test error due to dict ordering (#22055)
* Fixing test error due to dict ordering

* Dict ordering fixes

* replacing dict with list to maintain consistency

* better html parsing
2019-10-22 09:30:24 -04:00
Ayub
8aa2fad4ec Merge pull request #21988 from edx/BOM-898
BOM fix remaining capa module issues
2019-10-14 17:33:27 +05:00
Ayub khan
8717510d35 BOM-805
python3 compatibility: Before comparison with unicode decode text if its type is bytes.
2019-10-14 15:15:28 +05:00
Ayub khan
e9c4c22e6a BOM fixed remaining capa module issues
BOM-898 fix test_responsetypes.py issues
Updated safe_exec to use random2 library instead of random.
As python3 random generates different results as compared to
python2, which causes a lot of test failures and if we use
python3 random and fix tests it will cause state invalidation
of capa problems, So random2 was uses to make the behaviour same
in python3.

BOM-899 name xrange is not defined
xrange is used in safe_exec and there might be old courses where
this is being used in capa problems. All those tests fail in python3
as this was renamed to range. Used six.moves.xrange so that code
works for python3 and if there is any old code using xrange it
works too.
2019-10-14 13:29:12 +05:00
Awais Qureshi
a231876493 BOM-799
\\n\\n was coming inside the html. Clean it.
2019-10-09 11:45:14 +05:00
Ayub
7537283048 Merge pull request #21935 from edx/BOM-capa-random-python3-combatibility
BOM Project Capa Module Python3 Compatibility
2019-10-08 11:11:02 +05:00
Jeremy Bowman
71e9c85dca Fix capa problem i18n BOM-775 (#21832) 2019-10-07 11:19:49 -04:00
Ayub khan
bb242c4b22 BOM Project Capa Module Python3 Compatibility
Python3 RNG produces different results as compared to python2
In capa problems we save seed value and generate random state
using the seed. Python3 random generates a different state as
compared to python2. Thats why using random2 library to make
state genration consistent in both python versions.
2019-10-07 16:39:47 +05:00
Ayub khan
277afeb85e BOM-788
python3 compatibility: etree returns a bytes type string so in py3 we need to decode it
to compare with a unicode string
2019-10-03 15:26:36 +05:00
Ayub khan
b5dc95a30d BOM-609
python3 compatibility
2019-10-01 11:33:37 +05:00
Ayub khan
a21604afdb BOM-613
Made all tests py3 compatible.
2019-09-30 12:07:49 +05:00
Ayub
12140e5b78 Merge pull request #21784 from edx/BOM-608
BOM-608
2019-09-30 10:34:58 +05:00
Feanil Patel
07df64eb8c Fix the rest of these. 2019-09-27 14:36:40 -04:00
Awais Jibran
007dfa5c55 Merge pull request #21750 from edx/aj/prevent-unicode-error
Prevent unicode error
2019-09-27 13:25:10 +05:00
Ayub
290caa4c8e Merge pull request #21788 from edx/BOM-612
BOM-612
2019-09-27 09:44:44 +05:00
Jeremy Bowman
1e3d6f6db3 Fix parsing of Unicode capa XML BOM-611 (#21803) 2019-09-26 16:34:35 -04:00
Manjinder Singh
61015ad840 Merge pull request #21779 from edx/msingh/python3_test_shuffle_custom_names
BOM-614: AssertionError: Lists differ Fix.
2019-09-26 13:13:53 -04:00
jinder1s
7a2aaa09c1 random.shuffle compatibility fix between python 2.7 and 3.5 2019-09-26 08:47:18 -04:00
Ayub khan
476da01f36 BOM-612
python3 compatibility
2019-09-26 15:22:22 +05:00
Aarif
37b08c5784 Merge pull request #21745 from edx/BOM-610
BOM-610
2019-09-26 12:35:24 +05:00
Ayub khan
1178384a52 BOM-608
python3 compatibility
2019-09-26 12:28:23 +05:00
Ayub khan
5c47a3b425 BOM Project
Updated __unicode__ to __str__
2019-09-25 18:31:54 +05:00
aarif
736001e7f1 python 3 fixes
quality fixes

python 3 fixes
2019-09-25 15:10:50 +05:00
Awais Jibran
c0e0318f08 Prevent unicode error
This PR prevents `UnicodeDecodeError` when replacing unicode with bytes string.

Example:

PROD-680
2019-09-24 13:12:40 +05:00
Feanil Patel
fb59752c75 Need to return a unicode string in the xml factory.
The underlying data is put into json documents that expect unicode
strings not byte strings.  In python2 lxml provided strings that were
auto coerced but in python3 it provides byte strings.
2019-09-16 11:30:05 -04:00
Awais Qureshi
68ecbc0432 BOM-477
Fixing python3
2019-09-13 17:31:02 +05:00
Jillian Vogel
fb981bfbbe Aids styleability of CAPA checkbox and radio problems
by making CAPA <input> elements siblings of their <label>s, instead of children.

Also:

* Moves radio submitted status block down below the problem
  to match the checkbox problem status blocks.
* Marks submitted choicegroup answers with a class
2019-09-11 13:54:07 +09:30
Ayub khan
df45007ce8 BOM-235
python3 compatibility
2019-09-05 16:32:57 +05:00
Ayub khan
8e71206312 BOM-96
-fixes all issues
2019-09-02 13:30:33 +05: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
9b87cb0172 BOM-85
he builtin basestring abstract type was removed. Use str instead.
2019-08-09 22:08:57 +05:00
aarif
61800c619f replaced StringIO imports with import from six
replaced cStringIO and StringIO imports with import from six

fixed StringIO imports

fixed StringIO imports

fixed XSS python-wrap warning
2019-08-08 00:09:16 +05:00
Muhammad Zaid Bamber
ffc2d9729b Revert "Added logs for XQueue Information" 2019-07-30 14:14:04 +05:00
aarif
86b810a23a ran python-modernize and isort on files mentioned in INCR-410
Updated the file as suggested

ran python-modernize and isort on files mentioned in INCR-410

Updated the file as suggested

changes made to comply with quality

ran python-modernize and isort on files mentioned in INCR-410

Updated the file as suggested

changes made to comply with quality
2019-07-24 09:50:13 +00:00
Feanil Patel
7ae8221a47 Merge pull request #21055 from amitvadhel/INCR-411
INCR-411: Updates on Python 3.x
2019-07-19 10:18:04 -04:00
amitvadhel
7d05a9666a INCR-411: Disable python-wrap-html for xss-lint 2019-07-18 21:29:32 +03:00
zaidbamber161
d4c41008b4 Updated logs information 2019-07-15 15:50:37 +05:00
zaidbamber161
f02b34c1a1 Updated logs information 2019-07-15 15:50:37 +05:00
zaidbamber161
f86d0c8e16 Fixed quality test 2019-07-15 15:50:37 +05:00
zaidbamber161
bc7e2a900c Added logs for XQueue 2019-07-15 15:50:37 +05:00
amitvadhel
182a177b4e INCR-411: Updates on Python 3.x 2019-07-11 00:15:33 +03:00
Amit
4fb5679987 INCR-245: Make compatible with Python 3.x without breaking Python 2.7… (#20530)
* INCR-245: Make compatible with Python 3.x without breaking Python 2.7 support > common/lib/capa/capa/safe_exec

* INCR-245: Add absolute_import to CODE_PROLOG
2019-06-20 15:38:33 -04:00
Jeremy Bowman
47292e5f92 Update StringIO usage for Python 3 (#20462) 2019-05-08 12:13:22 -04:00