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

Keep items in dropped position in assessment mode. #82

Merged
merged 1 commit into from
Jul 31, 2016

Conversation

mtyaka
Copy link
Contributor

@mtyaka mtyaka commented Jul 20, 2016

Description

This PR implements the following use case:

As a learner, I want to place all items belonging to a drag-and-drop problem in assessment mode on the board first, and then check (submit) my answer by clicking a button.

Items dropped onto wrong zones in standard mode are immediately removed from the board and sent back to the bank.

In assessment mode, items should stick in the dropped position until the entire problem is explicitly submitted by clicking a button.

Note that the submit button and associated xhr handler will be implemented in a future PR.

UX

The workflow for placing items on the board should not change in assessment mode. However, items that were placed on an incorrect zone should stay on the board in assessment mode (at least until the learner checks their answer) instead of returning to the item bank.

Also, a drag-and-drop problem in assessment mode should not show per-item "Success Feedback" or "Error Feedback" to the learner as they place items on the board.

JIRA tickets: SOL-1942

Discussions: Discovery document for DnDv2 assessment mode (relevant section: 2.2.1)

Dependencies: None

Screenshots:

Items stick in dropped position even when dropped onto a wrong zone:

screen shot 2016-07-20 at 19 40 22

Sandbox URLs (ff7ddfd):

Testing instructions:

  1. Add a DnDv2 block to a unit in Studio.
  2. Click "EDIT" and change "Problem mode" to "assessment".
  3. Drag items from the bank into drop zones. Place some items in wrong zones.
  4. Observe that the items "stick" in the placed position (are not moved back to the bank). Observe that per-item feedbacks are not displayed.
  5. Change "Problem mode" back to "standard".
  6. Make sure everything still works correctly in standard mode.

Author notes and concerns:

When you reload the page after dragging some items on the board, the state of the board is not correct. Correctly placed items are left in their positioned (but faded out) while incorrectly placed items are sent back to the bank.
This behavior will be sorted out in future tickets.

Reviewers

@mtyaka mtyaka force-pushed the mtyaka/assessment-item-placement branch 2 times, most recently from c8eac81 to b1ff73d Compare July 20, 2016 12:40
@@ -1,4 +1,4 @@
function DragNDropTemplates(url_name) {
function DragNDropTemplates(configuration) {
Copy link
Contributor

Choose a reason for hiding this comment

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

@mtyaka Since you're touching this line, could you take the opportunity to make the spelling consistent with the remaining code (i.e., change DragNDropTemplates to DragAndDropTemplates)? That would be great :) There's only two occurrences of this spelling in the entire repo, and both of them are in this file, so it should be a quick change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@itsjeyd Done, that inconsistency was weird.

@mtyaka mtyaka force-pushed the mtyaka/assessment-item-placement branch 2 times, most recently from 1d7aacf to 7718cdc Compare July 21, 2016 07:55
@mtyaka
Copy link
Contributor Author

mtyaka commented Jul 21, 2016

@itsjeyd Thanks for the review. I addressed your comments, please take a look.

# While the XHR is in progress, a spinner icon is shown inside the item.
# When the spinner disappears, we can assume that the XHR request has finished.
wait.until(lambda e: 'fa-spinner' not in e.get_attribute('innerHTML'),
u"Spinner should not be in {}".format(elem.get_attribute('innerHTML')))
Copy link
Contributor

Choose a reason for hiding this comment

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

@mtyaka This should probably be reformatted according to edX's style guide for breaking long lines:

        wait.until(
            lambda e: 'fa-spinner' not in e.get_attribute('innerHTML'),
            u"Spinner should not be in {}".format(elem.get_attribute('innerHTML'))
        )

Sorry for not noticing sooner :/

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@itsjeyd No problem, I should have noticed it when implementing the function :) Fixed.

@itsjeyd
Copy link
Contributor

itsjeyd commented Jul 21, 2016

@mtyaka Thanks for the updates! The code is looking great aside from one small formatting issue.

@sstack22
Copy link

@mtyaka - 👍 . Outside the scope of PR, I noticed the Note on the edit page: "Note: do not edit the problem if students have already completed it. Delete the problem and create a new one." I was wondering what the original intent of this note was? In general, especially for graded assignments, we don't recommend deleting a problem, as it could impact scores.

@mtyaka
Copy link
Contributor Author

mtyaka commented Jul 22, 2016

@itsjeyd Thanks, formatting issue addressed.

@sstack22 Thanks for the review! I am not entirely sure, but I'm guessing the original intent of that note was to let staff know that they shouldn't modify problems that students have already started (or completed) working on. I don't think the second part about deleting the problem instead makes much sense, we should probably remove it.

@itsjeyd
Copy link
Contributor

itsjeyd commented Jul 22, 2016

@mtyaka 👍

  • I followed the test instructions on the sandbox and everything worked as advertised.
  • I read through the code.
  • Includes documentation We will update the README (and our demo course) once assessment mode functionality is mostly complete.

@cahrens
Copy link

cahrens commented Jul 22, 2016

@mtyaka Please let me know when this is ready for TNL review.

@mtyaka
Copy link
Contributor Author

mtyaka commented Jul 22, 2016

@cahrens This is ready for TNL review.

@staubina
Copy link
Contributor

👍
Like the last PR, I tested the visual changes and they all match expectations. The code changes look clear enough also.

Is there a story in Jira for the Refresh issue mentioned in the Notes?

@cahrens
Copy link

cahrens commented Jul 22, 2016

"I don't belong anywhere" can't be dragged (in Standard mode) when it is the only thing left. Up until then, it can.

var description_content;
if (configuration.mode === DragAndDropBlock.ASSESSMENT_MODE) {
// In assessment mode placed items will "stick" even when not in correct zone.
description_content = gettext('Placed in: ') + zone_title;
Copy link

Choose a reason for hiding this comment

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

Should use named placeholders instead of concatenating together strings. Otherwise it cannot be properly translated into all languages.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@cahrens Thanks for pointing that out. I switched to interpolation in this line and in old code a couple of lines below.

@cahrens
Copy link

cahrens commented Jul 22, 2016

I am seeing non-unique IDs when feedback is shown (this is sr feedback).

image

@mtyaka
Copy link
Contributor Author

mtyaka commented Jul 23, 2016

@staubina Thanks! The refresh issue will be handled as part of https://openedx.atlassian.net/browse/SOL-1944

@mtyaka
Copy link
Contributor Author

mtyaka commented Jul 23, 2016

@cahrens Thanks for the review!

"I don't belong anywhere" can't be dragged (in Standard mode) when it is the only thing left. Up until then, it can.

That's the expected behavior in Standard mode. Once you drag all items (except decoy items) to correct zones, the problem is finished and you cannot move any item (including decoy items) unless you hit "Reset problem".

I am seeing non-unique IDs when feedback is shown (this is sr feedback).

Nice catch. That bug would manifest itself when multiple DnDv2 blocks were present in the same unit. This was an old bug that existed prior to the changes in this PR. The most recent commit in this PR fixes it. I also updated the sandbox with the latest fixes.

Please have another look.

@cahrens
Copy link

cahrens commented Jul 25, 2016

👍

@mtyaka
Copy link
Contributor Author

mtyaka commented Jul 25, 2016

@cptvitamin Would you be able to take a quick look at the changes in this PR?

@e-kolpakov e-kolpakov mentioned this pull request Jul 27, 2016
4 tasks
@bradenmacdonald
Copy link
Contributor

@mtyaka Can you please rebase and merge? Since the a11y team likely can't review this before our deadlines, I created SOL-1978 for a final / follow-up a11y review of the assessment mode functionality.

@mtyaka mtyaka force-pushed the mtyaka/assessment-item-placement branch from ff7ddfd to 5455b50 Compare July 30, 2016 14:28
@mtyaka
Copy link
Contributor Author

mtyaka commented Jul 30, 2016

Squashed from ff7ddfd

@mtyaka mtyaka force-pushed the mtyaka/assessment-item-placement branch from 5455b50 to c1b2152 Compare July 30, 2016 14:39
@mtyaka
Copy link
Contributor Author

mtyaka commented Jul 30, 2016

Rebased 5455b50 onto master

Items dropped onto wrong zones in standard mode are immediately removed
from the board and sent back to the bank.

In assessment mode, items should stick in the dropped position until the
entire problem is explicitly submitted by clicking a button.

This commit only implements the "stick" part, but does not implement the
submit button and associated handler.

This commit also fixes an existing bug where the template function
would gett reused between blocks.

The template function (which is slightly different for each block,
depending on block's configuration) was getting assigned to the global
DragAndDropBlock function. Each block would overwrite the previous
value, which caused bugs.
@mtyaka mtyaka force-pushed the mtyaka/assessment-item-placement branch from c1b2152 to 97c5c4d Compare July 31, 2016 08:49
@mtyaka mtyaka merged commit 30173c4 into openedx:master Jul 31, 2016
@mtyaka mtyaka deleted the mtyaka/assessment-item-placement branch July 31, 2016 09:57
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.

6 participants