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

Add ability to ask for numerical value on drop. #1

Closed
wants to merge 1 commit into from
Closed

Conversation

mtyaka
Copy link
Member

@mtyaka mtyaka commented Nov 23, 2014

If the input value (with optional margin) is set for a drop item,
an input field is shown and focused when the user drops the item
on the correct zone.

The value is submitted on field blur. If correct (within the margin),
the field is colored green. If the value is not correct, the field is
colored red. In either case, the field gets disabled and user cannot
try again until resetting the exercise.

The exercise is not considered finished until all required input
fields are filled.

If the item has an input set, the user only gets points for the item if
the input value is within the correct margin.

return state

def _is_correct_input(self, item, val):
"""Is submitted numerical value within the tolerated margin for this item."""
Copy link
Member

Choose a reason for hiding this comment

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

I know that on some functions, we don't really have that much to add in the way of docstrings, but I'd prefer we stick with one way of writing them. PEP8 recommends a triple quoted string, a line break, the text, and then the other triple quoted string on the next line. This makes adding more to the docstring easier later.

This is a nitpick, but it's better that we just pick one style of docstring and stick with it. We have two or three here.

@mtyaka mtyaka force-pushed the stgallen branch 2 times, most recently from 908fe1f to 7ba20ae Compare November 28, 2014 09:27
If the input value (with optional margin) is set for a drop item,
an input field is shown and focused when the user drops the item
on the correct zone.

The value is submitted on field blur. If correct (within the margin),
the field is colored green. If the value is not correct, the field is
colored red. In either case, the field gets disabled and user cannot
try again until resetting the exercise.

The exercise is not considered finished until all required input
fields are filled.

If the item has an input set, the user only gets points for the item if
the input value is within the correct margin.

The patch includes changes to the testing infrastructure.

Instead of having to checkout the `xblock-sdk` repository
and set `xblock-drag-and-drop-v2` to run within it,
the `xblock-sdk` repository has been added to the test requirements.

A barebone django app that loads the workbench to run integration tests
has been created inside the tests folder.

All test dependencies have been explicitly pinned in `test/requirements.txt`.

Assuming you have Firefox installed, running the tests should be
as simple as `pip install -r tests/requirements.txt` in a fresh virtual
environment and then `tests/manage.py test`.
@Kelketek
Copy link
Member

Kelketek commented Dec 1, 2014

👍

This appears to work according to spec.

@antoviaque
Copy link
Member

@Kelketek @mtyaka Thanks for this. Rather than merging here, can the PR be against the edx-solutions fork? We're upstream there so it should be easy to get upstream to want that feature : ) Unless there are any backward-incompatible changes, or anything that could make the edx-solutions client not want this?

@mtyaka
Copy link
Member Author

mtyaka commented Dec 4, 2014

@antoviaque It should be backwards compatible. I opened openedx#26 and am closing this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants