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

Better validation errors when cell type changes #908

Merged
merged 7 commits into from
Oct 29, 2017

Conversation

jhamrick
Copy link
Member

Fixes #878

Phew, I thought this would be a relatively straightforward PR, but turns out I was wrong!

The reason this wasn't straightforward is that the original cell type wasn't actually stored anywhere in the notebook metadata---only in the database. So, this meant that while the cell type would be fixed when nbgrader autograde was run, it would fail on validation but not provide a useful error message to the user. To address this, I created a new version of the metadata which now includes a key for the cell type. This key is added when nbgrader assign is run, and then the validation code looks to see whether the stored cell type is the same as the current cell type.

In implementing all of this I added a bit more tooling to make the metadata updating more obvious (see #883). For example, the create assignment extension will complain now if the metadata version is too old.

@jhamrick jhamrick added this to the 0.6.0 milestone Oct 29, 2017
@jhamrick jhamrick merged commit 46bfcaa into jupyter:master Oct 29, 2017
@jhamrick jhamrick deleted the validation-errors branch October 29, 2017 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enforce uneditable test cells
1 participant