Commit Graph

52200 Commits

Author SHA1 Message Date
Diana Huang
6fb40586fb Move LoginSessionView from user_api to user_authn 2019-11-01 08:19:55 -04:00
Nimisha Asthagiri
748398e57a Merge pull request #22173 from edx/diana/logistration-refactor
Move RegistrationView from user_api to user_authn
2019-11-01 08:13:39 -04:00
Diana Huang
e026006f9a Move RegistrationView from user_api to user_authn. 2019-11-01 07:41:48 -04:00
Awais Qureshi
75c83a2584 Merge pull request #22197 from edx/awais786/BOM-996-fix
BOM-996
2019-11-01 12:42:07 +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
David Ormsbee
9176f699b9 Merge pull request #22205 from open-craft/cms-base-fix
Read CMS_BASE from the environment, define it explicitly as public host
2019-10-31 22:28:48 -04:00
Braden MacDonald
05d7592eda Read CMS_BASE from the environment, define it explicitly as public host 2019-10-31 16:17:08 -07:00
Ned Batchelder
b9563acaac Merge pull request #19441 from danialmalik/pdf_viewer_static_url_fix
Fix static urls in pdf_viewer.html to correctly display PDF viewer for textbooks
2019-10-31 15:46:45 -04:00
Jeremy Bowman
a6b8cbe627 Remove obsolete field type BOM-996 (#22203) 2019-10-31 15:23:58 -04:00
Feanil Patel
15a7f3d4d3 Merge pull request #22149 from edx/feanil/update_rounding
BOM-738 - Review and update rounding for python 3
2019-10-31 14:58:07 -04:00
Bill DeRusha
d9506c1b6d Merge pull request #22202 from edx/bderusha/revert-PR-22152
REVERT PR #22152 88e7589a19
2019-10-31 14:52:16 -04:00
Awais Jibran
5e11708e11 Adding ContextualizeTextError. 2019-10-31 23:37:20 +05:00
Feanil Patel
facd737ee4 Update code to use the new rounding method in course_grades.
So making this code change took a few hours. But then deciding that it
was the right one of the many options available took the next 3 days.

When changing to the new rounding function, we had a test that started
failing.  It appears as if our new rounding function is not the same in
some way as the one built into python 2.

```
>>> round(.0045*100 + .05)/100
0.0
>>> round_away_from_zero(.0045*100 + .05)/100
0.01
```

Doing the math by hand we see that the new function is actually correct
but the old one is clearly rounding incorrectly in this case. Looking
closer at this I discovered that it was due to a floating point issue
where .0045*100 is represented as 0.44999999999999996 so when we add
0.05 to this number we get 0.49999999999999994.  This is all because of
the limitations of floating point arithmetic.

See https://docs.python.org/3/tutorial/floatingpoint.html#tut-fp-issues
for more on that.

Because python does its rounding at the bit level in C code.  It treats
the .4999... as below the .5 cutoff and rounds down. Whereas our code
does more simple arithmetic which causes the number to correct itself
before we round and so correctly rounds up to 0.01

The result of this change is that previously, the rounding threshold used to
be that any number > .0045 would ronud to 0.01 and now any number that
is >= .0045 rounds to 0.01

Note that if we only care about the two most significant digits of
number between 0 and 1, this error only manifests itself in such a way
that other than the case of going from 0.00 to 0.01 eg. from 0% to 1%
none of the other cases where we would now round up cause the 2 most
significant digits to change.  Given this level of impact, we're fine
with this change.

In our tests we see this for one case, where an incomplete turns into an
F in a test.  I'm updating the test here to be more correct.

As we were looking at it we speculated as to why we were adding the .05
to the number.  Could it be to counteract this floating point issue?  It
turns out not.

Looking at this commit(a1286b1c7d) we see that it
looks like this was intended to always round up to the nearest
percentage point.  However, there's a typo here.  If you wanted to
ensure that we always rounded up to the nearest percentage point you
would have the math be `round(final_grade_percent*100 + 0.5)/ 100` or a
simpler way to do this would be
`math.ceil(final_grade_percent*100)/100`.  However, that is not what
happened and 7 years later, there have been a lot of people graded with
the wrong rounding where essentialy anyone with a grade of 89.45 gets a
90 when the intended impact was supposed to be that anyone with a grade
above an 89.0 would get a grade of 90.

Changing it now requires a lot of conversation and wolud have a large
impact on existing learners.  So we are not going to change it as a part
of the python 2 -> python 3 upgrade.  I have created
https://openedx.atlassian.net/browse/TNL-6972  to capture this issue if
we want to address it in the future.
2019-10-31 14:29:57 -04: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
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
Bill DeRusha
c76390729d REVERT PR #22152 88e7589a19 2019-10-31 13:06:24 -04:00
Alex Dusenbery
5bf2a25842 EDUCATOR-4731 | Upgrade ORA2 to 2.3.5 (enable teams, behind course waffle flag). 2019-10-31 11:12:02 -04:00
Dave St.Germain
729e03b951 Merge pull request #22159 from edx/dcs/title-edit
TNL-6968 Access settings modal should not have an editable title
2019-10-31 11:09:39 -04:00
Awais Qureshi
5f2ebf713f BOM-996
Fixing Test.
2019-10-31 19:05:36 +05:00
edX requirements bot
636037514c Updating Python Requirements (#22196) 2019-10-31 10:01:16 -04:00
Dillon-Dumesnil
1b7edb55b6 Merge pull request #22188 from edx/ddumesnil/fix-pub-redirect-disco-1422
Encoding course key for url
2019-10-31 08:56:11 -04:00
adeel khan
819888ce05 Merge pull request #22190 from edx/adeel/prod_834_html_not_formatted
Fix escaping of html tags.
2019-10-31 15:49:41 +05:00
danial
ea53c3922d Fix static urls in pdf_viewer.html to correctly display pdf viewer for course text books 2019-10-31 13:57:59 +05:00
Waheed Ahmed
559069d5d2 Merge pull request #22193 from edx/waheed/run-make-upgrade
Run make upgrade.
2019-10-31 12:41:34 +05:00
Waheed Ahmed
6df1f8d70f Run make upgrade.
Upgraded xblock-google-drive to latest commit hash.
2019-10-31 12:05:41 +05:00
Awais Jibran
cb2a24711e Add error in logging 2019-10-31 09:48:58 +05:00
edX Transifex Bot
6c0ede859e geoip2: update maxmind geolite country database 2019-10-30 17:03:31 -04:00
Adeel Khan
b82d1b964e Fix escaping of html tags.
Using six.text_type() is converting
MarkSafe object created using HTML
function to simple string which is
essential html tags interpolation.
Applying escaping via Text function on
this string object is causing escaping
of html tags.

PROD-834
2019-10-31 00:59:09 +05:00
Diana Huang
ec2be49a44 Merge pull request #21185 from eduNEXT/lmm/retirementssiteaware
Making student account deletion components a bit site aware
2019-10-30 14:46:14 -04:00
Dillon Dumesnil
87c9563da5 Encoding course key for url
DISCO-1422
2019-10-30 14:27:20 -04:00
edX cache uploader bot
0b47380680 Updating Bokchoy testing database cache (#22186) 2019-10-30 14:25:44 -04:00
Jeremy Bowman
24cf5bbb84 Make discussion stub server URL handling deterministic BOM-994 (#22180) 2019-10-30 14:17:05 -04:00
Syed Muhammad Dawoud Sheraz Ali
778d9ea53a Merge pull request #22185 from edx/revert-22181-dsheraz/PROD-762
Revert "enable video url rewrite flag"
2019-10-30 22:19:50 +05:00
Troy Sankey
31c5cdf24c Merge pull request #22172 from edx/pwnage101/enable-pii-checking-enforcement
Enable PII Annotations checking enforcement
2019-10-30 13:04:29 -04:00
Matt Tuchfarber
f80c16da75 Merge pull request #22169 from edx/tuchfarber/fix_ecommerce_worker_email
Add data migration to fix ecommerce_worker email
2019-10-30 12:39:52 -04:00
Syed Muhammad Dawoud Sheraz Ali
83f567c485 Revert "enable video url rewrite flag" 2019-10-30 21:09:34 +05:00
Calen Pennington
e1034675e2 Merge pull request #22184 from cpennington/fix-typo-in-user-metadat
Fix typo in user_metadata.html (which was being obscured by mako non-…
2019-10-30 11:33:25 -04:00
Manjinder Singh
bf18c1ecc6 Modified dependencies and ran make upgrade: (#22171)
- edx-sga recently released new release that supports python 3.5
2019-10-30 11:27:46 -04:00
edX requirements bot
2874c1fa6a Updating Python Requirements (#22183) 2019-10-30 11:04:20 -04:00
Calen Pennington
7de48b4351 Fix typo in user_metadata.html (which was being obscured by mako non-strictness) 2019-10-30 10:41:30 -04:00
Uzair Rasheed
9ce3d555d2 Merge pull request #22177 from edx/PROD-782/disable-language-cookie
Disable language preference cookie to mobile views.
2019-10-30 17:58:07 +05:00
uzairr
4efe22c959 Disable language preference cookie to mobile views.
Language preference cookie is not allowing to change the site
language on mobile-apps affecting user-experience.To improve it,
mobile team suggested to disable the language preference cookie
for the request originated from mobile.

PROD-782
2019-10-30 17:12:10 +05:00
adeel khan
61f7cf25b2 Merge pull request #22175 from edx/adeel/prod_810_fixing_course_title_escaping
Fixing templates for double escaping.
2019-10-30 16:27: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
2423069315 Merge pull request #22165 from edx/as/bug/html-editor-url
fixed language issue and added test
2019-10-30 14:42:39 +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
Syed Muhammad Dawoud Sheraz Ali
6e4559c933 Merge pull request #22181 from edx/dsheraz/PROD-762
enable video url rewrite flag
2019-10-30 12:48:34 +05:00
Awais Jibran
222c74e855 JavaScript Error when inserting second image in Studio 2019-10-30 12:21:40 +05:00