Fix check and show answer for split
LMS-11237
This commit is contained in:
@@ -37,7 +37,7 @@ from xmodule.modulestore import ModuleStoreWriteBase, ModuleStoreEnum
|
||||
from xmodule.modulestore.draft_and_published import ModuleStoreDraftAndPublished, DIRECT_ONLY_CATEGORIES
|
||||
from opaque_keys.edx.locations import Location
|
||||
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 opaque_keys.edx.locations import SlashSeparatedCourseKey
|
||||
from opaque_keys.edx.locator import CourseLocator
|
||||
|
||||
@@ -9,6 +9,7 @@ from xmodule.errortracker import exc_info_to_str
|
||||
from xmodule.modulestore.split_mongo import encode_key_for_mongo
|
||||
from ..exceptions import ItemNotFoundError
|
||||
from .split_mongo_kvs import SplitMongoKVS
|
||||
from fs.osfs import OSFS
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
@@ -34,9 +35,17 @@ class CachingDescriptorSystem(MakoDescriptorSystem):
|
||||
module_data: a dict mapping Location -> json that was cached from the
|
||||
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__(
|
||||
field_data=None,
|
||||
load_item=self._load_item,
|
||||
resources_fs = OSFS(root),
|
||||
**kwargs
|
||||
)
|
||||
self.modulestore = modulestore
|
||||
|
||||
@@ -2041,7 +2041,6 @@ class SplitMongoModuleStore(ModuleStoreWriteBase):
|
||||
default_class=self.default_class,
|
||||
error_tracker=self.error_tracker,
|
||||
render_template=self.render_template,
|
||||
resources_fs=None,
|
||||
mixins=self.xblock_mixins,
|
||||
select=self.xblock_select,
|
||||
services=self.services,
|
||||
|
||||
@@ -13,7 +13,6 @@ from django.utils.translation import ugettext as _
|
||||
from django_future.csrf import ensure_csrf_cookie
|
||||
from django.views.decorators.cache import cache_control
|
||||
from edxmako.shortcuts import render_to_response
|
||||
from django.contrib.auth.models import User
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.utils.html import escape
|
||||
from django.http import Http404, HttpResponse, HttpResponseNotFound
|
||||
@@ -27,7 +26,7 @@ from xmodule.modulestore.django import modulestore
|
||||
from xblock.field_data import DictFieldData
|
||||
from xblock.fields import ScopeIds
|
||||
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_common.models import FORUM_ROLE_ADMINISTRATOR
|
||||
from student.models import CourseEnrollment
|
||||
@@ -35,7 +34,6 @@ from shoppingcart.models import Coupon, PaidCourseRegistration
|
||||
from course_modes.models import CourseMode, CourseModesArchive
|
||||
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 analyticsclient.client import Client
|
||||
|
||||
Reference in New Issue
Block a user