Hi,
I have spend a long time already trying to make this module work. I have Drupal and Moodle installed on my local system (C:\wamp\www\drupal and C:\wamp\www\moodle).
I have installed the qapi plugin in Moodle. I dont really know what to put into the Client host IP but i put 127.0.0.1.
I enabled the external db authentically to read drupal users table and this is working. But i have not been able to make the list of moodle courses show up in Drupal.
Can anyone help me out please!

Comments

Chris Johnson’s picture

Component: Code » Miscellaneous
Assigned: Unassigned » Chris Johnson
Category: task » support

127.0.0.1 also known as localhost should be correct if you have both the Drupal and Moodle installs on the same host.

Have you installed the moodle module on your Drupal site? Is it enabled and configured?

ibraaheem’s picture

Thanks you very much for your reply.
I am not sure i have properly configured the module but i have tried my best to configure it reading so much from forums and articles but i just dont get to make the drupal site communicate with the moodle site.

I will appreciate any useful contribution and help.
Thanks

dpuente’s picture

I have it installed and configured. I will post the last moodle module integration... The person who develop it, now is out of work...
Let's me some hours to do it. There is a secret with the module: You have to configure an start date for courses and the module will show only with courses with dates (start and finish). Let's me some time...
Thanks!

ibraaheem’s picture

Hi, i have already done that and even created more courses with start and finish dates. It is still not working

dpuente’s picture

The user need to be exactly with the same username and password. Are they?

ibraaheem’s picture

Thanks . yes they are. I enabled the external db authentication to read drupal users table and this is working but the two installations (drupal and moodle) dont seem to communicate other than that way

c-c-m’s picture

I have also made the steps described in readme (installed and enabled drupal's module and moodle's qapi) but when trying to add an IP (I type 127.0.0.1. and 127.0.0.1) I get a message saying "Unable to add new client"

What am I doing wrong?

Chris Johnson’s picture

The "Unable to add new client" message is generated when the qapi module tries to insert the new client IP address in the database table, and gets a failure error back from the Moodle database API, i.e. function insert_record(). There are a lot of possible problems which can result in this error. Looking through Moodle's database code, I find these:

1. No database connection.

2. Corrupt or missing table. Make sure when you installed qapi you visited the Moodle Site Administration -> Notifications page (/admin/index.php) to trigger the install of the qapi module and its database table.

3. Missing SQL from adoDB (yet another database layer, assume this one occurs if you are using a database that doesn't have the appropriate SQL translation in adoDB).

4. Error during actual SQL insert into the table (syntax error, other errors).

5. If using Oracle or Postgres, an error in updating LOBs. (I don't know what these are.)

Turn on Moodle database error logging and then examine the log after getting the error message to see what it says. You can do this (I think) by setting $CFG->dblogerror to TRUE in your Moodle's config.php file.

c-c-m’s picture

Thank you for your reply,

I have to admit that I never used moodle as administrator, so I don't feel confident in installing qapi. Since I am not sure about how to check any of the causes of the problem, I assume they are due to a qapi misconfiguration, so I'll try to explain as best as I can all what I did:

  1. I installed a fresh new drupal installation in /www/drupal folder
  2. I installed a fresh new moodle installation in /www/moodle folder
  3. I activated moodle-integration module and configured its options (I only had to write moodle's url and description)
  4. I downloaded qapi
  5. I read readme.txt file, although I had problems in understanding it :(
  6. I copied qapi folder to /www/moodle/qapi
  7. I copied "index.php", "versions.php" and "db" and "lang" directories to /www/moodle/admin/reports/qapi/
  8. I signed in as admin in moodle
  9. I visited url: http://localhost/moodle/admin/index.php and followed the instructions (since I haven't been able to reproduce them again I can't remember exactly what was all about) After several steps I got messages that made me think that qapi had been correctly installed.
  10. I couldn't register moodle because I am using a local copy
  11. I visited admin/reports/qapi
  12. I try to add 127.0.0.1 but I get the already mentioned error message

Thank you

Chris Johnson’s picture

Can you look in your Moodle database for a table named qapi_client and check the structure and display any contents it might have, and post them here?

For example, mine look like this:

mysql> desc qapi_client;
+-----------+---------------------+------+-----+---------+----------------+
| Field     | Type                | Null | Key | Default | Extra          |
+-----------+---------------------+------+-----+---------+----------------+
| id        | bigint(10) unsigned | NO   | PRI | NULL    | auto_increment | 
| clientip  | varchar(15)         | NO   |     |         |                | 
| sharedkey | varchar(255)        | NO   |     |         |                | 
+-----------+---------------------+------+-----+---------+----------------+


mysql> select * from qapi_client;
+----+-----------+--------------+
| id | clientip  | sharedkey    |
+----+-----------+--------------+
|  1 | 127.0.0.1 | unusedfornow | 
+----+-----------+--------------+
1 row in set (0.03 sec)
Chris Johnson’s picture

Status: Active » Postponed (maintainer needs more info)
c-c-m’s picture

Status: Postponed (maintainer needs more info) » Fixed

Hello,

I have tried again with a fresh installation, and I realized the problem was that I missed copying db folder into qapi folder. I copied it there but couldn't make it work (I don't know how to use moodle yet) so I installed Moodle again. Now it's working

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

abhip_85’s picture

Assigned: Chris Johnson » abhip_85
Priority: Normal » Critical
Status: Closed (fixed) » Active

Hi, I am new to moodle, though i tried to sort out the the things as they were written in various readme files but the thing still persists. Let me tell you what procedure i adopted:
1.Downloaded and installed drupal.
2.Downloaded and installed moodle. ( installed both with same database name.)
3.Installed moodle integeration module in drupal.
3.placed qapi module from the moodle integeration module in drupal and pasted it to moodle directory and copied index.php and versions.php files, and db and lang subdirectories of qapi and pasted it to moodle/admin/report directory.
4.installed the qapi module in moodle and then put an ip 127.0.0.1 where asked as both my sites are on same server.

Now when i tried to configure my moodle integration module in drupal, after putting moodle site url as http://localhost/moodle, i clicked on the add new courses then it showed me this error.
* The following modules must be enabled for this import to work: link.
* Exiting. No import performed.

Can anyone please help me and tell me the actual procedure so that i'll be able to work properly on this.
please do remember that i am a novice.

thnx

c-c-m’s picture

It seems that you need to install link module in order to make it work (I guess it is needed to create links to moodle's courses). Just try to download it and install it and try again with Moodle Integration.

PS: If that module is really a requirement (I didn't realize, since I already had it installed for other purposes) the project's page should be updated to note this.

abhip_85’s picture

abhip_85’s picture

abhip_85’s picture

Hello friends. I am facing a new problem. i did the whole thing from start. but this time stucked at the start. as while installing QAPI-1.0 module in moodle, it says that moodle 2.0 is not compatible with this qapi module. what should i do now, plz help

c-c-m’s picture

Don't know much about it, but I guess you have two options: either use Moodle 1.9 or create (or wait/pay/ask someone to make it in your behalf) a new version of QAPI which works with Moodle 2.0

Sorry for not being more helpful

Chris Johnson’s picture

Status: Active » Closed (works as designed)

The CCK link module is only required by the moodle module when the optional and experimental CCK "course" node type is enabled.

karen.sparx’s picture

Issue summary: View changes

Hi ,I am new for moodle .I have to make a LMS site using drupal + moodle.for this i have installed moodle 3.0 and drupal 7 on same server php version 7.and site like this : http://abc/drupal and http://abc/moodle.With using drupalservice auth plugin I have followed each instruction as mention
1. Installation Drupal Side(https://github.com/cannod/moodle-drupalservices/wiki/Installation-Drupal...)
2. Installation Moodle Side(https://github.com/cannod/moodle-drupalservices/wiki/Installation-Moodle...)
Its working fine on my local server where php version is 5 but when i make same installation process on live server its create error.i have create a user in drupal with service authentication role but when in moodle I do setting for drupal services there are mapping profile field not populated.
If I login in drupal with authenticate user and same time also login in moodle its give error "error writing to database". I am not getting why this error created on live server.
Also i have enable debug mode in moodle, then with error message "error writing to database" one more debug info display "username can not be null".

Can any one help me to resolve this problem???