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

True read-only cells #1402

Closed
jhamrick opened this issue Apr 28, 2016 · 6 comments · Fixed by #1482
Closed

True read-only cells #1402

jhamrick opened this issue Apr 28, 2016 · 6 comments · Fixed by #1482

Comments

@jhamrick
Copy link
Member

nbgrader currently has pseudo "read-only" cells where they are "read-only" in the sense that their contents get saved to the nbgrader database, and then overwritten during grading if they have been changed by the student. I have reports that this is confusing, and requests for true read-only cells where the cell actually cannot be edited at all in the live notebook.

I think this would be really useful to have for nbgrader. We could keep it as an undocumented feature for the moment, just like "undeletable" cells are, until we can figure out an appropriate UI for it.

@Carreau
Copy link
Member

Carreau commented Apr 28, 2016

Do you want it in the core? Or as an extension ?

By read-only, I suppose you want users to not be able to clear output, and not modify the text of cell.
Can they enter edit mode for markdown cell, or just see the rendered version ?
Should they be allowed to select the text ? (Codemirror as 2 read-only option: readOnly:true|'nocursor')
Copy the cell ?
Past it ?
If pasted, is the new cell read-only too ? Or not ?

@jhamrick
Copy link
Member Author

Yes, I'd like it in core. Ideally students shouldn't have to install anything extra.

By read-only, I suppose you want users to not be able to clear output, and not modify the text of cell.

I would be ok with clearing output -- just not editing the source of the cell. I think not being able to clear the output (or overwrite it, if the cell is re-run) could be confusing.

Can they enter edit mode for markdown cell, or just see the rendered version ?

I think they should probably be able to see the source of markdown, just not edit it.

Should they be allowed to select the text ? (Codemirror as 2 read-only option: readOnly:true|'nocursor')

I think disabling the cursor would be fine.

Copy the cell ?
Past it ?
If pasted, is the new cell read-only too ? Or not ?

Yes, it should be copiable, and pasted versions shouldn't be read-only. I would expect the behavior to be similar to how the "undeletable" property is maintained (and actually, "read-only" should imply "undeleteable", I think).

@yuvipanda
Copy link
Contributor

yuvipanda commented May 24, 2016

Is there even a way to enforce this 'serverside' at all? If not, just adding a 'readonly' field to cell metadata and enforcing it in client side JS (either in an extension or core) would be enough, right?

@yuvipanda yuvipanda reopened this May 24, 2016
@yuvipanda
Copy link
Contributor

(pressed wrong button, sorry!)

@jhamrick
Copy link
Member Author

No, it's something that the frontend would have to support. So yeah, adding a 'readonly' field to the cell metadata and then enforcing it in the core notebook client JS (this is also how the 'deletable' field works).

@takluyver
Copy link
Member

Yes, if/when we document this, we should make it clear that it's a 'stop users shooting themselves in the foot' measure, not a security measure.

@Carreau Carreau modified the milestone: 5.0 Jun 17, 2016
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants