Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion cms/djangoapps/contentstore/views/item.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cms/djangoapps/contentstore/views/tabs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
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.
Expand Down
22 changes: 11 additions & 11 deletions common/test/data/splitmongo_json/structures.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"definition":{ "$oid" : "cd00000000000000dddd0020"},
"fields":{
"children":[

],
"display_name":"Hercules"
},
Expand All @@ -86,7 +86,7 @@
"definition":{ "$oid" : "cd00000000000000dddd0022"},
"fields":{
"children":[

],
"display_name":"Hera heckles Hercules"
},
Expand Down Expand Up @@ -123,7 +123,7 @@
"definition":{ "$oid" : "0d00000040000000dddd0031"},
"fields":{
"children":[

],
"display_name":"Problem 3.1",
"graceperiod":"4 hours 0 minutes 0 seconds"
Expand All @@ -142,7 +142,7 @@
"definition":{ "$oid" : "0d00000040000000dddd0032"},
"fields":{
"children":[

],
"display_name":"Problem 3.2"
},
Expand Down Expand Up @@ -172,7 +172,7 @@
"definition":{ "$oid" : "ad00000000000000dddd0001"},
"fields":{
"children":[

],
"end":"2013-04-13T04:30",
"tabs":[
Expand Down Expand Up @@ -236,7 +236,7 @@
"definition":{ "$oid" : "ad00000000000000dddd0010"},
"fields":{
"children":[

],
"end":null,
"tabs":[
Expand Down Expand Up @@ -290,7 +290,7 @@
"definition":{ "$oid" : "ad00000000000000dddd0020"},
"fields":{
"children":[

],
"end":null,
"tabs":[
Expand Down Expand Up @@ -326,7 +326,7 @@
"$date":1364481313238
}
}

}
}
},
Expand All @@ -345,7 +345,7 @@
"definition":{ "$oid" : "2d00000000000000dddd0020"},
"fields":{
"children":[

],
"end":null,
"tabs":[
Expand Down Expand Up @@ -399,7 +399,7 @@
"definition":{ "$oid" : "ad00000000000000dddd0020"},
"fields":{
"children":[

],
"end":null,
"tabs":[
Expand Down Expand Up @@ -453,7 +453,7 @@
"definition":{ "$oid" : "3d00000000000000dddd0020"},
"fields":{
"children":[

],
"end":null,
"tabs":[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.)

Expand Down Expand Up @@ -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>
</conditional>
2 changes: 1 addition & 1 deletion docs/developers/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions docs/internal/mongo.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# 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
Expand Down Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions docs/internal/remote_gradebook.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion i18n/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def source_locale(self):
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)
Expand Down
9 changes: 7 additions & 2 deletions i18n/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -21,6 +21,7 @@

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
Expand Down Expand Up @@ -52,13 +53,15 @@ 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.
This reads in a PO file and simply saves it back out again.
"""
pofile(file).save()


def validate_files(dir, files_to_merge):
"""
Asserts that the given files exist.
Expand All @@ -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:
Expand All @@ -81,5 +85,6 @@ def main ():
compile_cmd = 'django-admin.py compilemessages'
execute(compile_cmd, working_directory=BASE_DIR)


if __name__ == '__main__':
main()
8 changes: 5 additions & 3 deletions i18n/make_dummy.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/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
Expand All @@ -28,6 +28,7 @@
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
Expand All @@ -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)
Expand All @@ -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]
Expand Down
6 changes: 3 additions & 3 deletions lms/djangoapps/courseware/tests/test_tabs.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ def test_progress(self):
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)


Expand Down
6 changes: 3 additions & 3 deletions lms/djangoapps/dashboard/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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.
Expand All @@ -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()

Expand Down
2 changes: 1 addition & 1 deletion lms/djangoapps/django_comment_client/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
2 changes: 1 addition & 1 deletion lms/envs/dev_ike.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
)
)
18 changes: 9 additions & 9 deletions lms/templates/discussion/_underscore_templates.html
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -29,8 +29,8 @@ <h4>${_("Post a response:")}</h4>
<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>
Expand All @@ -52,8 +52,8 @@ <h1>${'<%- title %>'}</h1>
<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>
Expand All @@ -62,10 +62,10 @@ <h1>${'<%- title %>'}</h1>
${"<% 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>)
Expand Down Expand Up @@ -231,5 +231,5 @@ <h1 class="home-title">${course.display_name_with_default}</h1>
% endif
% endif

</div>
</div>
</script>
Loading