jupyter / nbgrader

A system for assigning and grading notebooks
https://nbgrader.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
1.3k stars 317 forks source link

Manual grading in live notebooks #67

Open ellisonbg opened 9 years ago

ellisonbg commented 9 years ago

After doing lots of manual grading of notebooks, I have found that doing so in the static HTML nbgrader web app doesn't work. A few issues I ran into:

Because of this I ended up doing all of my manual grading in the live notebook with a modified nbgrader JS extension that allowed me to simple set the manual grade score (also showed the autograde score). This worked very well.

ellisonbg commented 9 years ago

I should mention that we do have plans to improve the performance of loading large notebooks (should be much better already in master) and to add per cell comments. This should further alleviate the need to maintain a separate web app for nbgrader.

jhamrick commented 9 years ago

I found that I often wanted a new comment space in a location where the nbgrader web app didn't put one. Many comment areas in the nbgrader web app went unused, making it difficult to navigate with all of that extra space.

I would really like to have the ability to just insert comments wherever in between cells... I think this probably wouldn't be too hard to add to the current HTML grader, though is definitely more predisposed to the live notebook.

I also found myself adding code comments in student code cells so I could be very specific like # <---- this line has an index error.

Hmmm, I hadn't thought of that use case before. That would definitely be nice to have, though.

I should mention that we do have plans to improve the performance of loading large notebooks (should be much better already in master) and to add per cell comments.

Having that would be great, but at least right now that's not feasible for a class size of 200. Currently it takes about 6-7 seconds to load the notebooks for my class locally (plus 1-2 seconds to load the kernel, and an additional 1-2 seconds if it's remote), which would mean at least 30 minutes of extra grading time per problem just waiting for the notebooks to load (and that's assuming you grade the whole problem at once, which usually isn't true for us, because it's easier to grade all of one part of the problem, then all of the next part, etc.)

Because of this I ended up doing all of my manual grading in the live notebook with a modified nbgrader JS extension that allowed me to simple set the manual grade score (also showed the autograde score). This worked very well.

Could you make a PR with your extension? I don't think we'll be able to use it for my class this semester unless the notebook load time is significantly faster, but I'd really like to try it out!

ellisonbg commented 9 years ago

Yeah, the load time is pretty painful for a class of 200 students. I do think that until we have those times down much lower it is very reasonable to maintain the nbgrader HTML web app. Especially if you are grading the notebooks in sections like that.

I will submit a PR with the nbgrader extension changes.

jhamrick commented 9 years ago

I just had a thought about the notebook loading times. I think if there were two things possible:

Then this would significantly decrease load times and definitely make it possible to do grading in the live notebook. Obviously, these aren't changes (especially the first one) that are feasible to do right now, but I just wanted to write my thoughts down somewhere.

Also, when you were doing grading in the notebook, was it just saving into the notebook metadata, or was it also communicating with the database?

ellisonbg commented 9 years ago

We have definitely been thinking about these two optimizations for performance (lazy loading of cells and delayed kernel starting) and it would help a huge amount. These will almost surely be required when we start to work more on the real time collaboration as well.

When I was doing manual grading, I did everything through the modified grading cell toolbar that I wrote. I just saved the metadata in the notebook and a later "nbgrader record" run would put that into the database.

On Thu, Jan 22, 2015 at 5:19 PM, Jessica B. Hamrick < notifications@github.com> wrote:

I just had a thought about the notebook loading times. I think if there were two things possible:

  • if the notebook could be loaded cell-by-cell, rather than all at once, and
  • if there could be a config option (or maybe just the extension could do this) to not automatically start kernels -- just start it on demand

Then this would significantly decrease load times and definitely make it possible to do grading in the live notebook. Obviously, these aren't changes (especially the first one) that are feasible to do right now, but I just wanted to write my thoughts down somewhere.

Also, when you were doing grading in the notebook, was it just saving into the notebook metadata, or was it also communicating with the database?

— Reply to this email directly or view it on GitHub https://github.com/jupyter/nbgrader/issues/67#issuecomment-71132263.

Brian E. Granger Cal Poly State University, San Luis Obispo @ellisonbg on Twitter and GitHub bgranger@calpoly.edu and ellisonbg@gmail.com

jhamrick commented 7 years ago

@ellisonbg commented in #604:

The core client UI of formgrade could be replace in many situation by a live notebook with the following:

  • An nbextension that allow human grading and commenting and stores the results in nbgrader metadata.
  • A new nbgrader command line phase that takes that metadata and stores it in the db. We already have nbconvert preprocessors that essentially do this, so this would be super simple.
  • Some sort of additional frontend UI that makes it easy to navigate through notebooks for grading.

In JupyterLab, offering additional UIs is relatively easy. I don't have a ton of time right now to work on this stuff, but I may pick away at it.

jhamrick commented 7 years ago

While I think it would be really nice to do grading in the live notebook, I'm still not convinced it is something that can really replace formgrader right now.

Currently, the formgrader stores the results in the database (through the use of a REST api) rather than in the notebook itself. This is really a critical feature for several reasons:

Those critiques aside, I'm happy to explore the idea of doing live grading, and maybe we could even offer a "lightweight" version of the grading interface that works in the live notebook. But, I don't think we can retire the formgrader entirely.

ellisonbg commented 7 years ago

Good points:

The point is that if you can work within the (extended) bounds of the single user notebook server (or jupyterlab) all of the deployment problems vanish. But all of this is predicated on being able to host single user servers that have group access permissions.

jhamrick commented 7 years ago

For me my grading process is already strongly driven by the command line, so having another command wouldn't really bother me (but see my next pont)

Some feedback that I've gotten about nbgrader from other instructors is that there is too much going on with the command line already, so I'm hesitant to introduce more commands that are required (I'm ok with adding additional commands that are optional, e.g. nbgrader export)

For that I was thinking about a serverextension for the single user notebook that provides the REST API for form grading logic. That would also allow live grading to be written directly to the db without a separate command line pass.

Ah, yes, if we could still have that, then my concerns would be alleviated. It would still require re-writing a lot of the UI functionality to work as a plugin with the notebook, but if we can keep the REST API for the grading stuff in the backend then that will at least keep the core functionality the same.

ellisonbg commented 7 years ago

Classic notebook serverextensions can offer additional HTML pages at URLs the notebook isn't using. Couldn't we move the existing formgrade UI to a URL prefix like /grading on the single user server and have it serve up the REST API and existing formgrade pages? Then the classic notebook and formgrade pages would be on a single server and having formgrade pages link out to the live notebooks would be trivial. That single serverextension could also provided the needed REST endpoints for the assignment-list nbextension.

Then creating a formgrade instance would simply be:

ellisonbg commented 7 years ago

From the implementation perspective that would require:

jhamrick commented 7 years ago

Classic notebook serverextensions can offer additional HTML pages at URLs the notebook isn't using. Couldn't we move the existing formgrade UI to a URL prefix like /grading on the single user server and have it serve up the REST API and existing formgrade pages?

Yes, I actually have something like that already to make it work with the binder demo:

https://github.com/jhamrick/nbgrader-demo/blob/master/formgrade_extension.py

Bundling the existing formgrade/assignment handlers into a single user serverextension.

I am still a little concerned about the loading times that we discussed when this issue was originally opened. Do you know if that's been addressed at all?

ellisonbg commented 7 years ago

Yes and no. In the JupyterLab beta we are doing a lot to make the rendering of notebooks faster. But the solution I am starting to think about wouldn't face that slowdown. I am imagining not using actual live kernel backed notebooks for grading, but rather just host the existing formgrade app as a serverextension. No notebook loading times would be relevant for now as it would still use the formgrade UI/backend.

ellisonbg commented 7 years ago

But it sounds like this type of implementation might simplify things in a huge way if you already have much of it working.

jhamrick commented 7 years ago

Ah, yes, I see. In that case then yeah, I have implemented almost everything we'd need to do already. The only thing is that there are no links between the notebook interface and the formgrader, so people have to know what URL to include explicitly.

This is the auth that I wrote for the notebook extension:

https://github.com/jhamrick/nbgrader-demo/blob/master/notebookauth.py

So if we can get this setup to work with JupyterHub as well then we could just get rid of all the auth stuff, and put the notebook auth as being the one (and only) way of linking the formgrader up with the live notebook server.

ellisonbg commented 7 years ago

When you say "no links between the notebook interface and the formgrader" what do you mean? The formgrade UI could link directly to live notebook. Or are you thinking about links from the main notebook UI over to the formgrade pages?

On Thu, Jan 5, 2017 at 4:31 PM, Jessica B. Hamrick <notifications@github.com

wrote:

Ah, yes, I see. In that case then yeah, I have implemented almost everything we'd need to do already. The only thing is that there are no links between the notebook interface and the formgrader, so people have to know what URL to include explicitly.

This is the auth that I wrote for the notebook extension:

https://github.com/jhamrick/nbgrader-demo/blob/master/notebookauth.py

So if we can get this setup to work with JupyterHub as well then we could just get rid of all the auth stuff, and put the notebook auth as being the one (and only) way of linking the formgrader up with the live notebook server.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jupyter/nbgrader/issues/67#issuecomment-270789050, or mute the thread https://github.com/notifications/unsubscribe-auth/AABr0GjXr1ZIFu4yjAeLt3AMt1w9Ztz7ks5rPX1mgaJpZM4DU-bl .

-- Brian E. Granger Associate Professor of Physics and Data Science Cal Poly State University, San Luis Obispo @ellisonbg on Twitter and GitHub bgranger@calpoly.edu and ellisonbg@gmail.com

jhamrick commented 7 years ago

Sorry, I just mean there is nothing currently in the UI (the way I've implemented it) that links to the formgrader. But yes, that is certainly something that could be (and probably should be) added.