google apps integration with moodle

google apps integration with moodle

by Kostis M -
Number of replies: 3

Hello Everyone,
I am trying to integrate moodle 2.6.4 and Google. I have followed each and every single 
step
But when I try to sync the users from Moodle User sync block I am getting error
ERROR: Incorrect number of query parameters. Expected 1, got 0.
Also i am getting the following errors from the debugging:

  • line ? of unknownfile: call to block_gdata::view()
  • line 1671 of /lib/blocklib.php: call to call_user_func()
  • line 35 of /blocks/gdata/index.php: call to block_method_result()

Invalid array parameter detected in required_param(): userids

  • line 637 of /lib/moodlelib.php: call to debugging()
  • line 432 of /blocks/gdata/block_gdata.php: call to optional_param()
  • line 272 of /blocks/gdata/block_gdata.php: call to block_gdata->addusers_process()
  • line ? of unknownfile: call to block_gdata::view()
  • line 1671 of /lib/blocklib.php: call to call_user_func()
  • line 35 of /blocks/gdata/index.php: call to block_method_result()

Aldo i have updated the line below from the file /blocks/gdata/block_gdata.php,:
if ($users = $DB->get_records_sql("$select $from $where ORDER BY ".$table->get_sql_sort(), array(), $table->get_page_start(), $table->get_page_size())) {
Change it to:
if ($users = $DB->get_records_sql("$select $from $where ORDER BY ".$table->get_sql_sort(), $params, $table->get_page_start(), $table->get_page_size())) {
Can someone help me?
Kind Regards
Kostis

Average of ratings: -
In reply to Kostis M

Re: google apps integration with moodle

by john Simpson -

Why would you want to do that? Why mix google with Moodle.

In reply to john Simpson

Re: google apps integration with moodle

by Ken Task -
Picture of Particularly helpful Moodlers

How about asking the reverse?  Why wouldn't X entity want to interface Moodle and Google?

As with all things there is Yin/Yang ... what Google giveth, Google can take away - that's true.  But, they claim to be 'less evil' than 'others' and for the most part, I'd say that's true.

Much depends upon how X entity plans to use Moodle and other factors ... a school district that has opted into Google for EDU and who has decided to use Chrombooks, there's a *need* to pursue interfacing the two.  So the question isn't why it's why not and how to!

There are some mods to Moodle core that will *NEVER* behave like Google ... and using existing mod/blocks/addons for purposes other than what they were intended almost always leaves them 'less than desired'.

So press on ... Kostis M!!!!   Don't be deterred!

Wish I had an answer for ya, but don't right now.   There are a couple of users in these forums that have accomplished this feat.   Maybe they'd be so kind as to jump in here and help! smile

'spirit of sharing ... and encouraging"  Ken



In reply to Kostis M

Re: google apps integration with moodle

by Rob Johnson -

Hi Kostis,

The sync block has been buggy since the transition from Moodle 1.9 to Moodle 2+.  I know there is a hack posted somewhere that will clear that error.  Search the forum enough and you will find it.  There is another hack posted that will fix the create user in Google issue if you use events in the block settings.  There is also a hack for one of the components that will log users out of Google when they log out of Moodle.  I highly recommend do the last one.

For the user sync, you are likely better spending your time finding an alternative.  Even if you work out your issues, the User Provisioning API from Google is deprecated and will stop working in April 2015.  I have been using Google Apps Manager (GAM) to sync users for the past year and a half.  There is a post somewhere on these forums with a script to automate the creation of users in Moodle with gam on a Linux server.  I have not tried it, but it may be a path to follow.  

I run a new user sync twice a week manually in gam.  It is mid school year in my district, so we do not get many new students.  I like syncing manually so I can see the  results.

I think Ken did a good job of answering John's question.  We have been a Google Apps for ed district since 2009.  My teachers and students like the SSO.  They can get coursework in Moodle and open email, Drive, etc from any Moodle page.