I have the following problem which uses the attached macro, parserLewisStructureTool.pl. Since the upgrade to 2.20, this is not working. I did not write the macro and the person that did, isn't able to help at the moment. Can someone help me figure out what caused it to stop working and how it might be fixed?
chemistry lewis structure drawing problem broken since 2.20 upgrade
by Stephanie Bryan -
Number of replies: 4
In reply to Stephanie Bryan
chemistry lewis structure drawing problem broken since 2.20 upgrade
by Stephanie Bryan -
I am curious if anyone has had a chance to look at this. Given the error that shows up, the problem seems to be in how the JSON.pm module is accessed.
Thanks!
In reply to Stephanie Bryan
chemistry lewis structure drawing problem broken since 2.20 upgrade
by Glenn Rice -
That macro will have a problem with PG 2.20. The JSON module is no longer used by webwork or PG. Instead the Mojo::JSON module is used. So the parserLewisStructureTool.pl macro will need to have line 281 deleted. That is the line that reads
my $json = JSON->new->allow_nonref;
. Then the lines that call $json->decode
need to be changed to call Mojo:JSON::decode_json
instead.
In reply to Glenn Rice
chemistry lewis structure drawing problem broken since 2.20 upgrade
by Stephanie Bryan -
Thanks so much Glenn! This worked. I really appreciate it.
I used a double colon after Mojo for anyone reading but followed these directions otherwise exactly.
In reply to Stephanie Bryan
chemistry lewis structure drawing problem broken since 2.20 upgrade
by Glenn Rice -
Yes, that should have been
Mojo::JSON::decode_json
. That was a mistake.