Closed jeremydavis519 closed 1 month ago
Thanks for a good catch! There are a few approaches here, we could add \
to the parser or maybe just output slightly different Python? I am not even sure myself why the error is as it is, because both quotes should still be around the text? Maybe @jpelay can dive in?
I am not even sure myself why the error is as it is, because both quotes should still be around the text? The cause of this is that the error returns as unquoted text the first child of the
error_print_nq
node:
https://github.com/hedyorg/hedy/blob/211948b660d9cada93317bc0fe89f39e9639293d/hedy.py#L997-L999
In the case of this code snippet it returns the second word of the first text 'divided', if we change that line, the error message changes accordingly.
Nowadays the error indicates that there are missing quotes:
However, it seems a bit off that the error points the whole text including the already quoted parts. It would be nicer to only mention the unquoted parts, e.g. 5 \ 5. Also, the double backslash should be addressed.
Describe the bug Trying to use a backslash as an operator is, of course, a syntax error, but Hedy seems to get confused about where exactly the error is. This situation can arise if a student, having recently been given access to division, forgets which way the slash should be slanted.
In the example code below, Hedy gives an error starting like this:
That's fine so far, but the error becomes confusing in the next sentence:
The problem is that
divided
was part of the quoted text.Paste the Hedy code & level I tried this on level 6.
Add a screenshot (optional)
Expected behavior I expected the error to say that the backslash needed to be quoted, or perhaps all of
5 \ 5
.Ideally, though, Hedy would suggest using a forward slash instead, since that's probably what the student meant. I've seen some references to the Confusables package in other issues, and that might help in this case. Not sure, as I haven't looked into what that package does specifically.
What machine and browser you were using (optional) If the issue concerns things in the website, let us know: