Hi everyone, I'm testing a question with a Python programming part. In this question students should write a piece of code to graph a simple equation. To prepare the question in the preamble I import matplotlib.pyplot as plt and numpy as np. I insert other code stuff needed for the drawing too. The question works pretty well if it's standalone, but when it's inside an Exam the problem appears.
Traceback (most recent call last):
File "/lib/python3.10/asyncio/futures.py", line 201, in result
raise self._exception
File "/lib/python3.10/asyncio/tasks.py", line 232, in __step
result = coro.send(None)
File "/lib/python3.10/site-packages/_pyodide/_base.py", line 506, in eval_code_async
await CodeRunner(
File "/lib/python3.10/site-packages/_pyodide/_base.py", line 357, in run_async
coroutine = eval(self.code, globals, locals)
File "", line 1, in
NameError: name 'plt' is not defined
PD:
In the same question other programming part works as expected, both as standalone and in Exam. This is the preamble for this question
import numpy as np
from scipy.optimize import fsolve
Any help would be appreciated.
Thank you in advance