Commit Graph

52181 Commits

Author SHA1 Message Date
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
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
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
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
DawoudSheraz
8c75a3757d enable video url rewrite flag 2019-10-30 12:19:37 +05:00
Matt Hughes
cfbfe35904 Link program enrollments on social auth updates in add. to creation
See
lms/djangoapps/program_enrollments/docs/decisions/0002-matriculation-on-user_social_auth_change.rst
for more details

JIRA:EDUCATOR-4770
2019-10-29 16:19:48 -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
Troy Sankey
b073ece3d3 Lower PII annotation threshold so that I can enable enforcement
The CMS check is currently reporting 94.5% coverage, so I must lower to
that value or else quality checks will fail on master after I merge.

DE-1764
2019-10-29 14:47:04 -04:00
Troy Sankey
1312e4fedf Enable PII Annotations checking enforcement
DE-1764
2019-10-29 14:47:00 -04:00
Matt Tuchfarber
865114cba6 Add data migration to fix ecommerce_worker email
ecommerce_worker is the only service user with a @fake.email  instead of
an @example.com email address. This was fixed manually in a devstack sql
dump, but was lost during the next sql dump. This will fix it moving
forward so we don't have to work around it.
2019-10-29 14:04:29 -04:00
Alex Dusenbery
a5aaffbb78 Upgrade edx-ora2==2.3.3 2019-10-29 12:07:20 -04:00
Diana Huang
2e3f9cb1de Merge pull request #22145 from edx/diana/remove-node-install
Remove nodeenv install for jenkins.
2019-10-29 11:30:52 -04:00
Ned Batchelder
b245defb11 Merge pull request #22132 from philanthropy-u/saad/fix_visible_blocks_hash_value
Fixed exception in VisibleBlocks.bulk_create due to incorrect argument passed
2019-10-29 11:14:52 -04:00
Diana Huang
a4d70cb127 Remove nodeenv install for jenkins. 2019-10-29 11:04:13 -04:00
Manjinder Singh
6f1be3ed2c BOM-933: Fix type mismatches in various migrations 6 (#22170)
* Fix type mismatches in coursewaqre

* Fix type mismatch in credit migrations

* Fix type mismatch in status migrations

* Fix type mismatch in user_api migrations

* Review Fixes
2019-10-29 10:36:10 -04:00
Nimisha Asthagiri
f533134db1 Merge pull request #22086 from edx/arch/user-authn-delete-deprecated
User Authn: Remove deprecated, ENABLE_COMBINED_LOGIN_REGISTRATION
2019-10-29 09:37:53 -04:00
Nimisha Asthagiri
db42c7e1e2 User Authn: Remove deprecated, ENABLE_COMBINED_LOGIN_REGISTRATION 2019-10-29 08:57:58 -04:00
Adeel Khan
e9708ca6e0 Fixing templates for double escaping.
Some of the email templates are escaped
in such a way that could potentially cause
double escaping i.e via django default behaviour
and other via interpolate_html tag. Fixing it
by only applying escape via tag.

PROD-810
2019-10-29 14:58:05 +05:00
Jeremy Bowman
6b16a1b9c1 Fix UnicodeEncodeError in dashboard sharing links (#22174) 2019-10-28 18:41:56 -04:00
Andytr1
122ee29a13 Merge pull request #22158 from edx/andytr1/prod-waffle-flag-for-report
PROD-826 - add waffle flag
2019-10-28 14:03:31 -04:00
irfanuddinahmad
b509b2b652 Merge pull request #22167 from edx/iahmad/ENT-2428-Upgraded-version-for-edx-enterprise
ENT-2428: Update edx-enterprise version
2019-10-28 18:32:14 +05:00
irfanuddinahmad
7bcb618163 Updated requirements for edx-enterprise 2019-10-28 18:02:30 +05:00