-
Notifications
You must be signed in to change notification settings - Fork 327
added java, matlab, and octave codestubs to clearsolutions.py #870
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution! 🎉
I have just a few requests to match the code style of nbgrader and to keep the code stubs consistent across languages.
@@ -10,7 +10,7 @@ | |||
class ClearSolutions(NbGraderPreprocessor): | |||
|
|||
code_stub = Dict( | |||
dict(python="# YOUR CODE HERE\nraise NotImplementedError()"), | |||
dict(python="# YOUR CODE HERE\nraise NotImplementedError()",matlab="%YOUR CODE HERE",octave="%YOUR CODE HERE",java="//YOUR CODE HERE"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make the following changes:
- Add spaces between comment marks and the first character (e.g.
% YOUR CODE HERE
) - Add a second line to each stub to throw an error, as in the python code stub
- Please place each code stub on a different line, e.g.
dict(
python="# YOUR CODE HERE\nraise NotImplementedError()",
matlab="% YOUR CODE HERE\n% code that throws an error",
...
)
@jhamrick I've made an attempt to make the requested changes, but I'm having a heck of a time figuring out an elegant way to throw an exception in Processing, since it generally hides that from users for simplicity. The code stub may get a little bit complicated. Any advice on the best path forward here? |
I am not familiar with processing, so I'm not really sure. If there isn't a good option for throwing an error I'd say let's just leave it as only the comment. Generally looks great, but one nitpick: please remove the space after the newline, otherwise you'll end up with code that doesn't have consistent indentation like:
|
Done. Thank you! |
Thanks! |
@Alexanderallenbrown |
I haven't tackled that yet... part of the reason is that I don't use any autograded questions in my course. I am always having formgrader take me through each submission manually anyway, so it hasn't been a priority for the notebooks to gracefully pass all tests. I'd be happy to take a look though. |
Thanks @Alexanderallenbrown for a quick response. |
@sigurdurb I could be way off base here, but I'm wondering if this has to do with the "output type" that is assigned to Octave error when the octave kernel executes. I'm really not sure, but if you look here it appears that the validation system is looking for something that is explicitly called out as an error in the cell output. I'm poking around in the octave kernel, but I guess I don't know enough about what exactly the validator is looking for yet. I'll keep digging around. |
@Alexanderallenbrown Yes, that is one, but it first goes to this line, that gets called from here |
@sigurdurb yeah i bet we will have to elevate this upstream to the octave kernel to do it right. Happy to raise an issue... the octave kernel doesnt seem to have much to it, so we may be able to figure it out and submit a pull request there if someone in that circle doesnt have a quick solution. |
@sigurdurb It's been a while since I have touched Octave + nbgrader. I do remember getting it to work at some point but I also remember it being limited. I'll look over old code and see if I can replicate what I had. |
Hey, |
@sigurdurb sorry, haven't had a moment to dig into that yet. Sounds like you have a workable solution though? |
No description provided.