WeBWorK Problems

Problem Authoring - setting up shop - help

Problem Authoring - setting up shop - help

by Paul Hermans -
Number of replies: 5
Hi,
I am brand new to WebWork, and planning on creating a bunch of problems.
i have read the various tutorials etc, but could use guidance on a few other things related to this:

1) While I can edit my .pl file online, it is "awkward" to do so. Is there a better setup so that I can use a proper IDE and maybe even debug?

2) Is it realistic to use an FTP client to upload file(s) to webwork server to create problems, or do I have to "upload" them using the webpage?

3) How do I debug a problem instead of using Trial/Error method?


Thanks for any tips you can provide.

Paul
In reply to Paul Hermans

Re: Problem Authoring - setting up shop - help

by Alex Jordan -
For 1) and 2), are you working on your own institution's WeBWorK server? If so, and if you have permissions to access it server side, then there are options. But if you are using say the MAA hosting service, I'm not sure what more you can do.

For 3), I have a few answers, but not much time at the moment. I'll try to return for that.
In reply to Alex Jordan

Re: Problem Authoring - setting up shop - help

by Paul Hermans -
Thanks Alex,

For 1 and 2 I am working on my institution's WebWork server.....don't currently have access directly, but can probably get it ( just have to tell IT what I need).

No rush, I appreciate the help!

Paul
In reply to Paul Hermans

Re: Problem Authoring - setting up shop - help

by Alex Jordan -
OK, then for 1) and 2) you need IT to give you an account where you can log in to the server using FTP that has access to /opt/webwork/courses/name-of-your-course/. If you are at all nervous about having that access and accidentally mucking something up, having access only to /opt/webwork/courses/name-of-your-course/templates/ would be a little safer.

This only solves the problem for one course. Next term, your IT people may not want to do it all again. So maybe get access to /opt/webwork/courses/ or more, depending on what you and everyone else using the server is comfortable with.

This doesn't fully answer 1), since you asked about an IDE. In your situation, I would probably have a browser open to edit problem files, and ssh into the server side to be editing the macro library as I experimented.
In reply to Paul Hermans

Re: Problem Authoring - setting up shop - help

by Alex Jordan -
For debugging, my answer depends at what stage you want to debug. If you want to see what your Perl code is doing, you can insert things like TEXT($variable) or TEXT(@array) to see their values print to screen.

Always keep a lookout for entering an infinite loop (which will time out after 30 seconds or so.)

For debugging custom answer checkers, there are other things to do. But I won't get into that unless that is what you are doing.
In reply to Alex Jordan

Re: Problem Authoring - setting up shop - help

by Michael Gage -
Also useful are

DEBUG_MESSAGE(" ");

which prints out the message below the problem.

For macro files which will be used in lots of places you can use

WARN_MESSAGE(" "); which is just the same as the debug message but suggests that the message should stay in place permanently to guard against bad input or other unexpected states.

The perl command "warn" also works but is somewhat deprecated since it has perl behavior unmodified by PG. It can be useful when there are syntax errors because syntax errors currently disrupt the DEBUG_MESSAGE system.

For 1 and 2 you can checkout the standaloneProblemRender --

Definitely SAR at the moment, but perhaps you can help with that. :-)

Slightly closer to being ready for prime time is sendXMLRPC.pl in webwork2/clients/


With a little more work these two scripts can be somewhat disentangled from the webwork2 code and permit one to install the pg code and the editor and edit files locally.

One last trick is the "it's all text" add-on which you can use with firefox. it allows you to edit textarea text in the editor of your choice.