Collect an assignment from the nbgrader exchange
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'.
--quiet
set log level to CRITICAL (minimize logging output)
--debug
set log level to DEBUG (maximize logging output)
--update
Update existing submissions with ones that have newer timestamps.
--timezone=<Unicode> (TransferApp.timezone)
Default: 'UTC'
Timezone for recording timestamps
--student=<Unicode> (NbGrader.student_id)
Default: '*'
File glob to match student IDs. This can be changed to filter by student.
Note: this is always changed to '.' when running `nbgrader assign`, as the
assign step doesn't have any student ID associated with it.
--course-dir=<Unicode> (NbGrader.course_directory)
Default: ''
The root directory for the course files (that includes the `source`,
`release`, `submitted`, `autograded`, etc. directories). Defaults to the
current working directory.
--db=<Unicode> (NbGrader.db_url)
Default: ''
URL to the database. Defaults to sqlite:///<course_directory>/gradebook.db,
where <course_directory> is another configurable variable.
--notebook=<Unicode> (NbGrader.notebook_id)
Default: '*'
File glob to match notebook names, excluding the '.ipynb' extension. This
can be changed to filter by notebook.
--assignment=<Unicode> (NbGrader.assignment_id)
Default: ''
The assignment name. This MUST be specified, either by setting the config
option, passing an argument on the command line, or using the --assignment
option on the command line.
--log-level=<Enum> (Application.log_level)
Default: 30
Choices: (0, 10, 20, 30, 40, 50, 'DEBUG', 'INFO', 'WARN', 'ERROR', 'CRITICAL')
Set the log level by value or name.
--course=<Unicode> (NbGrader.course_id)
Default: ''
A key that is unique per instructor and course. This MUST be specified,
either by setting the config option, or using the --course option on the
command line.
Class parameters
----------------
Parameters are set from command-line arguments of the form:
`--Class.trait=value`. This line is evaluated in Python, so simple expressions
are allowed, e.g.:: `--C.a='range(3)'` For setting C.a=[0,1,2].
CollectApp options
------------------
--CollectApp.answer_yes=<Bool>
Default: False
Answer yes to any prompts.
--CollectApp.assignment_id=<Unicode>
Default: ''
The assignment name. This MUST be specified, either by setting the config
option, passing an argument on the command line, or using the --assignment
option on the command line.
--CollectApp.autograded_directory=<Unicode>
Default: 'autograded'
The name of the directory that contains assignment submissions after they
have been autograded. This corresponds to the `nbgrader_step` variable in
the `directory_structure` config option.
--CollectApp.cache_directory=<Unicode>
Default: ''
Local cache directory for nbgrader submit and nbgrader list. Defaults to
$JUPYTER_DATA_DIR/nbgrader_cache
--CollectApp.config_file=<Unicode>
Default: ''
Full path of a config file.
--CollectApp.config_file_name=<Unicode>
Default: ''
Specify a config file to load.
--CollectApp.course_directory=<Unicode>
Default: ''
The root directory for the course files (that includes the `source`,
`release`, `submitted`, `autograded`, etc. directories). Defaults to the
current working directory.
--CollectApp.course_id=<Unicode>
Default: ''
A key that is unique per instructor and course. This MUST be specified,
either by setting the config option, or using the --course option on the
command line.
--CollectApp.db_assignments=<List>
Default: []
A list of assignments that will be created in the database. Each item in the
list should be a dictionary with the following keys:
- name
- duedate (optional)
The values will be stored in the database. Please see the API documentation
on the `Assignment` database model for details on these fields.
--CollectApp.db_students=<List>
Default: []
A list of student that will be created in the database. Each item in the
list should be a dictionary with the following keys:
- id
- first_name (optional)
- last_name (optional)
- email (optional)
The values will be stored in the database. Please see the API documentation
on the `Student` database model for details on these fields.
--CollectApp.db_url=<Unicode>
Default: ''
URL to the database. Defaults to sqlite:///<course_directory>/gradebook.db,
where <course_directory> is another configurable variable.
--CollectApp.directory_structure=<Unicode>
Default: '{nbgrader_step}/{student_id}/{assignment_id}'
Format string for the directory structure that nbgrader works over during
the grading process. This MUST contain named keys for 'nbgrader_step',
'student_id', and 'assignment_id'. It SHOULD NOT contain a key for
'notebook_id', as this will be automatically joined with the rest of the
path.
--CollectApp.exchange_directory=<Unicode>
Default: '/srv/nbgrader/exchange'
The nbgrader exchange directory writable to everyone. MUST be preexisting.
--CollectApp.feedback_directory=<Unicode>
Default: 'feedback'
The name of the directory that contains assignment feedback after grading
has been completed. This corresponds to the `nbgrader_step` variable in the
`directory_structure` config option.
--CollectApp.generate_config=<Bool>
Default: False
Generate default config file.
--CollectApp.ignore=<List>
Default: ['.ipynb_checkpoints', '*.pyc', '__pycache__']
List of file names or file globs to be ignored when copying directories.
--CollectApp.log_datefmt=<Unicode>
Default: '%Y-%m-%d %H:%M:%S'
The date format used by logging formatters for %(asctime)s
--CollectApp.log_format=<Unicode>
Default: '[%(name)s]%(highlevel)s %(message)s'
The Logging format template
--CollectApp.log_level=<Enum>
Default: 30
Choices: (0, 10, 20, 30, 40, 50, 'DEBUG', 'INFO', 'WARN', 'ERROR', 'CRITICAL')
Set the log level by value or name.
--CollectApp.logfile=<Unicode>
Default: '.nbgrader.log'
Name of the logfile to log to.
--CollectApp.notebook_id=<Unicode>
Default: '*'
File glob to match notebook names, excluding the '.ipynb' extension. This
can be changed to filter by notebook.
--CollectApp.release_directory=<Unicode>
Default: 'release'
The name of the directory that contains the version of the assignment that
will be released to students. This corresponds to the `nbgrader_step`
variable in the `directory_structure` config option.
--CollectApp.source_directory=<Unicode>
Default: 'source'
The name of the directory that contains the master/instructor version of
assignments. This corresponds to the `nbgrader_step` variable in the
`directory_structure` config option.
--CollectApp.student_id=<Unicode>
Default: '*'
File glob to match student IDs. This can be changed to filter by student.
Note: this is always changed to '.' when running `nbgrader assign`, as the
assign step doesn't have any student ID associated with it.
--CollectApp.submitted_directory=<Unicode>
Default: 'submitted'
The name of the directory that contains assignments that have been submitted
by students for grading. This corresponds to the `nbgrader_step` variable in
the `directory_structure` config option.
--CollectApp.timestamp_format=<Unicode>
Default: '%Y-%m-%d %H:%M:%S %Z'
Format string for timestamps
--CollectApp.timezone=<Unicode>
Default: 'UTC'
Timezone for recording timestamps
--CollectApp.update=<Bool>
Default: False
Update existing submissions with ones that have newer timestamps.
NbGrader options
----------------
--NbGrader.answer_yes=<Bool>
Default: False
Answer yes to any prompts.
--NbGrader.assignment_id=<Unicode>
Default: ''
The assignment name. This MUST be specified, either by setting the config
option, passing an argument on the command line, or using the --assignment
option on the command line.
--NbGrader.autograded_directory=<Unicode>
Default: 'autograded'
The name of the directory that contains assignment submissions after they
have been autograded. This corresponds to the `nbgrader_step` variable in
the `directory_structure` config option.
--NbGrader.config_file=<Unicode>
Default: ''
Full path of a config file.
--NbGrader.config_file_name=<Unicode>
Default: ''
Specify a config file to load.
--NbGrader.course_directory=<Unicode>
Default: ''
The root directory for the course files (that includes the `source`,
`release`, `submitted`, `autograded`, etc. directories). Defaults to the
current working directory.
--NbGrader.course_id=<Unicode>
Default: ''
A key that is unique per instructor and course. This MUST be specified,
either by setting the config option, or using the --course option on the
command line.
--NbGrader.db_assignments=<List>
Default: []
A list of assignments that will be created in the database. Each item in the
list should be a dictionary with the following keys:
- name
- duedate (optional)
The values will be stored in the database. Please see the API documentation
on the `Assignment` database model for details on these fields.
--NbGrader.db_students=<List>
Default: []
A list of student that will be created in the database. Each item in the
list should be a dictionary with the following keys:
- id
- first_name (optional)
- last_name (optional)
- email (optional)
The values will be stored in the database. Please see the API documentation
on the `Student` database model for details on these fields.
--NbGrader.db_url=<Unicode>
Default: ''
URL to the database. Defaults to sqlite:///<course_directory>/gradebook.db,
where <course_directory> is another configurable variable.
--NbGrader.directory_structure=<Unicode>
Default: '{nbgrader_step}/{student_id}/{assignment_id}'
Format string for the directory structure that nbgrader works over during
the grading process. This MUST contain named keys for 'nbgrader_step',
'student_id', and 'assignment_id'. It SHOULD NOT contain a key for
'notebook_id', as this will be automatically joined with the rest of the
path.
--NbGrader.feedback_directory=<Unicode>
Default: 'feedback'
The name of the directory that contains assignment feedback after grading
has been completed. This corresponds to the `nbgrader_step` variable in the
`directory_structure` config option.
--NbGrader.generate_config=<Bool>
Default: False
Generate default config file.
--NbGrader.ignore=<List>
Default: ['.ipynb_checkpoints', '*.pyc', '__pycache__']
List of file names or file globs to be ignored when copying directories.
--NbGrader.log_datefmt=<Unicode>
Default: '%Y-%m-%d %H:%M:%S'
The date format used by logging formatters for %(asctime)s
--NbGrader.log_format=<Unicode>
Default: '[%(name)s]%(highlevel)s %(message)s'
The Logging format template
--NbGrader.log_level=<Enum>
Default: 30
Choices: (0, 10, 20, 30, 40, 50, 'DEBUG', 'INFO', 'WARN', 'ERROR', 'CRITICAL')
Set the log level by value or name.
--NbGrader.logfile=<Unicode>
Default: '.nbgrader.log'
Name of the logfile to log to.
--NbGrader.notebook_id=<Unicode>
Default: '*'
File glob to match notebook names, excluding the '.ipynb' extension. This
can be changed to filter by notebook.
--NbGrader.release_directory=<Unicode>
Default: 'release'
The name of the directory that contains the version of the assignment that
will be released to students. This corresponds to the `nbgrader_step`
variable in the `directory_structure` config option.
--NbGrader.source_directory=<Unicode>
Default: 'source'
The name of the directory that contains the master/instructor version of
assignments. This corresponds to the `nbgrader_step` variable in the
`directory_structure` config option.
--NbGrader.student_id=<Unicode>
Default: '*'
File glob to match student IDs. This can be changed to filter by student.
Note: this is always changed to '.' when running `nbgrader assign`, as the
assign step doesn't have any student ID associated with it.
--NbGrader.submitted_directory=<Unicode>
Default: 'submitted'
The name of the directory that contains assignments that have been submitted
by students for grading. This corresponds to the `nbgrader_step` variable in
the `directory_structure` config option.
Examples
--------
Collect assignments students have submitted. For the usage of instructors.
This command is run from the top-level nbgrader folder. Before running
this command, you may want toset the unique `course_id` for the course.
It must be unique for each instructor/course combination. To set it in
the config file add a line to the `nbgrader_config.py` file:
c.NbGrader.course_id = 'phys101'
To pass the `course_id` at the command line, add `--course=phys101` to any
of the below commands.
To collect `assignment1` for all students:
nbgrader collect assignment1
To collect `assignment1` for only `student1`:
nbgrader collect --student=student1 assignment1
Collected assignments will go into the `submitted` folder with the proper
directory structure to start grading. All submissions are timestamped and
students can turn an assignment in multiple times. The `collect` command
will always get the most recent submission from each student, but it will
never overwrite an existing submission unless you provide the `--update`
flag:
nbgrader collect --update assignment1