Closed larrywang0701 closed 7 months ago
Originally posted by @martin-henz in https://github.com/source-academy/frontend/issues/2419#issuecomment-1763694711
I've actually already triaged and lodged an issue in #1495, and it has more details on the bug.
@sayomaki : the two issues may be related but describe different symptoms: One is talking about blocks the other one about the REPL.
@sayomaki : the two issues may be related but describe different symptoms: One is talking about blocks the other one about the REPL.
They are actually related, in the sense that the context is not preserved (since Source Native runs the code in native javascript), and as such the imported variables seems to be lost when executing (more) code. I will take a look again at this issue and see if it is possible to come up with a fix.
https://github.com/source-academy/frontend/issues/2419
In Source 3 Native, the import executed in the prepend for an assessment can NOT keep in student's code. You have to re-import the functions again in student's code or use another constant to hold the imported value in the prepend.