Commit 515082ba by asadiqbal

WL-373

parent 37637e4b
......@@ -9,7 +9,7 @@ install:
- "sh install_test_deps.sh"
- "pip uninstall -y xblock-drag-and-drop-v2"
- "python setup.py sdist"
- "pip install dist/xblock-drag-and-drop-v2-2.0.4.tar.gz"
- "pip install dist/xblock-drag-and-drop-v2-2.0.5.tar.gz"
script:
- pep8 drag_and_drop_v2 tests --max-line-length=120
- pylint drag_and_drop_v2 tests
......
Development version:
--------------------
Version 2.0.5 (2016-03-30)
--------------------------
* Marked strings for translations (PR #66)
* Added the ability to specify automatic alignment of dropped items. (PR #57)
Version 2.0.4 (2016-03-10)
......
......@@ -27,6 +27,7 @@ loader = ResourceLoader(__name__)
# Classes ###########################################################
@XBlock.wants('settings')
@XBlock.needs('i18n')
class DragAndDropBlock(XBlock, XBlockWithSettingsMixin, ThemableXBlockMixin):
"""
XBlock that implements a friendly Drag-and-Drop problem
......@@ -106,10 +107,6 @@ class DragAndDropBlock(XBlock, XBlockWithSettingsMixin, ThemableXBlockMixin):
block_settings_key = 'drag-and-drop-v2'
has_score = True
def _(self, text):
""" Translate text """
return self.runtime.service(self, "i18n").ugettext(text)
@XBlock.supports("multi_device") # Enable this block for use in the mobile app via webview
def student_view(self, context):
"""
......@@ -186,7 +183,7 @@ class DragAndDropBlock(XBlock, XBlockWithSettingsMixin, ThemableXBlockMixin):
js_templates = loader.load_unicode('/templates/html/js_templates.html')
help_texts = {
field_name: self._(field.help)
field_name: self.ugettext(field.help)
for field_name, field in self.fields.viewitems() if hasattr(field, "help")
}
context = {
......
msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: 2016-03-30 16:54+0500\n"
"PO-Revision-Date: 2016-03-30 16:54+0500\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: en\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: default_data.py
msgid ""
"An isosceles triangle with three layers of similar height. It is shown "
"upright, so the widest layer is located at the bottom, and the narrowest "
"layer is located at the top."
msgstr ""
#: default_data.py
msgid "The Top Zone"
msgstr ""
#: default_data.py
msgid "The Middle Zone"
msgstr ""
#: default_data.py
msgid "The Bottom Zone"
msgstr ""
#: default_data.py
msgid "Use this zone to associate an item with the top layer of the triangle."
msgstr ""
#: default_data.py
msgid ""
"Use this zone to associate an item with the middle layer of the triangle."
msgstr ""
#: default_data.py
msgid ""
"Use this zone to associate an item with the bottom layer of the triangle."
msgstr ""
#: default_data.py
#, python-brace-format
msgid "Correct! This one belongs to {zone}."
msgstr ""
#: default_data.py
msgid "No, this item does not belong here. Try again."
msgstr ""
#: default_data.py
msgid "You silly, there are no zones for this one."
msgstr ""
#: default_data.py
msgid "Drag the items onto the image above."
msgstr ""
#: default_data.py
msgid "Good work! You have completed this drag and drop problem."
msgstr ""
#: default_data.py
msgid "Goes to the top"
msgstr ""
#: default_data.py
msgid "Goes to the middle"
msgstr ""
#: default_data.py
msgid "Goes to the bottom"
msgstr ""
#: default_data.py
msgid "I don't belong anywhere"
msgstr ""
#: drag_and_drop_v2.py
msgid "Title"
msgstr ""
#: drag_and_drop_v2.py
msgid ""
"The title of the drag and drop problem. The title is displayed to learners."
msgstr ""
#: drag_and_drop_v2.py
msgid "Drag and Drop"
msgstr ""
#: drag_and_drop_v2.py
msgid "Show title"
msgstr ""
#: drag_and_drop_v2.py
msgid "Display the title to the learner?"
msgstr ""
#: drag_and_drop_v2.py
msgid "Problem text"
msgstr ""
#: drag_and_drop_v2.py
msgid "The description of the problem or instructions shown to the learner"
msgstr ""
#: drag_and_drop_v2.py
msgid "Show \"Problem\" heading"
msgstr ""
#: drag_and_drop_v2.py
msgid "Display the heading \"Problem\" above the problem text?"
msgstr ""
#: drag_and_drop_v2.py
msgid "Weight"
msgstr ""
#: drag_and_drop_v2.py
msgid "The maximum score the learner can receive for the problem"
msgstr ""
#: drag_and_drop_v2.py
msgid "Item background color"
msgstr ""
#: drag_and_drop_v2.py
msgid "The background color of draggable items in the problem."
msgstr ""
#: drag_and_drop_v2.py
msgid "Item text color"
msgstr ""
#: drag_and_drop_v2.py
msgid "Text color to use for draggable items."
msgstr ""
#: drag_and_drop_v2.py
msgid "Problem data"
msgstr ""
#: drag_and_drop_v2.py
msgid ""
"Information about zones, items, feedback, and background image for this "
"problem. This information is derived from the input that a course author "
"provides via the interactive editor when configuring the problem."
msgstr ""
#: drag_and_drop_v2.py
msgid ""
"Information about current positions of items that a learner has dropped on "
"the target image."
msgstr ""
#: drag_and_drop_v2.py
msgid "Indicates whether a learner has completed the problem at least once"
msgstr ""
#: templates/html/js_templates.html
msgid "Text"
msgstr ""
#: templates/html/js_templates.html
msgid "Description"
msgstr ""
#: templates/html/js_templates.html
msgid "Describe this zone to non-visual users"
msgstr ""
#: templates/html/js_templates.html
msgid "width"
msgstr ""
#: templates/html/js_templates.html
msgid "height"
msgstr ""
#: templates/html/js_templates.html
msgid "Alignment"
msgstr ""
#: templates/html/js_templates.html
msgid "none"
msgstr ""
#: templates/html/js_templates.html
msgid "left"
msgstr ""
#: templates/html/js_templates.html
msgid "center"
msgstr ""
#: templates/html/js_templates.html
msgid "right"
msgstr ""
#: templates/html/js_templates.html
msgid ""
"Align dropped items to the left, center, or right. Default is no alignment "
"(items stay exactly where the user drops them)."
msgstr ""
#: templates/html/js_templates.html
msgid "Zone"
msgstr ""
#: templates/html/js_templates.html
msgid "Image URL (alternative to the text)"
msgstr ""
#: templates/html/js_templates.html
msgid "For example, http://example.com/image.png or /static/image.png"
msgstr ""
#: templates/html/js_templates.html
msgid ""
"Image description (should provide sufficient information to place the item "
"even if the image did not load)"
msgstr ""
#: templates/html/js_templates.html
msgid "Success Feedback"
msgstr ""
#: templates/html/js_templates.html
msgid "Error Feedback"
msgstr ""
#: templates/html/js_templates.html
msgid "Show advanced settings"
msgstr ""
#: templates/html/js_templates.html
msgid ""
"Preferred width as a percentage of the background image width (or blank for "
"automatic width):"
msgstr ""
#: templates/html/js_templates.html
msgid ""
"Optional numerical value (if you set this, learners will be prompted for "
"this value after dropping this item)"
msgstr ""
#: templates/html/js_templates.html
msgid ""
"Margin ± (when a numerical value is required, values entered by learners "
"must not differ from the expected value by more than this margin; default "
"is zero)"
msgstr ""
#: templates/html/drag_and_drop.html
msgid "Loading drag and drop problem."
msgstr ""
#: templates/html/drag_and_drop_edit.html
msgid ""
"Note: do not edit the problem if students have already completed it. Delete "
"the problem and create a new one."
msgstr ""
#: templates/html/drag_and_drop_edit.html
msgid "Problem title"
msgstr ""
#: templates/html/drag_and_drop_edit.html
msgid "Show title"
msgstr ""
#: templates/html/drag_and_drop_edit.html
msgid "Maximum score"
msgstr ""
#: templates/html/drag_and_drop_edit.html
msgid "Problem text"
msgstr ""
#: templates/html/drag_and_drop_edit.html
msgid "Show \"Problem\" heading"
msgstr ""
#: templates/html/drag_and_drop_edit.html
msgid "Introductory Feedback"
msgstr ""
#: templates/html/drag_and_drop_edit.html
msgid "Final Feedback"
msgstr ""
#: templates/html/drag_and_drop_edit.html
msgid "Zones"
msgstr ""
#: templates/html/drag_and_drop_edit.html
msgid "Background URL"
msgstr ""
#: templates/html/drag_and_drop_edit.html
msgid ""
"For example, http://example.com/background.png or /static/background.png"
msgstr ""
#: templates/html/drag_and_drop_edit.html
msgid "Change background"
msgstr ""
#: templates/html/drag_and_drop_edit.html
msgid "Background description"
msgstr ""
#: templates/html/drag_and_drop_edit.html
msgid ""
"\n"
" Please provide a description of the image for "
"non-visual users.\n"
" The description should provide sufficient "
"information to allow anyone\n"
" to solve the problem even without seeing the "
"image.\n"
" "
msgstr ""
#: templates/html/drag_and_drop_edit.html
msgid "Zone labels"
msgstr ""
#: templates/html/drag_and_drop_edit.html
msgid "Display label names on the image"
msgstr ""
#: templates/html/drag_and_drop_edit.html
msgid "Zone borders"
msgstr ""
#: templates/html/drag_and_drop_edit.html
msgid "Display zone borders on the image"
msgstr ""
#: templates/html/drag_and_drop_edit.html
msgid "Add a zone"
msgstr ""
#: templates/html/drag_and_drop_edit.html
msgid "Items"
msgstr ""
#: templates/html/drag_and_drop_edit.html
msgid "Background color"
msgstr ""
#: templates/html/drag_and_drop_edit.html
msgid "Text color"
msgstr ""
#: templates/html/drag_and_drop_edit.html
msgid "Add an item"
msgstr ""
#: templates/html/drag_and_drop_edit.html
msgid "Continue"
msgstr ""
#: templates/html/drag_and_drop_edit.html
msgid "Save"
msgstr ""
#: templates/html/drag_and_drop_edit.html
msgid "Cancel"
msgstr ""
#: public/js/drag_and_drop.js
msgid "ok"
msgstr ""
#: public/js/drag_and_drop.js
msgid "Correctly placed in: "
msgstr ""
#: public/js/drag_and_drop.js
msgid "Reset problem"
msgstr ""
#: public/js/drag_and_drop.js
msgid "Feedback"
msgstr ""
#: public/js/drag_and_drop.js
msgid "Keyboard Help"
msgstr ""
#: public/js/drag_and_drop.js
msgid "You can complete this problem using only your keyboard."
msgstr ""
#: public/js/drag_and_drop.js
msgid "Use \"Tab\" and \"Shift-Tab\" to navigate between items and zones."
msgstr ""
#: public/js/drag_and_drop.js
msgid ""
"Press \"Enter\", \"Space\", \"Ctrl-m\", or \"⌘-m\" on an item to select it "
"for dropping, then navigate to the zone you want to drop it on."
msgstr ""
#: public/js/drag_and_drop.js
msgid ""
"Press \"Enter\", \"Space\", \"Ctrl-m\", or \"⌘-m\" to drop the item on the "
"current zone."
msgstr ""
#: public/js/drag_and_drop.js
msgid ""
"Press \"Esc\" if you want to cancel the drop operation (for example, to "
"select a different item)."
msgstr ""
#: public/js/drag_and_drop.js
msgid "OK"
msgstr ""
#: public/js/drag_and_drop.js
msgid "Problem"
msgstr ""
#: public/js/drag_and_drop.js
msgid "An error occurred. Unable to load drag and drop problem."
msgstr ""
#: public/js/drag_and_drop_edit.js
msgid "There was an error with your form."
msgstr ""
#: public/js/drag_and_drop_edit.js
msgid "Please check over your submission."
msgstr ""
#: public/js/drag_and_drop_edit.js
msgid "None"
msgstr ""
#: public/js/drag_and_drop_edit.js
msgid "Error: "
msgstr ""
# Installs xblock-sdk and dependencies needed to run the tests suite.
# Run this script inside a fresh virtual environment.
pip install -e git://github.com/edx/xblock-sdk.git@4e8e713e7dd886b8d2eb66b5001216b66b9af81a#egg=xblock-sdk
pip install -e git://github.com/edx/xblock-sdk.git@v0.1.2#egg=xblock-sdk==v0.1.2
cd $VIRTUAL_ENV/src/xblock-sdk/ && pip install -r requirements/base.txt \
&& pip install -r requirements/test.txt && cd -
pip install -r requirements.txt
......@@ -23,7 +23,7 @@ def package_data(pkg, root_list):
setup(
name='xblock-drag-and-drop-v2',
version='2.0.4',
version='2.0.5',
description='XBlock - Drag-and-Drop v2',
packages=['drag_and_drop_v2'],
install_requires=[
......@@ -35,5 +35,5 @@ setup(
entry_points={
'xblock.v1': 'drag-and-drop-v2 = drag_and_drop_v2:DragAndDropBlock',
},
package_data=package_data("drag_and_drop_v2", ["static", "templates", "public"]),
package_data=package_data("drag_and_drop_v2", ["static", "templates", "public", "translations"]),
)
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