Forum archive 2000-2006

Zbigniew Fiedorowicz - Hacking WeBWorK 2.0?

Zbigniew Fiedorowicz - Hacking WeBWorK 2.0?

by Arnold Pizer -
Number of replies: 0
inactiveTopicHacking WeBWorK 2.0? topic started 3/1/2003; 2:13:12 PM
last post 3/4/2003; 12:19:19 PM
userZbigniew Fiedorowicz - Hacking WeBWorK 2.0?  blueArrow
3/1/2003; 2:13:12 PM (reads: 2725, responses: 13)
Will the sort of hacks I've been doing such as interfacing WeBWorK with
WIMS and Moodle continue to work (modulo minor tweaks)? Or will
this require major rethinking about how to do such things?



Zig

<| Post or View Comments |>


userMichael Gage - Re: Hacking WeBWorK 2.0?  blueArrow
3/1/2003; 3:53:16 PM (reads: 2950, responses: 0)
Hi Zig,

I'm very interested in the kind of interoperation you are pioneering with WIMS and moodle. I haven't yet had a chance to look at the details of your work, so I can't answer your question precisely. The core problem rendering facility is essentially the same for both WeBWorK 1.8 and 2. On the other hand the core processProblem8 script has been replaced in WeBWorK 2 by several scripts by a sequence of mod_perl modules which are called successively. This makes the code more flexible and easier to maintain (and probably faster) which is a plus for writing interoperation code, but to the extent that you have relied on internal workings of processProblem8, some modificiations your work might be required to work with the new scripts. Starting from scratch I would bet that co-operating with WeBWorK 2.0 will be easier and more straightforward than with WeBWorK 1.8.

If you are just using the problem rendering facilities of WeBWorK then I suggest looking at the XML interface described in http://webhost.math.rochester.edu/webworkdocs/discuss/msgReader$755. Even if some details of the syntax of this interface change, the core of the interface -- i.e. what information is required by the problem renderer and what information it returns -- is likely to remain pretty stable, so it's a good model to use when trying to build other applications that call the problem renderer.

-- Mike

<| Post or View Comments |>


userZbigniew Fiedorowicz - Re: Hacking WeBWorK 2.0?  blueArrow
3/1/2003; 5:37:26 PM (reads: 2941, responses: 0)
Mike,

Could you clarify whether "problem rendering" includes checking student answers for correctness? Je ne parle pas XML (at least not yet).

Zig

<| Post or View Comments |>


userZbigniew Fiedorowicz - Re: Hacking WeBWorK 2.0?  blueArrow
3/1/2003; 5:41:34 PM (reads: 2936, responses: 1)
Mike,



Another thought. What you seem to be describing here is an interface
on the individual problem level. Moodle doesn't have such a fine grained
interface. It has a coarser interface at a single problem set level.



Zig

<| Post or View Comments |>


userMichael Gage - Re: Hacking WeBWorK 2.0?  blueArrow
3/1/2003; 6:30:45 PM (reads: 2922, responses: 0)
Yes it does. It includes all of the processing of the problem itself and the answers. It does not include the logo's where the warnings are placed, the next previous buttons and so forth. (For that matter the answers are also returned separately of the rest of the HTML so the answers could be placed after the text, or ...) The problem library is rendered remotely via an XML-RPC call to a daemon which does nothing but render a problem. The tutorials on this site work the same way. This gives you two variations on how the result of the problem rendering can be presented.

Actually XML at the level I'm using it is pretty transparent. It's just a subroutine call with name value pairs. I use XML-RPC (XML remote procedure calls) just because it seems to be the lightest weight standard for communicating from one computer to another.

The construct user=gage&course=mth141 becomes

<member> <name>user</name> <value>gage</value> </member> <member> <name>course</name> <value>mth141</value> </member>

It is very verbose, but very regular and therefore easy to process. (And to design processors that interpret it.)

The one other trick used is to encode long passages containing HTML with the base64 encoding (originally used by e-mail I believe). This encodes any text into strings using only standard letters and numbers, so that nothing will be misinterpreted.

In the examples I referred to the render is actually sent the raw PG text of the problem along with the rest of the data that is needed to render the problem. This is not always necessary. In practice some of the data could be stored "next to" the problem renderer and accessed directly. Then for example you would only need to send the name of the problem to be rendered, not the entire PG code for the problem.

-- Mike

<| Post or View Comments |>


userMichael Gage - Re: Hacking WeBWorK 2.0?  blueArrow
3/1/2003; 6:40:36 PM (reads: 3172, responses: 0)
You are correct. I'm describing a single problem interface, not a set level interface. WeBWorK 1.8 does interoperate better at the set level. I think WeBWorK 2.0 is even more flexible in this regard. The third possibility to build another front end over the renderer that is designed specifically to interface with moodle or with WIMS (or with Blackboard, Angel or WeBCT for that matter).

Try this url to get directly to set 5 in my mt143 course. You will need to enter a login, but you never go through the intial pages which WeBWorK 1.8 requires you to pass through before you can get to a given set. http://webwork3.math.rochester.edu:11002/webwork/mth143/5

You can get to problem 4 in set 5 directly (module authentication) via http://webwork3.math.rochester.edu:11002/webwork/mth143/5/6

(Use login: practice1 and password practice1 )

-- Mike

<| Post or View Comments |>


userZbigniew Fiedorowicz - Re: Hacking WeBWorK 2.0?  blueArrow
3/3/2003; 8:34:49 AM (reads: 2937, responses: 0)
Hi Mike,



I understand that you have developed an interface with Frontier. Are
your students using it? Are they using it to the extent that they
never log in directly into WeBWorK itself?



I am contemplating using Moodle next quarter as the exclusive
interface to WeBWorK, with only instructors and TAs ever needing to
log into WeBWorK. [This would be just for my own course.]



Is anybody else using a frontend to WeBWorK? I recall that Bill
Wheeler was working on an interface with Zope.



Zig

<| Post or View Comments |>


userMichael Gage - Re: Hacking WeBWorK 2.0?  blueArrow
3/3/2003; 9:02:08 AM (reads: 2908, responses: 0)
Hi Zig,

I use the Frontier/Radio interface as an instructor and developer tool, since it presents a faster way for me to write and debug problems, without having to set up an entire course structure.

Its other main purpose has been to illustrate one way in which WeBWorK can interoperate with other systems.

The third use is to develop applications for this website such as the Problem Library and and the tutorials. A problem in the library can be inserted in a message such as this one by using the command {pgView("setMAAtutorial/hello.pg")}

Since Frontier is a moderate load server I have not used it in large courses. I have considered using it to develop training courses that could be easily set up for such events as the AMS-MAA mini-workshops, but I haven't found the time to do that yet.

I'll be very interested in hearing about your experiences melding moodle and WeBWorK together. Good luck with your project.

-- Mike

<| Post or View Comments |>


userZbigniew Fiedorowicz - Re: Hacking WeBWorK 2.0?  blueArrow
3/3/2003; 1:53:12 PM (reads: 2877, responses: 0)
Hi Mike,



I am responding to your message below, which you left in my Moodle forum.



I have a couple of comments. First of all the set level interface was
very simple to implement. It only took a few days work on my part.
The problem level interface would take a great deal more work. I
think it would require a nontrivial rewrite of some of the Moodle
code.



Secondly while I find Moodle to be much cleaner and more intuitive in
its student interface than commercial alternatives like WebCT, it
still has some catching up to do from the point of view of instructor
management facilities.



Moodle's developer, Martin Dougiamas, is currently completing his Ph.D.
degree and doesn't have any time to do further development until he
finishes in April. He promises to develop a major upgrade to Moodle
by the end of this year.



Zig




>Hi Zig,
>
>I've finally found some time to check this out. Moodle seems to have a very
>clean interface and the interface with WeBWorK at the set level seems to be
>pretty seamless.
>
>You seem to have a very nice way to add bulletin board and discussion facilities
>to WeBWorK ( or rather to add WeBWorK math problems to bulletin board and
>discussion facilities).
>
>I think it might be worth looking into the further possibility of making the two
>systems interoperate on a problem level -- then some of moodle's management
>facilities for instructors would be made available as well.
>
>-- Mike Gage

<| Post or View Comments |>


userZbigniew Fiedorowicz - Re: Hacking WeBWorK 2.0?  blueArrow
3/3/2003; 3:58:48 PM (reads: 2891, responses: 0)
Hi Mike,

I have a few followup questions on your interface between WeBWorK and Frontier.

1) Where is the random number seed for the problem stored?

2) Where is the information about number of correct/incorrect attempts stored? Who generates statistics for this data?

3) Where are student answers for the previous attempt stored?

Zig

<| Post or View Comments |>


userMichael Gage - Re: Hacking WeBWorK 2.0?  blueArrow
3/3/2003; 4:21:44 PM (reads: 2898, responses: 0)
Hi,

In the "proof of concept" version that I have been using, all of this information is stored in Frontier. (For the instructor/developer app, which is most developed, the correct/incorrect attempts aren't being saved -- although that would not be hard to change.)

Even the problem text itself is stored in Frontier in most examples.

The idea was to insure that I had isolated _all_ of the information needed by the problem renderer and was explicitly passing it to the application. One potential of this compartimentalizing is scalability. A single computer could run the front end of WeBWorK (or some other CMS) and farm out the cpu intensive problem rendering to other computers. If you want to add more students you simply add more cpu's in the background, but no new organization is needed. It remains to see whether this approach will be necessary or useful.

WeBWorK 2.0 also follows this idea to a large extent. The operations of authentication, authorization, database retrieval, problem rendering and templating of the final results are all separated from each other.

-- Mike

<| Post or View Comments |>


userZbigniew Fiedorowicz - Re: Hacking WeBWorK 2.0?  blueArrow
3/3/2003; 5:06:03 PM (reads: 2922, responses: 0)
Hi Mike,

I believe that Frontier is not specifically a class management system, but a more general web construction kit. Is that right?

The upside of this is that you have a lot more flexibility. The downside is that you have to put in quite a bit of work to get the standard class management facilities up and running.

Class management systems have these facilities built in but are much less flexible as to what sort of data they are expected to store. I don't see any provision for storing the kind of data WeBWorK needs within Moodle or WebCT. In Moodle, I think you would have to develop an entirely new kind of object, and have to write your own interface to the MySql or Postgres database.

As to spreading out WeBWorK activity over several servers, this can also be done at the problem set level, although obviously not as flexibly.

Zig

<| Post or View Comments |>


userArnold K. Pizer - Re: Hacking WeBWorK 2.0?  blueArrow
3/4/2003; 12:00:14 PM (reads: 2947, responses: 0)
Hi Zig,

Here are the answers to your questions:

1) Where is the random number seed for the problem stored?

2) Where is the information about number of correct/incorrect attempts stored? Who generates statistics for this data?

3) Where are student answers for the previous attempt stored?

All this information is stored in the webwork db (e.g. mth161_webwork_DB). Look at DBglue8.pl to see how this info is stored and retrieved. Student answers for a single problem are first compiled into a single string by processProblem8.pl, then encoded (to protect special characters) and stored by DBglue8.pl.

I'm not sure what you mean by statistics? If you mean what I think you do, the answer is profCourseData.pl and similar scripts.

Arnie

<| Post or View Comments |>


userZbigniew Fiedorowicz - Re: Hacking WeBWorK 2.0?  blueArrow
3/4/2003; 12:19:19 PM (reads: 2910, responses: 0)
Hi Arnie,

I know that. Mike and I were not discussing WeBWorK in its standalone mode. Rather I was asking Mike about where this data is stored when the problem rendering functions of WeBWorK are invoked directly from within Frontier.

Zig

<| Post or View Comments |>