-
Notifications
You must be signed in to change notification settings - Fork 60
Step Builder: Allow re-adding children after removing them and (un)lock unit navigation when appropriate #68
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
Conversation
once (for Step Builder and Review Step).
after deleting child that can only be added once. This is a follow-up to the previous commit. It is now possible to add and remove children ad infinitum, irrespective of whether the parent block allows single or multiple copies of them.
When navigation is locked, it is not possible to click arrow buttons to navigate between existing units. This should be the case during completion of an attempt. When navigation is unlocked, users can click arrow buttons to navigate between existing units. This should be the case when user has completed an attempt, i.e., when they are reviewing their grade for the last attempt.
|
@itsjeyd 👍 The code looks good and I verified it works. It would be nice if we could add some tests for these issues, although I'm not sure how easy that is. I don't think we currently have any way to test the Studio sections of the code. Would it be possible to add a test for navigation events? |
|
@mtyaka Thanks for reviewing!
I'm not sure. Is there a way to inject a fake with patch.object(WorkbenchRuntime, 'notify', create=True) as patched_method:
step_builder, controls = self.load_assessment_scenario("step_builder.xml", params)
self.assertTrue(patched_method.called)This works to the extent that the function notify(name, data) {
// Notification interface does not exist in the workbench.
if (runtime.notify) {
runtime.notify(name, data);
}
}to this: function notify(name, data) {
runtime.notify(name, data);
}to make sure that the JS code tries to call in the Browser console. |
|
@itsjeyd I never tried this, but it might be possible to patch patch the To be honest, it's probably not worth doing that on this PR. Ideally the ability to patch the custom JS runtime would be provided by the base test classes from xblock-utils. |
|
@mtyaka OK, I'm going to go ahead and merge this PR then.
What would be a good next step here? Should we create a separate ticket for this in the backlog? There is a ticket for extending test coverage for Step Builder; out of the existing tickets that would probably be the best place to put a note about this. However, it might not be a good idea to further increase the scope of that ticket without doing some discovery first. |
|
@itsjeyd I would add it to the existing ticket, I wouldn't worry about extending the scope while the ticket is still in the backlog. |
Step Builder: Allow re-adding children after removing them and (un)lock unit navigation when appropriate
|
@mtyaka OK thanks, done. |
This PR fixes the following issues:
Testing
For the first issue:
For the second issue: