Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
f199c30
bulk_email fix course_image_unicode name
Shrhawk May 11, 2015
f31746e
ECOM-1471 Hiding the text.
awais786 May 13, 2015
1021151
Complete printing cleanup, rebased into one
Apr 3, 2015
8ad0153
LMS: removing redundant Sass base/base partial call in build compile
talbs May 14, 2015
aee3281
clean up all-tests.sh script
May 13, 2015
abd25b8
Add a "tags" view in student notes.
Apr 29, 2015
d5d7fbf
Moving no-outline use to be more global
May 14, 2015
930b4f6
Remove outdated comment referencing IE9 rule limit
singingwolfboy May 14, 2015
57143d6
Merge pull request #8050 from edx/db/remove-ie9-rule-limit-comment
singingwolfboy May 14, 2015
f3f0f08
Add flaky test decorator (TNL-2199)
sarina May 14, 2015
4f9c50e
Merge pull request #8047 from edx/talbs/fix-lms-dupe-sass-base
talbs May 14, 2015
3f2c370
Merge pull request #7923 from edx/christina/show-notes
May 14, 2015
161d89a
Merge pull request #8045 from edx/clrux/new-extend-for-outline
May 14, 2015
2899885
LMS: renaming Sass/CSS files for consistency and clarity
talbs May 14, 2015
d09d0a2
Studio: renaming Sass/CSS files for consistency and clarity
talbs May 14, 2015
c043e8d
LMS: removing now unnecessary IE-specific _ie.scss Sass partial
talbs May 14, 2015
657f156
use mock_open for paver quality tests
May 14, 2015
25eb694
Merge pull request #8051 from edx/sarina/add-flaky-TNL-2199
sarina May 14, 2015
7c704f3
Move xmodule_modifiers.py to openedx/core/lib/xblock_utils.py
May 6, 2015
05cd331
Fix pre-existing pylint errors. Diff-quality won't let me move the fi…
May 6, 2015
b98d85f
Merge pull request #7943 from edx/ned/move-xmodule-modifiers
nedbat May 14, 2015
31a232e
Update ecommerce-api-client and add regression test for XCOM-1606
May 13, 2015
36060f3
Merge pull request #8053 from edx/jsa/xcom-1606
May 14, 2015
78e9445
Add super() calls to setUp/tearDown that are missing them
May 14, 2015
aad7c52
LMS: updating use of IE-conditional comments
talbs May 14, 2015
bac56af
Studio: updating use of IE-conditional comments
talbs May 15, 2015
7922858
No role inside of courseware
May 15, 2015
2d08d66
Learner Profile page tweaks.
May 7, 2015
378cf9b
Sending preferences and accounts data to template.
May 7, 2015
cae5623
Updating the django-countries version to support sorting.
May 14, 2015
5cef287
MA-635 Block Mobile Content for unfulfilled milestones
Apr 13, 2015
71bc147
start paver quality tests with clean paver task environment
May 15, 2015
ab912fa
Merge pull request #7956 from edx/muzaffar/tnl2047-profile-tweaks
May 15, 2015
3e247cd
Merge pull request #8061 from edx/talbs/update-ie-conditionals
talbs May 15, 2015
a57f0d7
Merge pull request #7794 from edx/clee/gated_content_mobile_api
May 15, 2015
4aceb02
add more detailed comment about exit status
May 15, 2015
76fa485
LMS: updating recommended/modern browser links
talbs May 15, 2015
c309523
Remove MathPlayer message
singingwolfboy May 15, 2015
e97b94b
Merge pull request #8060 from edx/ned/add-supers
nedbat May 15, 2015
85839b5
Reorganize imports in main HTML templates for Studio and LMS
singingwolfboy May 14, 2015
99a3053
Merge pull request #8067 from edx/talbs/lms-update-browser-links
talbs May 15, 2015
2e1534d
The SAMPLE feature flag is not used anywhere
singingwolfboy May 15, 2015
87954cd
Update translations (autogenerated message)
sarina May 15, 2015
a01e92c
Merge pull request #8072 from edx/sarina/20150515-translations-update
sarina May 15, 2015
e7a348d
Merge pull request #8062 from edx/ahsan/AC-108-no-role-inside-coursew…
May 15, 2015
09b7fee
update xml
Apr 19, 2015
358aa77
Add "Teams Configuration" advanced setting
andy-armstrong May 13, 2015
dd20bad
Merge pull request #7996 from edx/shr/bug/TNL-2119-Unicode-error-in-t…
Shrhawk May 15, 2015
b147117
Merge pull request #8055 from edx/diana/team-advanced-setting
dianakhuang May 15, 2015
90daffe
Merge pull request #8057 from edx/db/reorg-main-html-imports
singingwolfboy May 15, 2015
8f22b51
Merge pull request #8056 from edx/clytwynec/TE-868
May 15, 2015
8a7c2d6
Merge pull request #8068 from edx/db/remove-mathplayer-message
singingwolfboy May 15, 2015
b6164b5
Merge pull request #7595 from jolyonb/jolyonb/printing_cleanup
marcotuts May 15, 2015
4f531f6
Merge pull request #7750 from edx/danielli/recommender_xml
May 15, 2015
41363ea
Merge pull request #8020 from edx/aamir-khan/ECOM-1471-hidden-text-be…
awais786 May 18, 2015
392937d
MAYN-68 fixed the bug, total credit card purchases amount does not in…
May 18, 2015
3e0342c
i18n lon-capa problem explanation title
rmoch May 18, 2015
8ce222e
Add Richard Moch to AUTHORS
rmoch May 18, 2015
3f739b0
Merge pull request #7997 from openfun/rmoch/i18n_problem_explanation_…
sarina May 18, 2015
20a32a7
Merge pull request #8043 from edx/dcikatic/SOL-487-filter-staff-view-…
May 18, 2015
11ca11a
Merge pull request #8035 from edx/talbs/sass+css-file-names
talbs May 18, 2015
ffd5c1f
Merge pull request #8071 from edx/db/remove-sample-feature-flag
singingwolfboy May 18, 2015
fe3326d
Merge pull request #8083 from edx/muhhshoaib/MAYN-68-total-in-instruc…
May 18, 2015
f81d88e
ECOM-1547 created new template and Sass file for new footer. Wrapped …
AlasdairSwan May 11, 2015
e121aa4
updated dashboard html to remove rebase bug which displayed the usern…
marcotuts May 18, 2015
565cdb8
Move Discussion API access control checks
May 8, 2015
7309352
Refactor discussion API to use DRF serializer
May 14, 2015
8a4503b
Display Scope.content fields in Studio editor
singingwolfboy Apr 8, 2015
41e84a5
Skip flaky test. SOL-618.
May 18, 2015
2159d34
Added a simple XBlockMixin for courseware licenses
singingwolfboy Mar 5, 2015
ca2fee1
Move LicenseMixin into VideoFields class
singingwolfboy Apr 21, 2015
37ab2fc
Wrap block with license info in LMS only
singingwolfboy Apr 27, 2015
648e8a2
Creative Commons: Accessibility improvements
singingwolfboy Apr 29, 2015
8fbaa66
Make courseware licenses show up in Studio XBlock previews
singingwolfboy Apr 29, 2015
a3887e9
Courseware license (Creative Commons): FED
singingwolfboy Apr 30, 2015
ca64c66
Default course license to All Rights Reserved
sarina May 14, 2015
d1df7b1
Merge pull request #7986 from edx/alasdair/ECOM-1547-footer-2015
AlasdairSwan May 18, 2015
081b7ca
Merge pull request #8031 from edx/clytwynec/clean-up-all-tests-script
May 18, 2015
3679396
Merge pull request #8093 from edx/benp/test-user-mgmt-skip
May 18, 2015
1775dd5
Merge pull request #7315 from edx/db/creative-commons
sarina May 18, 2015
e124fb0
Merge pull request #8059 from edx/gprice/discussion-api-thread-list-r…
May 18, 2015
2807277
Merge pull request #8092 from edx/marco/dashboard/rebase-cleanup
marcotuts May 18, 2015
9eb565e
Remove unused css
sarina May 18, 2015
b1227c1
Merge pull request #8095 from edx/sarina/cleanup-styles
sarina May 18, 2015
6298531
SOL-496 Experiment-Aware content search
dsego Apr 18, 2015
83906b5
Fix for the failing tests
marjev May 18, 2015
3835092
Covering the case when group_usage_info is None; Code cleanup;
marjev May 19, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,12 @@ bin/
lms/static/css/
lms/static/sass/*.css
lms/static/sass/*.css.map
lms/static/sass/application.scss
lms/static/sass/application-rtl.scss
lms/static/sass/course.scss
lms/static/sass/course-rtl.scss
lms/static/sass/lms-main.scss
lms/static/sass/lms-main-rtl.scss
lms/static/sass/lms-course.scss
lms/static/sass/lms-course-rtl.scss
lms/static/sass/lms-footer-edx.scss
lms/static/sass/lms-footer-edx-rtl.scss
cms/static/css/
cms/static/sass/*.css
cms/static/sass/*.css.map
Expand Down
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -211,3 +211,4 @@ Amir Qayyum Khan <amir.qayyum@arbisoft.com>
Jolyon Bloomfield <jolyon@mit.edu>
Kyle McCormick <kylemccor@gmail.com>
Jim Cai <jimcai@stanford.edu>
Richard Moch <richard.moch@gmail.com>
2 changes: 0 additions & 2 deletions cms/djangoapps/contentstore/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +0,0 @@
""" module init will register signal handlers """
import contentstore.signals
2 changes: 1 addition & 1 deletion cms/djangoapps/contentstore/course_info_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from xmodule.modulestore.django import modulestore
from xmodule.html_module import CourseInfoModule

from xmodule_modifiers import get_course_update_items
from openedx.core.lib.xblock_utils import get_course_update_items
from cms.djangoapps.contentstore.push_notification import enqueue_push_course_update

# # This should be in a class which inherits from XmlDescriptor
Expand Down
24 changes: 22 additions & 2 deletions cms/djangoapps/contentstore/courseware_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

from contentstore.utils import course_image_url
from contentstore.course_group_config import GroupConfiguration
from contentstore.views.component import SPLIT_TEST_COMPONENT_TYPE
from course_modes.models import CourseMode
from eventtracking import tracker
from search.search_engine_base import SearchEngine
Expand Down Expand Up @@ -153,6 +154,12 @@ def index(cls, modulestore, structure_key, triggered_at=None, reindex_age=REINDE
# list - those are ready to be destroyed
indexed_items = set()

def get_item_location(item):
"""
Gets the version agnostic item location
"""
return item.location.version_agnostic().replace(branch=None)

def index_item(item, skip_index=False, groups_usage_info=None):
"""
Add this item to the search index and indexed_items list
Expand All @@ -175,9 +182,22 @@ def index_item(item, skip_index=False, groups_usage_info=None):
return

item_content_groups = None

if item.category == SPLIT_TEST_COMPONENT_TYPE:
if groups_usage_info is None and item.has_children:
groups_usage_info = {}
for vertical in item.get_children():
group_id = int(vertical.display_name.split(" ")[2])
groups_usage_info.update({

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like when groups_usage_info is None here we could have a problem.

unicode(get_item_location(vertical)): [group_id],
})
for component in vertical.get_children():
groups_usage_info.update({
unicode(get_item_location(component)): [group_id]
})

if groups_usage_info:
item_location = item.location.version_agnostic().replace(branch=None)
item_content_groups = groups_usage_info.get(unicode(item_location), None)
item_content_groups = groups_usage_info.get(unicode(get_item_location(item)), None)

item_id = unicode(cls._id_modifier(item.scope_ids.usage_id))
indexed_items.add(item_id)
Expand Down
39 changes: 39 additions & 0 deletions cms/djangoapps/contentstore/tests/test_contentstore.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from mock import patch
import shutil
import lxml.html
from lxml import etree
import ddt

from datetime import timedelta
Expand Down Expand Up @@ -1836,6 +1837,44 @@ def test_rerun_error_trunc_message(self):
self.assertEqual(len(rerun_state.message), CourseRerunState.MAX_MESSAGE_LENGTH)


class ContentLicenseTest(ContentStoreTestCase):
"""
Tests around content licenses
"""
def test_course_license_export(self):
content_store = contentstore()
root_dir = path(mkdtemp_clean())
self.course.license = "creative-commons: BY SA"
self.store.update_item(self.course, None)
export_course_to_xml(self.store, content_store, self.course.id, root_dir, 'test_license')
fname = "{block}.xml".format(block=self.course.scope_ids.usage_id.block_id)
run_file_path = root_dir / "test_license" / "course" / fname
run_xml = etree.parse(run_file_path.open())
self.assertEqual(run_xml.getroot().get("license"), "creative-commons: BY SA")

def test_video_license_export(self):
content_store = contentstore()
root_dir = path(mkdtemp_clean())
video_descriptor = ItemFactory.create(
parent_location=self.course.location, category='video',
license="all-rights-reserved"
)
export_course_to_xml(self.store, content_store, self.course.id, root_dir, 'test_license')
fname = "{block}.xml".format(block=video_descriptor.scope_ids.usage_id.block_id)
video_file_path = root_dir / "test_license" / "video" / fname
video_xml = etree.parse(video_file_path.open())
self.assertEqual(video_xml.getroot().get("license"), "all-rights-reserved")

def test_license_import(self):
course_items = import_course_from_xml(
self.store, self.user.id, TEST_DATA_DIR, ['toy'], create_if_not_present=True
)
course = course_items[0]
self.assertEqual(course.license, "creative-commons: BY")
videos = self.store.get_items(course.id, qualifiers={'category': 'video'})
self.assertEqual(videos[0].license, "all-rights-reserved")


class EntryPageTestCase(TestCase):
"""
Tests entry pages that aren't specific to a course.
Expand Down
137 changes: 135 additions & 2 deletions cms/djangoapps/contentstore/tests/test_courseware_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -964,6 +964,7 @@ def setUp(self):
publish_item=True,
start=datetime(2015, 3, 1, tzinfo=UTC),
)

self.sequential = ItemFactory.create(
parent_location=self.chapter.location,
category='sequential',
Expand All @@ -972,6 +973,16 @@ def setUp(self):
publish_item=True,
start=datetime(2015, 3, 1, tzinfo=UTC),
)

self.sequential2 = ItemFactory.create(
parent_location=self.chapter.location,
category='sequential',
display_name="Lesson 2",
modulestore=self.store,
publish_item=True,
start=datetime(2015, 3, 1, tzinfo=UTC),
)

self.vertical = ItemFactory.create(
parent_location=self.sequential.location,
category='vertical',
Expand All @@ -990,6 +1001,15 @@ def setUp(self):
start=datetime(2015, 4, 1, tzinfo=UTC),
)

self.vertical3 = ItemFactory.create(
parent_location=self.sequential2.location,
category='vertical',
display_name='Subsection 3',
modulestore=self.store,
publish_item=True,
start=datetime(2015, 4, 1, tzinfo=UTC),
)

# unspecified start - should inherit from container
self.html_unit1 = ItemFactory.create(
parent_location=self.vertical.location,
Expand Down Expand Up @@ -1018,6 +1038,66 @@ def setUp(self):
)
self.html_unit3.parent = self.vertical2

c0_url = self.course.id.make_usage_key("vertical", "condition_0_vertical")
c1_url = self.course.id.make_usage_key("vertical", "condition_1_vertical")
c2_url = self.course.id.make_usage_key("vertical", "condition_2_vertical")

self.split_test_unit = ItemFactory.create(
parent_location=self.vertical3.location,
category='split_test',
user_partition_id=0,
display_name="Test Content Experiment 1",
group_id_to_child={"0": c0_url, "1": c1_url, "2": c2_url}
)

self.condition_0_vertical = ItemFactory.create(
parent_location=self.split_test_unit.location,
category="vertical",
display_name="Group ID 0",
location=c0_url,
)
self.condition_0_vertical.parent = self.vertical3

self.condition_1_vertical = ItemFactory.create(
parent_location=self.split_test_unit.location,
category="vertical",
display_name="Group ID 1",
location=c1_url,
)
self.condition_1_vertical.parent = self.vertical3

self.condition_2_vertical = ItemFactory.create(
parent_location=self.split_test_unit.location,
category="vertical",
display_name="Group ID 2",
location=c2_url,
)
self.condition_2_vertical.parent = self.vertical3

self.html_unit4 = ItemFactory.create(
parent_location=self.condition_0_vertical.location,
category="html",
display_name="Split A",
publish_item=True,
)
self.html_unit4.parent = self.condition_0_vertical

self.html_unit5 = ItemFactory.create(
parent_location=self.condition_1_vertical.location,
category="html",
display_name="Split B",
publish_item=True,
)
self.html_unit5.parent = self.condition_1_vertical

self.html_unit6 = ItemFactory.create(
parent_location=self.condition_2_vertical.location,
category="html",
display_name="Split C",
publish_item=True,
)
self.html_unit6.parent = self.condition_2_vertical

groups_list = {
u'id': 666,
u'name': u'Test name',
Expand Down Expand Up @@ -1075,6 +1155,52 @@ def _html_group_result(self, html_unit, content_groups):
}
)

def _html_experiment_group_result(self, html_unit, content_groups):
"""
Return call object with arguments and content group for html_unit.
"""
return call(
'courseware_content',
{
'course_name': unicode(self.course.display_name),
'id': unicode(html_unit.location),
'content': {'html_content': '', 'display_name': unicode(html_unit.display_name)},
'course': unicode(self.course.id),
'location': [
unicode(self.chapter.display_name),
unicode(self.sequential2.display_name),
unicode(self.vertical3.display_name)
],
'content_type': 'Text',
'org': self.course.org,
'content_groups': content_groups,
'start_date': datetime(2015, 4, 1, 0, 0, tzinfo=tzutc())
}
)

def _vertical_experiment_group_result(self, vertical, content_groups):
"""
Return call object with arguments and content group for split_test vertical.
"""
return call(
'courseware_content',
{
'start_date': datetime(2015, 4, 1, 0, 0, tzinfo=tzutc()),
'content': {'display_name': unicode(vertical.display_name)},
'course': unicode(self.course.id),
'location': [
unicode(self.chapter.display_name),
unicode(self.sequential2.display_name),
unicode(vertical.parent.display_name)
],
'content_type': 'Sequence',
'content_groups': content_groups,
'id': unicode(vertical.location),
'course_name': unicode(self.course.display_name),
'org': self.course.org
}
)

def _html_nogroup_result(self, html_unit):
"""
Return call object with arguments and content group set to empty array for html_unit.
Expand Down Expand Up @@ -1107,9 +1233,9 @@ def test_content_group_gets_indexed(self):

# Only published modules should be in the index
added_to_index = self.reindex_course(self.store)
self.assertEqual(added_to_index, 7)
self.assertEqual(added_to_index, 16)
response = self.searcher.search(field_dictionary={"course": unicode(self.course.id)})
self.assertEqual(response["total"], 8)
self.assertEqual(response["total"], 17)

group_access_content = {'group_access': {666: [1]}}

Expand All @@ -1119,11 +1245,18 @@ def test_content_group_gets_indexed(self):
)

self.publish_item(self.store, self.html_unit1.location)
self.publish_item(self.store, self.split_test_unit.location)

with patch(settings.SEARCH_ENGINE + '.index') as mock_index:
self.reindex_course(self.store)
self.assertTrue(mock_index.called)
self.assertIn(self._html_group_result(self.html_unit1, [1]), mock_index.mock_calls)
self.assertIn(self._html_experiment_group_result(self.html_unit4, [0]), mock_index.mock_calls)
self.assertIn(self._html_experiment_group_result(self.html_unit5, [1]), mock_index.mock_calls)
self.assertIn(self._html_experiment_group_result(self.html_unit6, [2]), mock_index.mock_calls)
self.assertIn(self._vertical_experiment_group_result(self.condition_0_vertical, [0]), mock_index.mock_calls)
self.assertIn(self._vertical_experiment_group_result(self.condition_1_vertical, [1]), mock_index.mock_calls)
self.assertIn(self._vertical_experiment_group_result(self.condition_2_vertical, [2]), mock_index.mock_calls)
mock_index.reset_mock()

def test_content_group_not_assigned(self):
Expand Down
2 changes: 1 addition & 1 deletion cms/djangoapps/contentstore/views/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"editor-mode-button", "upload-dialog", "image-modal",
"add-xblock-component", "add-xblock-component-button", "add-xblock-component-menu",
"add-xblock-component-menu-problem", "xblock-string-field-editor", "publish-xblock", "publish-history",
"unit-outline", "container-message"
"unit-outline", "container-message", "license-selector",
]


Expand Down
2 changes: 1 addition & 1 deletion cms/djangoapps/contentstore/views/item.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from collections import OrderedDict
from functools import partial
from static_replace import replace_static_urls
from xmodule_modifiers import wrap_xblock, request_token
from openedx.core.lib.xblock_utils import wrap_xblock, request_token

import dogstats_wrapper as dog_stats_api
from django.conf import settings
Expand Down
7 changes: 6 additions & 1 deletion cms/djangoapps/contentstore/views/preview.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@
from django.contrib.auth.decorators import login_required
from edxmako.shortcuts import render_to_string

from xmodule_modifiers import replace_static_urls, wrap_xblock, wrap_fragment, request_token
from openedx.core.lib.xblock_utils import replace_static_urls, wrap_xblock, wrap_fragment, request_token
from xmodule.x_module import PREVIEW_VIEWS, STUDENT_VIEW, AUTHOR_VIEW
from xmodule.contentstore.django import contentstore
from xmodule.error_module import ErrorDescriptor
from xmodule.exceptions import NotFoundError, ProcessingError
from xmodule.library_tools import LibraryToolsService
from xmodule.services import SettingsService
from xmodule.modulestore.django import modulestore, ModuleI18nService
from xmodule.mixin import wrap_with_license
from opaque_keys.edx.keys import UsageKey
from opaque_keys.edx.locator import LibraryUsageLocator
from xmodule.x_module import ModuleSystem
Expand Down Expand Up @@ -170,6 +171,10 @@ def _preview_module_system(request, descriptor, field_data):
_studio_wrap_xblock,
]

if settings.FEATURES.get("LICENSING", False):
# stick the license wrapper in front
wrappers.insert(0, wrap_with_license)

descriptor.runtime._services['studio_user_permissions'] = StudioPermissionsService(request) # pylint: disable=protected-access

return PreviewModuleSystem(
Expand Down
1 change: 1 addition & 0 deletions cms/djangoapps/course_creators/tests/test_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class CourseCreatorAdminTest(TestCase):

def setUp(self):
""" Test case setup """
super(CourseCreatorAdminTest, self).setUp()
self.user = User.objects.create_user('test_user', 'test_user+courses@edx.org', 'foo')
self.table_entry = CourseCreator(user=self.user)
self.table_entry.save()
Expand Down
1 change: 1 addition & 0 deletions cms/djangoapps/course_creators/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class CourseCreatorView(TestCase):

def setUp(self):
""" Test case setup """
super(CourseCreatorView, self).setUp()
self.user = User.objects.create_user('test_user', 'test_user+courses@edx.org', 'foo')
self.admin = User.objects.create_user('Mark', 'admin+courses@edx.org', 'foo')
self.admin.is_staff = True
Expand Down
Loading