Just for your information there are more recent versions of wwassignment available (that work with moodle 1.8 and moodle 1.9 respectively). These don't require that WeBWorK and moodle share the same database since they communicate using webservices instead of via database lookup. This means that the new versions of the wwassignment are less sensitive to changes in the database structure as new versions are created.
for a description of wwassignment3 and wwassignment4 versions.
See also http://webwork.maa.org/wiki/Category:Moodle_Integration
for a description of a tighter link between Moodle and WeBWorK which embeds WeBWorK questions as a question type within the Moodle quiz activity.