Commit Graph

609 Commits

Author SHA1 Message Date
Régis Behmo
d1f9e769d0 Simplify the toggle_use_case annotation
Since code-annotations==0.7.0, incremental_release, launch_date,
monitored_rollout, graceful_degradation, beta_testing are all considered
as "temporary" use cases.
2020-09-16 15:16:13 +02:00
Régis Behmo
9445bbe930 Document lms/djangoapps/grades feature toggles 2020-09-16 15:16:13 +02:00
Régis Behmo
307457a255 Simplify hack to obtain waffle module names
Instead of going up the stacktrace to find the module names of waffle
flags and switches, we manually pass the module __name__ whenever the
flag is created. This is similar to `logging.getLogger(__name__)`
standard behaviour.

As the waffle classes are used outside of edx-platform, we make the new
module_name argument an optional keyword argument. This will change once
we pull waffle_utils outside of edx-platform.

Note that the module name is normally only required to view the list of
existing waffle flags and switches. The module name should not be
necessary to verify if a flag is enabled. Thus, maybe it would make
sense to create a `add` class methor similar to:

    class WaffleFlag:
        @classmethod
        def add(cls, namespace, flag, module):
            instance = cls(namespace, flag)
            cls._class_instances.add((instance, module))
2020-09-14 09:30:24 +02:00
Jansen Kantor
d0bd99a028 EDUCATOR-5240: LMS Returns 500 when requesting grade override history for a Subsection a Course Staff does not have access to (#24849)
* recreate issue

* add success and error_message

* catch case where target block has been hidden
2020-09-08 15:59:33 -04:00
Manjinder Singh
c76ed6ae45 Extracting plugin app from edx-platform (#24678)
* Moving plugins infrastructure to edx-django-utils
This PR extracts the code that enables plugins in edx-platform and puts it in edx-django-utils. This is done to allow other IDAS to add plugin functionality.
2020-08-12 07:48:53 -04:00
Andytr1
001cf153b3 EDUCATOR-5181 grading documentation (#24727) 2020-08-11 10:00:00 -04:00
Robert Raposa
77e490f057 ARCHBOM-1305: remove deprecated flag_undefined_default (#24426)
This is the final step in removing the deprecated
flag_undefined_default as explained by the following ADR:
https://github.com/edx/edx-platform/blob/master/openedx/core/djangoapps/waffle_utils/docs/decisions/0001-refactor-waffle-flag-default.rst

Notes:

* All uses of flag_undefined_default=False were always
  supposed to have been no-ops.
* All uses of flag_undefined_default=True that are removed
  in this PR have been replaced by migrations in past PRs.
* The temporary metric temp_flag_default_used id no longer
  reporting any data.

ARCHBOM-1305
2020-07-09 09:31:31 -04:00
Aarif
9e34cb3df9 Removed deprecated future imports (#24295) 2020-06-28 23:40:03 +05:00
Robert Raposa
9b0024376a update flags using flag_undefined_default=True
In order to enable us to remove flag_undefined_default, this
updates flags according to alternatives documented in:
https://github.com/edx/edx-platform/blob/master/openedx/core/djangoapps/waffle_utils/docs/decisions/0001-refactor-waffle-flag-default.rst

These flags were updated with a migration:
- enable_checklists_quality
- REJECTED_EXAM_OVERRIDES_GRADE
- ENFORCE_FREEZE_GRADE_AFTER_COURSE_END
- WRITABLE_GRADEBOOK

ARCHBOM-1304
2020-06-23 14:37:50 -04:00
Aarif
27480cdd2f Removed deprecated future imports 2020-06-23 18:51:43 +05:00
Aarif
98af9ce418 remove useless-supression warnings 2020-05-01 19:42:15 +05:00
Alex Dusenbery
5f00228b11 Add grades how_tos doc. 2020-03-18 14:38:07 -04:00
Awais Qureshi
0f002bafb8 BOM-1399
checking django-wiki and fixing deprecation warnings.
2020-03-16 14:37:18 +05:00
Michael Terry
b96efcf71b Merge pull request #23258 from edx/mikix/experiment-flag
Add ExperimentWaffleFlag
2020-03-03 15:01:16 -05:00
Simon Chen
eb3e36b822 MST-121 We should allow the business case where a learner can be enrolled into a program, then unenrolled, then enroll into another program with the same course 2020-03-03 14:39:57 -05:00
Michael Terry
e724a4bcb7 Add ExperimentWaffleFlag
This is a helpful class when running an experiment, to help
bucket users and keep track of which enrollments to consider
as part of the experiment.

AA-53
2020-03-03 14:39:02 -05:00
Diana Huang
0b9f7298c6 Replace DOP library factories with the DOT equivalent.
https://openedx.atlassian.net/browse/BOM-1312
2020-02-24 16:33:56 -05:00
Calen Pennington
98328ea426 On publish, add evenly spaced dates to self-paced courses 2020-02-21 10:50:22 -05:00
Dave St.Germain
00f5beb66f Merge pull request #22992 from edx/dcs/perf-vertical
Improve Vertical Performance
2020-02-20 12:30:22 -05:00
Dave St.Germain
a5b0f71108 Several optimizations for improving vertical rendering performance. 2020-02-20 11:41:21 -05:00
Dave St.Germain
5e6d3a0411 Merge pull request #22973 from eduNEXT/lmm/gradebook_full_name
Display profile name in gradebook api
2020-02-19 11:53:39 -05:00
Manjinder Singh
d7bd80a100 Renamed OAuth2Authentication to BearerAuthentication (#23128)
* Renamed OAuth2Authentication to BearerAuthentication
* Added back OAuth2Authentication name
-there are libraries such as edx-enterprise that still import OAuth2Authentication.  The OAuth2Authentication class should be fully removed when everything is importing BearerAuthentication correctly
2020-02-18 13:29:29 -05:00
Luis Moreno
b602665edc Display profile name in gradebook aapi 2020-02-17 11:42:29 -04:00
Manjinder Singh
cce8cdd661 Replacing OAuth2Auth (#23067)
- Removing deprecated auth classes
- Replacing OAuth2AuthenticationAllowInactiveUserDeprecated with OAuth2AuthenticationAllowInactiveUser
- the old class was a child class of a deprecated class that we are removing and replacing.
2020-02-11 10:38:13 -05:00
DawoudSheraz
0b1c7db967 add multiple correct values check for Dropdown problems 2020-02-10 11:36:28 +05:00
Manjinder Singh
cea795b02e Added new auth class (#23018)
* Added new auth class

- Created new class called OAuth2AuthenticationAllowInactiveUser, which replaces old class with same name
- Renames previous  OAuth2AuthenticationAllowInactiveUser to  OAuth2AuthenticationAllowInactiveUserDeprecated
- Replaced all imports of  OAuth2AuthenticationAllowInactiveUser to call deprecated class instead
- testing new class in discussion(added flag based on django setting)
2020-02-06 10:37:27 -05:00
atesker
8234208cbb Delete persisten subsection grade override history
Removed model

renamed file
2020-01-07 12:05:24 -05:00
Aarif
e607657a73 Merge pull request #22620 from edx/on_delete_parameter
Added on_delete parameter to models
2019-12-31 15:23:47 +05:00
David Ormsbee
2cb2265ffe Add request caching to reduce ORM queries
This adds request caching to the following places:
* course expiration wrapper (displayed in Units)
* offer banner generation (displayed in Units)
* get_enrollment
* user_by_anonymous_id
* youtube_disabled_for_course

On a sample course with edx-val enabled, this reduced the queries
for a large sequence from 450 to 155.
2019-12-30 16:19:25 -05:00
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
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
aarif
02350e0fee added on_delete parameter to foreign_key and oneToOne fields
changes made to fix issues with quality
2019-12-27 19:59:45 +05:00
Jeremy Bowman
e0a22db806 Fix Python 3 bug in LTI stub server BOM-1006 (#22260) 2019-11-08 08:42:56 -05:00
Matthew Piatetsky
bd76a71019 delete old holdback code 2019-11-07 09:51:39 -05:00
Jeremy Bowman
a6b8cbe627 Remove obsolete field type BOM-996 (#22203) 2019-10-31 15:23:58 -04: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
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
Manjinder Singh
a384e753fd BOM-933: Fix type mismatches in various migrations (#22112)
* Fix type mismatches in the course_modes migrations

* Fix type mismatches in the course_action_state migrations

* Fix type mismatches in the schedules migrations

* Fix type mismatches in grades migrations

* Fix type mismatches in video_pipeline

* Fix type mismatches in api_admin

* Fix mismatches in credential migrations
2019-10-24 11:42:39 -04:00
Saad Waqar
7fca58f88b replaced brl.hash_value with brl in bulk_get_or_create because it calls bulk_create afterwards and bulk_create uses objects to create VisibleBlocks whereas brl.hash_value would return a string 2019-10-23 20:56:08 +05:00
Feanil Patel
871d62f246 Fix type mismatches in the grades migrations.
Mixing byte and unicode strings causes migrations to fail.
2019-10-21 13:32:46 -04:00
Zia Fazal
3b69a4f279 Invoke learner transmission task only for enterprise learners
Invoke learner transmission task only for enterprise learners
ENT-2384

added docstring

Fixed brokent unit test
2019-10-15 15:58:37 +05:00
atesker
4aff507847 EDUCATOR-4700 - pull grade overrides by grade_id
pep8

udate filter on simple history

convert to list

diable no member error
2019-10-10 12:13:07 -04:00
atesker
e07635559c EDUCATOR-4365 - display max score for not started assignment
pep8

moved includes

refactor 1

correted properties

update unit test

pep update

cr 2

made failure case a function
2019-10-02 08:48:31 -04:00
Nimisha Asthagiri
b73e0d8120 Grades python-3 upgrade: test_recalculate_learner_grades.py 2019-09-28 11:39:26 -04:00
Matt Hughes
6085852c99 Attribute grade overrides from proctoring to the final reviewer
More generally, makes it so we don't ever pull in the user to whom
we're attributing overrides from the request, but always use the one
passed in via method parameters

Also pass through comments, if they're provided via this method

JIRA:EDUCATOR-4641
2019-09-27 10:58:58 -04:00
atesker
6c6a0e47af fixed for production - add get_history
EDUCATOR-4696 - put back get_history and update UI

add pylint
2019-09-26 14:35:20 -04:00
Ned Batchelder
efba6e45e8 Finally import courseware properly everywhere to get rid of a warning 2019-09-26 09:40:15 -04:00