-
Notifications
You must be signed in to change notification settings - Fork 68
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
Update Otter Assign to disallow metadata tests for colab notebooks #901
Comments
This is WAI. In order to read tests from the notebook metadata, Otter needs to read the notebook file; it's not possible (AFAIK) to access the notebook metadata otherwise. Colab does not store the notebook in the file system, so there's no way for Otter to read the notebook metadata. It would be a good idea to update Otter Assign to enforce this by disallowing a notebook with |
@chrispyles Thanks for the quick reply. Could you please clarify the following:
I could not find relevant information on the documentation. Thanks in advance! |
I found a assignment configuration setting: Is there a way to solve this problem. Or using Colab is too much additional work that I'd better stick with Jupyter notebook locally? Thanks! |
Yes, the setting
Because of the limitation of not being able to access the notebook file, there are several features that aren't available on Colab, including generating a submission zip with |
@chrispyles Thank you! |
Tried to create an assignment so students can use it on Colab. Added runs_on: colab in configuration. Used Otter assign to generate the student file. After Otter grader is installed, executed
import otter
grader = otter.Notebook()
and got this error:
/usr/local/lib/python3.10/dist-packages/otter/check/notebook.py in init(self, nb_path, tests_dir, tests_url_prefix)
105
106 if self.interpreter is IPythonInterpreter.COLAB and not os.path.isdir(tests_dir):
--> 107 raise ValueError(f"Tests directory {tests_dir} does not exist")
108
109 cls = type(self)
ValueError: Tests directory ./tests does not exist
I tried to add the file name as this: grader = otter.Notebook('Week_3_Coding_Exercise.ipynb') and got the same error.
It is easy to reproduce the issue. It throws the same error every time the code cell is executed
I expect this works without the tests directory since the test cases are in the meta data of the notebook.
Versions
Python: 3.10.12
otter: 6.0.4
Additional context
I read the posts about colab and still don't know how to solve the problem.
The text was updated successfully, but these errors were encountered: