Also, be forewarned, this module has gone through neither extensive testing nor heavy usage yet. It is my belief that it should work as intended, but I can make no guarantee.
If you have any comments or questions, please feel free to ask!
a couple of notes:
1. due to some of the SQL syntax used, the pre-requisites list should specify that if using mysql, it should be version 4.1+ which allows the field in (select field2) syntax
2. line 276 of lib/DB/Schema/Moodle/Permission.pm which currently reads:
my $qry = "SELECT COUNT(*) FROM `$table` JOIN `$userTable` ON $table.userid=$userTable.id WHERE username=?";
should be changed to:
my $qry = "SELECT COUNT(*) FROM `$table` JOIN `$userTable` ON $table.id=$userTable.userid WHERE username=?;
(hard to see, but the fieldnames id and userid need to be switched)
2. Ahh, took me a moment to see that (It's actually line 257

I just updated the website with a new version (beta-2) that addresses these issues.
Thanks in advance,
Leonardo

Thanks for your work on this.
I am having problems with database creation of the wwmoodle tables. I am using Moodle 1.5+, Mysql 3.23 on RHLinux. Am I missing something here:
----------------------------------------------------------------------------------
wwmoodle
(mysql): DROP TABLE IF EXISTS `mdl_wwmoodle`
(mysql): CREATE TABLE `mdl_wwmoodle` ( `id` int(10) unsigned NOT NULL auto_increment, `name` varchar(255) NOT NULL, `allowedRecipients` text NOT NULL, `course` int(10) unsigned NOT NULL, `timemodified` int(10) unsigned NOT NULL, PRIMARY KEY (`id`), KEY (`course`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Information for courses using wwmoodle'
1064: You have an error in your SQL syntax near 'ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Information for courses using wwmood' at line 1
Error
(mysql): INSERT INTO `mdl_config` (`name`, `value`) VALUES ('wwmoodle_webwork_courses', '/opt/webwork2/courses/')
1062: Duplicate entry 'wwmoodle_webwork_courses' for key 2
Error
(mysql): SELECT COUNT(*) FROM mdl_message WHERE useridto = '2' AND timecreated > '0'
wwmoodle tables could NOT be set up successfully!
(mysql): SELECT * FROM mdl_user WHERE id = '2' AND username = 'guest' LIMIT 1
----------------------------------------------------------------------------------------------------------
I seem to be overlooking something. Thanks again.
Frank Parker
In mod/wwmoodle/db/mysql.sql change line 15 [) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Information for courses using wwmoodle';] to simply be ');' (sans ').
In turn, edit mod/wwmoodle_set/db/mysql.sql line 17 [) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Information for courses using wwmoodle_set';] to ');' (again, sans ').
Finally, you'll need to delete the configuration options created by these SQL scripts. Basically, this is the tuples in the 'mdl_config' table that have one of the following as the value of the 'name' column:
- wwmoodle_webwork_courses
- wwmoodle_set_webwork_url
- wwmoodle_set_iframe_width
- wwmoodle_set_iframe_height
DELETE FROM `mdl_config` WHERE `name`='wwmoodle_webwork_courses' OR `name`='wwmoodle_set_webwork_url' OR `name`='wwmoodle_set_iframe_width' OR `name`='wwmoodle_set_iframe_height';
The next release of wwmoodle will have these changes (and possibly others to make it function better with a wider range of databases). However, it won't be released until around the 14th (it's winter break, and I don't have access to everything I'd need to make a release

Also, sorry for the delay in responding, I was out of town until today, and had no 'net access

Peter, Thanks for your response. I am just getting back from the holiday as well. I updated to sql 4.1 before your reply and adjusted webworks. Here is the progress to date:
We made the corrections you suggested but a single error remained. To get the database to load correctly, we had to make a change to following file:
moodle/mod/wwmoodle_set/db/mysql.sql
And change the CREATE TABLE to below, by removing the unsigned on the set_id:
CREATE TABLE `prefix_wwmoodle_set` (
`id` int(10) unsigned NOT NULL auto_increment,
`name` varchar(255) NOT NULL,
`course` int(10) unsigned NOT NULL,
`set_id` text NOT NULL,
`grade_method` int(3) unsigned NOT NULL,
`timemodified` int(10) unsigned NOT NULL,
PRIMARY KEY (`id`),
KEY (`course`)
);
This could be the first mistake. Moodle did complete database creation and setup of the wwmoodle moodles.
The following errors appear when we created the course with the wrong Authen.pm:
Modifications to user information is not supported from WeBWorK. Please use Moodle to make any changes. at /opt/webwork2/lib/WeBWorK/DB.pm line 1031
addPassword: user global_user not found at /opt/webwork2/lib/WeBWorK/Utils/CourseManagement.pm line 199
addPermissionLevel: user global_user not found at /opt/webwork2/lib/WeBWorK/Utils/CourseManagement.pm line 200
addUser: user exists (perhaps you meant to use putUser?) at /opt/webwork2/lib/WeBWorK/Utils/CourseManagement.pm line 198
addPassword: password exists (perhaps you meant to use putPassword?) at /opt/webwork2/lib/WeBWorK/Utils/CourseManagement.pm line 199
addPermissionLevel: permission level exists (perhaps you meant to use putPermissionLevel?) at /opt/webwork2/lib/WeBWorK/Utils/CourseManagement.pm line 200
After fixing that, we lost the ability to log into Webwork, it would not take the password. By reverting back to the old Authen.pm, we were able to get things working again. However, since we can't login to webwork from Moodle or WW, we cannot continue.
Any clues?
Frank
Re: Forums on the main WeBWorK site (webwork.math.rochester.edu)
There is a new bridge application between WeBWorK and Moodle. All the details can be found at http://question.webwork.rochester.edu.
It basically creates a WeBWorK question type within the Moodle quiz module.
Let me know if you have any questions.
Is that I just unzip and upload the folder.
Also, I find that there is no config.php inside the unzip folder.
Please help!