Commit 28f22393 by David Baumgold

whitespace-only changes

parent c8416451
......@@ -67,7 +67,7 @@ def xblock_handler(request, tag=None, course_id=None, branch=None, version_guid=
to None! Absent ones will be left alone.
:nullout: which metadata fields to set to None
:graderType: change how this unit is graded
:publish: can be one of three values, 'make_public, 'make_private', or 'create_draft'
:publish: can be one of three values, 'make_public, 'make_private', or 'create_draft'
The JSON representation on the updated xblock (minus children) is returned.
if xblock locator is not specified, create a new xblock instance. The json playload can contain
......
......@@ -40,7 +40,7 @@ def initialize_course_tabs(course):
{"type": "discussion", "name": _("Discussion")},
{"type": "wiki", "name": _("Wiki")},
{"type": "progress", "name": _("Progress")},
]
]
modulestore('direct').update_metadata(course.location.url(), own_metadata(course))
......
......@@ -28,6 +28,7 @@ MAX_SCORE = 1
FILE_NOT_FOUND_IN_RESPONSE_MESSAGE = "We could not find a file in your submission. Please try choosing a file or pasting a link to your file into the answer box."
ERROR_SAVING_FILE_MESSAGE = "We are having trouble saving your file. Please try another file or paste a link to your file into the answer box."
def upload_to_s3(file_to_upload, keyname, s3_interface):
'''
Upload file to S3 using provided keyname.
......
......@@ -68,7 +68,7 @@
"definition":{ "$oid" : "cd00000000000000dddd0020"},
"fields":{
"children":[
],
"display_name":"Hercules"
},
......@@ -86,7 +86,7 @@
"definition":{ "$oid" : "cd00000000000000dddd0022"},
"fields":{
"children":[
],
"display_name":"Hera heckles Hercules"
},
......@@ -123,7 +123,7 @@
"definition":{ "$oid" : "0d00000040000000dddd0031"},
"fields":{
"children":[
],
"display_name":"Problem 3.1",
"graceperiod":"4 hours 0 minutes 0 seconds"
......@@ -142,7 +142,7 @@
"definition":{ "$oid" : "0d00000040000000dddd0032"},
"fields":{
"children":[
],
"display_name":"Problem 3.2"
},
......@@ -172,7 +172,7 @@
"definition":{ "$oid" : "ad00000000000000dddd0001"},
"fields":{
"children":[
],
"end":"2013-04-13T04:30",
"tabs":[
......@@ -236,7 +236,7 @@
"definition":{ "$oid" : "ad00000000000000dddd0010"},
"fields":{
"children":[
],
"end":null,
"tabs":[
......@@ -290,7 +290,7 @@
"definition":{ "$oid" : "ad00000000000000dddd0020"},
"fields":{
"children":[
],
"end":null,
"tabs":[
......@@ -326,7 +326,7 @@
"$date":1364481313238
}
}
}
}
},
......@@ -345,7 +345,7 @@
"definition":{ "$oid" : "2d00000000000000dddd0020"},
"fields":{
"children":[
],
"end":null,
"tabs":[
......@@ -399,7 +399,7 @@
"definition":{ "$oid" : "ad00000000000000dddd0020"},
"fields":{
"children":[
],
"end":null,
"tabs":[
......@@ -453,7 +453,7 @@
"definition":{ "$oid" : "3d00000000000000dddd0020"},
"fields":{
"children":[
],
"end":null,
"tabs":[
......
......@@ -23,7 +23,7 @@ be specified for this tag::
sources - location id of required modules, separated by ';'
[message | ""] - message for case, where one or more are not passed. Here you can use variable {link}, which generate link to required module.
[submitted] - map to `is_submitted` module method.
(pressing RESET button makes this function to return False.)
......@@ -77,4 +77,4 @@ Examples of conditional depends on problem
</conditional>
<conditional sources="i4x://MITx/0.000x/problem/Conditional:lec27_Q1" attempted="False">
<html display_name="HTML for not attempted problem">You see this, cause "lec27_Q1" is not attempted.</html>
</conditional>
\ No newline at end of file
</conditional>
......@@ -12,7 +12,7 @@ ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
endif
Q_FLAG =
Q_FLAG =
ifeq ($(quiet), true)
Q_FLAG = -Q
......
# Notes on using mongodb backed LMS and CMS
These are some random notes for developers, on how things are stored in mongodb, and how to debug mongodb data.
## Databases
......@@ -62,7 +62,7 @@ Under ubuntu, do:
- apt-get install php5-fpm php-pear
- pecl install mongo
- edit /etc/php5/fpm/php.ini to add "extension=mongo.so"
- edit /etc/php5/fpm/php.ini to add "extension=mongo.so"
- /etc/init.d/php5-fpm restart
and also setup nginx to run php through fastcgi.
......
......@@ -26,13 +26,13 @@ Each course, in addition, should define the name of the gradebook being used. A
- user: username of staff person initiating the request (for logging)
- section: (optional) name of section
The return body content should be a JSON string, of the format {'msg': message, 'data': data}. The message is displayed in the instructor dashboard.
The return body content should be a JSON string, of the format {'msg': message, 'data': data}. The message is displayed in the instructor dashboard.
The data is a list of dicts (associative arrays). Each dict should be key:value.
## For submit=post-grades:
A file is also posted, with the field name "datafile". This file is CSV format, with two columns, one being "External email" and the other being the name of the assignment (that column contains the grades for the assignment).
A file is also posted, with the field name "datafile". This file is CSV format, with two columns, one being "External email" and the other being the name of the assignment (that column contains the grades for the assignment).
## For submit=get-assignments
......
......@@ -50,7 +50,7 @@ class Configuration:
def dummy_locale(self):
"""
Returns a locale to use for the dummy text, e.g. 'eo'.
Throws exception if no dummy-locale is declared.
Throws exception if no dummy-locale is declared.
The locale is a string.
"""
dummy = self._config.get('dummy-locale', None)
......
......@@ -4,7 +4,7 @@
See https://edx-wiki.atlassian.net/wiki/display/ENG/PO+File+workflow
This task merges and compiles the human-readable .pofiles on the
This task merges and compiles the human-readable .pofiles on the
local filesystem into machine-readable .mofiles. This is typically
necessary as part of the build process since these .mofiles are
needed by Django when serving the web app.
......@@ -21,6 +21,7 @@ from execute import execute
LOG = logging.getLogger(__name__)
def merge(locale, target='django.po', fail_if_missing=True):
"""
For the given locale, merge django-partial.po, messages.po, mako.po -> django.po
......@@ -52,6 +53,7 @@ def merge(locale, target='django.po', fail_if_missing=True):
django_filename = locale_directory.joinpath(target)
os.rename(merged_filename, django_filename) # can't overwrite file on Windows
def clean_metadata(file):
"""
Clean up redundancies in the metadata caused by merging.
......@@ -59,6 +61,7 @@ def clean_metadata(file):
"""
pofile(file).save()
def validate_files(dir, files_to_merge):
"""
Asserts that the given files exist.
......@@ -71,7 +74,8 @@ def validate_files(dir, files_to_merge):
if not pathname.exists():
raise Exception("I18N: Cannot generate because file not found: {0}".format(pathname))
def main ():
def main():
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
for locale in CONFIGURATION.locales:
......@@ -81,5 +85,6 @@ def main ():
compile_cmd = 'django-admin.py compilemessages'
execute(compile_cmd, working_directory=BASE_DIR)
if __name__ == '__main__':
main()
#!/usr/bin/env python
# Generate test translation files from human-readable po files.
#
#
# Dummy language is specified in configuration file (see config.py)
# two letter language codes reference:
# see http://www.loc.gov/standards/iso639-2/php/code_list.php
......@@ -28,6 +28,7 @@ from dummy import Dummy
from config import CONFIGURATION
from execute import create_dir_if_necessary
def main(file, locale):
"""
Takes a source po file, reads it, and writes out a new po file
......@@ -44,6 +45,7 @@ def main(file, locale):
create_dir_if_necessary(new_file)
pofile.save(new_file)
def new_filename(original_filename, new_locale):
"""Returns a filename derived from original_filename, using new_locale as the locale"""
orig_dir = os.path.dirname(original_filename)
......@@ -57,10 +59,10 @@ def new_filename(original_filename, new_locale):
if __name__ == '__main__':
# required arg: file
if len(sys.argv)<2:
if len(sys.argv) < 2:
raise Exception("missing file argument")
# optional arg: locale
if len(sys.argv)<3:
if len(sys.argv) < 3:
locale = CONFIGURATION.get_dummy_locale()
else:
locale = sys.argv[2]
......
......@@ -35,13 +35,13 @@ class ProgressTestCase(TestCase):
self.assertEqual(tab_constructor(self.stagnation_page, self.course, self.anonymous_user), [])
self.assertEqual(tab_constructor(self.progress_page, self.course, self.user)[0].name, 'same')
tab_list = tab_constructor(self.progress_page, self.course, self.user)
expected_link = reverse('progress', args=[self.course.id])
self.assertEqual(tab_list[0].link, expected_link)
self.assertEqual(tab_constructor(self.stagnation_page, self.course, self.user)[0].is_active, False)
self.assertEqual(tab_constructor(self.progress_page, self.course, self.user)[0].is_active, True)
......
......@@ -12,7 +12,7 @@ def dictfetchall(cursor):
desc = cursor.description
table = []
table.append([col[0] for col in desc])
# ensure response from db is a list, not a tuple (which is returned
# by MySQL backed django instances)
rows_from_cursor=cursor.fetchall()
......@@ -27,7 +27,7 @@ def SQL_query_to_list(cursor, query_string):
def dashboard(request):
"""
Slightly less hackish hack to show staff enrollment numbers and other
simple queries.
simple queries.
All queries here should be indexed and simple. Mostly, this means don't
touch courseware_studentmodule, as tempting as it may be.
......@@ -45,7 +45,7 @@ def dashboard(request):
# count how many users we have
results["scalars"]["Unique Usernames"]=User.objects.filter().count()
results["scalars"]["Activated Usernames"]=User.objects.filter(is_active=1).count()
# count how many enrollments we have
results["scalars"]["Total Enrollments Across All Courses"] = CourseEnrollment.objects.filter(is_active=1).count()
......
......@@ -117,7 +117,7 @@ def _filter_unstarted_categories(category_map):
return result_map
def _sort_map_entries(category_map, sort_alpha):
things = []
for title, entry in category_map["entries"].items():
......
......@@ -51,4 +51,4 @@ MIDDLEWARE_CLASSES = tuple([mcl for mcl in MIDDLEWARE_CLASSES if not mcl.startsw
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
)
)
......@@ -4,7 +4,7 @@
<script type="text/template" id="thread-template">
<article class="discussion-article" data-id="${'<%- id %>'}">
<div class="thread-content-wrapper"></div>
<ol class="responses">
<li class="loading"><div class="loading-animation"><span class="sr">Loading content</span></div></li>
</ol>
......@@ -29,8 +29,8 @@
<header>
${"<% if (obj.group_id) { %>"}
<div class="group-visibility-label">${"<%- obj.group_string%>"}</div>
${"<% } %>"}
${"<% } %>"}
<a href="#" class="vote-btn discussion-vote discussion-vote-up" data-role="discussion-vote" data-tooltip="vote">
<span class="plus-icon">+</span> <span class='votes-count-number'>${'<%- votes["up_count"] %>'}<span class="sr">votes (click to vote)</span></span></a>
<h1>${'<%- title %>'}</h1>
......@@ -52,8 +52,8 @@
<div class="post-body">${'<%- body %>'}</div>
<div class="discussion-flag-abuse notflagged" data-role="thread-flag" role="button" aria-pressed="false" tabindex="0">
<i class="icon icon-flag"></i><span class="flag-label">${_("Report Misuse")}</span></div>
% if course and has_permission(user, 'openclose_thread', course.id):
<div class="admin-pin discussion-pin notpinned" data-role="thread-pin" data-tooltip="pin this thread">
<i class="icon icon-pushpin"></i><span class="pin-label">${_("Pin Thread")}</span></div>
......@@ -62,10 +62,10 @@
${"<% if (pinned) { %>"}
<div class="discussion-pin notpinned" data-role="thread-pin" data-tooltip="pin this thread">
<i class="icon icon-pushpin"></i><span class="pin-label">${_("Pin Thread")}</span></div>
${"<% } %>"}
${"<% } %>"}
% endif
${'<% if (obj.courseware_url) { %>'}
<div class="post-context">
(this post is about <a href="${'<%- courseware_url%>'}">${'<%- courseware_title %>'}</a>)
......@@ -231,5 +231,5 @@
% endif
% endif
</div>
</div>
</script>
......@@ -33,8 +33,8 @@
</li>
<li class="field">
<label>Message:</label>
<div class="email-editor">
${ section_data['editor'] }
<div class="email-editor">
${ section_data['editor'] }
</div>
<input type="hidden" name="message" value="">
</li>
......
......@@ -30,7 +30,7 @@
</p>
<br>
<p> ${_('Specify a particular problem in the course here by its url:')}
<p> ${_('Specify a particular problem in the course here by its url:')}
<input type="text" name="problem-select-single" placeholder="${_("Problem urlname")}">
</p>
......
......@@ -18,7 +18,7 @@
"publication": "The New York Times",
"publish_date": "April 29, 2013"
},
{
"title": "Online Education Lifts Pass Rates at University",
"url": "http://online.wsj.com/article/SB10001424127887323741004578414861572832182.html?mod=googlenews_wsj",
......@@ -80,7 +80,7 @@
"publish_date": "February 20, 2013"
},
{
"title": "Georgetown to offer free online courses",
"url": "http://www.washingtonpost.com/local/education/georgetown-to-offer-free-online-courses/2012/12/09/365c4612-3fd3-11e2-bca3-aadc9b7e29c5_story.html",
......@@ -90,7 +90,7 @@
"publication": "The Washington Post",
"publish_date": "December 9, 2012"
},
{
"title": "Wellesley College teams up with online provider edX",
"url": "http://bostonglobe.com/2012/12/04/edx/AqnQ808q4IEcaUa8KuZuBO/story.html",
......@@ -136,7 +136,7 @@
"deck": null,
"publication": "BBC",
"publish_date": "October 31, 2012"
},
},
{
"title": "VMware to provide software for HarvardX CS50x",
"url": "http://tech.mit.edu/V132/N48/edxvmware.html",
......
......@@ -62,7 +62,7 @@
Toronto="University of Toronto",
ANU="Australian National University",
Delft="Delft University of Technology",
Rice="Rice University",
Rice="Rice University",
)}</p>
<p>${_("{EdX} will actively explore the addition of other institutions from around the world to the {edX} platform, and looks forward to adding more \"{X_Universities}\".").format(EdX="EdX", edX="edX", X_Universities="X Universities")}
</p>
......
......@@ -29,4 +29,4 @@
};
</script>
<!-- end dummy segment.io -->
% endif
\ No newline at end of file
% endif
# Mapping of
# Mapping of
#
# From the /mitx directory:
# /usr/local/Cellar/nginx/1.2.2/sbin/nginx -p `pwd`/ -c nginx.conf
......@@ -49,7 +49,7 @@ http {
rewrite ^(.*)/favicon.ico$ /static/images/favicon.ico last;
# Our catchall
# Our catchall
location / {
proxy_pass http://portal;
}
......
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