Commit Graph

315 Commits

Author SHA1 Message Date
Muhammad Ammar
edf88962b5 Merge pull request #9534 from edx/ammar/update-factory-boy
Update factory_boy
2015-09-18 19:04:48 +05:00
Peter Pinch
01aea1a494 Merge pull request #9335 from mitocw/error_message_student_notfound_ccx_coach_dashboard
Added error message in enrollment tab inside CCX coach dashboard
2015-09-18 09:33:02 -04:00
muhammad-ammar
6a5ce5d544 Upgrade factory_boy
TNL-3179
2015-09-18 18:02:38 +05:00
Dennis Jen
844edac443 Optimize OpenID Course Claims for users.
- Course overviews will cache courses upon publish.
- Added management command to warm up cache.
- OAuth2 handler returns courses via course overviews.
2015-09-17 11:29:28 -04:00
amir-qayyum-arbisoft
4ab368720e Added error message in enrollment tab ccx coach dashboard 2015-09-17 14:49:55 +05:00
Syed Hassan Raza
49dfee0e44 save_cxx slow transaction 2015-09-11 06:06:42 -07:00
David Ormsbee
ff62a8eaaa Merge branch 'release' into release-2015-08-26-conflict 2015-08-26 14:28:35 -04:00
David Ormsbee
4053d625c9 Move some CCX view tests to use SharedModuleStoreTestCase (performance). 2015-08-24 16:21:27 -04:00
unknown
88a038aa1e Fixed email parm function for CCX email
modified:   lms/djangoapps/instructor/tests/test_enrollment.py
2015-08-24 20:34:11 +05:00
zubair-arbi
ec28a75f14 In-course reverification access control
* Automatically create user partitions on course publish for each ICRV checkpoint.
* Disable partitions for ICRV checkpoints that have been deleted.
* Skip partitions that have been disabled when checking access.
* Add verification access control UI to visibility settings.
* Add verification access control UI to sequential and vertical settings.
* Add partition scheme for verification partition groups.
* Cache information used by verification partition scheme and invalidate the cache on update.
* Add location parameter to UserPartition so the partition scheme can find the associated checkpoint.
* Refactor GroupConfiguration to allow multiple user partitions.
* Add special messaging to ICRV for students in the honor track.

Authors: Zubair Arbi, Awais Qureshi, Aamir Khan, Will Daly
2015-08-20 08:43:55 -07:00
Carlos de la Guardia
aa647bd87e fix test broken by course_overview changes 2015-08-14 10:00:04 -05:00
Carlos de la Guardia
066d5ab651 Changes to a CCX course should emit a course_published event 2015-08-14 01:24:11 -05:00
Diana Huang
2ac1590df4 Merge pull request #9276 from edx/diana/update-status-message
Make status use ConfigurationModel instead.
2015-08-13 16:37:23 -04:00
Diana Huang
82eb1f6b74 Make status use ConfigurationModel instead. 2015-08-11 17:51:39 -04:00
Brandon DeRosier
912db9910f Fix CCX 0002 migration
(cherry picked from commit 558b93fdeaaf72d02e050808698b2015e123a01c)
2015-08-11 13:04:09 -04:00
Brandon DeRosier
34526ddf6a Revert "Revert "Merge pull request #8986 from jazkarta/remove-ccx-enrollment""
This reverts commit 42e78463a7.
2015-08-11 13:03:58 -04:00
Carlos de la Guardia
458ed0a64e Use the standard enrollment table instead of a custom CCX table for CCX
enrollments.

The goal for this PR is to have a single mechanism for registering users and
reducing the number of places where special-casing for ccx courses is needed. The
migration at this point is purposefully limited to convert ccx memberships into
student enrollments when moving forward. No backward migration is in place at the
moment. The ccx membership tables are not removed at this time. It is possible to go
backwards and forwards multiple times with no errors or data loss.
2015-08-01 02:59:10 -05:00
David Ormsbee
58f36d3e93 Enable faster ModuleStore tests with SharedModuleStoreTestCase.
This is a new TestCase base class, intended for situations where
you only want to initialize course content in the setUpClass(),
as opposed to setUp(). This is done for performance reasons, since
many test cases only use courses in a read-only fashion,
particularly in LMS tests.

This commit also converts the following modules to use this new
base class:

  lms/djangoapps/ccx/tests/test_ccx_modulestore.py (38s -> 4s)
  lms/djangoapps/discussion_api/tests/test_api.py (2m45s -> 51s)
  lms/djangoapps/teams/tests/test_views.py (1m17s -> 33s)
2015-07-27 13:02:16 -04:00
Adam Palay
e515842395 Merge remote-tracking branch 'origin/release' into merge-release-into-master
Conflicts:
	requirements/edx/github.txt
2015-07-22 08:10:26 -04:00
Calen Pennington
0e8b303d2e Cache CcxFieldOverrides on a per-request basis 2015-07-20 14:54:27 -04:00
Calen Pennington
63ddbd9b03 Cache CustomCourseForEdX object lookup per-request 2015-07-20 14:53:11 -04:00
Calen Pennington
1e84ad9941 Make CcxFactory fill in a coach if one isn't supplied 2015-07-20 14:53:10 -04:00
Kyle McCormick
a9c4774fe7 PLA-749 Fix student dashboard for users enrolled in CCX courses 2015-07-20 14:03:50 -04:00
Sarina Canelake
22bbdacee9 Convert Meta classes to new-style classes 2015-07-13 17:33:26 -04:00
Sarina Canelake
ba8fd1c21d Eliminate instances of unused-import Pylint violation 2015-07-13 17:33:25 -04:00
David Ormsbee
79de77cf95 Optimize grading/progress page to reduce database queries (cache max scores).
The progress page did a number of things that make performance terrible for
courses with large numbers of problems, particularly if those problems are
customresponse CapaModule problems that need to be executed via codejail.

The grading code takes pains to not instantiate student state and execute the
problem code. If a student has answered the question, the max score is stored
in StudentModule. However, if the student hasn't attempted the question yet, we
have to run the problem code just to call .max_score() on it. This is necessary
in grade() if the student has answered other problems in the assignment (so we
can know what to divide by). This is always necessary to know in
progress_summary() because we list out every problem there. Code execution can
be especially slow if the problems need to invoke codejail.

To address this, we create a MaxScoresCache that will cache the max raw score
possible for every problem. We select the cache keys so that it will
automatically become invalidated when a new version of the course is published.

The fundamental assumption here is that a problem cannot have two different
max score values for two unscored students. A problem *can* score two students
differently such that they have different max scores. So Carlos can have 2/3 on
a problem, while Lyla gets 3/4. But if neither Carlos nor Lyla has ever
interacted with the problem (i.e. they're just seeing it on their progress
page), they must both see 0/4 -- it cannot be the case that Carlos sees 0/3 and
Lyla sees 0/4.

We used to load all student state into two separate FieldDataCache instances,
after which we do a bunch of individual queries for scored items. Part of this
split-up was done because of locking problems, but I think we might have gotten
overzealous with our manual transaction hammer.

In this commit, we consolidate all state access in grade() and progress()
to use one shared FieldDataCache. We also use a filter so that we only pull
back StudentModule state for things that might possibly affect the grade --
items that either have scores or have children.

Because some older XModules do work in their __init__() methods (like Video),
instantiating them takes time, particularly on large courses. This commit also
changes the code that fetches the grading_context to filter out children that
can't possibly affect the grade.

Finally, we introduce a ScoresClient that also tries to fetch score
information all at once, instead of in separate queries. Technically, we are
fetching this information redundantly, but that's because the state and score
interfaces are being teased apart as we move forward. Still, this only
amounts to one extra SQL query, and has very little impact on performance
overall.

Much thanks to @adampalay -- his hackathon work in #7168 formed the basis of
this.

https://openedx.atlassian.net/browse/CSM-17
2015-07-09 10:03:58 -04:00
Awais
b8e04f30a1 ECOM-1597 adding signals to update min-grade requirement. 2015-06-29 15:01:19 +05:00
Calen Pennington
ba971db1ba Merge pull request #8594 from cpennington/pass-xblock-parents
Pass xblock parents
2015-06-26 12:15:41 -04:00
Calen Pennington
fdf81042f5 Pass XBlock parents down to their children when constructing them, for caching 2015-06-25 13:59:46 -04:00
Calen Pennington
324d4785c1 Include stack traces when counting calls in unit tests 2015-06-25 13:58:00 -04:00
Calen Pennington
de142b2b51 Set a minimum number of Xblock constructions in field override tests 2015-06-23 13:32:50 -04:00
Diana Huang
ecd237396e Merge pull request #8617 from edx/diana/course-tab-cleanup
Switch tabs to use ugettext_noop for titles.
2015-06-23 12:33:06 -04:00
Diana Huang
e6cbff47b7 Switch tabs to use ugettext_noop for titles. 2015-06-23 11:08:41 -04:00
Ahsan Ulhaq
6fdff766bc Credit eligibility requirements display on student progress page
ECOM-1523
2015-06-22 18:36:54 +05:00
Calen Pennington
6bb25982de Add enable_ccx to the suite of override performance checking tests 2015-06-17 15:26:10 -04:00
Carlos de la Guardia
d56303dd0f Only enable the OverrideFieldData when there are active overrides on a course. 2015-06-17 15:26:10 -04:00
Ahsan Ulhaq
d35b652843 Display Eligibility table on progress page
1-Adding basic html for displaying eligibility table
2-Updated Eligibility Requirements Dynamically

ECOM-1523
2015-06-16 16:19:33 +05:00
Calen Pennington
9821323946 Merge pull request #8504 from cpennington/bdero/ccx-query-tests
A version of #8260 that is consistent on jenkins and locally
2015-06-15 11:51:33 -04:00
Calen Pennington
b06d256f99 Clear all caches before measure FieldOverride performance 2015-06-15 11:10:27 -04:00
Calen Pennington
e4bc328c3a Reduce the number of queries when walking parents in MongoModuleStore by avoiding cache misses on the data due to missing runs 2015-06-15 11:09:43 -04:00
Calen Pennington
67bde5e2e9 Measure XBlock instantiations in FieldOverride performance tests 2015-06-15 11:08:57 -04:00
Calen Pennington
5962c4eb8f Better simulate a request happening in the LMS in FieldOverride performance tests 2015-06-15 11:06:45 -04:00
Brandon DeRosier
5c6ccc8f0b Add CCX SQL query/mongo read tests 2015-06-15 09:50:44 -04:00
cewing
cb431ccb24 MIT CCX: Use CCX Keys: further revisions in response to code review
only require ccx-keys once

get_current_ccx will now expect a CourseKey instance as its argument, and will raise a value error if this expectation is not met.

document reason for local import

add special methods to pass attribute setting and deletion through to the wrapped modulestore

add __setattr__ and __delattr__ per code review, update __init__ to work with new methods

style change per code review

clean up context manager usage as recommended by code review

remove unused code and imports

convert modulestore type tests to use the `get_modulestore_type` api, remove unused imports

code quality: add docstrings

increase coverage for utils tests

fix bug found in testing.

increase test coverage on modulestore wrapper

code quality fixes

code-quality: ignore import error, but mark site for future consideration
2015-06-12 11:20:30 -07:00
cewing
ef4836503f MIT CCX: Use CCX Keys - responses to code review
remove references to middleware that were missed previously

use key apis rather than local implementation of key conversion.  remove local implementationa

remove spurious test for attribute

fix test setUp to avoid unneeded flattening

code quality fixes

add security check ensuring that the coach is coach for *this* CCX.

prevent ccx/deprecated course id problems

1.  do not allow ccx objects to be created if the course id is deprecated
2.  filter out any ccx memberships that involve deprecated course ids (in case there are bad ccxs in the database)

Fix test failures and errors arising from incorrect code path execution

Create context manager to handle unwrapping and restoring ccx values for the modulestore wrapper, employ it throughout modulestore wrapper implementation
2015-06-12 00:01:24 -07:00
cewing
6a0c9aee9d MIT CCX: Use CCX Keys
Implement the use of CCX opaque keys throughout the ccx code base

include the new custom ccx id package in the github checkouts list

update the coach dashboard wrapper to get CCX information from the incoming course_id, if possible

update function signatures for all view functions to expect CCX as passed by the dashboard wrapper (default to None), remove calls to get_ccx_for_coach as the ccx is passed in.

update reverse calls in python view code to use a CCXLocator for the URL instead of a CourseLocator

use CCXLocator where necessary

use course id to find ccx, instead of thread local

remove unused method and related tests

use course id for getting ccx

provide course id to the get_current_ccx method

ensure the course id passed in is a CourseKey instance of some type whether it starts out as a string or not

use the provided block to figure out what the course_id should be, then get the ccx for that

redirect to ccx dashboard using coach ccx if no ccx is passed in

update student dashboard listing for ccx to build an appropriate url from a CCXLocator, not from the course locator.

refactor building the ccx locator so we don't have to do it repeatedly

begin test refactoring after ccx_keys introduction

Ensure that when access checking happens, the course_locator form of a ccx locator is used.  This ensures that the access check happens against the course and it is not necesarry to duplicate the entire access control structure for the course.

pick up api change in ccx-keys

create and conditionally use a wrapper for the mixed modulestore returned by xmodule.modulestore.django.modulestore

the wrapper will strip and restore ccx values from CourseKey and UsageKey objects

fix return values on a few methods

remove unused symbol

pull updated ccx-keys package

set course_id on the caching descriptor system to avoid api incompatibilities in some subsystems

use ccx.course instead of self.course

fix get method to find course keys from blocks that are not themselves keys but have a location attribute (which will be a key)

if an item coming out of the db has children, restore the ccx to them as well

if the block passed in has a CCX key, unwrap that before we try to look up the override, otherwise it will never be found.

pick up a change in the ccx keys package that allows for stripping CCX identity from a usage key

begin writing tests to cover this modulestore wrapper

remove the switch_pocs view, the url pattern for it, and the tests that covered it

remove the ccx context and the middleware responsible for setting the current CCX.  These are no longer needed

all dashboard views should raise 404 if a ccx is not provided by the coach_dashboard decorator

code quality

prevent errors resulting from trying to `get` a ccx based on non-unique criteria.

remove obsolete usage of ACTIVE_CCX_KEY

fix setUp method for grading tests to properly create grades for the ccx rather than for the course.

clean up reverse calls

code quality

adding docstrings to clarify purpose of this patch

fix bug in getting ccx for coach

fix grading views to properly fetch a ccx-ified course so that grades for that version will be calculated

fix small errors in modulestore implementation

fix errant merge marker

update call to get_current_ccx after key refactoring merged with tab changes
2015-06-12 00:01:24 -07:00
Diana Huang
cddd387beb Merge pull request #8367 from edx/diana/merge-course-view-and-tab
Refactor and merge CourseViewType and CourseTab.
2015-06-08 16:08:27 -04:00
Diana Huang
7461a2fd37 Refactor and merge CourseViewType and CourseTab.
TNL-2321
2015-06-08 15:18:39 -04:00
Sarina Canelake
e53b9c83d9 Use Django 1.4 @ensure_csrf_cookie method PLAT-664 2015-06-06 08:48:36 -04:00
Diana Huang
dae137feaa Convert all tabs to the new plugin framework. 2015-06-02 15:05:16 -04:00