Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
beabdf14
Commit
beabdf14
authored
May 11, 2013
by
Arthur Barrett
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into feature/abarrett/lms-notes-app
parents
11a48dc9
348e9826
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
53 additions
and
15 deletions
+53
-15
cms/djangoapps/contentstore/management/commands/update_templates.py
+2
-1
cms/djangoapps/contentstore/tests/test_contentstore.py
+1
-1
cms/envs/aws.py
+10
-0
cms/envs/common.py
+1
-0
common/djangoapps/terrain/course_helpers.py
+1
-1
common/lib/capa/capa/responsetypes.py
+1
-1
common/lib/xmodule/xmodule/modulestore/mongo.py
+9
-1
common/lib/xmodule/xmodule/modulestore/tests/django_utils.py
+1
-1
common/lib/xmodule/xmodule/modulestore/tests/test_mongo.py
+10
-0
common/lib/xmodule/xmodule/templates.py
+6
-7
lms/templates/help_modal.html
+11
-2
No files found.
cms/djangoapps/contentstore/management/commands/update_templates.py
View file @
beabdf14
from
xmodule.templates
import
update_templates
from
xmodule.templates
import
update_templates
from
xmodule.modulestore.django
import
modulestore
from
django.core.management.base
import
BaseCommand
from
django.core.management.base
import
BaseCommand
...
@@ -6,4 +7,4 @@ class Command(BaseCommand):
...
@@ -6,4 +7,4 @@ class Command(BaseCommand):
help
=
'Imports and updates the Studio component templates from the code pack and put in the DB'
help
=
'Imports and updates the Studio component templates from the code pack and put in the DB'
def
handle
(
self
,
*
args
,
**
options
):
def
handle
(
self
,
*
args
,
**
options
):
update_templates
()
update_templates
(
modulestore
(
'direct'
)
)
cms/djangoapps/contentstore/tests/test_contentstore.py
View file @
beabdf14
...
@@ -937,7 +937,7 @@ class TemplateTestCase(ModuleStoreTestCase):
...
@@ -937,7 +937,7 @@ class TemplateTestCase(ModuleStoreTestCase):
self
.
assertIsNotNone
(
verify_create
)
self
.
assertIsNotNone
(
verify_create
)
# now run cleanup
# now run cleanup
update_templates
()
update_templates
(
modulestore
(
'direct'
)
)
# now try to find dangling template, it should not be in DB any longer
# now try to find dangling template, it should not be in DB any longer
asserted
=
False
asserted
=
False
...
...
cms/envs/aws.py
View file @
beabdf14
...
@@ -43,6 +43,16 @@ CACHES = ENV_TOKENS['CACHES']
...
@@ -43,6 +43,16 @@ CACHES = ENV_TOKENS['CACHES']
SESSION_COOKIE_DOMAIN
=
ENV_TOKENS
.
get
(
'SESSION_COOKIE_DOMAIN'
)
SESSION_COOKIE_DOMAIN
=
ENV_TOKENS
.
get
(
'SESSION_COOKIE_DOMAIN'
)
#Email overrides
DEFAULT_FROM_EMAIL
=
ENV_TOKENS
.
get
(
'DEFAULT_FROM_EMAIL'
,
DEFAULT_FROM_EMAIL
)
DEFAULT_FEEDBACK_EMAIL
=
ENV_TOKENS
.
get
(
'DEFAULT_FEEDBACK_EMAIL'
,
DEFAULT_FEEDBACK_EMAIL
)
ADMINS
=
ENV_TOKENS
.
get
(
'ADMINS'
,
ADMINS
)
SERVER_EMAIL
=
ENV_TOKENS
.
get
(
'SERVER_EMAIL'
,
SERVER_EMAIL
)
#Timezone overrides
TIME_ZONE
=
ENV_TOKENS
.
get
(
'TIME_ZONE'
,
TIME_ZONE
)
for
feature
,
value
in
ENV_TOKENS
.
get
(
'MITX_FEATURES'
,
{})
.
items
():
for
feature
,
value
in
ENV_TOKENS
.
get
(
'MITX_FEATURES'
,
{})
.
items
():
MITX_FEATURES
[
feature
]
=
value
MITX_FEATURES
[
feature
]
=
value
...
...
cms/envs/common.py
View file @
beabdf14
...
@@ -152,6 +152,7 @@ IGNORABLE_404_ENDS = ('favicon.ico')
...
@@ -152,6 +152,7 @@ IGNORABLE_404_ENDS = ('favicon.ico')
EMAIL_BACKEND
=
'django.core.mail.backends.console.EmailBackend'
EMAIL_BACKEND
=
'django.core.mail.backends.console.EmailBackend'
DEFAULT_FROM_EMAIL
=
'registration@edx.org'
DEFAULT_FROM_EMAIL
=
'registration@edx.org'
DEFAULT_FEEDBACK_EMAIL
=
'feedback@edx.org'
DEFAULT_FEEDBACK_EMAIL
=
'feedback@edx.org'
SERVER_EMAIL
=
'devops@edx.org'
ADMINS
=
(
ADMINS
=
(
(
'edX Admins'
,
'admin@edx.org'
),
(
'edX Admins'
,
'admin@edx.org'
),
)
)
...
...
common/djangoapps/terrain/course_helpers.py
View file @
beabdf14
...
@@ -137,4 +137,4 @@ def clear_courses():
...
@@ -137,4 +137,4 @@ def clear_courses():
# $ mongo test_xmodule --eval "db.dropDatabase()"
# $ mongo test_xmodule --eval "db.dropDatabase()"
_MODULESTORES
=
{}
_MODULESTORES
=
{}
modulestore
()
.
collection
.
drop
()
modulestore
()
.
collection
.
drop
()
update_templates
()
update_templates
(
modulestore
(
'direct'
)
)
common/lib/capa/capa/responsetypes.py
View file @
beabdf14
...
@@ -1783,7 +1783,7 @@ class FormulaResponse(LoncapaResponse):
...
@@ -1783,7 +1783,7 @@ class FormulaResponse(LoncapaResponse):
response_tag
=
'formularesponse'
response_tag
=
'formularesponse'
hint_tag
=
'formulahint'
hint_tag
=
'formulahint'
allowed_inputfields
=
[
'textline'
]
allowed_inputfields
=
[
'textline'
]
required_attributes
=
[
'answer'
]
required_attributes
=
[
'answer'
,
'samples'
]
max_inputfields
=
1
max_inputfields
=
1
def
setup_response
(
self
):
def
setup_response
(
self
):
...
...
common/lib/xmodule/xmodule/modulestore/mongo.py
View file @
beabdf14
...
@@ -476,7 +476,15 @@ class MongoModuleStore(ModuleStoreBase):
...
@@ -476,7 +476,15 @@ class MongoModuleStore(ModuleStoreBase):
'''
'''
# TODO (vshnayder): Why do I have to specify i4x here?
# TODO (vshnayder): Why do I have to specify i4x here?
course_filter
=
Location
(
"i4x"
,
category
=
"course"
)
course_filter
=
Location
(
"i4x"
,
category
=
"course"
)
return
self
.
get_items
(
course_filter
)
return
[
course
for
course
in
self
.
get_items
(
course_filter
)
if
not
(
course
.
location
.
org
==
'edx'
and
course
.
location
.
course
==
'templates'
)
]
def
_find_one
(
self
,
location
):
def
_find_one
(
self
,
location
):
'''Look for a given location in the collection. If revision is not
'''Look for a given location in the collection. If revision is not
...
...
common/lib/xmodule/xmodule/modulestore/tests/django_utils.py
View file @
beabdf14
...
@@ -42,7 +42,7 @@ class ModuleStoreTestCase(TestCase):
...
@@ -42,7 +42,7 @@ class ModuleStoreTestCase(TestCase):
num_templates
=
modulestore
.
collection
.
find
(
query
)
.
count
()
num_templates
=
modulestore
.
collection
.
find
(
query
)
.
count
()
if
num_templates
<
1
:
if
num_templates
<
1
:
update_templates
()
update_templates
(
modulestore
)
@classmethod
@classmethod
def
setUpClass
(
cls
):
def
setUpClass
(
cls
):
...
...
common/lib/xmodule/xmodule/modulestore/tests/test_mongo.py
View file @
beabdf14
...
@@ -7,6 +7,7 @@ from pprint import pprint
...
@@ -7,6 +7,7 @@ from pprint import pprint
from
xmodule.modulestore
import
Location
from
xmodule.modulestore
import
Location
from
xmodule.modulestore.mongo
import
MongoModuleStore
from
xmodule.modulestore.mongo
import
MongoModuleStore
from
xmodule.modulestore.xml_importer
import
import_from_xml
from
xmodule.modulestore.xml_importer
import
import_from_xml
from
xmodule.templates
import
update_templates
from
.test_modulestore
import
check_path_to_location
from
.test_modulestore
import
check_path_to_location
from
.
import
DATA_DIR
from
.
import
DATA_DIR
...
@@ -45,6 +46,7 @@ class TestMongoModuleStore(object):
...
@@ -45,6 +46,7 @@ class TestMongoModuleStore(object):
# Explicitly list the courses to load (don't want the big one)
# Explicitly list the courses to load (don't want the big one)
courses
=
[
'toy'
,
'simple'
]
courses
=
[
'toy'
,
'simple'
]
import_from_xml
(
store
,
DATA_DIR
,
courses
)
import_from_xml
(
store
,
DATA_DIR
,
courses
)
update_templates
(
store
)
return
store
return
store
@staticmethod
@staticmethod
...
@@ -103,3 +105,11 @@ class TestMongoModuleStore(object):
...
@@ -103,3 +105,11 @@ class TestMongoModuleStore(object):
def
test_path_to_location
(
self
):
def
test_path_to_location
(
self
):
'''Make sure that path_to_location works'''
'''Make sure that path_to_location works'''
check_path_to_location
(
self
.
store
)
check_path_to_location
(
self
.
store
)
def
test_get_courses_has_no_templates
(
self
):
courses
=
self
.
store
.
get_courses
()
for
course
in
courses
:
assert_false
(
course
.
location
.
org
==
'edx'
and
course
.
location
.
course
==
'templates'
,
'{0} is a template course'
.
format
(
course
)
)
common/lib/xmodule/xmodule/templates.py
View file @
beabdf14
...
@@ -19,7 +19,6 @@ from collections import defaultdict
...
@@ -19,7 +19,6 @@ from collections import defaultdict
from
.x_module
import
XModuleDescriptor
from
.x_module
import
XModuleDescriptor
from
.mako_module
import
MakoDescriptorSystem
from
.mako_module
import
MakoDescriptorSystem
from
.modulestore
import
Location
from
.modulestore
import
Location
from
.modulestore.django
import
modulestore
log
=
logging
.
getLogger
(
__name__
)
log
=
logging
.
getLogger
(
__name__
)
...
@@ -50,7 +49,7 @@ class TemplateTestSystem(MakoDescriptorSystem):
...
@@ -50,7 +49,7 @@ class TemplateTestSystem(MakoDescriptorSystem):
)
)
def
update_templates
():
def
update_templates
(
modulestore
):
"""
"""
Updates the set of templates in the modulestore with all templates currently
Updates the set of templates in the modulestore with all templates currently
available from the installed plugins
available from the installed plugins
...
@@ -58,7 +57,7 @@ def update_templates():
...
@@ -58,7 +57,7 @@ def update_templates():
# cdodge: build up a list of all existing templates. This will be used to determine which
# cdodge: build up a list of all existing templates. This will be used to determine which
# templates have been removed from disk - and thus we need to remove from the DB
# templates have been removed from disk - and thus we need to remove from the DB
templates_to_delete
=
modulestore
(
'direct'
)
.
get_items
([
'i4x'
,
'edx'
,
'templates'
,
None
,
None
,
None
])
templates_to_delete
=
modulestore
.
get_items
([
'i4x'
,
'edx'
,
'templates'
,
None
,
None
,
None
])
for
category
,
templates
in
all_templates
()
.
items
():
for
category
,
templates
in
all_templates
()
.
items
():
for
template
in
templates
:
for
template
in
templates
:
...
@@ -86,9 +85,9 @@ def update_templates():
...
@@ -86,9 +85,9 @@ def update_templates():
),
exc_info
=
True
)
),
exc_info
=
True
)
continue
continue
modulestore
(
'direct'
)
.
update_item
(
template_location
,
template
.
data
)
modulestore
.
update_item
(
template_location
,
template
.
data
)
modulestore
(
'direct'
)
.
update_children
(
template_location
,
template
.
children
)
modulestore
.
update_children
(
template_location
,
template
.
children
)
modulestore
(
'direct'
)
.
update_metadata
(
template_location
,
template
.
metadata
)
modulestore
.
update_metadata
(
template_location
,
template
.
metadata
)
# remove template from list of templates to delete
# remove template from list of templates to delete
templates_to_delete
=
[
t
for
t
in
templates_to_delete
if
t
.
location
!=
template_location
]
templates_to_delete
=
[
t
for
t
in
templates_to_delete
if
t
.
location
!=
template_location
]
...
@@ -97,4 +96,4 @@ def update_templates():
...
@@ -97,4 +96,4 @@ def update_templates():
if
len
(
templates_to_delete
)
>
0
:
if
len
(
templates_to_delete
)
>
0
:
logging
.
debug
(
'deleting dangling templates = {0}'
.
format
(
templates_to_delete
))
logging
.
debug
(
'deleting dangling templates = {0}'
.
format
(
templates_to_delete
))
for
template
in
templates_to_delete
:
for
template
in
templates_to_delete
:
modulestore
(
'direct'
)
.
delete_item
(
template
.
location
)
modulestore
.
delete_item
(
template
.
location
)
lms/templates/help_modal.html
View file @
beabdf14
<
%
namespace
name=
'static'
file=
'static_content.html'
/>
<
%
namespace
name=
'static'
file=
'static_content.html'
/>
<
%!
from
datetime
import
datetime
%
>
<
%!
import
pytz
%
>
<
%!
from
django
.
conf
import
settings
%
>
<
%!
from
django
.
conf
import
settings
%
>
<
%!
from
courseware
.
tabs
import
get_discussion_link
%
>
<
%!
from
courseware
.
tabs
import
get_discussion_link
%
>
...
@@ -79,9 +81,16 @@ discussion_link = get_discussion_link(course) if course else None
...
@@ -79,9 +81,16 @@ discussion_link = get_discussion_link(course) if course else None
<hr>
<hr>
</header>
</header>
<
%
dst =
datetime.now(pytz.utc).astimezone(pytz.timezone("America/New_York")).dst()
business_hours =
"13:00 UTC to 21:00 UTC"
if
dst
else
"
14:00
UTC
to
22:00
UTC
"
%
>
<p>
<p>
Thanks for your feedback. We will read your message, and our
Thank you for your inquiry or feedback. We typically respond to a
support team may contact you to respond or ask for further clarification.
request within one business day (Monday to Friday,
${business_hours}.) In the meantime, please review our
<a
href=
"/help"
target=
"_blank"
>
detailed FAQs
</a>
where most questions have already been answered.
</p>
</p>
<div
class=
"close-modal"
>
<div
class=
"close-modal"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment