|Modifying the answer messages, depending on the answer.||topic started 1/16/2001; 3:20:08 PM
last post 1/18/2001; 9:07:05 AM
|Michael Gage - Re: Modifying the answer messages, depending on the answer.
1/18/2001; 9:07:05 AM (reads: 1573, responses: 0)
|Lot's of good questions here Don. Let me answer the last one first.|
The WeBWorK Newbie Guide which Tom Shemanske wrote while he was learning to use WeBWorK is really helpful tutorial. It is a great way to get started.
To learn a little more about perl my experience is that the Learning Perl book by Randal Schwartz and Tom Christiansen was really useful. It has been recently updated, so I think it will include any of the Perl 5 features that we use in WeBWorK. Even the original edition tells you more than enough to modify and write most problems.
Finally the canonical reference Programming Perl, by Larry Wall, Tom Christiansen & Jon Orwant is really well written and is an important reference if you are writing complicated new macros or making other modifications to WeBWorK.
Now for working with modifying the output of an answer evaluator. This is already slightly advanced and we don't yet have a very good tutorial on the subject. However here are some places to get started:
The example at http://webwork.math.rochester.edu/maa100, (log in as practice1) setMAAtutorial, problem 16 illustrates how you can check the contents of the answer hash and on the basis of that either pose a followup question, or repeat the original question. There is a link to the source code from the page.
There is also general information on the structure of an Answer hash object in the write/modify problems advanced section. While debugging the following construction can also be useful:
If $object contains some object, such as an answer hash, then placing
in the code section of a problem, will print out the contents of the object's data base. That way you don't have to guess what it contains -- you can check it for sure.