## Forum archive 2000-2006

### Marc BUFFAT - WebWork and Moodle: almost working

by Arnold Pizer -
Number of replies: 0
 WebWork and Moodle: almost working topic started 6/29/2006; 9:16:15 AMlast post 7/1/2006; 7:06:11 AM
 Marc BUFFAT - WebWork and Moodle: almost working  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 |>

 Marc BUFFAT - Re: WebWork and Moodle: almost working  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 |>  Sam Hathaway - Re: WebWork and Moodle: almost working 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 |>  Michael Gage - Re: WebWork and Moodle: almost working 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 |>  Michael Gage - Re: WebWork and Moodle: almost working 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 |>  Michael Gage - Re: WebWork and Moodle: almost working 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 |>  Marc BUFFAT - Re: WebWork and Moodle: almost working 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 |>