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

Add --no-metadata option to nbgrader assign #407

Merged
merged 1 commit into from
Sep 1, 2015

Conversation

jhamrick
Copy link
Member

@jhamrick jhamrick commented Sep 1, 2015

Fixes #403

This allows you to run nbgrader assign --no-metadata and it will not perform any metadata validation or modify it either. Can be used in conjunction with --no-db to just replace solution regions and not use the "Create Assignment" toolbar or save anything into the database.

cc @jklymak

@jhamrick jhamrick added this to the 0.3.0 milestone Sep 1, 2015
@jklymak
Copy link

jklymak commented Sep 1, 2015

Cool, thanks! That seems useful.

To recap for those who didn't follow #403 this means you can just use ### BEGIN SOLUTION and ### END SOLUTION in your cells and nbgrader will just strip those regions. Lightweight use of nbgrader for sure, but useful for manually graded problem sets.

@jklymak
Copy link

jklymak commented Sep 1, 2015

... well kind of cool.

I can't install flit, so I can't install the development version of nbgrader. Probably because I still use python2.7? So I can't test this.

@jhamrick
Copy link
Member Author

jhamrick commented Sep 1, 2015

Oh, bleh, yeah, because flit is python 3 only. I should create an installation script or something that makes this a bit more friendly to do a development install. In the meantime, you can do:

pip install flit-install-py2
flit-install-py2 --symlink

and hopefully that should work (that's how I do the installation on travis). I'll make another PR now that reduces the complexity of this installation, sorry again about that!

@jklymak
Copy link

jklymak commented Sep 1, 2015

Hmmm, same error:

valdez:nbgrader jklymak$ pip install -e ./
Obtaining file:///Users/jklymak/Downloads/nbgrader
    Complete output from command python setup.py egg_info:
    /Users/jklymak/anaconda/bin/python: No module named flit
    Warning: this setup.py uses flit, not setuptools.
    Behavior may not be exactly what you expect. Use at your own risk!
    /Users/jklymak/anaconda/bin/python -m flit install --deps production
    Traceback (most recent call last):
      File "<string>", line 20, in <module>
      File "/Users/jklymak/Downloads/nbgrader/setup.py", line 9, in <module>
        sp.check_call(cmd)
      File "/Users/jklymak/anaconda/lib/python2.7/subprocess.py", line 540, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['/Users/jklymak/anaconda/bin/python', '-m', 'flit', 'install', '--deps', 'production']' returned non-zero exit status 1

@jklymak
Copy link

jklymak commented Sep 1, 2015

... also I'm not sure how this works for markdown cells (which I also expect answers in). ### BEGIN SOLUTION renders as heading 3 in markdown. Even if it is properly stripped by nbgrader assign it is inelegant in the "key".

I guess I'm fine w/ using the meta data and just ignoring the warning about not naming the cells (or in my case, removing that check from the main.js source code).

@jklymak
Copy link

jklymak commented Sep 1, 2015

OK, downloaded the individual files that you changed, at it works fine for me. I can still use the cell metadata to specify read-only or manual-grading, which I like. ### BEGIN SOLUTION also works in both code and markdown cells. So, I think this is a decent solution for my needs. Thanks a lot!

@jhamrick
Copy link
Member Author

jhamrick commented Sep 1, 2015

@jklymak yeah, unfortunately python comment markers are the same as headings in markdown :-/ I could change it so that you don't need to include the comment mark in the markdown cells, but I'm worried that's going to make things too complicated.

One option would be to configure the ClearSolutions preprocessor so that it uses multiline strings instead of comments:

c.ClearSolutions.comment_mark = '"""'
c.ClearSolutions.begin_solution_delimeter = 'BEGIN SOLUTION"""'
c.ClearSolutions.end_solution_delimeter = 'END SOLUTION"""'

and then in your cells (both code and markdown) you would use """BEGIN SOLUTION""" and """END SOLUTION""" rather than ### BEGIN SOLUTION and ### END SOLUTION.

jhamrick added a commit that referenced this pull request Sep 1, 2015
Add --no-metadata option to nbgrader assign
@jhamrick jhamrick merged commit 008b5c3 into jupyter:master Sep 1, 2015
@jhamrick jhamrick deleted the enforce-metadata branch September 1, 2015 23:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants