Wordpress and Moodle LTI

Wordpress and Moodle LTI

by Chris Kenniburg -
Number of replies: 31
Picture of Particularly helpful Moodlers Picture of Plugin developers

I would like to create a tutorial explaining how to go from point A to point B for the average user to setup and use wordpress multisite inside Moodle.  However I am having the hardest time setting it up for myself.

I have downloaded and installed the Wordpress LTI Plugin using this-

Directions for configuring WordPress:

  1. Configure your WordPress account for multisite
  2. Download the WordPress LTI plugin
  3. Extract the LTI plugin into wp-content/mu-plugin
  4. Log as superAdmin and go to Network Dashboard -> Settings -> LTI Consumers Keys. Here you can manage the authorized consumers keys
  5. For more detailed configuration, follow the directions here

 

The part that is missing is how you add wordpress into Moodle.  

What is the Launch URL???  Obviously with the plugin you have to setup the consumer key and shared secret, but I cannot find any documentation on the Launch URL.

If anyone can shed some light on this let me know.

Attachment wordpress_LTI.png
Average of ratings: -
In reply to Chris Kenniburg

Re: Wordpress and Moodle LTI

by Chris Kenniburg -
Picture of Particularly helpful Moodlers Picture of Plugin developers

I have gotten to the point where I can add my Wordpress site to a course and using the external tool it will embed the main WP blog in my Moodle course.

However, it doesn't login the Moodle user and it doesn't create a new blog or anything like that.  Is there a special trick to this?

In reply to Chris Kenniburg

Re: Wordpress and Moodle LTI

by Darcy Christ -

Hi Chris,

I have been working on this myself. I'm not sure what you are seeing. I had to add some debugging statements to determine there was a invalid signature in the OAuth process. In the end, it came down to some bad code related to magic quotes. For testing purposes, try to turn on magic quotes in your php.ini (not recommended for production). This will at least let you know whether this is your issue or not.

I'm going to be working on LTI4WordPress. It's essentially an abandoned project. I'll probably try to put my own version up on github. Stay tuned.

Average of ratings: Useful (1)
In reply to Darcy Christ

Re: Wordpress and Moodle LTI

by Chris Kenniburg -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Thank you Darcy.  If you have code you want to share I would love to be a part of testing.  

In reply to Chris Kenniburg

Re: Wordpress and Moodle LTI

by Simon Leung -

Hi Chris,

I have the setup running on the latest build of Moode/Wordpress. There's no trick as referring to the "documentation" except:

1. The Launch URL in my case (the root installation of your wordpress) is : http://mydomain.com/wordpress, so student's blog will look like http://mydomain.com/wordpress/wordpress-2-1

2. be sure to NOT to check the box of "Accept grades from the tool.

I am also puzzled with the access right when other students can edit on someone's blog (e.g change the title) and wish Darcy will come up with the updated coding.

Thanks Both.

 

Simon

 

Attachment lti.JPG
In reply to Simon Leung

Re: Wordpress and Moodle LTI

by Chris Kenniburg -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Simon,

Did you modify any settings or files?  

I did get the lauch URL to work.

Here is the current issues:

  1. When I launch the activity it doesn't transfer my username to the blogs or create new users in wordpress.
  2. It doesn't create a new blog?  is it supposed to?
In reply to Chris Kenniburg

Re: Wordpress and Moodle LTI

by Chris Kenniburg -
Picture of Particularly helpful Moodlers Picture of Plugin developers

I should point out we are using LDAP for logins, so maybe that might be the issue?  I am not seeing anything in the error logs either.

In reply to Chris Kenniburg

Re: Wordpress and Moodle LTI

by Chris Kenniburg -
Picture of Particularly helpful Moodlers Picture of Plugin developers

YES!  I just got it working.  I had missed a file when uploading the LTI plugin.  Not sure how or why, but a re-upload worked.

In reply to Chris Kenniburg

Re: Wordpress and Moodle LTI

by Chris Kenniburg -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Here is a demo video I just made of wordpress and how it works with LTI and Moodle:
In reply to Chris Kenniburg

회신: Re: Wordpress and Moodle LTI

by Jong-Dae Park -

Thanks for your module. I could setup an external tool activity but I got message when I clicked the activity next time.

existing_user_login
This username is already registered.

I have a question about role mapping. I found that "Instructor" mapped to "editor". Is "Instructor" a customized name for "Teacher"?

	public function roleMapping($role, $blti) {
		
	    if ($role == 'Administrator' || $role == 'Instructor,Administrator') return 'administrator';
	    if ($role == 'Instructor') return 'editor';
		
	    return 'subscriber';

 

In reply to Jong-Dae Park

회신: Re: Wordpress and Moodle LTI

by Jong-Dae Park -

I installed a subdirectory type multisite  wordpress 3.4.2. The os for the blog system is debian linux squeeze and the moodle version is 2.3.2+.

The problem I have :

Even though a course blog is created, a new user is created at the main blog as a subscriber, not a author of the created blog. 

Thanks in advance.

JD Park

In reply to Jong-Dae Park

Re: 회신: Re: Wordpress and Moodle LTI

by Chris Kenniburg -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Jong,

Your issue may be related to renaming some of the user roles?  Have you renamed your user roles in Moodle?  Not quite sure why the user would be added as a subscriber.  Have you been changing the code for the WP Plugin?  It should just work out of the box.

In reply to Chris Kenniburg

Re: Wordpress and Moodle LTI

by Petri Calderon Larjanko -

Hi All,

It's great to see that some people have gotten this plugin to work. For some reason I haven't been able to.  I correctly configured the WP LTI plugin in wordpress and also configured an External Tool configuration in Moodle. I have followed the instructions to the letter, followed some suggestions from this post, and ensured (through some code additions) that the Consumer key received in the POST (from Moodle) and the secret retrieved (by WP) are correct.  I have reuploaded the plugin several times as well.  But alas, it is still not working.

What I experience is that when I add an external tool activity in Moodle, pointing to the WP instance (hosted by me), I get a a Basic LTI Authentication Failed error:

"BASIC LTI Authentication Failed, not valid request (make sure that consumer is authorised and secre is correct) invalid signature ours=1yKmUk016k5LdhW85f2OAcwnSOg=  yours=o+cj)Nz5P/LD7GIV9Fd0txhaMhc="

I have already ensured that the consumer key and secret are exactly the same in both sites. I have also ensured that the time/date/etc are correct in both sites.  Some token used to construct the signatures is different between both sites, but I can't figure out which one.

Does anyone have any ideas on this?

Thanks in advanced,

Petri

 

In reply to Petri Calderon Larjanko

Re: Wordpress and Moodle LTI

by Chris Kenniburg -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Petri,

I have gotten that error too sometimes.  Make sure the email address for the Moodle User and your Wordpress Admin are different.

Also, make sure you only add the External Tool ONCE to Moodle via the Site Admin Panel > Plugins > External Tool.   If you have two instances I have seen it kick back the error you described ---- "BASIC LTI Authentication Failed, not valid request (make sure that consumer is authorised and secre is correct) invalid signature ours=1yKmUk016k5LdhW85f2OAcwnSOg=  yours=o+cj)Nz5P/LD7GIV9Fd0txhaMhc=".

You can add that one instance over and over in courses and it will create unique blogs for each instance, but you cannot have two in the site admin panel.

In reply to Chris Kenniburg

Re: Wordpress and Moodle LTI

by Stephen Elaschuk -

Any other suggestions? I'm having the same issue on a fresh install of wordpress, my admin account's email is different and I only have a single instance of the external tool. Any help would be appreciated.

In reply to Stephen Elaschuk

Re: Wordpress and Moodle LTI

by Petri Calderon Larjanko -

Hi Stephen,

 

I still haven't gotten this to work yet either. I had to stop work on attempting to do this because of compeeting priorities.  I had chats to colleagues more proficient in PHP than me and they can't see anything wrong with the code (in the 30 minutes I had with them).  Also, our Moodle instance is already using other external tools via LTI successfully, so it is also unlikely to be our Moodle instance.  

all the investigation I have done points to the LTI Wordpress plugin or the environment it is sitting in, generating a different signature due to some unknown token or parameter.  But I can't figure out what.

Since this is not an active developed plugin, I have provided my techncial evaluation and advice to our learning and teaching area to either find a different external tool that has better supported plugins, or comission work to write our own LTI plugin for Wordpress.  However, they are very interested in using this one if we can get it to work.

Regards,

Petri

In reply to Petri Calderon Larjanko

Re: Wordpress and Moodle LTI

by Stephen Elaschuk -

Yes, it does seem to be some kind of issue with the way the OAuth signature is computed, even though the code between the moodle and wordpress LTI plugins are virtually identical.

I'm debating a workaround of just commenting out the actual verification of the token in mu-plugins/IMSBasicLTI/ims-blti/OAuth.php and implementing some kind of basic referrer check, since all my sites using the LTI plugin will be from the same domain. I've tried it just commenting out the signature check and it seems to work fine, although it is highly insecure obviously. I just added the /* and */ around the relevant portions of the "valid_sig" condition in mu-plugins/IMSBasicLTI/ims-blti/OAuth.php of the wordpress plugin as below

/*
if (!$valid_sig) {
$ex_text = "Invalid signature";
if ( $OAuth_last_computed_signature ) {
$ex_text = $ex_text . " ours= $OAuth_last_computed_signature yours=$signature";
}
throw new OAuthException($ex_text);
}
*/

 

In reply to Stephen Elaschuk

Re: Wordpress and Moodle LTI

by Chris Kenniburg -
Picture of Particularly helpful Moodlers Picture of Plugin developers

The only time I have run into issues is when you have an Admin Account on Moodle and the Admin Account on Wordpress with the same name and email.  Then it throws an error.  We have this working quite well.

In reply to Stephen Elaschuk

Re: Wordpress and Moodle LTI

by John Andrewartha -

First thing, set your WP site to network, there are some good docs on same in there wiki. Then you can setup categories with blogs per cat. Install the LTI module from the WP site.

At some point you will have to also replace the .htaccess file in WP to allow tredirects. 

Check out  http://sourceforge.net/apps/mediawiki/learningapps/index.php?title=LTI4Wordpress

Hope that helps

John

 

In reply to Chris Kenniburg

Re: Wordpress and Moodle LTI

by Petri Calderon Larjanko -

Thanks for the suggestions Chris, and also for posting your step-by-step, nicely written.

Unfortunately, I had already taken into consideration your suggestions (the mail address of the moodle user does not exist in WP and the external tool config in Moodle for WP is there only once. I even removed the external tool configuration and attempted to add manual entry of the config at the "add external tool activity" step, but same error.

Moodle is hosted externally at our University, so I took the steps to install a local instance of Moodle using Bitnami, after doing all the config in Moodle I still get the same issue. This leads me to believe that it is either my WP server or something in the code of the plugin (I have re-downloaded the plugin and reinstalled resulting in the same error).

Darcy Christ mentioned something about smart quotes and this causing an issue similar to what I have. I enabled magic quotes in php.ini but that didn't change anything. I wonder how else I can pursue this. If anybody has further suggestions I would greatly appreciate them.

Regards,

Petri

In reply to Petri Calderon Larjanko

Re: Wordpress and Moodle LTI

by Chris Kenniburg -
Picture of Particularly helpful Moodlers Picture of Plugin developers
I suspect it maybe something with the local server install.
In reply to Chris Kenniburg

Re: Wordpress and Moodle LTI

by Simon Leung -

Hi Petri and Chris,

I have come across the problem "BASIC LTI Authentication Failed, ....." at the very beginning when I copied the "mu-plugins" folder to a wrong place. I didn't follow the readme and put under "/wordpress/wp-content/plugins/" which is supposed to be under "/wordpress/wp-content/".

Wordpress then installed the plugin at the top "global" plugin section, but not in the plugin section under the "Network Admin" and I was prompted with that error.

 

Simon

In reply to Chris Kenniburg

Re: Wordpress and Moodle LTI

by Chris Kenniburg -
Picture of Particularly helpful Moodlers Picture of Plugin developers
In reply to Chris Kenniburg

Trả lời: Re: Wordpress and Moodle LTI

by Van Tam Tran -

Hi !

You can connect login between Moodle and Wordpress?.

If homepage is Wordpress, you will login in WordPress.

After you can go to lesson, course, quiz, ... without login again (not login again moode)!!

In reply to Van Tam Tran

Re: Trả lời: Re: Wordpress and Moodle LTI

by Chris Kenniburg -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Not really following you Van Tam.

The LTI plugin for Wordpress allows users from Moodle to connect to Wordpress and isntantly creates a Wordpress blog for the course and adds all the users to the blog.  

 

The direction is from moodle to wordpress.  Wordpress is a tool of moodle.  You seem to want something that the LTI plugin currently doesn't do.

In reply to Chris Kenniburg

Trả lời: Re: Trả lời: Re: Wordpress and Moodle LTI

by Van Tam Tran -

Hi thanks you Chris Kenniburg!

I want to use acount of Moodle or Wordpress single sign on (SSO) betwwen Moodle and wordpress!

I hope you know and guide me!

In reply to Van Tam Tran

Re: Wordpress and Moodle LTI

by benoit tostain -

Hi All,

Thanks for your stepsheet and tutorial !

When the installation is completed, I do not understand if the students and theteacher can also access to Wordpress outside of moodle ?

In reply to Chris Kenniburg

Re: Trả lời: Re: Wordpress and Moodle LTI

by Chris Hall -

Hi your tutorial for LTI and Wordpress doesn't seem to be alive anymore, is it still available somewhere?

In reply to Chris Hall

Re: Trả lời: Re: Wordpress and Moodle LTI

by Frankie Kam -
Picture of Plugin developers

Hi Chris H. It's found here in my humble little blog. Check out the Appendix section for the correct link (it's next to the stuck-out link which is obsolete) to Chris K's 2012 blog post on Moodle & LTI. You can also download the zip file from Chris K's original blog post - check the comments section of my blog post.

In reply to Chris Kenniburg

Re: Wordpress and Moodle LTI

by Jared Stein -

Hey guys, is there an external discussion forum specifically for the LTI4WordPress tool? I ask because I want to talk about the LTI functionality beyond just Moodle, and understand this may not be the place for it.