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

Allow code stubs to be language specific #523

Merged
merged 6 commits into from
Aug 20, 2016

Conversation

jhamrick
Copy link
Member

Fixes #517

The idea here is that you can specify the code stubs and solution region delimeters for the ClearSolutions preprocessor as a dictionary keyed by language, where the language should be the same as the language of the kernelspec in the notebook metadata. This way, nbgrader can flexibly handle assignments with notebooks that have different kernels. For example, the config file might look like:

c = get_config()
c.ClearSolutions.code_stub = {
    "python": "# YOUR CODE HERE\nraise NotImplementedError()",
    "javascript": "// YOUR CODE HERE\nthrow new Error();"
}
c.ClearSolutions.begin_solution_delimeter = {
    "python": "### BEGIN SOLUTION",
    "javascript": "// BEGIN SOLUTION"
}
c.ClearSolutions.end_solution_delimeter = {
    "python": "### END SOLUTION",
    "javascript": "// END SOLUTION"
}

@randy3k does this seem like it would satisfy what you were looking for?

@jhamrick jhamrick added this to the 0.4.0 milestone Jun 23, 2016
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.

1 participant