Skip to content

Commit

Permalink
Merge pull request #11532 from edx/rc/2016-02-16
Browse files Browse the repository at this point in the history
Release Candidate rc/2016-02-16
  • Loading branch information
nasthagiri committed Feb 17, 2016
2 parents a566927 + c7b049b commit 71b3080
Show file tree
Hide file tree
Showing 479 changed files with 10,298 additions and 30,378 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ django-pyfs
.prereqs_cache
.vagrant/
node_modules
.bundle/
bin/

### Static assets pipeline artifacts
Expand Down
1 change: 1 addition & 0 deletions .jshintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
node_modules
cms/static/js/i18n/**/*.js
lms/static/js/i18n/**/*.js
venv
1 change: 0 additions & 1 deletion .ruby-gemset

This file was deleted.

1 change: 0 additions & 1 deletion .ruby-version

This file was deleted.

3 changes: 0 additions & 3 deletions Gemfile

This file was deleted.

18 changes: 0 additions & 18 deletions Gemfile.lock

This file was deleted.

1 change: 0 additions & 1 deletion circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ general:
dependencies:
override:
- npm install
- bundle install

- pip install setuptools
- pip install --exists-action w -r requirements/edx/paver.txt
Expand Down
4 changes: 3 additions & 1 deletion cms/djangoapps/contentstore/views/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
from student.auth import has_course_author_access
from django.utils.translation import ugettext as _
from models.settings.course_grading import CourseGradingModel
from xblock_django.models import XBlockDisableConfig

__all__ = [
'container_handler',
Expand Down Expand Up @@ -57,7 +58,8 @@ def _advanced_component_types():
"""
Return advanced component types which can be created.
"""
return [c_type for c_type in ADVANCED_COMPONENT_TYPES if c_type not in settings.DEPRECATED_ADVANCED_COMPONENT_TYPES]
disabled_create_block_types = XBlockDisableConfig.disabled_create_block_types()
return [c_type for c_type in ADVANCED_COMPONENT_TYPES if c_type not in disabled_create_block_types]


def _load_mixed_class(category):
Expand Down
18 changes: 13 additions & 5 deletions cms/djangoapps/contentstore/views/tests/test_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
)
from contentstore.tests.utils import CourseTestCase
from student.tests.factories import UserFactory
from xblock_django.models import XBlockDisableConfig
from xmodule.capa_module import CapaDescriptor
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.django import modulestore
Expand Down Expand Up @@ -1328,6 +1329,11 @@ def setUp(self):
super(TestComponentTemplates, self).setUp()
self.templates = get_component_templates(self.course)

# Initialize the deprecated modules settings with empty list
XBlockDisableConfig.objects.create(
disabled_create_blocks='', enabled=True
)

def get_templates_of_type(self, template_type):
"""
Returns the templates for the specified type, or None if none is found.
Expand Down Expand Up @@ -1384,22 +1390,24 @@ def test_advanced_problems(self):
self.assertEqual(circuit_template.get('category'), 'problem')
self.assertEqual(circuit_template.get('boilerplate_name'), 'circuitschematic.yaml')

@patch('django.conf.settings.DEPRECATED_ADVANCED_COMPONENT_TYPES', ["poll", "survey"])
@patch('django.conf.settings.DEPRECATED_ADVANCED_COMPONENT_TYPES', [])
def test_deprecated_no_advance_component_button(self):
"""
Test that there will be no `Advanced` button on unit page if units are
deprecated provided that they are the only modules in `Advanced Module List`
"""
XBlockDisableConfig.objects.create(disabled_create_blocks='poll survey', enabled=True)
self.course.advanced_modules.extend(['poll', 'survey'])
templates = get_component_templates(self.course)
button_names = [template['display_name'] for template in templates]
self.assertNotIn('Advanced', button_names)

@patch('django.conf.settings.DEPRECATED_ADVANCED_COMPONENT_TYPES', ["poll", "survey"])
@patch('django.conf.settings.DEPRECATED_ADVANCED_COMPONENT_TYPES', [])
def test_cannot_create_deprecated_problems(self):
"""
Test that we can't create problems if they are deprecated
"""
XBlockDisableConfig.objects.create(disabled_create_blocks='poll survey', enabled=True)
self.course.advanced_modules.extend(['annotatable', 'poll', 'survey'])
templates = get_component_templates(self.course)
button_names = [template['display_name'] for template in templates]
Expand All @@ -1408,7 +1416,7 @@ def test_cannot_create_deprecated_problems(self):
template_display_names = [template['display_name'] for template in templates[0]['templates']]
self.assertEqual(template_display_names, ['Annotation'])

@patch('django.conf.settings.DEPRECATED_ADVANCED_COMPONENT_TYPES', [])
@patch('django.conf.settings.DEPRECATED_ADVANCED_COMPONENT_TYPES', ['poll'])
def test_create_non_deprecated_problems(self):
"""
Test that we can create problems if they are not deprecated
Expand All @@ -1417,9 +1425,9 @@ def test_create_non_deprecated_problems(self):
templates = get_component_templates(self.course)
button_names = [template['display_name'] for template in templates]
self.assertIn('Advanced', button_names)
self.assertEqual(len(templates[0]['templates']), 3)
self.assertEqual(len(templates[0]['templates']), 2)
template_display_names = [template['display_name'] for template in templates[0]['templates']]
self.assertEqual(template_display_names, ['Annotation', 'Poll', 'Survey'])
self.assertEqual(template_display_names, ['Annotation', 'Survey'])


@ddt.ddt
Expand Down
3 changes: 2 additions & 1 deletion cms/envs/bok_choy.env.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@
"PREVIEW_LMS_BASE": "localhost:8003",
"ALLOW_ALL_ADVANCED_COMPONENTS": true,
"ENABLE_CONTENT_LIBRARIES": true,
"ENABLE_SPECIAL_EXAMS": true
"ENABLE_SPECIAL_EXAMS": true,
"SHOW_LANGUAGE_SELECTOR": true
},
"FEEDBACK_SUBMISSION_EMAIL": "",
"GITHUB_REPO_ROOT": "** OVERRIDDEN **",
Expand Down
55 changes: 38 additions & 17 deletions cms/envs/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,9 @@
'ENABLE_SPECIAL_EXAMS': False,

'ORGANIZATIONS_APP': False,

# Show Language selector
'SHOW_LANGUAGE_SELECTOR': False,
}

ENABLE_JASMINE = False
Expand Down Expand Up @@ -328,6 +331,9 @@
'django.contrib.messages.middleware.MessageMiddleware',
'track.middleware.TrackMiddleware',

# This is used to set or update the user language preferences.
'lang_pref.middleware.LanguagePreferenceMiddleware',

# Allows us to dark-launch particular languages
'dark_lang.middleware.DarkLangMiddleware',

Expand Down Expand Up @@ -999,11 +1005,6 @@
### Default language for a new course
DEFAULT_COURSE_LANGUAGE = "en"

# Adding components in this list will disable the creation of new problem for
# those components in Studio. Existing problems will work fine and one can edit
# them in Studio.
DEPRECATED_ADVANCED_COMPONENT_TYPES = []

# Specify XBlocks that should be treated as advanced problems. Each entry is a
# dict:
# 'component': the entry-point name of the XBlock.
Expand Down Expand Up @@ -1055,6 +1056,30 @@
}
}

################################ XBlock Deprecation ################################

# The following settings are used for deprecating XBlocks.

# Adding an XBlock to this list does the following:
# 1. Shows a warning on the course outline if the XBlock is listed in
# "Advanced Module List" in "Advanced Settings" page.
# 2. List all instances of that XBlock on the top of the course outline page asking
# course authors to delete or replace the instances.
DEPRECATED_BLOCK_TYPES = [
'peergrading',
'combinedopenended',
'graphical_slider_tool',
]

# Adding components in this list will disable the creation of new problems for
# those advanced components in Studio. Existing problems will work fine
# and one can edit them in Studio.
# DEPRECATED. Please use /admin/xblock_django/xblockdisableconfig instead.
DEPRECATED_ADVANCED_COMPONENT_TYPES = []

# XBlocks can be disabled from rendering in LMS Courseware by adding them to
# /admin/xblock_django/xblockdisableconfig/.

################################ Settings for Credit Course Requirements ################################
# Initial delay used for retrying tasks.
# Additional retries use longer delays.
Expand All @@ -1070,16 +1095,6 @@
# or denied for credit.
CREDIT_PROVIDER_TIMESTAMP_EXPIRATION = 15 * 60


################################ Deprecated Blocks Info ################################

DEPRECATED_BLOCK_TYPES = [
'peergrading',
'combinedopenended',
'graphical_slider_tool',
]


################################ Settings for Microsites ################################

### Select an implementation for the microsite backend
Expand All @@ -1094,8 +1109,7 @@
# TTL for microsite database template cache
MICROSITE_DATABASE_TEMPLATE_CACHE_TTL = 5 * 60

#### PROCTORING CONFIGURATION DEFAULTS

############################### PROCTORING CONFIGURATION DEFAULTS ##############
PROCTORING_BACKEND_PROVIDER = {
'class': 'edx_proctoring.backends.null.NullBackendProvider',
'options': {},
Expand All @@ -1111,5 +1125,12 @@
# 5 minute expiration time for JWT id tokens issued for external API requests.
OAUTH_ID_TOKEN_EXPIRATION = 5 * 60

USERNAME_PATTERN = r'(?P<username>[\w.@+-]+)'

# Partner support link for CMS footer
PARTNER_SUPPORT_EMAIL = ''


################################ Settings for Credentials Service ################################

CREDENTIALS_SERVICE_USERNAME = 'credentials_service_user'
2 changes: 1 addition & 1 deletion cms/envs/dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@

################################ PIPELINE #################################

PIPELINE_SASS_ARGUMENTS = '--debug-info --require {proj_dir}/static/sass/bourbon/lib/bourbon.rb'.format(proj_dir=PROJECT_ROOT)
PIPELINE_SASS_ARGUMENTS = '--debug-info'

################################# CELERY ######################################

Expand Down
1 change: 0 additions & 1 deletion cms/static/cms/js/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
'js/factories/asset_index',
'js/factories/base',
'js/factories/container',
'js/factories/course',
'js/factories/course_create_rerun',
'js/factories/course_info',
'js/factories/edit_tabs',
Expand Down
4 changes: 4 additions & 0 deletions cms/static/cms/js/require-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
"ova": 'js/vendor/ova/ova',
"catch": 'js/vendor/ova/catch/js/catch',
"handlebars": 'js/vendor/ova/catch/js/handlebars-1.1.2',
"lang_edx": "js/src/lang_edx",
// end of Annotation tool files

// externally hosted files
Expand Down Expand Up @@ -196,6 +197,9 @@
"tinymce": {
exports: "tinymce"
},
"lang_edx": {
deps: ["jquery"]
},
"mathjax": {
exports: "MathJax",
init: function() {
Expand Down
2 changes: 1 addition & 1 deletion cms/static/js/factories/base.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
define(['js/base', 'coffee/src/main', 'js/src/logger', 'datepair', 'accessibility',
'ieshim', 'tooltip_manager']);
'ieshim', 'tooltip_manager', 'lang_edx', 'js/models/course']);
6 changes: 0 additions & 6 deletions cms/static/js/factories/course.js

This file was deleted.

Loading

0 comments on commit 71b3080

Please sign in to comment.