Chemistry extension

18 views
Skip to first unread message

David Wishart

unread,
Jun 9, 2021, 9:27:23 AM6/9/21
to Numbas Users
I've started using the chemistry extension and think I've found a bug (see attached screenshot). I'm sometimes getting a error evaluating variable message when I try to read a chemical symbol. So far I have only seen this for Arsenic and Indium but I haven't tested all possibilities.
error.png


Christian Lawson-Perfect

unread,
Jun 9, 2021, 9:33:45 AM6/9/21
to numbas...@googlegroups.com
Hi David,
Why are you making expression objects?
The error is because the word "in" is reserved in JME - it's an operator. You get the same for Arsenic, with symbol "As", which is also an operator in JME. If you don't put expression() around the symbol, then there's no error.
I've found your question, and it seems that the parts where you ask the student to enter a symbol are mathematical expression parts. Chemical symbols are not mathematical expressions. I think a "match text pattern" part would be more appropriate.

On Wed, 9 Jun 2021 at 14:27, David Wishart <d.wi...@tees.ac.uk> wrote:
I've started using the chemistry extension and think I've found a bug (see attached screenshot). I'm sometimes getting a error evaluating variable message when I try to read a chemical symbol. So far I have only seen this for Arsenic and Indium but I haven't tested all possibilities.
error.png


--
You received this message because you are subscribed to the Google Groups "Numbas Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to numbas-users...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/numbas-users/d3deda72-c893-44f9-97bc-83dd042f072dn%40googlegroups.com.

David Wishart

unread,
Jun 9, 2021, 9:48:12 AM6/9/21
to Numbas Users
Hello Christian,
Thank-you for your (as always) quick answer.

Short answer
That works now thank-you.

Long answer
I had the answer check as an expression as otherwise it would only answer correctly if I entered in quotes i.e. "Co" for Cobalt instead of Co. I had initially tried to use match text pattern but couldn't get it to make sense (I have now). Using exact match instead of regex got it working for me, I'm happy being strict with this question.
Reply all
Reply to author
Forward
0 new messages