Commit 4d701beb by Don Mitchell

Fix check and show answer for split

LMS-11237
parent e4aaf497
...@@ -37,7 +37,7 @@ from xmodule.modulestore import ModuleStoreWriteBase, ModuleStoreEnum ...@@ -37,7 +37,7 @@ from xmodule.modulestore import ModuleStoreWriteBase, ModuleStoreEnum
from xmodule.modulestore.draft_and_published import ModuleStoreDraftAndPublished, DIRECT_ONLY_CATEGORIES from xmodule.modulestore.draft_and_published import ModuleStoreDraftAndPublished, DIRECT_ONLY_CATEGORIES
from opaque_keys.edx.locations import Location from opaque_keys.edx.locations import Location
from xmodule.modulestore.exceptions import ItemNotFoundError, DuplicateCourseError, ReferentialIntegrityError from xmodule.modulestore.exceptions import ItemNotFoundError, DuplicateCourseError, ReferentialIntegrityError
from xmodule.modulestore.inheritance import own_metadata, InheritanceMixin, inherit_metadata, InheritanceKeyValueStore from xmodule.modulestore.inheritance import InheritanceMixin, inherit_metadata, InheritanceKeyValueStore
from xblock.core import XBlock from xblock.core import XBlock
from opaque_keys.edx.locations import SlashSeparatedCourseKey from opaque_keys.edx.locations import SlashSeparatedCourseKey
from opaque_keys.edx.locator import CourseLocator from opaque_keys.edx.locator import CourseLocator
......
...@@ -9,6 +9,7 @@ from xmodule.errortracker import exc_info_to_str ...@@ -9,6 +9,7 @@ from xmodule.errortracker import exc_info_to_str
from xmodule.modulestore.split_mongo import encode_key_for_mongo from xmodule.modulestore.split_mongo import encode_key_for_mongo
from ..exceptions import ItemNotFoundError from ..exceptions import ItemNotFoundError
from .split_mongo_kvs import SplitMongoKVS from .split_mongo_kvs import SplitMongoKVS
from fs.osfs import OSFS
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
...@@ -34,9 +35,17 @@ class CachingDescriptorSystem(MakoDescriptorSystem): ...@@ -34,9 +35,17 @@ class CachingDescriptorSystem(MakoDescriptorSystem):
module_data: a dict mapping Location -> json that was cached from the module_data: a dict mapping Location -> json that was cached from the
underlying modulestore underlying modulestore
""" """
# needed by capa_problem (as runtime.filestore via this.resources_fs)
if 'course' in course_entry:
root = modulestore.fs_root / course_entry['org'] / course_entry['course'] / course_entry['run']
else:
root = modulestore.fs_root / course_entry['structure']['_id']
root.makedirs_p() # create directory if it doesn't exist
super(CachingDescriptorSystem, self).__init__( super(CachingDescriptorSystem, self).__init__(
field_data=None, field_data=None,
load_item=self._load_item, load_item=self._load_item,
resources_fs = OSFS(root),
**kwargs **kwargs
) )
self.modulestore = modulestore self.modulestore = modulestore
......
...@@ -2041,7 +2041,6 @@ class SplitMongoModuleStore(ModuleStoreWriteBase): ...@@ -2041,7 +2041,6 @@ class SplitMongoModuleStore(ModuleStoreWriteBase):
default_class=self.default_class, default_class=self.default_class,
error_tracker=self.error_tracker, error_tracker=self.error_tracker,
render_template=self.render_template, render_template=self.render_template,
resources_fs=None,
mixins=self.xblock_mixins, mixins=self.xblock_mixins,
select=self.xblock_select, select=self.xblock_select,
services=self.services, services=self.services,
......
...@@ -13,7 +13,6 @@ from django.utils.translation import ugettext as _ ...@@ -13,7 +13,6 @@ from django.utils.translation import ugettext as _
from django_future.csrf import ensure_csrf_cookie from django_future.csrf import ensure_csrf_cookie
from django.views.decorators.cache import cache_control from django.views.decorators.cache import cache_control
from edxmako.shortcuts import render_to_response from edxmako.shortcuts import render_to_response
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from django.utils.html import escape from django.utils.html import escape
from django.http import Http404, HttpResponse, HttpResponseNotFound from django.http import Http404, HttpResponse, HttpResponseNotFound
...@@ -27,7 +26,7 @@ from xmodule.modulestore.django import modulestore ...@@ -27,7 +26,7 @@ from xmodule.modulestore.django import modulestore
from xblock.field_data import DictFieldData from xblock.field_data import DictFieldData
from xblock.fields import ScopeIds from xblock.fields import ScopeIds
from courseware.access import has_access from courseware.access import has_access
from courseware.courses import get_course_by_id, get_cms_course_link, get_course_with_access from courseware.courses import get_course_by_id, get_cms_course_link
from django_comment_client.utils import has_forum_access from django_comment_client.utils import has_forum_access
from django_comment_common.models import FORUM_ROLE_ADMINISTRATOR from django_comment_common.models import FORUM_ROLE_ADMINISTRATOR
from student.models import CourseEnrollment from student.models import CourseEnrollment
...@@ -35,7 +34,6 @@ from shoppingcart.models import Coupon, PaidCourseRegistration ...@@ -35,7 +34,6 @@ from shoppingcart.models import Coupon, PaidCourseRegistration
from course_modes.models import CourseMode, CourseModesArchive from course_modes.models import CourseMode, CourseModesArchive
from student.roles import CourseFinanceAdminRole from student.roles import CourseFinanceAdminRole
from bulk_email.models import CourseAuthorization
from class_dashboard.dashboard_data import get_section_display_name, get_array_section_has_problem from class_dashboard.dashboard_data import get_section_display_name, get_array_section_has_problem
from analyticsclient.client import Client from analyticsclient.client import Client
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment