Forum LAMS for Tech-Heads - General Forum: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Moodle tool adapter, error editing activity


 
Search: 

16: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Moodle tool adapter, error editing activity
In response to 15 07/05/09 07:53 AM
[ Reply | Forward ]
Luke did the changes in the LAMS moodle tool adapters so he will be able to tell us where the latest code is.

Thanks,

Ernie

Posted by Ernie Ghiglione

17: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Moodle tool adapter, error editing activity
In response to 16 07/05/09 06:56 PM
[ Reply | Forward ]
Hi Dave,

Have you gone into each tool adapter's admin page and set it to map to your integrated moodle server? If the tool adapters in LAMS are up-to-date then they should each have this option in their admin pages (which can be access through tool management in the sysadmin module) - see attached picture.

If the moodle changes are working properly, when you access author, the url called should be like this:
http://integrations.lamscommunity.org/lams/home.do?method=author&customCSV=lfoxton,2,1,lamsv2&extlmsid=lamsv2&requestSrc=Moodle&notifyCloseURL=http%3A%2F%2Fmoodle.lamscommunity.org%2Fmoodle%2Fmod%2Flamstwo%2Fview.php%3Fid%3D219

Notice the customCSV is in the form <username>, <course id>, <section id>, <server id>

where the server id corresponds to the serverid listed in the integrated servers page both in lams and on the moodle integration module.

When you open author, is the url in this form?

Luke

Posted by Luke Foxton

Attachments:
18: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Moodle tool adapter, error editing activity
In response to 17 07/05/09 07:31 PM
[ Reply | Forward ]
Yes I did map each tool to the server. There is a checkbox for each server.

I'll check the URL that is a good hint. thanks.

Posted by Dave Bauer

19: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Moodle tool adapter, error editing activity
In response to 17 07/05/09 07:32 PM
[ Reply | Forward ]
Also when I got to the default content link in the tool admin it gives the same CSV error.

Posted by Dave Bauer

20: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Moodle tool adapter, error editing activity
In response to 17 07/05/09 07:37 PM
[ Reply | Forward ]
Ok i definitely don't have customCSV URL parameter for author when I click "Create Sequence" in moodle.

Can you tell me which php library contains the code that generates that URL? Then I can see if I have the correct version of that code.

Thanks
Dave

Posted by Dave Bauer

21: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Moodle tool adapter, error editing activity
In response to 20 07/05/09 07:52 PM
[ Reply | Forward ]
I think its the same one as I sent in the earlier posts.

http://lamscvs.melcoe.mq.edu.au/fisheye/changelog/lams/temp_moodle_dev/moodle?cs=MAIN:ernieg:20090623061401

in add.php, you need this line:
array('course'=>$course, 'lamstwo'=>$lamstwo, 'customCSV'=>"$USER->username,$course->id,$cm->section,$CFG->lamstwo_serverid"));

There also is a similar line in view.php.

Ernie is this correct?

Luke

Posted by Luke Foxton

22: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Moodle tool adapter, error editing activity
In response to 21 07/06/09 08:22 AM
[ Reply | Forward ]
Ok,

Thanks, I looked again and I copied the new lamstwo mod INSIDE the old one, so I had /mod/lamstwo/lamstwo.

Fixed that and I get a new error

avax.servlet.ServletException: mdlChoice tool cusomCSV not in required (user,course,courseURL) form: sgadmin,7,68

and I am looking into that.

It appears to have used and id number instead of the courseURL.

Posted by Dave Bauer

23: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Moodle tool adapter, error editing activity
In response to 22 07/06/09 08:40 AM
[ Reply | Forward ]
This was not there:

$customcsv = "$USER->username,$course->id,$cm->section,$CFG->lamstwo_server\
id";

the lamstwo_serverid bit.
Added it.


Now when I click Open Lams Author, add Moodle tool, then double click, it opens a new window and I get a file not found. Unfortunately, I don't know what url its trying to open, the url in the popup with the not found error is http://lamsdev.solutiongrove.com/lams/errorpages/404.jsp

Posted by Dave Bauer

24: Re: Moodle tool adapter, error editing activity
In response to 23 07/06/09 08:58 AM
[ Reply | Forward ]
OK.

Looked in the lams access log

74.76.1.174 - mdl_sgadmin [06/Jul/2009:10:55:41 -0500] "GET /lams/tool/mdchce10/
authoring.do?toolContentID=2538&contentFolderID=4e40973e2236abc60122508ecf76001b
&customCSV=sgadmin%2C7%2C68%2Cmoodle HTTP/1.1" 302 -
74.76.1.174 - mdl_sgadmin [06/Jul/2009:10:55:41 -0500] "GET /lams/tool/mdchce10/
nullcourse/lamsframes.php?lamsUpdateURL=http%253A%252F%252Flamsdev.solutiongrove
.com%252Flams%252F%252Ftool%252Fmdchce10%252F%252Fauthoring.do%253Fdispatch%253D
updateContent%2526toolContentID%253D2538&dest=course%2Fmodedit-lams.php§ion=
68&add=choice&course=7 HTTP/1.1" 302 -
74.76.1.174 - mdl_sgadmin [06/Jul/2009:10:55:41 -0500] "GET /lams/errorpages/404
.jsp HTTP/1.1" 200 1092

Posted by Dave Bauer

25: Re: Re: Moodle tool adapter, error editing activity
In response to 24 07/06/09 05:34 PM
[ Reply | Forward ]
Hey Dave,

It looks like the neccessary changes on the moodle code for the tools has not been made... Each moodle tool used for the tool adapters requires a few small changes - these changes do not affect the normal operation of the tool, but just provide some hooks to talk to the lams server... Can you find within your moodle code the lamsframes.php file?

Ernie has recently done these changes, but they have not been committed to the cvs yet, so we cant give you a full changelog. However you could have a look at the changed files in full and do a comparison between your source and Ernie's and merge the changes. Perhaps using a program like winmerge or meld for linux. You can get the full source code here

http://downloads.lamsinternational.com/moodle-soe.tgz

Luke

Posted by Luke Foxton

26: Re: Re: Re: Moodle tool adapter, error editing activity
In response to 25 07/06/09 06:03 PM
[ Reply | Forward ]
Thanks again! I thought I merged all those changes in but I'll double check everything.

I used emacs ediff-directories, but maybe I missed some files.

Posted by Dave Bauer

27: Re: Re: Re: Moodle tool adapter, error editing activity
In response to 25 07/08/09 05:44 AM
[ Reply | Forward ]
Wait :)

I think this is a problem on the LAMS side. It is not making any requests back to mooodle, and moodle is sending the customCSV information now.

If I look in the Moodle access logs I am not seeing any incoming requests.

So this is what LAMS is doing

74.76.1.174 - mdl_sgadmin [06/Jul/2009:10:55:41 -0500] "GET /lams/tool/mdchce10/
nullcourse/lamsframes.php?lamsUpdateURL=http%253A%252F%252Flamsdev.solutiongrove
.com%252Flams%252F%252Ftool%252Fmdchce10%252F%252Fauthoring.do%253Fdispatch%253D
updateContent%2526toolContentID%253D2538&dest=course%2Fmodedit-lams.php§ion=
68&add=choice&course=7 HTTP/1.1" 302 -
74.76.1.174 - mdl_sgadmin [06/Jul/2009:10:55:41 -0500] "GET /lams/errorpages/404
.jsp HTTP/1.1" 200 1092

which ends up at a file not found page.

Posted by Dave Bauer

28: Re: Re: Re: Moodle tool adapter, error editing activity
In response to 25 07/08/09 06:49 AM
[ Reply | Forward ]
Ok i guess this is the issue here:


09:00:40,568 [http-0.0.0.0-80-3:] DEBUG org.lamsfoundation.lams.tool.mdasgm.servi
ce.MdlAssignmentService - Could not find the content with toolContentID:2547

First can't find the content with toolcontentid 2547
Where should I look for that? What database tables?

09:00:40,620 [http-0.0.0.0-80-3:] DEBUG org.lamsfoundation.lams.web.action.LamsDi
spatchAction - Sending to moodle assignment edit page: nullcourse/lamsframes.php?
&lamsUpdateURL=http%3A%2F%2Flamsdev.solutiongrove.com%2Flams%2F%2Ftool%2Fmdasgm10
%2F%2Fauthoring.do%3Fdispatch%3DupdateContent%26toolContentID%3D2547&dest=mod%2Fa
ssignment%2Fassignment_types.php§ion=68&add=assignment&course=7

It tries to send to the moodle assignment edit page but the URL begins with "null" instead of the moodle integration server URL.

The author environment is opened with the correct data afaict:

customCSV=sgadmin,7,68,moodle&extlmsid=moodle

as passed into the author page.

Posted by Dave Bauer

29: Re: Re: Re: Re: Moodle tool adapter, error editing activity
In response to 28 07/08/09 07:18 AM
[ Reply | Forward ]
Curiously the tool_content_id in question does exist:

mysql> select * from lams_tool_content where tool_content_id = 2547;
+-----------------+---------+
| tool_content_id | tool_id |
+-----------------+---------+
| 2547 | 23 |
+-----------------+---------+
1 row in set (0.00 sec)


Not sure where to go from there.

Posted by Dave Bauer

32: Re: Re: Re: Re: Re: Moodle tool adapter, error editing activity
In response to 29 07/08/09 02:20 PM
[ Reply | Forward ]
I turned on SQL debugging in hibernate. No query is ever executed to get the object when I click so it looks like somewhere its caching a bogus object.

I found this SQL where it creates the moodle assignment tool

16:29:19,036 [http-0.0.0.0-80-2] DEBUG org.hibernate.SQL - update tl_mdasgm10_md
lassignment set create_date=?, update_date=?, define_later=?, content_in_use=?,
run_offline=?, tool_content_id=?, ext_tool_content_id=?, ext_user_name=?, ext_co
urse_id=?, ext_section=?, ext_lms_id=? where uid=?
16:29:19,036 [http-0.0.0.0-80-2] DEBUG org.hibernate.jdbc.AbstractBatcher - prep
aring statement
16:29:19,036 [http-0.0.0.0-80-2] DEBUG org.hibernate.persister.entity.BasicEntit
yPersister - Dehydrating entity: [org.lamsfoundation.lams.tool.mdasgm.model.MdlA
ssignment#8]
16:29:19,036 [http-0.0.0.0-80-2] DEBUG org.hibernate.type.TimestampType - bindin
g '2009-07-08 16:29:19' to parameter: 1
16:29:19,036 [http-0.0.0.0-80-2] DEBUG org.hibernate.type.TimestampType - bindin
g null to parameter: 2
16:29:19,036 [http-0.0.0.0-80-2] DEBUG org.hibernate.type.BooleanType - binding
'false' to parameter: 3
16:29:19,036 [http-0.0.0.0-80-2] DEBUG org.hibernate.type.BooleanType - binding
'false' to parameter: 4
16:29:19,036 [http-0.0.0.0-80-2] DEBUG org.hibernate.type.BooleanType - binding
'false' to parameter: 5
16:29:19,036 [http-0.0.0.0-80-2] DEBUG org.hibernate.type.LongType - binding '25
56' to parameter: 6

and its setting the tool_content_id when it inserts the tool.

More from hibernate log

16:29:19,034 [http-0.0.0.0-80-2] DEBUG org.hibernate.pretty.Printer - org.lamsfo
undation.lams.tool.mdasgm.model.MdlAssignment{uid=8, extToolContentId=null, cont
entInUse=false, toolContentId=2556, extUsername=sgadmin, updateDate=null, runOff
line=false, extLmsId=moodle, extCourseId=7, mdlAssignmentSessions=[], extSection
=68, defineLater=false, createDate=2009-07-08 16:29:19}

Posted by Dave Bauer

30: Re: Re: Re: Re: Moodle tool adapter, error editing activity
In response to 28 07/08/09 08:45 AM
[ Reply | Forward ]
I deployed the assignment tool from CVS just in case it was different, but the same results.

Posted by Dave Bauer

31: Re: Re: Re: Re: Moodle tool adapter, error editing activity
In response to 28 07/08/09 01:40 PM
[ Reply | Forward ]
Went into the source, I couldn't see anything that would cause this to fail in this particular way unless there is some sort of caching that is going on.

Posted by Dave Bauer

33: Re: Re: Re: Re: Re: Moodle tool adapter, error editing activity
In response to 31 07/08/09 05:36 PM
[ Reply | Forward ]
Hi Dave,

At which point is this failing, when you attempt to get to the author screen? And which of the tool adapters is it that you are testing?

If its failing in lams, there should be some sort of exception being thrown in the lams.log, can you see anything there.

Also, if you have debug logging on, when the call is made to the external moodle server, it should be printed there like this example for the moodle choice tool:

lams.log.5:2009-05-19 20:49:10,102 [TP-Processor1:] DEBUG org.lamsfoundation.lams.web.action.LamsDispatchAction - Sending to moodle choice edit page: http://moodle.lamscommunity.org/moodle/course/lamsframes.php?lamsUpdateURL=http%253A%252F%252Fintegrations.lamscommunity.org%252Flams%252F%252Ftool%252Fmdchce10%252F%252Fauthoring.do%253Fdispatch%253DupdateContent%2526toolContentID%253D126295&dest=course%2Fmodedit-lams.php§ion=2&add=choice&course=2


Is it getting to this point? Please attach your lams.log after attempting to get to author and i'll see if that tells me anything.

Luke

Posted by Luke Foxton

34: Re: Re: Re: Re: Re: Re: Moodle tool adapter, error editing activity
In response to 33 07/08/09 06:20 PM
[ Reply | Forward ]
Hi.

Opening author works fine.
Then I drag a moodle tool into the workspace, say Moodle Assignment. That works ok.

Then I double click on the tool to edit the content for that tool. It opens a new window and I get the 404 error message. I am getting the 404 error message because the URL its going to is

nullcourse/lamsframes.php?lamsUpdateURL=http%253A%252F%252Flamsdev.solutiongrove
.com%252Flams%252F%252Ftool%252Fmdchce10%252F%252Fauthoring.do%253Fdispatch%253D
updateContent%2526toolContentID%253D2538&dest=course%2Fmodedit-lams.php§ion=
68&add=choice&course=7

null is there instead of the moodle server URL.

This is caused I assume when it tried to get the tool_content_id but it can't.
I'll attach the relevant lams.log.

Posted by Dave Bauer

35: Re: Re: Re: Re: Re: Re: Re: Moodle tool adapter, error editing activity
In response to 34 07/08/09 06:41 PM
[ Reply | Forward ]
Aha!

I think I know the problem now, sorry I should have noticed before.

Since 2.3.1 there is a new field in the "Maintain Integrated Servers" area. When you click on your integrated server, there should be a new field simply asking for the external server url.... (See picture)

Has this been set?

As I said, we will be putting together a proper setup guide for the tool adapters soon, unfortunately for you, we're still ironing out the process, sorry about the difficulties so far.

Luke

Posted by Luke Foxton

Attachments:
36: Re: Re: Re: Re: Re: Re: Re: Re: Moodle tool adapter, error editing activity
In response to 35 07/08/09 06:47 PM
[ Reply | Forward ]
Aha :)

No I recall noticing it was blank before, but I thought it was always that way. I set it.

Progress! Now i get /mod/assignment/assignment_types.php missing error. I'll see why I don't have that file.

Posted by Dave Bauer

37: Re: Re: Re: Re: Re: Re: Re: Re: Re: Moodle tool adapter, error editing activity
In response to 36 07/08/09 07:12 PM
[ Reply | Forward ]
Aha, missing files from merge. I'll have to go through all the mods and find those. I think I got them all, then I get


Fatal error: Cannot delete class mod_assignment_upload_notes_form in /opt/coolstack/apache2/htdocs/MEL/mod/assignment/view.php on line 48

After trying to create the assignment.

Posted by Dave Bauer

Reply to first post on this page
Back to LAMS for Tech-Heads - General Forum