-
Notifications
You must be signed in to change notification settings - Fork 71
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
Keep items in dropped position in assessment mode. #82
Conversation
c8eac81
to
b1ff73d
Compare
@@ -1,4 +1,4 @@ | |||
function DragNDropTemplates(url_name) { | |||
function DragNDropTemplates(configuration) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
1d7aacf
to
7718cdc
Compare
@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'))) |
There was a problem hiding this comment.
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 :/
There was a problem hiding this comment.
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.
@mtyaka Thanks for the updates! The code is looking great aside from one small formatting issue. |
@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. |
@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. |
@mtyaka 👍
|
@mtyaka Please let me know when this is ready for TNL review. |
@cahrens This is ready for TNL review. |
👍 Is there a story in Jira for the Refresh issue mentioned in the Notes? |
"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; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
@staubina Thanks! The refresh issue will be handled as part of https://openedx.atlassian.net/browse/SOL-1944 |
@cahrens Thanks for the review!
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".
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. |
👍 |
@cptvitamin Would you be able to take a quick look at the changes in this PR? |
ff7ddfd
to
5455b50
Compare
Squashed from ff7ddfd |
5455b50
to
c1b2152
Compare
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.
c1b2152
to
97c5c4d
Compare
Description
This PR implements the following use case:
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:
Sandbox URLs (ff7ddfd):
Testing instructions:
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