Submitting assignments¶
See also
- nbgrader submit
- Command line options for
nbgrader fetch
- nbgrader list
- Command line options for
nbgrader list
- Configuration options
- Details on
nbgrader_config.py
From the command line¶
First, as a reminder, here is what the student’s nbgrader_config.py
file looks like:
%%bash
cat /tmp/student_home/nbgrader_config.py
c = get_config()
c.TransferApp.exchange_directory = '/tmp/exchange'
c.NbGrader.course_id = "example_course"
After working on an assignment, the student can submit their version for
grading using nbgrader submit
and passing the name of the assignment
and the name of the class:
%%bash
export HOME=/tmp/student_home && cd $HOME
nbgrader submit "Problem Set 1"
[SubmitApp | INFO] Source: /private/tmp/student_home/Problem Set 1
[SubmitApp | INFO] Destination: /tmp/exchange/example_course/inbound/jhamrick+Problem Set 1+2016-03-03 15:06:15 UTC
[SubmitApp | INFO] Submitted as: example_course Problem Set 1 2016-03-03 15:06:15 UTC
Note that “the name of the assignment” really corresponds to “the name of a folder”. It just happens that, in our current directory, there is a folder called “Problem Set 1”:
%%bash
export HOME=/tmp/student_home && cd $HOME
ls -l "/tmp/student_home"
total 8
drwxr-xr-x 3 jhamrick wheel 102 Mar 3 09:06 Library
drwxr-xr-x 5 jhamrick wheel 170 Mar 3 09:05 Problem Set 1
-rw-r--r-- 1 jhamrick wheel 108 Mar 3 09:06 nbgrader_config.py
Students can see what assignments they have submitted using
nbgrader list --inbound
:
%%bash
export HOME=/tmp/student_home && cd $HOME
nbgrader list --inbound
[ListApp | INFO] Submitted assignments:
[ListApp | INFO] example_course jhamrick Problem Set 1 2016-03-03 15:06:15 UTC
Importantly, students can run nbgrader submit
as many times as they
want, and all submitted copies of the assignment will be preserved:
%%bash
export HOME=/tmp/student_home && cd $HOME
nbgrader submit "Problem Set 1"
[SubmitApp | INFO] Source: /private/tmp/student_home/Problem Set 1
[SubmitApp | INFO] Destination: /tmp/exchange/example_course/inbound/jhamrick+Problem Set 1+2016-03-03 15:06:17 UTC
[SubmitApp | INFO] Submitted as: example_course Problem Set 1 2016-03-03 15:06:17 UTC
We can see all versions that have been submitted by again running
nbgrader list --inbound
:
%%bash
export HOME=/tmp/student_home && cd $HOME
nbgrader list --inbound
[ListApp | INFO] Submitted assignments:
[ListApp | INFO] example_course jhamrick Problem Set 1 2016-03-03 15:06:15 UTC
[ListApp | INFO] example_course jhamrick Problem Set 1 2016-03-03 15:06:17 UTC
Note that the nbgrader submit
(as well as nbgrader fetch
)
command also does not rely on having access to the nbgrader database –
the database is only used by instructors.
From the notebook dashboard¶
Alternatively, students can submit assignments using the assignment list notebook server extension. You must have installed the extension by following the instructions here. Students must have also already downloaded the assignments.
After students have worked on the assignment for a while, but before
submitting, they can validate that their notebooks pass the tests by
clicking the “Validate” button (analogous to running
nbgrader validate
). If any tests fail, they will see a warning:
If there are no errors, they will see that the validation passes:
Once students have validated all the notebooks, they can click the
“Submit” button to submit the assignment (analagous to running
nbgrader submit ps0 --course cogsci131
). Afterwards, it will show up
in the list of submitted assignments (and also still in the list of
downloaded assignments):
Students may submit an assignment as many times as they’d like. All copies of a submission will show up in the submitted assignments list, and when the instructor collects the assignments, they will get the most recent version of the assignment: