Installation

Integration of Moodle & WeBWorK: Installation

Integration of Moodle & WeBWorK: Installation

by Dallin Stephens -
Number of replies: 11
I'm trying to get wwassignment5 to work with moodle. I have WW 2.5, Moodle
2.3.3, and Apache 2.

Under 3.3 Configuration it says

4) Some checks:


Try the url http://host.name.edu/webwork2_wsdl

This is a simple check and it should return a (complicated) wsdl file.

http://host.name.edu/webwork2_rpc returns a blank page but does not create an error on my machine.

My url http://dallins/webwork2_wsdl works but http://dallins/webwork2_rpc does not. When I enter http://dallins/webwork2_rpc it says

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.


Apache/2.2.22 (Ubuntu) Server at dallins Port 80

How do I get http://dallins/webwork2_rpc to return a blank page rather than an error?

If I ignore this and go into moodle to integrate webwork and click the icon to configure WW link or WeBWorK Problem Set it brings up a screen that says "Exception - Internal Server Error".

Earlier I entered the following into moodle:

WeBWorK server URL:
http://dallins/webwork2
URL for WeBWorK server
http://dallins/webwork2_wsdl
Key identifying Moodle to WeBWorK.
0104
iframe width as per cent:
95%

iframe height in pixels
500px

I typed "tail -f /var/log/apache2/error.log" in the terminal to bring up the apache 2 error log. It says

[Fri Nov 30 16:30:38 2012] [error] [client 127.0.0.1] failed to resolve handler `Apache2::SOAP': Can't locate Apache2/SOAP.pm in @INC (@INC contains: /opt/webwork/pg/lib /opt/webwork/webwork2/lib /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl . /etc/apache2) at (eval 1397) line 2.\n

I would appreciate any help. Thanks, Dallin


In reply to Dallin Stephens

Re: Integration of Moodle & WeBWorK: Installation

by Dallin Stephens -
When restarting apache 2, this is what I get in my terminal:

wwadmin@DallinS:/opt/webwork/webwork2/conf$ sudo /etc/init.d/apache2 restart
* Restarting web server apache2 Localize.pm: Full path for the localization directory set to |/opt/webwork/webwork2/lib/WeBWorK/Localize|
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
webwork.apache2-config: WeBWorK server is starting
webwork.apache2-config: WeBWorK root directory set to /opt/webwork/webwork2 in webwork2/conf/webwork.apache2-config
webwork.apache2-config: The following locations and urls are set in webwork2/conf/global.conf
webwork.apache2-config: PG root directory set to /opt/webwork/pg
webwork.apache2-config: WeBWorK server userID is www-data
webwork.apache2-config: WeBWorK server groupID is wwdata
webwork.apache2-config: The webwork url on this site is http://DallinS/webwork2
WebworkWebservice: webwork_directory set to /opt/webwork/webwork2 via $WeBWorK::Constants::WEBWORK_DIRECTORY set in webwork.apache2-config
... waiting webwork.apache2-config: WeBWorK server is starting
webwork.apache2-config: WeBWorK root directory set to /opt/webwork/webwork2 in webwork2/conf/webwork.apache2-config
webwork.apache2-config: The following locations and urls are set in webwork2/conf/global.conf
webwork.apache2-config: PG root directory set to /opt/webwork/pg
webwork.apache2-config: WeBWorK server userID is www-data
webwork.apache2-config: WeBWorK server groupID is wwdata
webwork.apache2-config: The webwork url on this site is http://DallinS/webwork2
Localize.pm: Full path for the localization directory set to |/opt/webwork/webwork2/lib/WeBWorK/Localize|
WebworkWebservice: webwork_directory set to /opt/webwork/webwork2 via $WeBWorK::Constants::WEBWORK_DIRECTORY set in webwork.apache2-config
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName

This is what I get with my hostname:

wwadmin@DallinS:~$ hostname --fqdn
DallinS
wwadmin@DallinS:~$ hostname
DallinS

In reply to Dallin Stephens

Re: Integration of Moodle & WeBWorK: Installation

by Michael Gage -
Two things to check first.

1.  Do you have webwork setup and working without moodle?  Do that first.

2. What does the apache server logfile say about the error when you try to access the _rpc connection?
In reply to Michael Gage

Re: Integration of Moodle & WeBWorK: Installation

by Dallin Stephens -
Thanks for responding. This is what I got.

1. Do you have webwork setup and working without moodle?


When I enter http://dallins/webwork2 I'm able to access the test course I created called mytestcourse2. I put a homework set in mytestcourse2.

I'm able to login into mytestcourse2 as myself as and as a fake student. I previously downloaded and installed the client version of Webwork 2.5 with Ubuntu 12.04 LTS.

2. What does the apache server logfile say about the error when you try to access the _rpc connection?

I first tried to access the _rpc connection by typing http://dallins/webwork2_rpc. It brought up a screen that says "Internal Server Error".

Then I typed tail -f /var/log/apache2/error.log into the terminal and got the following:

[Sat Dec 01 11:46:38 2012] [error] [client 127.0.0.1] failed to resolve handler `Apache2::SOAP': Can't locate Apache2/SOAP.pm in @INC (@INC contains: /opt/webwork/pg/lib /opt/webwork/webwork2/lib /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl . /etc/apache2) at (eval 2860) line 2.\n


In reply to Dallin Stephens

Re: Integration of Moodle & WeBWorK: Installation

by Dallin Stephens -
To resolve the issue in my apache 2 error log as listed above, I entered the following into my terminal:

perl -MCPAN -e 'install Apache2::SOAP'

Then I restarted apache 2 in my terminal by entering sudo /etc/init.d/apache2 restart .

Then I went to http://dallins/webwork2_rpc and still got "Internal Server Error".

Then I checked the apache 2 error log by entering tail -f /var/log/apache2/error.log into the terminal. This is now what I got:

[Sat Dec 01 12:51:44 2012] [error] [client 127.0.0.1] The LENGTH argument can't be negative at /usr/local/share/perl/5.14.2/SOAP/Transport/HTTP2.pm line 103.\n

To address this, I entered

wwadmin@DallinS:~$ sudo gedit /usr/local/share/perl/5.14.2/SOAP/Transport/HTTP2.pm

I went to line 103 as seen below:

Ln 98 my $cl = ($self->{'MOD_PERL_VERSION'} == 1) ?
Ln 99 $r->header_in('Content-length') : $r->headers_in->{'Content-length'};
Ln 100 $self->request(HTTP::Request->new(
Ln 101 $r->method() => $r->uri,
Ln 102 HTTP::Headers->new($r->headers_in),
Ln 103 do { my ($c,$buf); while ($r->read($buf,$cl)) { $c.=$buf; } $c; }
Ln 104 ));
Ln 105 $self->SUPER::handle;

At line 103, I don't know how to fix "LENGTH argument can't be negative".

How should I proceed?



In reply to Dallin Stephens

Re: Integration of Moodle & WeBWorK: Installation

by Dallin Stephens -
I went to my moodle site; webwork link and webwork problem set now work. The configure buttons now work. At my moodle site at dallins/moodle I am able to add webwork homework problems. Now I just need to experiment to get more familiar with how it all works. I'm just glad that it does work now.

When I go to http://dallins/webwork2_rpc I still get "Internal Server Error". But, should I not worry about the _rpc since moodle works with webwork now?

I still have "LENGTH argument can't be negative" (concerning the file HTTP2.pm) in the apache 2 server error log. Should I not worry about that as well?

Thanks for leading me down the right track so I could find my own solution.

Dallin
In reply to Dallin Stephens

Re: Integration of Moodle & WeBWorK: Installation

by Jason Aubrey -
Dallin - don't worry too much about the error message when you go to /webwork2_rpc. That location is configured to handle specially formatted requests to the webwork webservice, and not regular traffic from web-browsers. So, the response it gives to traffic from a web-browser probably shouldn't be relied on as an indication that anything is wrong (or that anything is right). If other things don't work, this message in the logs might be helpful in finding the problem, but if everything works fine, then it is probably just saying "I don't know what to do with this request."

Jason
In reply to Jason Aubrey

Re: Integration of Moodle & WeBWorK: Installation

by Dallin Stephens -
Thanks: good to know. I look forward to integrating webwork with moodle.
In reply to Dallin Stephens

Re: Integration of Moodle & WeBWorK: Installation

by Dallin Stephens -
My webwork and moodle were working well together until recently. I'm not sure what caused the problem. I did some updates, but I'm not sure if the updates created the problem. To fix the problem, I reinstalled ubuntu 12.04, webwork 2.5, and moodle 2.4. My sites dallins/moodle and dallins/webwork2 both work, but I'm having problems with webwork working with moodle.

The webwork link configuration button works, but adding a webwork problem set does not work.

In moodle, I did select the debugging options under "Development" which is under "Site administration". I thought this might provide more code on how to fix the situation.

When I click the webwork link configuration button, select "Any page" on "Display on page types", and then select to add webwork problem set I get this apache error log:

[Fri Dec 07 03:29:52 2012] [error] [client 127.0.0.1] PHP Strict Standards: Creating default object from empty value in /var/www/moodle/blocks/wwlink/block_wwlink.php on line 46, referer: http://dallins/moodle/course/view.php?id=2

When I click the webwork link configuration button, select "Any course page" on "Display on page types", and then select to add webwork problem set I get this apache error log:

[Fri Dec 07 03:34:53 2012] [error] [client 127.0.0.1] PHP Notice: Trying to get property of non-object in /var/www/moodle/mod/wwassignment/locallib.php on line 253, referer: http://dallins/moodle/course/view.php?id=2
[Fri Dec 07 03:34:53 2012] [error] [client 127.0.0.1] Default exception handler: Exception - Application error Debug: \nError code: generalexceptionmessage\n* line 407 of /mod/wwassignment/locallib.php: SoapFault thrown\n* line 407 of /mod/wwassignment/locallib.php: call to SoapClient->__soapCall()\n* line 428 of /mod/wwassignment/locallib.php: call to wwassignment_client->handler()\n* line 188 of /mod/wwassignment/locallib.php: call to wwassignment_client->mapped_user()\n* line 18 of /mod/wwassignment/mod_form.php: call to _wwassignment_mapcreate_user()\n* line 191 of /lib/formslib.php: call to mod_wwassignment_mod_form->definition()\n* line 71 of /course/moodleform_mod.php: call to moodleform->moodleform()\n* line 261 of /course/modedit.php: call to moodleform_mod->moodleform_mod()\n, referer: http://dallins/moodle/course/view.php?id=2

When I click the webwork link configuration button, select "Any type of course main page" on "Display on page types", and then select to add webwork problem set I get this apache error log:

[Fri Dec 07 03:37:39 2012] [error] [client 127.0.0.1] PHP Fatal error: Call to undefined method MoodleQuickForm::setHelpButton() in /var/www/moodle/mod/wwassignment/mod_form.php on line 56, referer: http://dallins/moodle/course/view.php?id=2

If I enter dallins/webwork2_rpc I get this apache error log:

[Fri Dec 07 03:39:14 2012] [error] [client 127.0.0.1] The LENGTH argument can't be negative at /usr/local/share/perl/5.14.2/SOAP/Transport/HTTP2.pm line 103.\n

I would appreciate any help concerning the matter. I'm not sure what to do next so that I can access webwork through moodle. I did create a course called Algebra-2 in webwork and added a homework set to the course in webwork.

Thanks,

Dallin


In reply to Dallin Stephens

Re: Integration of Moodle & WeBWorK: Installation

by Dallin Stephens -
Previously I had Moodle 2.3.3+ working with webwork. Later for some reason Moodle 2.3.3+ stopped working; I could not access my site dallins/moodle when previously I could.

To fix the problem, I installed Moodle 2.4 which then was working fine. But, as said in the previous post, I could not get Moodle 2.4 to work with webwork.

To fix the problem, I got rid of Moodle 2.4 and reinstalled Moodle 2.3.3+. Now my webwork works again with moodle.

My guess is that Moodle 2.4 does not work properly with webwork and that Moodle 2.3.3+ does work properly with webwork.
In reply to Dallin Stephens

Re: Integration of Moodle & WeBWorK: Installation

by Michael Gage -
Thanks for the report Dallin.  I'm pretty sure you are right.  The error messages you reported were all from the wwassignment5  plugin module to Moodle.  It's likely that some small change has to be made to the module to make it compatible with the new version of moodle.  

I'm on leave to the CS department this semester and not using moodle to teach so I won't be able to look at this until over break.  I don't expect that a big change will be required to make it work with the new moodle version 2.4

Thanks again for the heads up -- there are others using moodle now who will want to know about this and might even be able to create a patch to fix the problem before I get to it.

-- Mike

In reply to Dallin Stephens

Re: Integration of Moodle & WeBWorK: Installation

by Josue Oregel -
To address the problem:
PHP Fatal error: Call to undefined method MoodleQuickForm::setHelpButton() in /var/www/moodle/mod/wwassignment/mod_form.php on line 56, I had modified it commenting (//) two lines where the $mform->setHelpButton appears, i.e., the lines 56 and 61.

I'm not sure what happens with the HelpButton parameters, but I think that a misconfiguration is provoking an information lack.

After that changes in the mod_form.php, the wwassignment were functional in my server, apparently without evident problems.

My software:
- WebWork 2.7 at Ubuntu Server 12.04LTS (virtual machine from maa.org page).
- Joomla 3.2 at CentOS 6.5
- wwassignment5

Regards!