## WeBWorK Main Forum

### IO.pm file discrepancies

by Joe Zhou -
Number of replies: 5
Hi, I work with Prof. Joel Trussell on developing WeBWorK questions at NCSU. We encountered the problem of discrepancies in IO.pm for asksage (asking for success attribute in $decoded, yet$success does not in fact exist).

In a previous forum question, Mike has addressed the problem by defining $success. (find the correspondents here http://webwork.maa.org/moodle/mod/forum/discuss.php?d=4251). I have two questions: Firstly, is there a permanent fix to this problem yet? Secondly, the bug has impacted a course that is using WeBWork at ECE department of our school. We would like to update our IO.pm file with the suggested fix. However, IO.pm file is not within access of us in the ECE department as the WeBWorK server is managed by the Math department. My question is, is there any way that we could use a local copy of the IO.pm file? Note that this is a bit different from the ".pl" file, which can be included in the Template/marcros folder. However, for the IO.pm, first I could not directly include ".pm" file like ".pl" files. Then I also tried to rename IO.pm to IO.pl, the question get stuck during loading at PGloadfiles.pm. Our question is, is there a way to overwrite the IO.pm file using our customized version without tempering the ones in the in the WeBWorK server file system (hence without going to the command line interface and obtaining sudo right for the WeBWorK server). Thanks. Joe In reply to Joe Zhou ### Re: IO.pm file discrepancies by Michael Gage - If this is the same bug as the one defined in the discussion 4251 then I'm afraid that it has been over looked and not been fixed. (The hazards of putting in a temporary fix.) I'll try to take a look at it soon. To determine whether it's the same bug it might work to turn the debug flag on and compare your output with the one in the discussion. $sageReply = AskSage($SageCode,{accepted_tos=>true,debug=>'1',seed=>$problemSeed});

I'm not sure if this is going to help you very much unless you can get access to the server. You can install local .pl files, but on purpose the .pm files require server access since they also have direct access to the server disk.

I'll let you know what I come up with in terms of a fix. It should only affect the pg/WeBWorK/PG/IO.pm module.

-- Mike

### Re: IO.pm file discrepancies

by Michael Gage -
The comment above is not accurate.

The hacks that fix the issues discussed in the "askSage Problem" thread 4251 have been included in release PG-2.15.

They are in commit 89f700467f3fb580c023bc5d28782a3765291a54 submitted in Sept 24 2017. So the fixes have been around for a while.

It would still be worthwhile to review this fix and make it more robust.

### Re: IO.pm file discrepancies

by Michael Gage -
Hi Joel,

I finally got some time to look at this briefly. I’ve hacked up Problem 2 in EC308 in order to get more precise information about
what sage is sending back.

It looks like Sage is sending back an error message because it can’t process the code that you sent it.

Does this code work if you enter it into sage cell or mathSage directly? in particular "traceback": ["\u001b[0;31mAttributeError\u001b[0m\u001b[0;31m:\u001b[0m 'module' object has no attribute 'matrix'\n"]}}

looks like an error message from sage not from WeBWorK

In any case this is error is not due to the changes to HTTP2 etc. which were solved in http://webwork.maa.org/moodle/mod/forum/discuss.php?d=4251#p13748 and as it turns out was already in PG-2.15. (and is probably in PG-2.14 as well)

Which version of PG are you using?

Take care,
Mike

Hi Joel,

I don’t think one is built right at the moment but it would be possible. But you would still need command line access to the server to install it.

I expect to have a fix for askSage (at least as good as what I had hacked together as described in that post) and I’ll put it up on demo.webwork.rochester.edu
but it might take a couple of more days— we’re in the throws of getting 2.15 out the door.

Here is another thing you can do which will give you a sage calculator but won’t connect it to the answer mechanisms:

Take care,

Mike

On Sep 27, 2019, at 1:11 PM, Joel Trussell <hjt@ncsu.edu> wrote:

Mike,

I uploaded some problems with the Sage calls to the UofR server
Problems 2-4 all fail with the same error that we get down here.

is there any other external computation system we could use besides Sage? I thought there was a possibility of getting a Python link at one time.

Thanks
Joel

On Thu, Sep 26, 2019 at 2:18 PM Joel Trussell <hjt@ncsu.edu> wrote:
Mike,

I sent this question to the forum and have response yet. It may relate to a problem hat you wrote about in 2017