Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Click handlers and backend processing for assessment mode #87

Merged
merged 1 commit into from
Aug 15, 2016
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
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
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not seeing any success or failure feedback (except whether or not the item moves back to the bank) in standard mode on this problem:

http://studio-dndv2-sandbox8.opencraft.hosting/container/block-v1:Opencraft+DNDv2+v2.1+type@vertical+block@28ae4b11831b42949d8815c86671424b#

Aren't there supposed to be tooltips that show up?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No; the buckets unit demo does not have success/failure feedback defined for any of its items:

screen shot 2016-08-11 at 1 46 51 pm

Try the "Canada Demo" and drag "British Columbia" onto somewhere wrong.

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