Commit Graph

121 Commits

Author SHA1 Message Date
ahmed-zubair-1998
73a446d85b perf: Reduce database calls when generating problem responses report (#33940)
During the process of generatinng report for problem responses,
there are two places where N + 1 query problem exist. In both
cases, `StudentModule` objects are fetched and looped over where
`student.username` field for each object is accessed. This result
in a seperate database call to get the username for each student
response.

This problem is fixed by creating a join to fetch the related
table in the original query using `select_related`. In a test
conducted on report having 5000 `StudentModule` objects, the
number of queries for the request reduced from 8363 to 29. The
total time taken for the task reduced from 23764 ms to 7394 ms.
2024-01-16 13:41:15 -05:00
Bernard Szabo
377edc2f4d feat: TNL-10136 Propagate changes from last PR 2022-12-13 17:19:41 -05:00
Bernard Szabo
2d544f94be feat: TNL-10136 tease course enrollment from student model
Reapply changes developed in bszabo/TNL-10136-student-course-enrollment branch to current master
2022-12-13 17:19:34 -05:00
Javier
6bad34d3e0 fix: Avoid overcounting former pending users who changed their emails. 2022-07-15 08:28:43 -07:00
Jawayria
d0fbde8973 chore: Applied lint-amnesty on lms/djangoapps (#29395) 2021-12-21 13:36:50 +05:00
edX requirements bot
bb20b17428 Python Requirements Update (#29516)
* chore: Updating Python Requirements

* fix: fix pylint issues

Co-authored-by: Mohammad Ahtasham ul Hassan <mohammad.ahtasham@arbisoft.com>
2021-12-08 14:13:27 +05:00
Usama Sadiq
780a6f3c2d Revert "chore: install codejail from pypi (#29481)" (#29501)
This reverts commit 21551095ac.
2021-12-02 22:19:15 +05:00
Mohammad Ahtasham ul Hassan
21551095ac chore: install codejail from pypi (#29481)
* chore: install codejail from pypi

* chore: Updating Python Requirements

* chore: Updating Python Requirements

* fix: fixed failing tests

* fix: fixed pytest failures

* fix: fixed failing test bug

* Update mocks.py

Co-authored-by: edX requirements bot <testeng+edx-requirements-bot@edx.org>
2021-12-02 17:07:29 +05:00
Ned Batchelder
d9dd10dc97 style: code cleanups from Steven Burch (#29292)
* chore: update deprecated import from collections

* chore: remove outdated imports from markdown library

as it hasn't been supported since 2.0.3 and we're on 3.x.
This was deprecated at least as early as 2012!

* docs: add docstring and remove lint-amnesty to markdown plugin

* chore: remove deprecated etree import

* style: remove unnecessary-comprehension for sets

* style: resolve a number of amnestied pylint complaints

Co-authored-by: stvn <stvn@mit.edu>
2021-11-10 07:11:57 -08:00
Andy Shultz
2e0393d098 fix: update platform test that directly creates proctor attempts
Student name field is gone. This test was providing a blank name so nothing
more than delete is needed.

MST-872
2021-07-22 16:44:11 -04:00
Josh McLaughlin
ddffeaac4a fix: Use UserProfile.meta for city field if set in the profile information report
There are two distinct ways to store a city for users in edx-platform:
one directly in UserProfile.city, and another in UserProfile.meta.

Depending on configuration, both fields can be used. Though the
UserProfile.meta['city'] field is not set unless specifically configured,
so we choose this over the UserProfile.city field when generating the student
features report.

Additional details and discussion available on edx/edx-platform#23171
2021-06-16 11:26:41 -07:00
Albert (AJ) St. Aubin
c37e88fdbf refactor: Move CertificateStatuses to data.py file per OEP-49
[MICROBA-678]

To allow access to CertificateStatuses constants in other Django apps we are moving the
CertificateStatuses enum to data.py per OEP-49.
2021-06-08 08:56:21 -04:00
Usama Sadiq
228c54d222 refactor: pyupgrade second iteration 2021-05-03 14:55:47 +05:00
stvn
22fb1ec124 refactor: Move InstructorFactory helper to common/ 2021-04-14 07:26:39 -07:00
Simon Chen
4c5d56ef06 MST-682 Add external_user_key to the student profile CSV (#27091)
* MST-682 Add external_user_key to the student profile CSV
This is a request from some Masters school partners. They would like to download the student enrolled list with the Masters external_user_key data referenced. This way, the schools can properly match the students enrolled in the course with the students enrolled through Masters enrollment system
2021-03-22 14:25:34 -04:00
Jawayria
7285ae5151 BOM-2352: Removed unused imports from lms/djangoapps/{instructor_analytics, instructor_task, learner_dashboard} 2021-02-23 17:21:42 +05:00
usamasadiq
3f1df8eb2a Ran pyupgrade on lms/djangoapps
Ran pyupgrade on lms/djangoapps/instructor_analytics
Ran pyugprade on lms/djangoapps/instructor_task
Ran pyupgrade on lms/djangoapps/learner_dashboard
2021-02-19 17:30:59 +05:00
Aarif
1ead9f684c replaced unittest assertions pytest assertions (#26546) 2021-02-18 18:01:41 +05:00
Awais Qureshi
44576ce3f6 BOM-2282
Apply pylint-amnesty.
2021-02-01 19:27:15 +05:00
Kyle McCormick
151bd13666 Use full names for common.djangoapps imports; warn when using old style (#25477)
* Generate common/djangoapps import shims for LMS
* Generate common/djangoapps import shims for Studio
* Stop appending project root to sys.path
* Stop appending common/djangoapps to sys.path
* Import from common.djangoapps.course_action_state instead of course_action_state
* Import from common.djangoapps.course_modes instead of course_modes
* Import from common.djangoapps.database_fixups instead of database_fixups
* Import from common.djangoapps.edxmako instead of edxmako
* Import from common.djangoapps.entitlements instead of entitlements
* Import from common.djangoapps.pipline_mako instead of pipeline_mako
* Import from common.djangoapps.static_replace instead of static_replace
* Import from common.djangoapps.student instead of student
* Import from common.djangoapps.terrain instead of terrain
* Import from common.djangoapps.third_party_auth instead of third_party_auth
* Import from common.djangoapps.track instead of track
* Import from common.djangoapps.util instead of util
* Import from common.djangoapps.xblock_django instead of xblock_django
* Add empty common/djangoapps/__init__.py to fix pytest collection
* Fix pylint formatting violations
* Exclude import_shims/ directory tree from linting
2020-11-10 07:02:01 -05:00
Feanil Patel
ca85021187 DEPR-43 - Remove shopping cart from instructor analytics. 2020-07-07 16:38:32 -04:00
Diana Huang
c7bd5a8a15 Remove more references to fix tests. 2020-06-09 13:06:44 -04:00
Feanil Patel
6e3fe00fff Fix all E303 pep8 errors. 2019-12-30 12:25:38 -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
Daniel Clemente Laboreo
a9476ea50e Add last_login and date_joined to the student profile export 2019-11-25 19:58:05 +01:00
Ned Batchelder
efba6e45e8 Finally import courseware properly everywhere to get rid of a warning 2019-09-26 09:40:15 -04:00
Ayub khan
d34eba0e9c BOM-438
Python3 compatibility.
2019-09-17 16:08:32 +05:00
amitvadhel
b0c28187b6 Fixes decoding for csv response 2019-09-08 11:10:46 +03:00
Awais Jibran
69ca1ac448 Merge pull request #21284 from edx/aj/fix-japanees-chars-in-csv
Fix Japaness Characters not visible on Data Download Report
2019-08-27 15:44:16 +05:00
Ayub
f51306b2be Merge pull request #21424 from edx/BOM-221
BOM-221
2019-08-26 09:28:34 +05:00
Ayub
356f92add7 Merge pull request #21426 from edx/BOM-190
BOM-190
2019-08-26 09:23:40 +05:00
Ayub khan
ee61f26fed BOM-142
Py3 Assertion Error
2019-08-23 16:27:09 +05:00
Ayub khan
4250c3a0b3 BOM-190
py3 assertion error
2019-08-23 16:10:21 +05:00
Ayub khan
5b984ffb5c BOM-221
py3 Assetion Error
2019-08-23 15:31:29 +05:00
Awais Jibran
b1cdf6a96f Fix Japaness Characters not visible on Data Download Report 2019-08-21 16:36:46 +05:00
Calen Pennington
0cd8f58bcc Remove all instances of from instructor import imports 2019-08-05 09:59:30 -04:00
atesker
d88e41db46 updated header location, error handling 2019-05-22 15:51:36 -04:00
atesker
0bd94327fe killed rebase 2019-05-21 14:35:10 -04:00
Stu Young
3e92168e80 incr-271 (#20568)
* run python modernize

* run isort

* quality
2019-05-16 13:56:35 -04:00
Nimisha Asthagiri
eb0791ec89 Inter-app API cleanup for Grades 2019-05-04 11:35:06 -04:00
cclauss
44d62fac75 Fix explicit tuple parameters for Python 3 2019-02-19 12:37:34 +01:00
Calen Pennington
8c53ce6493 Merge pull request #19743 from edx/unicode7
fix unicode strings in lms/ part 2
2019-02-13 14:15:02 -05:00
Matthew Piatetsky
764319d3e0 fix unicode strings in lms/ part 2 2019-02-13 10:35:56 -05:00
Michael Youngstrom
3221c2b91f Remove lms pytest shards 2019-02-12 11:03:46 -05:00
cclauss
8fca11b85c Use print() function in both Python 2 and Python 3 2019-01-13 17:16:37 +01:00
Jeremy Bowman
bcaec3c5bb TE-2525 nose.tools removal part 1/2 2018-08-07 08:30:12 -04:00
Jeremy Bowman
ca3316962d TE-2524 Stop using nose.plugins - LMS 1 2018-07-31 13:03:18 -04:00
Eric Fischer
247bb50ed2 s/django.core.urlresolvers/django.urls/g
Django 1.10 deprecation fix for Hackathon XIX
Addresses PLAT-1397
2018-06-05 13:59:09 -04:00
Kshitij Sobti
1252760de4 Allow list_problem_responses to limit the number of responses
Allow problem_location to be a UsageKey or string in list_problem_responses
2018-05-25 18:44:59 +05:30
Stuart Young
1fd2167144 rebalance python unittests onto new shards 2018-05-03 11:16:05 -04:00