Commit Graph

29 Commits

Author SHA1 Message Date
Calen Pennington
b353ed2ea2 Better support specifying of modulestore configuration in test cases
The existing pattern of using `override_settings(MODULESTORE=...)` prevented
us from having more than one layer of subclassing in modulestore tests.

In a structure like:

    @override_settings(MODULESTORE=store_a)
    class BaseTestCase(ModuleStoreTestCase):
        def setUp(self):
            # use store

    @override_settings(MODULESTORE=store_b)
    class ChildTestCase(BaseTestCase):
        def setUp(self):
            # use store

In this case, the store actions performed in `BaseTestCase` on behalf of
`ChildTestCase` would still use `store_a`, even though the `ChildTestCase`
had specified to use `store_b`. This is because the `override_settings`
decorator would be the innermost wrapper around the `BaseTestCase.setUp` method,
no matter what `ChildTestCase` does.

To remedy this, we move the call to `override_settings` into the
`ModuleStoreTestCase.setUp` method, and use a cleanup to remove the override.
Subclasses can just defined the `MODULESTORE` class attribute to specify which
modulestore to use _for the entire `setUp` chain_.

[PLAT-419]
2015-02-04 09:09:14 -05:00
jsa
17d892c521 make block.get_parent() work.
Co-Authored-By: Christina Roberts <christina@edx.org>
Co-Authored-By: Daniel Friedman <dfriedman@edx.org>
Co-Authored-By: Don Mitchell <dmitchell@edx.org>
2015-01-15 10:33:44 -05:00
Calen Pennington
980f30c17f Move lms.lib.xblock into lms.djangoapps.lms_xblock in preparation add database backed configuration to it 2014-12-12 21:45:21 -05:00
David Baumgold
36e77c7463 Fixing pep8 issues 2014-12-11 13:04:49 -05:00
Andy Armstrong
356b2335e9 Add base support for cohorted group configurations
TNL-649
2014-12-05 09:52:26 -05:00
Jesse Zoldak
bf3b87bc64 Clean up all modulestore testcases
Move modulestore config for tests to an importable location
Disable pylnt warning for lms imports in common tests
Refactor all testcases that loaded all xml courses
TE-610
TE-489
2014-12-02 07:09:36 -05:00
cahrens
c09632ef69 Tests for conditional content (split_test module).
TNL-39
2014-10-22 10:38:50 -04:00
Don Mitchell
dc9654283e Fix unit tests for generated
course ids.
2014-09-29 11:25:56 -04:00
Don Mitchell
4ca5012f3c Use split to test views 2014-09-29 11:25:55 -04:00
Nimisha Asthagiri
ea32529866 Fix all modulestore calls to pass in user ids. 2014-07-09 21:10:12 -04:00
Nimisha Asthagiri
a9213509c3 Enable Mixed Modulestore STUD-1540
Refactor get_parent_locations STUD-1663
2014-06-26 18:00:11 -04:00
Calen Pennington
9811926d97 Make course ids and usage ids opaque to LMS and Studio [partial commit]
This commit updates lms/djangoapps/courseware.

These keys are now objects with a limited interface, and the particular
internal representation is managed by the data storage layer (the
modulestore).

For the LMS, there should be no outward-facing changes to the system.
The keys are, for now, a change to internal representation only. For
Studio, the new serialized form of the keys is used in urls, to allow
for further migration in the future.

Co-Author: Andy Armstrong <andya@edx.org>
Co-Author: Christina Roberts <christina@edx.org>
Co-Author: David Baumgold <db@edx.org>
Co-Author: Diana Huang <dkh@edx.org>
Co-Author: Don Mitchell <dmitchell@edx.org>
Co-Author: Julia Hansbrough <julia@edx.org>
Co-Author: Nimisha Asthagiri <nasthagiri@edx.org>
Co-Author: Sarina Canelake <sarina@edx.org>

[LMS-2370]
2014-05-06 10:08:32 -04:00
Will Daly
440d9ddb89 Install edx-ora2
Support for displaying submissions API scores in Progress page.
2014-03-25 09:42:55 -04:00
cahrens
09d90b16af Clean up of modulestore references (primarly LMS).
STUD-1151
2014-02-11 14:29:22 -05:00
Don Mitchell
16f0d12a1f Merge pull request #2356 from edx/dhm/mixed_ms_wrapper
MixedModulestore wraps most getters, update_item, delete_item
2014-02-10 16:01:50 -05:00
Ned Batchelder
1bd213beba Remove unused imports. 2014-02-10 14:07:50 -05:00
Don Mitchell
b8ea7f3c43 update_item and other refactorings continued 2014-02-05 10:24:24 -05:00
Don Mitchell
c601b75675 MixedModulestore wraps most getters, update_item, delete_item
with code to translate between addressing schemes based on app
and persistence layer addressing scheme specification.

STUD-1206
2014-02-05 09:34:30 -05:00
David Ormsbee
b1eff059a7 Merge pull request #2014 from edx/ormsbee/grade_distribution_fix
Fix (re-implement) answer distribution report generation.
2013-12-20 12:43:33 -08:00
David Ormsbee
0565fbbfab Fix (re-implement) answer distribution report generation.
This restores functionality that has been broken since the introduction of
XModuleDescriptor/XModule proxying (part of the XBlock transition). It generates
a CSV of all answers for all content of type "problem" in a given course, with a
row per (problem part, answer). The format is:

url_name, display name, answer id, answer, count

Example values:
  url_name = "7f1b1523a55848cd9f5c93eb8cbabcf7"
  display name = "Problem 1: Something Hard"
  answer id = i4x-JediAcdmy-LTSB304-problem-7f1b1523a55848cd9f5c93eb8cbabcf7_2_1
  answer = "Use the Force"
  count = 1138

Since it only grabs things of type "problem", it will not return results for
things like self/peer-assessments. Any Loncapa problem types will show up (so
multiple choice, text input, numeric, etc.)

Instead of crawling the course tree and instantiating the appropriate CapaModule
objects to grab state, this version draws directly from StudentModule. This lets
us skip a lot of processing and most importantly lets us generate the answer
distribution without causing side-effects (since XBlocks auto-save state). It
also lets us take advantage of a read-replica database if one is available, to
minimize locking concerns.

There are minor changes to the legacy dashboard around CSV charset encoding and
a change to OptionResponseXMLFactory to make it more unicode friendly. Answer
distribution output is now also sorted, to group together answers for the same
content piece.

Note that this does not introduce celery into the process. Answer distributions
are still only available for small courses.

This was originally created to fix [LMS-922], but it also addresses [LMS-811] and
possibly other areas in the legacy dashboard where CSV downloads break due to
character encoding issues.
2013-12-20 15:05:50 -05:00
Ned Batchelder
488923fd5c Add a test for Django-based file uploads to problems. 2013-12-07 19:53:23 -05:00
Adam Palay
7b72a18551 more granular transactions in grading [LMS-1480]
remove field_data_cache from grades.grade and grades.progress_summary

cleans grading code by adding wrappers
2013-11-20 14:40:32 -05:00
Calen Pennington
864d831ce3 Use XBlock handlers for handle_ajax in XModules
Adds xblock handler_url support to the LMS, and makes handle_ajax use
that code.

[LMS-230] [LMS-229]
2013-11-08 11:08:48 -05:00
Calen Pennington
8201b1412e Use XBlock 0.3 2013-09-06 09:45:59 -04:00
Will Daly
48c6daacb8 Removed unnecessary settings wrangling from ModuleStoreTestCase.
Modified navigation tests to use MixedModulestore
Updated factories to find editable modulestore

Updated test_submitting_problems

Updated test_tabs.py

Updated test_view_authentication

Updated test_views

Updated courseware/tests/tests.py

Updated test_masquerade

Updated test_module_render

Pylint fixes

Updated video and word cloud tests

Updated course wiki tests

Updated license and open_ended tests.
One open_ended test still failing due to Mako initialization issues

Updated staticbook

Updated django_comment_client tests

Updated instructor tests

Updated instructor task tests

Updated external_auth tests

Updated course_groups
2013-08-21 09:36:45 -04:00
Adam Palay
dfa435012b notify students for NotFoundErrors from capa_module, improve error logging 2013-07-17 11:03:47 -04:00
Don Mitchell
be4fbc562e Refactor tests to no longer use templates
Add boilerplate option to ItemFactory
Minor start date fix to not use microsecs
2013-07-16 16:00:28 -04:00
Don Mitchell
3722685e1a No longer persist XModule templates
Instead, we use XModule field default values when creating an empty
XModule. Driven by this use case, we also allow for XModules to be
created in memory without being persisted to the database at all. This
necessitates a change to the Modulestore api, replacing clone_item with
create_draft and save_xmodule.
2013-07-16 14:33:58 -04:00
ihoover
5a03d93000 refactor login and enrollment test cases to use the mongo modulestore
added namee to authors file
2013-07-10 10:34:14 -04:00