GithubHelp home page GithubHelp logo

jupyter / nbgrader Goto Github PK

View Code? Open in Web Editor NEW
1.3K 44.0 312.0 27.74 MB

A system for assigning and grading notebooks

Home Page: https://nbgrader.readthedocs.io/

License: BSD 3-Clause "New" or "Revised" License

Python 37.21% JavaScript 6.76% CSS 0.56% Smarty 0.63% Jupyter Notebook 31.39% Batchfile 0.22% Makefile 0.21% HTML 16.55% Mako 0.01% TeX 0.13% Jinja 0.50% TypeScript 5.82% Shell 0.02%
nbgrader jupyter jupyter-notebook jupyterhub teaching grading

nbgrader's Introduction

nbgrader

Build: Build Forum: Google Group Cite: DOI

A system for assigning and grading Jupyter notebooks.

Documentation can be found on Read the Docs.

Highlights of nbgrader

Instructor toolbar extension for Jupyter notebooks

The nbgrader toolbar extension for Jupyter notebooks guides the instructor through assignment and grading tasks using the familiar Jupyter notebook interface.

Creating assignment

Instructor "formgrader" extension for Jupyter notebooks

The formgrader extension for the Jupyter notebook allows instructors to use the core functionality of nbgrader---generating the student version of an assignment, releasing assignments to students, collecting assignments, autograding submissions, and manually grading submissions.

Formgrader extension

Student assignment list extension for Jupyter notebooks

Using the assignment list extension, students may conveniently view, fetch, submit, and validate their assignments.

nbgrader assignment list

The command line tools of nbgrader

Command line tools offer an efficient way for the instructor to generate, assign, release, collect, and grade notebooks.

SciPy 2017 overview talk (click to view on YouTube)

nbgrader: A Tool for Creating and Grading Assignments in the Jupyter Notebook | SciPy 2017

Installation

For detailed instructions on installing nbgrader and the nbgrader extensions for Jupyter notebook, please see Installation section in the User Guide.

Contributing

Please see the contributing guidelines and documentation.

If you want to develop features for nbgrader, please follow the development installation instructions.

nbgrader's People

Contributors

aalmanza1998 avatar alope107 avatar bertr avatar blink1073 avatar brichet avatar carreau avatar damianavila avatar danielmaitre avatar dependabot[bot] avatar dsblank avatar ellisonbg avatar github-actions[bot] avatar jdfreder avatar jhamrick avatar jtpio avatar kcranston avatar lawrence37 avatar lgpage avatar lxylxy123456 avatar lzach avatar minrk avatar mpacer avatar nthiery avatar rkdarst avatar ruin0x11 avatar sigurdurb avatar tmetzl avatar tuncbkose avatar willingc avatar zonca avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nbgrader's Issues

No tests?

It's passing, but I can't actually use it.

Improved navigation within grading a notebook

Right now there isn't a quick way to jump around the notebook. It seems like it would be really helpful to have a floating hierarchical representation that stays put as you scroll down, with hyperlinks to headers, subheaders, and graded cells.

This could be useful in the notebooks more generally (e.g. when students are doing them) but I think that they proceed through them largely linearly, so the real benefit is for graders who need to jump around a lot in the notebooks.

Add documentation

Currently the only docs are the ones that are in the readme. I can set up some docs with sphinx, and then we could put them on readthedocs.org.

Reorganize the various nbgrader apps

They're currently a bit disorganized, and there's some code duplication that I'm unhappy about (e.g. overriding the ipython_dir trait). This is not a major issue, but should be addressed at some point.

Add student view

Currently, you can only see an assignment view (e.g. assignments -> notebooks -> students -> grade). It would be nice to additionally have a student view, so you could do students -> assignments -> notebooks -> grade. This would make it easy to see what a student's grade is for the entire assignment, and what their overall grade is for the course.

Round floats for average score

Long floats in the average scores reported for a problem set, e.g. 4.340686274509804 out of 4.5. This should be to just 2-3 decimal places.

Manual grading in live notebooks

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:

  • 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 also found myself adding code comments in student code cells so I could be very specific like # <---- this line has an index error.
  • I ended up rerunning student code most of the time. It was very unusual to manually grade a notebook were I didn't rerun something.

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.

Tab between grade_id and points in extension toolbar

If you are editing the id and points for a grade cell, and have the cursor in the grade_id textbox, and then press tab, the cell body is selected rather than the points textbox. My intuition is that it should go to the points textbox next.

Use comment syntax instead of jinja templates to denote solution code

In the master version, instructors may want to mark some code inline as solution-only, like this:

def some_function():
    ### BEGIN SOLUTION
    print("this is the solution!")
    ### END SOLUTION

Previously I did this with jinja, but @ellisonbg and I agreed that using comments is better because then the cells are pure python and can still be run without using nbgrader, and it's a clearer syntax for people who are unfamiliar with jinja.

New nbgrader record subcommand

I have found that it caused problems to have the autograde step also record the grades in the db. I think there should be an nbgrader record subcommand that only records the grades that are in the notebook in the db. A side effect of this is that the autograde command should only do the autograding and save the autograde score in the notebook metadata itself. This creates a more modular and loosly coupled system.

Empty cell toolbar

After installing nbgrader I get a notebook with an empty cell toolbar.
The error message is (I am using IPython v 2.3):

"Failed to load extension(s):" Array [ "nbextensions/nbgrader" ] TypeError: celltoolbar is undefined
Stack trace:
@http://localhost:8938/nbextensions/nbgrader.js:20:9
newContext/context.execCb@http://localhost:8938/static/components/requirejs/require.js?v=07d7db4d3fd6519996822665e4239282:1650:24
newContext/Module.prototype.check@http://localhost:8938/static/components/requirejs/require.js?v=07d7db4d3fd6519996822665e4239282:861:47
newContext/Module.prototype.enable/</<@http://localhost:8938/static/components/requirejs/require.js?v=07d7db4d3fd6519996822665e4239282:1113:29
bind/<@http://localhost:8938/static/components/requirejs/require.js?v=07d7db4d3fd6519996822665e4239282:132:20
newContext/Module.prototype.emit/<@http://localhost:8938/static/components/requirejs/require.js?v=07d7db4d3fd6519996822665e4239282:1156:21
each@http://localhost:8938/static/components/requirejs/require.js?v=07d7db4d3fd6519996822665e4239282:57:31
newContext/Module.prototype.emit@http://localhost:8938/static/components/requirejs/require.js?v=07d7db4d3fd6519996822665e4239282:1155:17
newContext/Module.prototype.check@http://localhost:8938/static/components/requirejs/require.js?v=07d7db4d3fd6519996822665e4239282:917:25
newContext/Module.prototype.enable@http://localhost:8938/static/components/requirejs/require.js?v=07d7db4d3fd6519996822665e4239282:1143:17
newContext/Module.prototype.init@http://localhost:8938/static/components/requirejs/require.js?v=07d7db4d3fd6519996822665e4239282:774:21
callGetModule@http://localhost:8938/static/components/requirejs/require.js?v=07d7db4d3fd6519996822665e4239282:1170:17
newContext/context.completeLoad@http://localhost:8938/static/components/requirejs/require.js?v=07d7db4d3fd6519996822665e4239282:1564:1
newContext/context.onScriptLoad@http://localhost:8938/static/components/requirejs/require.js?v=07d7db4d3fd6519996822665e4239282:1671:21

Prompt numbers display as 'null'

After running nbgrader assign, the prompt numbers in the resulting notebook are null. This may be a bug in the ClearOutputPreprocessor in IPython, but I need to investigate further.

Make grading cells undeletable

As soon as ipython/ipython#6488 is merged, I'd like to provide some way of making the grading cells undeletable. This could either be something that's automatically done with the nbextension, or it could be a configurable flag in the ClearSolutions preprocessor.

If grading cells are undeletable, then we can be (relatively) confident that the cells will still be there when the student turns in the notebook. We can then do things like assign a hash of the cell to make sure the tests haven't changed, or just replace the cell contents with the original test, etc.

Add "mark graded" button

It should be possible to mark a submission as fully graded, so that if a human grader has to stop grading in the middle, they can come back and easily know where they left off.

Autofill non-reponse feedback.

It might be nice to automatically fill in some standard text as feedback for when a student's response is blank, e.g., ("No credit assigned because you did not provide a response.")

Add a warning/error for code cells that are marked as both grade cells and solution cells

The only cells that are marked as both grade and solution should be cells that need to be graded manually, e.g. markdown cells. I can see some use cases for doing this with code cells as well, so maybe there shouldn't be an actual error, but at least a warning in nbgrader assign because probably in both cases if a code cell is both a grade cell and a solution cell, it's a mistake.

Incompatible with nbformat 4 changes

Currently, nbgrader appears to be incompatible with the new nbformat 4 changes. For the time being, I've clamped the IPython version to be before nbformat 4 was merged (see #28), but we should actually fix nbgrader so that it's compatible with these new changes.

KeyError in autograde and formgrade apps

Trying to run the command line help for the autograde or formgrade apps results in a long traceback:

$ nbgrader autograde --help
Autograde a notebook by running it

Options
-------

Arguments that take values are actually convenience aliases to full
Configurables, whose aliases are listed on the help line. For more information
on full configurables, see '--help-all'.

--stdout
    Write notebook output to stdout instead of files.
--init
    Initialize profile with default config files.  This is equivalent
    to running `ipython profile create <profile>` prior to startup.
--quiet
    set log level to logging.CRITICAL (minimize logging output)
--debug
    set log level to logging.DEBUG (maximize logging output)
Traceback (most recent call last):
  File "/usr/local/bin/nbgrader", line 12, in <module>
    exec(compile(open(__file__).read(), __file__, 'exec'))
  File "/Users/jhamrick/project/tools/nbgrader/scripts/nbgrader", line 4, in <module>
    main()
  File "/Users/jhamrick/project/tools/nbgrader/nbgrader/apps/nbgraderapp.py", line 61, in main
    NBGraderApp.launch_instance()
  File "/Users/jhamrick/project/tools/ipython/IPython/config/application.py", line 548, in launch_instance
    app.initialize(argv)
  File "<string>", line 2, in initialize
  File "/Users/jhamrick/project/tools/ipython/IPython/config/application.py", line 74, in catch_config_error
    return method(app, *args, **kwargs)
  File "/Users/jhamrick/project/tools/nbgrader/nbgrader/apps/nbgraderapp.py", line 53, in initialize
    super(NBGraderApp,self).initialize(argv)
  File "<string>", line 2, in initialize
  File "/Users/jhamrick/project/tools/ipython/IPython/config/application.py", line 74, in catch_config_error
    return method(app, *args, **kwargs)
  File "/Users/jhamrick/project/tools/ipython/IPython/core/application.py", line 378, in initialize
    self.parse_command_line(argv)
  File "<string>", line 2, in parse_command_line
  File "/Users/jhamrick/project/tools/ipython/IPython/config/application.py", line 74, in catch_config_error
    return method(app, *args, **kwargs)
  File "/Users/jhamrick/project/tools/ipython/IPython/config/application.py", line 460, in parse_command_line
    return self.initialize_subcommand(subc, subargv)
  File "<string>", line 2, in initialize_subcommand
  File "/Users/jhamrick/project/tools/ipython/IPython/config/application.py", line 74, in catch_config_error
    return method(app, *args, **kwargs)
  File "/Users/jhamrick/project/tools/ipython/IPython/config/application.py", line 398, in initialize_subcommand
    self.subapp.initialize(argv)
  File "<string>", line 2, in initialize
  File "/Users/jhamrick/project/tools/ipython/IPython/config/application.py", line 74, in catch_config_error
    return method(app, *args, **kwargs)
  File "/Users/jhamrick/project/tools/nbgrader/nbgrader/apps/customnbconvertapp.py", line 41, in initialize
    super(CustomNbConvertApp,self).initialize(argv)
  File "<string>", line 2, in initialize
  File "/Users/jhamrick/project/tools/ipython/IPython/config/application.py", line 74, in catch_config_error
    return method(app, *args, **kwargs)
  File "/Users/jhamrick/project/tools/ipython/IPython/nbconvert/nbconvertapp.py", line 191, in initialize
    super(NbConvertApp, self).initialize(argv)
  File "<string>", line 2, in initialize
  File "/Users/jhamrick/project/tools/ipython/IPython/config/application.py", line 74, in catch_config_error
    return method(app, *args, **kwargs)
  File "/Users/jhamrick/project/tools/ipython/IPython/core/application.py", line 378, in initialize
    self.parse_command_line(argv)
  File "<string>", line 2, in parse_command_line
  File "/Users/jhamrick/project/tools/ipython/IPython/config/application.py", line 74, in catch_config_error
    return method(app, *args, **kwargs)
  File "/Users/jhamrick/project/tools/ipython/IPython/config/application.py", line 472, in parse_command_line
    self.print_help('--help-all' in interpreted_argv)
  File "/Users/jhamrick/project/tools/ipython/IPython/config/application.py", line 331, in print_help
    self.print_options()
  File "/Users/jhamrick/project/tools/ipython/IPython/config/application.py", line 302, in print_options
    self.print_alias_help()
  File "/Users/jhamrick/project/tools/ipython/IPython/config/application.py", line 266, in print_alias_help
    cls = classdict[classname]
KeyError: 'FindStudentID'

It seems like it doesn't know about the FindStudentID class, but I don't know why.

Complexity costs

The nbgrader system is complex enough that when something goes wrong, the average instructor won't have any idea how to recover without writing lots of custom python code. I found myself doing this time and time again, and that isn't sustainable over the long run. I think we really need to figure out how to make it simpler and also more bullet proof.

Use tornado instead of flask

The rest of IPython/Jupyter stuff uses tornado, so it might be better to switch to that from Flask in order to be a bit more consistent. Though, if we end up switching to live notebook grading, we wouldn't need to worry about this anyway. I'm creating this as an issue anyway just as a reminder in case the HTML grader does stick around.

nbgranger assign should abort if there is a graded problem with no points

An issue that I found a couple of times is that I forgot to add points to a problem before I send it out to students. The problem is a complete pain to fix once you get student work back. If a cell is marked for grading, nbgrader assign should abort with an error message saying that the points is empty.

Use SQLAlchemy for DB layer

Originally, it was not clear what the database would end up looking like, so mongodb made a lot of sense. However, seeing how the db tables/collections have evolved, I think it will really help to use sqlalchemy's ORM layer. This would remove the need for us to write and maintain our own custom ORM layer for MongoDB and would allow a much larger set of DB engines, most importantly file based ones that are easier to manage such as sqlite.

Minor bugs in nbgrader nbextension

Am using this for the first time (yeah!) and found the following bugs:

  • The points field is only writen on keyup, but should also trigger on change as there are other ways of changing this field.
  • Both grader_id and grade_id are being written to the metadata.

Add support for late assignments

Currently, there is no way to track when assignments are turned in, whether they are late, and if so, what late penalty should be applied.

Autograding markdown cells

This is very much a wishlist item, but it would be awesome to somehow be able to autograde markdown cells that have simple and clear solutions.

Create a "submit" extension or magic

I'm not entirely sure what the form of this will be, but perhaps a magic where they run:

%submit

and it figures out their username, and the time stamp, and creates a tar archive (or something) with the relevant information. Perhaps it could even then send that tar ball to a data store somewhere.

I think this might be easy to hack -- i.e., easy for students to change the timestamps -- but at least, for a first pass, I think something like this should be sufficient.

Save result of autograding somewhere

Currently, the autograder doesn't do much beyond just executing the cells. It should actually determine which grade cells pass and which don't, and record that information (along with the number of points earned) somewhere -- either CSV, JSON, or a database, perhaps.

Autograder should time out and continue running

It will eventually time out currently, but it will throw an error and halt. It should be smart enough to time out on a particular cell, but continue running on subsequent cells even if it times out.

Compute checksums of grade cells

We should create checksums of the contents of grade cells, and then verify them during autograding to ensure the contents haven't changed. Probably all this will require is a config option to specify a salt value, and then the instructor will need to ensure that the salt is the same for both nbgrader assign and nbgrader autograde.

Display total score in create assignment toolbar

I typically want my assignments to have some number of points across all the problems -- e.g., 20 points -- but it's hard to count up the points for all the individual parts. It would be nice if at least each notebook said how many points it was worth at the top or something.

autograde not working

I get the following output:
Any help is appreciated.

Ivan

!nbgrader autograde

[AutogradeApp] Using existing profile dir: '/tmp/nbgrader/profile_default'
Traceback (most recent call last):
  File "/home/ivan/.virtualenvs/nbgrader/bin/nbgrader", line 4, in <module>
    main()
  File "/home/ivan/.virtualenvs/nbgrader/lib/python3.4/site-packages/nbgrader/apps/nbgraderapp.py", line 71, in main
    NBGraderApp.launch_instance()
  File "/home/ivan/.virtualenvs/nbgrader/ipython/IPython/config/application.py", line 563, in launch_instance
    app.initialize(argv)
  File "<string>", line 2, in initialize
  File "/home/ivan/.virtualenvs/nbgrader/ipython/IPython/config/application.py", line 74, in catch_config_error
    return method(app, *args, **kwargs)
  File "/home/ivan/.virtualenvs/nbgrader/lib/python3.4/site-packages/nbgrader/apps/nbgraderapp.py", line 63, in initialize
    super(NBGraderApp, self).initialize(argv)
  File "<string>", line 2, in initialize
  File "/home/ivan/.virtualenvs/nbgrader/ipython/IPython/config/application.py", line 74, in catch_config_error
    return method(app, *args, **kwargs)
  File "/home/ivan/.virtualenvs/nbgrader/ipython/IPython/core/application.py", line 368, in initialize
    self.parse_command_line(argv)
  File "<string>", line 2, in parse_command_line
  File "/home/ivan/.virtualenvs/nbgrader/ipython/IPython/config/application.py", line 74, in catch_config_error
    return method(app, *args, **kwargs)
  File "/home/ivan/.virtualenvs/nbgrader/ipython/IPython/config/application.py", line 470, in parse_command_line
    return self.initialize_subcommand(subc, subargv)
  File "<string>", line 2, in initialize_subcommand
  File "/home/ivan/.virtualenvs/nbgrader/ipython/IPython/config/application.py", line 74, in catch_config_error
    return method(app, *args, **kwargs)
  File "/home/ivan/.virtualenvs/nbgrader/ipython/IPython/config/application.py", line 408, in initialize_subcommand
    self.subapp.initialize(argv)
  File "<string>", line 2, in initialize
  File "/home/ivan/.virtualenvs/nbgrader/ipython/IPython/config/application.py", line 74, in catch_config_error
    return method(app, *args, **kwargs)
  File "/home/ivan/.virtualenvs/nbgrader/lib/python3.4/site-packages/nbgrader/apps/customnbconvertapp.py", line 54, in initialize
    super(CustomNbConvertApp, self).initialize(argv)
  File "<string>", line 2, in initialize
  File "/home/ivan/.virtualenvs/nbgrader/ipython/IPython/config/application.py", line 74, in catch_config_error
    return method(app, *args, **kwargs)
  File "/home/ivan/.virtualenvs/nbgrader/ipython/IPython/nbconvert/nbconvertapp.py", line 197, in initialize
    self.init_notebooks()
  File "/home/ivan/.virtualenvs/nbgrader/lib/python3.4/site-packages/nbgrader/apps/customnbconvertapp.py", line 98, in init_notebooks
    self.prefix = os.path.commonprefix(zip(*self.notebooks)[0])
TypeError: 'zip' object is not subscriptable

If you suspect this is an IPython bug, please report it at:
    https://github.com/ipython/ipython/issues
or send an email to the mailing list at [email protected]

You can print a more detailed traceback right now with "%tb", or use "%debug"
to interactively debug it.

Extra-detailed tracebacks for bug-reporting purposes can be enabled via:
    c.Application.verbose_crash=True

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.