Forum archive 2000-2006

Marc BUFFAT - WebWork and Moodle: almost working

Marc BUFFAT - WebWork and Moodle: almost working

by Arnold Pizer -
Number of replies: 0
inactiveTopicWebWork and Moodle: almost working topic started 6/29/2006; 9:16:15 AM
last post 7/1/2006; 7:06:11 AM
userMarc BUFFAT - WebWork and Moodle: almost working  blueArrow
6/29/2006; 9:16:15 AM (reads: 459, responses: 9)
After trying a lot with different versions of webwork and wwmoodle and other moodle module without succes, I have got the last development version of webwork 2.2-dev, and the new wwmoodle module wwassignement. After some adjustement in the moodle database perl functions (table name) in lib/WeBWorK/DB/Schema/Moodle, I have been able to have a working webwork (2.2) and moodle (1.5) connection. However some problems remains: The moodle webwork set is not automatically valid for the moodle student. I.e, when a moodle student (bidon) select a webwork set (demo1), he got the error message "The selected homework set1 (demo1) is not a valid set for bidon" The administrator of the course must valided by hand the set for the student in the webwork interface. after that the student has access to the webwork set. The second point is the grades. Apparently, the grade for a student is only calculated within webwork, and no grade is avalaible within moodle.

Ave you any clue about thess 2 points Neverthless, thanks for all the development in webwork Marc

<| Post or View Comments |>


userMichael Gage - Re: WebWork and Moodle: almost working  blueArrow
6/29/2006; 9:57:14 AM (reads: 545, responses: 0)
I'm glad you had success with setting up moodle and webwork.

Could you tell me what adjustments you made in the table name in perl functions lib/WeBWorK/DB/Schema/Moodle? This module is only a few days old so there may be some variables that are hard-wired to our installation that need to be set in our global.conf file.

As to your second point. At the moment you have to both assign a homework set to a student in moodle AND make the same assignment to the student in WeBWorK. (The latter is fairly easy -- you can if you want assign all homeworksets to all students in WeBWorK from the instructor page and then control which sets a student sees from moodle.)

It would be nice to have an assignment in moodle trigger automatic assignment in WeBWorK as well, but that will have to await the next version of wwassign. There are a few other examples where things have to be done manually once on the moodle side and once on the WeBWorK side -- for example the two courses have to be set up separately. I'd like to make sure the current version is stable first before working on these enhancements which, to be done properly, will require some work on the webservice api's of both applications.

The grade information however should already be transferrable from WeBWorK to Moodle, but I admit I haven't yet made extensive tests of this feature so there may still some bugs in the code. All of the code for this feature is in the wwassignment/lib.php module since moodle has access to the webwork scoring database. I'll take a look at this as soon as I can, which may not be until after this long weekend.

<| Post or View Comments |>


userMarc BUFFAT - Re: WebWork and Moodle: almost working  blueArrow
6/29/2006; 10:25:33 AM (reads: 523, responses: 0)
Hello Michael,

the changes are in webwork2/lib/WeBWorK/DB/Schema/Moodle for the file Permission.pm , where you query the table wwmoodle instead of wwassignment_bridge) line 236, 258 my $courseTable = $self->prefixTable("wwmoodle"); should read my $courseTable = $self->prefixTable("wwassignment_bridge"); and for the file User.pm line 105 (idem) and the table name $courseTable.courseName shoud be $courseTable.coursename line 115, 127 (file User.pm)

In the config file webwork.apache-config i have to use my $pg_dir = "/opt/pg"; instead of my $pg_dir = $ce->{pg_dir};

As to the assignement problem, you tell me that the professor must assign the homework set to all student in webwork, but the moodle student must use webwork at least once in order to be in user list in webwork. So the first time a student uses the course, he got the error !

regards, Marc

<| Post or View Comments |>


userSam Hathaway - Re: WebWork and Moodle: almost working  blueArrow
6/29/2006; 11:43:36 AM (reads: 524, responses: 0)
Hi Marc,

Mike asked me to advise you on the $pg_dir issue. This isn't something we've seen before. Is it possible that either your webwork.apache-config or global.conf file got corrupted somehow? What are the CVS versions of those two files, as well as the CourseEnvironment.pm file?

Was there a time when using $ce->{pg_dir} worked? If so, did it stop working after a CVS update? After a local change to some code? After you got wwmoodle integration set up?

If you want to send me copies of your webwork.apache-config and global.conf files, I can compare them to mine (which work).

Thanks
-sam

<| Post or View Comments |>


userMichael Gage - Re: WebWork and Moodle: almost working  blueArrow
6/29/2006; 11:51:55 AM (reads: 517, responses: 0)
I've fixed the names for the moodle tables and the fields. Thanks for pointing them out.

Sam Hathaway will contact you about the error in configuring the webwork.apache-config file and we'll see what needs to be done there.

As to the assignment problem. There are still some problems with keeping the tables in sync. WeBWorK uses the moodle user table to determine who is in the course so I believe that if a student is registered in the moodle course then you will be able to assign homework to the student from WeBWorK, even if they have not yet tried a webwork homework assignment.

This will, for the moment, cause trouble if you are allowing students to self register in Moodle. They will have to wait for the instructor to update WeBWorK before they will be able to do WeBWorK homework. If you register all of the students in moodle before the course opens you can also assign them WeBWorK homework before the course opens.

As you pointed out earlier the grades are not available in Moodle. I'll look into this -- I probably broke some link when I combined the two moodle modules.

Thanks for the help and for beta testing the new module !!

Take care,

Mike

<| Post or View Comments |>


userMichael Gage - Re: WebWork and Moodle: almost working  blueArrow
6/29/2006; 12:05:53 PM (reads: 509, responses: 0)
The grading problem:

in wwassignment/lib.php around line 313 change "grade_method" to "gradingmethod" (moodle coding rules seem to suggest that underscores and capital letters should not be used in variable names and in table field names. I'll make the change in the CVS.

-- Mike

<| Post or View Comments |>


userMichael Gage - Re: WebWork and Moodle: almost working  blueArrow
6/29/2006; 1:57:43 PM (reads: 524, responses: 0)
Hi

I've fixed one error in wwassignment/lib.php which now returns all of the student problems found by the select statement, not just the first one. The grades now seem to be fetched correctly into moodle. I don't yet understand moodle's gradebook that well, so the format may not be exactly what is desired.

Take care,

Mike

<| Post or View Comments |>


userMarc BUFFAT - Re: WebWork and Moodle: almost working  blueArrow
6/30/2006; 3:31:35 AM (reads: 505, responses: 0)
Hi

thanks for your replies and help. Regarding the $pg_dir issue, I check again with $pg_dir = $ce->{pg_dir}; and it works! (so it was not a problem).

Concerning the assignement problem, I understand better the way of doing in WebWork, and I have checked that if the student are registered in the moodle course, I can easily assigned all to the problem set before they tried the webwork homework. The problem remains for students who register after the start of the moodle course (and in my university, this is unfortunately the case), but I can solve it (with email).

I also try the last wwassignment/lib.php, and now it works: i.e; I got the grade).However, I had to change in the debug_log subroutine the name of the debug file

$fh = fopen("/tmp/moodle_debug", "w");

and I commented the line 333 (call to debug_log)

I am also trying to translate some part of the webwork user interface in French. I have translated the file setHeader.pg, and it works. But when you download the hardcopy, all the accent dissapear, because latex is not configured to use french input. I had to put something like: usepackage{french} or RequirePackage[latin1]{inputenc} in the Latex preambule of my latex files. How can I do it in Webwork

OK I solve it. I had to modified the file hardcopyPreamble.tex

Thanks, Marc

<| Post or View Comments |>


userMichael Gage - Re: WebWork and Moodle: almost working  blueArrow
6/30/2006; 8:36:55 AM (reads: 472, responses: 0)
Hi Marc,

It sounds like you are making good progress. I'm sorry about the debug_log calls -- they should be commented out as you have done.

I will be away until July 5. Best of luck.

-- Mike

<| Post or View Comments |>


userDavide P. Cervone - Re: WebWork and Moodle: almost working  blueArrow
7/1/2006; 7:06:11 AM (reads: 487, responses: 0)
I don't see this in the documentation for wwassignment anywhere, but if you log into the WW course as a professor and use the Course Configuration function to change the course's theme to "moodle", the result will be a better layout (a slimmed-down user interface to WW) when the student views the assignment through moodle.

Davide

<| Post or View Comments |>