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

Assignment not Generated from FormGrader #1605

Closed
Anmol23oct opened this issue Jun 20, 2022 · 3 comments · Fixed by #1607
Closed

Assignment not Generated from FormGrader #1605

Anmol23oct opened this issue Jun 20, 2022 · 3 comments · Fixed by #1607
Labels
Milestone

Comments

@Anmol23oct
Copy link

Operating system

Ubuntu 20.04 LTS

jupyterhub --version (if used with JupyterHub)

jupyter notebook --version - 3.8.10

Generate Assignment for students by clicking on Generate in FormGrader

Giving Error with Following Log Info and StackTrace:

LogInfo:

INFO] Updating/creating assignment 'Lab3': {}
[INFO] Converting notebook /common/home/as3593/CS439/source/./Lab3/solution__Lab_2_Working_with_Pandas.ipynb
[DEBUG] Student: .
[DEBUG] Assignment: Lab3
[DEBUG] Notebook: solution__Lab_2_Working_with_Pandas
[DEBUG] Applying preprocessor: IncludeHeaderFooter
[DEBUG] Applying preprocessor: LockCells
[DEBUG] Applying preprocessor: ClearSolutions
[ERROR] There was an error processing assignment: /common/home/as3593/CS439/source/./Lab3
[ERROR] Traceback (most recent call last):
File "/common/home/as3593/.local/lib/python3.9/site-packages/nbgrader/converters/base.py", line 390, in convert_notebooks
self.convert_single_notebook(notebook_filename)
File "/common/home/as3593/.local/lib/python3.9/site-packages/nbgrader/converters/base.py", line 344, in convert_single_notebook
output, resources = self.exporter.from_filename(notebook_filename, resources=resources)
File "/common/home/as3593/.local/lib/python3.9/site-packages/nbconvert/exporters/exporter.py", line 189, in from_filename
return self.from_file(f, resources=resources, **kw)
File "/common/home/as3593/.local/lib/python3.9/site-packages/nbconvert/exporters/exporter.py", line 206, in from_file
return self.from_notebook_node(
File "/common/home/as3593/.local/lib/python3.9/site-packages/nbconvert/exporters/notebook.py", line 35, in from_notebook_node
nb_copy, resources = super().from_notebook_node(nb, resources, **kw)
File "/common/home/as3593/.local/lib/python3.9/site-packages/nbconvert/exporters/exporter.py", line 146, in from_notebook_node
nb_copy, resources = self._preprocess(nb_copy, resources)
File "/common/home/as3593/.local/lib/python3.9/site-packages/nbconvert/exporters/exporter.py", line 335, in _preprocess
nbc, resc = preprocessor(nbc, resc)
File "/common/home/as3593/.local/lib/python3.9/site-packages/nbconvert/preprocessors/base.py", line 47, in call
return self.preprocess(nb, resources)
File "/common/home/as3593/.local/lib/python3.9/site-packages/nbgrader/preprocessors/clearsolutions.py", line 138, in preprocess
nb, resources = super(ClearSolutions, self).preprocess(nb, resources)
File "/common/home/as3593/.local/lib/python3.9/site-packages/nbconvert/preprocessors/base.py", line 69, in preprocess
nb.cells[index], resources = self.preprocess_cell(cell, resources, index)
File "/common/home/as3593/.local/lib/python3.9/site-packages/nbgrader/preprocessors/clearsolutions.py", line 150, in preprocess_cell
replaced_solution = self._replace_solution_region(cell, language)
File "/common/home/as3593/.local/lib/python3.9/site-packages/nbgrader/preprocessors/clearsolutions.py", line 123, in _replace_solution_region
raise RuntimeError("no end solution statement found")
RuntimeError: no end solution statement found

[ERROR] There was an error processing assignment 'Lab3' for student '.'
[ERROR] Please see the the above traceback for details on the specific errors on the above failures.

Stack Trace:

Traceback (most recent call last):
File "/common/home/as3593/.local/lib/python3.9/site-packages/nbgrader/utils.py", line 530, in capture_log
app.start()
File "/common/home/as3593/.local/lib/python3.9/site-packages/nbgrader/converters/generate_assignment.py", line 161, in start
super(GenerateAssignment, self).start()
File "/common/home/as3593/.local/lib/python3.9/site-packages/nbgrader/converters/base.py", line 132, in start
self.convert_notebooks()
File "/common/home/as3593/.local/lib/python3.9/site-packages/nbgrader/converters/base.py", line 468, in convert_notebooks
raise NbGraderException(msg)
nbgrader.converters.base.NbGraderException: Please see the the above traceback for details on the specific errors on the above failures.

Steps to reproduce the behavior

Click on generate in FormGrader
solution__Lab_2_Working_with_Pandas.ipynb.zip

@perllaghu
Copy link
Contributor

Try looking at the actual notebook.... I'd suggest the first cell under Activity 4.4 is syntactically incorrect.

@Anmol23oct
Copy link
Author

Thanks for your reply,
I've updated the file but still getting below stacktrace:

[INFO] Updating/creating assignment 'Lab4': {}
[INFO] Converting notebook /common/home/as3593/CS439/source/./Lab4/solution__Lab_2_Working_with_Pandas.ipynb
[DEBUG] Student: .
[DEBUG] Assignment: Lab4
[DEBUG] Notebook: solution__Lab_2_Working_with_Pandas
[DEBUG] Applying preprocessor: IncludeHeaderFooter
[DEBUG] Applying preprocessor: LockCells
[DEBUG] Applying preprocessor: ClearSolutions
[ERROR] There was an error processing assignment: /common/home/as3593/CS439/source/./Lab4
[ERROR] Traceback (most recent call last):
File "/common/home/as3593/.local/lib/python3.9/site-packages/nbgrader/converters/base.py", line 390, in convert_notebooks
self.convert_single_notebook(notebook_filename)
File "/common/home/as3593/.local/lib/python3.9/site-packages/nbgrader/converters/base.py", line 344, in convert_single_notebook
output, resources = self.exporter.from_filename(notebook_filename, resources=resources)
File "/common/home/as3593/.local/lib/python3.9/site-packages/nbconvert/exporters/exporter.py", line 189, in from_filename
return self.from_file(f, resources=resources, **kw)
File "/common/home/as3593/.local/lib/python3.9/site-packages/nbconvert/exporters/exporter.py", line 206, in from_file
return self.from_notebook_node(
File "/common/home/as3593/.local/lib/python3.9/site-packages/nbconvert/exporters/notebook.py", line 35, in from_notebook_node
nb_copy, resources = super().from_notebook_node(nb, resources, **kw)
File "/common/home/as3593/.local/lib/python3.9/site-packages/nbconvert/exporters/exporter.py", line 146, in from_notebook_node
nb_copy, resources = self._preprocess(nb_copy, resources)
File "/common/home/as3593/.local/lib/python3.9/site-packages/nbconvert/exporters/exporter.py", line 335, in _preprocess
nbc, resc = preprocessor(nbc, resc)
File "/common/home/as3593/.local/lib/python3.9/site-packages/nbconvert/preprocessors/base.py", line 47, in call
return self.preprocess(nb, resources)
File "/common/home/as3593/.local/lib/python3.9/site-packages/nbgrader/preprocessors/clearsolutions.py", line 138, in preprocess
nb, resources = super(ClearSolutions, self).preprocess(nb, resources)
File "/common/home/as3593/.local/lib/python3.9/site-packages/nbconvert/preprocessors/base.py", line 69, in preprocess
nb.cells[index], resources = self.preprocess_cell(cell, resources, index)
File "/common/home/as3593/.local/lib/python3.9/site-packages/nbgrader/preprocessors/clearsolutions.py", line 150, in preprocess_cell
replaced_solution = self._replace_solution_region(cell, language)
File "/common/home/as3593/.local/lib/python3.9/site-packages/nbgrader/preprocessors/clearsolutions.py", line 123, in _replace_solution_region
raise RuntimeError("no end solution statement found")
RuntimeError: no end solution statement found

[ERROR] There was an error processing assignment 'Lab4' for student '.'
[ERROR] Please see the the above traceback for details on the specific errors on the above failures.

Traceback (most recent call last):
File "/common/home/as3593/.local/lib/python3.9/site-packages/nbgrader/utils.py", line 530, in capture_log
app.start()
File "/common/home/as3593/.local/lib/python3.9/site-packages/nbgrader/converters/generate_assignment.py", line 161, in start
super(GenerateAssignment, self).start()
File "/common/home/as3593/.local/lib/python3.9/site-packages/nbgrader/converters/base.py", line 132, in start
self.convert_notebooks()
File "/common/home/as3593/.local/lib/python3.9/site-packages/nbgrader/converters/base.py", line 468, in convert_notebooks
raise NbGraderException(msg)
nbgrader.converters.base.NbGraderException: Please see the the above traceback for details on the specific errors on the above [failures.``

@jhamrick
Copy link
Member

The issue is the instructions cell which has the text Please execute the cells (SHIFT-ENTER) that are already completed and then your task is to fill in the code between ### BEGIN SOLUTION ### and ### END SOLUTION ###. nbgrader is detecting the BEGIN SOLUTION delimiter, and expects then to find END SOLUTION on a separate line, which it doesn't. Also, students won't see the BEGIN SOLUTION and END SOLUTION lines because they get removed by nbgrader, so the instructions aren't quite right. If you just replace the above text with something like Please execute the cells (SHIFT-ENTER) that are already completed and then your task is to fill in the code whenever you see # YOUR SOLUTION HERE then it should work.

It would be helpful to display the cell contents in the error message so it's a bit more informative, though. I'll make a PR to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants