Skip to content

Commit

Permalink
[SOL-1944] Submitting answers in assessment mode
Browse files Browse the repository at this point in the history
  • Loading branch information
E. Kolpakov committed Aug 15, 2016
1 parent 630a8d7 commit a134bc9
Show file tree
Hide file tree
Showing 18 changed files with 1,249 additions and 307 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ install:
- "pip install dist/xblock-drag-and-drop-v2-2.0.7.tar.gz"
script:
- pep8 drag_and_drop_v2 tests --max-line-length=120
- pylint drag_and_drop_v2 tests
- pylint drag_and_drop_v2
- pylint tests --rcfile=tests/pylintrc
- python run_tests.py
notifications:
email: false
Expand Down
29 changes: 19 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,19 @@ and Drop component to a lesson, then click the `EDIT` button.

![Edit view](/doc/img/edit-view.png)

In the first step, you can set some basic properties of the component,
such as the title, the mode, the maximum number of attempts, the maximum score,
In the first step, you can set some basic properties of the component, such as
the title, the problem mode, the maximum number of attempts, the maximum score,
the problem text to render above the background image, the introductory feedback
(shown initially), and the final feedback (shown after the learner successfully
completes the drag and drop problem).
completes the drag and drop problem, or when the learner runs out of attempts).

There are two problem modes available:

* **Standard**: In this mode, the learner gets immediate feedback on each
attempt to place an item, and the number of attempts is not limited.
* **Assessment**: In this mode, the learner places all items on the board and
then clicks a "Submit" button to get feedback. The number of attempts can be
limited.

![Drop zone edit](/doc/img/edit-view-zones.png)

Expand All @@ -126,13 +134,14 @@ potentially, overlap the zones below.

![Drag item edit](/doc/img/edit-view-items.png)

In the final step, you define the background and text color for drag
items, as well as the drag items themselves. A drag item can contain
either text or an image. You can define custom success and error
feedback for each item. The feedback text is displayed in a popup
after the learner drops the item on a zone - the success feedback is
shown if the item is dropped on a correct zone, while the error
feedback is shown when dropping the item on an incorrect drop zone.
In the final step, you define the background and text color for drag items, as
well as the drag items themselves. A drag item can contain either text or an
image. You can define custom success and error feedback for each item. In
standard mode, the feedback text is displayed in a popup after the learner drops
the item on a zone - the success feedback is shown if the item is dropped on a
correct zone, while the error feedback is shown when dropping the item on an
incorrect drop zone. In assessment mode, the success and error feedback texts
are not used.

You can select any number of zones for an item to belong to using
the checkboxes; all zones defined in the previous step are available.
Expand Down
1 change: 1 addition & 0 deletions drag_and_drop_v2/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
""" Drag and Drop v2 XBlock """
from .drag_and_drop_v2 import DragAndDropBlock
181 changes: 86 additions & 95 deletions drag_and_drop_v2/default_data.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
""" Default data for Drag and Drop v2 XBlock """
from .utils import _

TARGET_IMG_DESCRIPTION = _(
Expand Down Expand Up @@ -27,100 +28,90 @@
FINISH_FEEDBACK = _("Good work! You have completed this drag and drop problem.")

DEFAULT_DATA = {
"targetImgDescription": TARGET_IMG_DESCRIPTION,
"zones": [
{
"uid": TOP_ZONE_ID,
"title": TOP_ZONE_TITLE,
"description": TOP_ZONE_DESCRIPTION,
"x": 160,
"y": 30,
"width": 196,
"height": 178,
"targetImgDescription": TARGET_IMG_DESCRIPTION,
"zones": [
{
"uid": TOP_ZONE_ID,
"title": TOP_ZONE_TITLE,
"description": TOP_ZONE_DESCRIPTION,
"x": 160,
"y": 30,
"width": 196,
"height": 178,
},
{
"uid": MIDDLE_ZONE_ID,
"title": MIDDLE_ZONE_TITLE,
"description": MIDDLE_ZONE_DESCRIPTION,
"x": 86,
"y": 210,
"width": 340,
"height": 138,
},
{
"uid": BOTTOM_ZONE_ID,
"title": BOTTOM_ZONE_TITLE,
"description": BOTTOM_ZONE_DESCRIPTION,
"x": 15,
"y": 350,
"width": 485,
"height": 135,
}
],
"items": [
{
"displayName": _("Goes to the top"),
"feedback": {
"incorrect": ITEM_INCORRECT_FEEDBACK,
"correct": ITEM_CORRECT_FEEDBACK.format(zone=TOP_ZONE_TITLE)
},
"zones": [TOP_ZONE_ID],
"imageURL": "",
"id": 0,
},
{
"displayName": _("Goes to the middle"),
"feedback": {
"incorrect": ITEM_INCORRECT_FEEDBACK,
"correct": ITEM_CORRECT_FEEDBACK.format(zone=MIDDLE_ZONE_TITLE)
},
"zones": [MIDDLE_ZONE_ID],
"imageURL": "",
"id": 1,
},
{
"displayName": _("Goes to the bottom"),
"feedback": {
"incorrect": ITEM_INCORRECT_FEEDBACK,
"correct": ITEM_CORRECT_FEEDBACK.format(zone=BOTTOM_ZONE_TITLE)
},
"zones": [BOTTOM_ZONE_ID],
"imageURL": "",
"id": 2,
},
{
"displayName": _("Goes anywhere"),
"feedback": {
"incorrect": "",
"correct": ITEM_ANY_ZONE_FEEDBACK
},
"zones": [TOP_ZONE_ID, BOTTOM_ZONE_ID, MIDDLE_ZONE_ID],
"imageURL": "",
"id": 3
},
{
"displayName": _("I don't belong anywhere"),
"feedback": {
"incorrect": ITEM_NO_ZONE_FEEDBACK,
"correct": ""
},
"zones": [],
"imageURL": "",
"id": 4,
},
],
"feedback": {
"start": START_FEEDBACK,
"finish": FINISH_FEEDBACK,
},
{
"uid": MIDDLE_ZONE_ID,
"title": MIDDLE_ZONE_TITLE,
"description": MIDDLE_ZONE_DESCRIPTION,
"x": 86,
"y": 210,
"width": 340,
"height": 138,
},
{
"uid": BOTTOM_ZONE_ID,
"title": BOTTOM_ZONE_TITLE,
"description": BOTTOM_ZONE_DESCRIPTION,
"x": 15,
"y": 350,
"width": 485,
"height": 135,
}
],
"items": [
{
"displayName": _("Goes to the top"),
"feedback": {
"incorrect": ITEM_INCORRECT_FEEDBACK,
"correct": ITEM_CORRECT_FEEDBACK.format(zone=TOP_ZONE_TITLE)
},
"zones": [
TOP_ZONE_ID
],
"imageURL": "",
"id": 0,
},
{
"displayName": _("Goes to the middle"),
"feedback": {
"incorrect": ITEM_INCORRECT_FEEDBACK,
"correct": ITEM_CORRECT_FEEDBACK.format(zone=MIDDLE_ZONE_TITLE)
},
"zones": [
MIDDLE_ZONE_ID
],
"imageURL": "",
"id": 1,
},
{
"displayName": _("Goes to the bottom"),
"feedback": {
"incorrect": ITEM_INCORRECT_FEEDBACK,
"correct": ITEM_CORRECT_FEEDBACK.format(zone=BOTTOM_ZONE_TITLE)
},
"zones": [
BOTTOM_ZONE_ID
],
"imageURL": "",
"id": 2,
},
{
"displayName": _("Goes anywhere"),
"feedback": {
"incorrect": "",
"correct": ITEM_ANY_ZONE_FEEDBACK
},
"zones": [
TOP_ZONE_ID,
BOTTOM_ZONE_ID,
MIDDLE_ZONE_ID
],
"imageURL": "",
"id": 3
},
{
"displayName": _("I don't belong anywhere"),
"feedback": {
"incorrect": ITEM_NO_ZONE_FEEDBACK,
"correct": ""
},
"zones": [],
"imageURL": "",
"id": 4,
},
],
"feedback": {
"start": START_FEEDBACK,
"finish": FINISH_FEEDBACK,
},
}
Loading

0 comments on commit a134bc9

Please sign in to comment.