-
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
Ensure old problems work on new version. #98
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Recent versions of the drag and drop v2 xblock require the 'correct' field to be present in items stored in user state, but the 'correct' field did not exist before assessment mode has been implemented and so problems created and completed before the introduction of assessment mode lack the 'correct' field. This patch adds the 'correct' field to item state at load time. In standard mode, only items that are placed in correct zone are stored in item state, so we can assume that any item stored in the state that does not have the 'correct' field is 'correct'.
7 tasks
if self.mode == self.ASSESSMENT_MODE: | ||
# In assessment mode, if item is placed correctly and than the page is refreshed, "correct" | ||
# will spill to the frontend, making item "disabled", thus allowing students to obtain answer by trial | ||
# and error + refreshing the page. In order to avoid that, we remove "correct" from an item here |
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 is a really nice patch! I only had a couple small comments about ... some of the comments :) 👍 once they are addressed.
|
👍 |
1 similar comment
👍 |
@sstack22 This PR is ready for merge. Does it look good to you - can we go ahead and merge? |
@mtyaka - looks good on my end 👍 |
Thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Recent versions of the drag and drop v2 xblock require the
'correct'
field to be present in items stored in user state, but the'correct'
field did not exist before assessment mode has been implemented and problems created and completed before the introduction of assessment mode lack the'correct'
field.Loading these stored items did not work on recent versions of DnDv2 xblock because recent versions are assuming the
'correct'
field is always present.This patch adds the
'correct'
field to item state at load time. In standard mode, only items that are placed in correct zone are stored in item state, so we can assume that we can set the'correct'
field toTrue
for any item stored in the state that is missing the'correct'
field.Dependencies
None
JIRA
Sandbox URLs
I did not prepare a sandbox because verifying the changes involves (re)installing several versions of the DnDv2 xblock which cannot easily be done on a sandbox.
I can spin up a sandbox if you think it would still be useful, though.
Testing Instructions
In order to test this, you need to create and complete (or partially complete) a DnDv2 problem using an older version of DnDv2 xblock. I used
v2.0.6
, but any pre-assessment mode version should work.Assuming you have
xblock-drag-and-drop-v2
installed in editable mode (pip install -e .
) in your devstack, follow these steps:v2.0.6
of DnD xblock in your devstack.edx-solutions/master
version of DnDv2 xblock.KeyError
in the logs.open-craft/mtyaka/legacy-item-state
branch.Reviewers