iblai / jupyter-edx-grader-xblock

Grade Jupyter Notebooks in Open edX
https://ibleducation.com/gw-and-ibl-release-an-open-edx-xblock-to-add-graded-problems-based-on-jupyter-notebooks/
BSD 3-Clause "New" or "Revised" License
45 stars 20 forks source link

Error stack trace for student: raise KeyError(key) KeyError: 'cell' [FeedbackApp | ERROR] #9

Open AndreyLykhoman opened 5 years ago

AndreyLykhoman commented 5 years ago

I installed this xblock to the EDX Hawthorn by the instruction of this repo (Installation and Setup part). When I tested this I had the next stack trace in the browser (the same output in the log files)

[FeedbackApp | INFO] Converting notebook /home/nbgrader/course/autograded/staff/ps1/1st Demo Assignment.ipynb [FeedbackApp | ERROR] There was an error processing assignment: /home/nbgrader/course/autograded/staff/ps1 [FeedbackApp | ERROR] Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/nbgrader/converters/base.py", line 293, in convert_notebooks self.convert_single_notebook(notebook_filename) File "/usr/local/lib/python3.7/site-packages/nbgrader/converters/base.py", line 249, in convert_single_notebook output, resources = self.exporter.from_filename(notebook_filename, resources=resources) File "/usr/local/lib/python3.7/site-packages/nbconvert/exporters/exporter.py", line 179, in from_filename return self.from_file(f, resources=resources, **kw) File "/usr/local/lib/python3.7/site-packages/nbconvert/exporters/exporter.py", line 197, in from_file return self.from_notebook_node(nbformat.read(file_stream, as_version=4), resources=resources, **kw) File "/usr/local/lib/python3.7/site-packages/nbconvert/exporters/html.py", line 90, in from_notebook_node return super(HTMLExporter, self).from_notebook_node(nb, resources, **kw) File "/usr/local/lib/python3.7/site-packages/nbconvert/exporters/templateexporter.py", line 314, in from_notebook_node output = self.template.render(nb=nb_copy, resources=resources) File "/usr/local/lib/python3.7/site-packages/jinja2/asyncsupport.py", line 76, in render return original_render(self, *args, **kwargs) File "/usr/local/lib/python3.7/site-packages/jinja2/environment.py", line 1008, in render return self.environment.handle_exception(exc_info, True) File "/usr/local/lib/python3.7/site-packages/jinja2/environment.py", line 780, in handle_exception reraise(exc_type, exc_value, tb) File "/usr/local/lib/python3.7/site-packages/jinja2/_compat.py", line 37, in reraise raise value.with_traceback(tb) File "/usr/local/lib/python3.7/site-packages/nbgrader/server_extensions/formgrader/templates/feedback.tpl", line 188, in top-level template code Comments: {{ cell.metadata.nbgrader.comment | markdown2html | strip_files_prefix }} File "/usr/local/lib/python3.7/site-packages/nbconvert/exporters/../templates/html/basic.tpl", line 1, in top-level template code {%- extends 'display_priority.tpl' -%} File "/usr/local/lib/python3.7/site-packages/nbconvert/exporters/../templates/skeleton/display_priority.tpl", line 1, in top-level template code {%- extends 'null.tpl' -%} File "/usr/local/lib/python3.7/site-packages/nbconvert/exporters/../templates/skeleton/null.tpl", line 26, in top-level template code {%- block body -%} File "/usr/local/lib/python3.7/site-packages/nbgrader/server_extensions/formgrader/templates/feedback.tpl", line 142, in block "body" {{ super() }} File "/usr/local/lib/python3.7/site-packages/nbconvert/exporters/../templates/skeleton/null.tpl", line 28, in block "body" {%- block any_cell scoped -%} File "/usr/local/lib/python3.7/site-packages/nbconvert/exporters/../templates/skeleton/null.tpl", line 31, in block "any_cell" {%- block codecell scoped -%} File "/usr/local/lib/python3.7/site-packages/nbconvert/exporters/../templates/html/basic.tpl", line 6, in block "codecell" {{ super() }} File "/usr/local/lib/python3.7/site-packages/nbconvert/exporters/../templates/skeleton/null.tpl", line 33, in block "codecell" {%- block input_group -%} File "/usr/local/lib/python3.7/site-packages/nbconvert/exporters/../templates/html/basic.tpl", line 12, in block "input_group" {{ super() }} File "/usr/local/lib/python3.7/site-packages/nbconvert/exporters/../templates/skeleton/null.tpl", line 37, in block "input_group" {%- block input -%}{%- endblock input -%} File "/usr/local/lib/python3.7/site-packages/nbgrader/server_extensions/formgrader/templates/feedback.tpl", line 231, in block "input" {{ nbgrader_footer(cell) }} File "/usr/local/lib/python3.7/site-packages/jinja2/runtime.py", line 579, in _invoke rv = self._func(*arguments) File "/usr/local/lib/python3.7/site-packages/nbgrader/server_extensions/formgrader/templates/feedback.tpl", line 188, in template Comments: {{ cell.metadata.nbgrader.comment | markdown2html | strip_files_prefix }} File "/usr/local/lib/python3.7/site-packages/nbconvert/exporters/html.py", line 74, in markdown2html cell = context['cell'] File "/usr/local/lib/python3.7/site-packages/jinja2/runtime.py", line 305, in getitem raise KeyError(key) KeyError: 'cell' [FeedbackApp | ERROR] There was an error processing assignment 'ps1' for student 'staff' [FeedbackApp | ERROR] Please see the error log (.nbgrader.log) for details on the specific errors on the above failures.

Step to reproduce: 1) Create two tasks in Instructor Workflow 2) Implement one of these tasks in Student Workflow and send for checking 3) The second block has the line like this: raise NotImplementedError(). With this line I can see the error stack trace error_stack_trace

If we replace this line raise NotImplementedError() to pass for example, everything works fine.

And another one: If student makes errors in code, xblock calculates wrong.