Moodle Mobile

Moodle Mobile

edem Koami -
Кількість відповідей: 13

Hi, I am a final year student working on a mobile version of Moodle as my final year project. I would like to know how which service i have to use to retrieve information from my school Moodle database. Please i need help and if possible a data flow diagram that explains how it works.

У відповідь на edem Koami

Re: Moodle Mobile

Juan Leyva -
Фото Core developers Фото Moodle HQ Фото Plugin developers Фото Testers

Hi Edem,

here you have information about how to create a web service client:

http://docs.moodle.org/dev/Creating_a_web_service_client

And the list of availavable webservices can be consulted here (by version):

http://docs.moodle.org/dev/Web_services_Roadmap

Here you have also sample code in different languages:

https://github.com/moodlehq/sample-ws-clients

Regards

У відповідь на Juan Leyva

Token is invalid

Edem Agbenyo -

I have read the link you provided and i have found them very useful to the progress of my project. Now i have been able to set up a moodle site. i have also set up the moodle mobile and have been able to connect it to the site. 

Now i want to be able to use the plugin that allow student to get their grades on the mobile application. I have set it up using the information on this page:http://docs.moodle.org/dev/Moodle_Mobile_Developing_a_plugin_tutorial

But everytime a user try to get his grade, i receive the warning: we lost connection, you need to reconnect. Your token is now invalid.

Please What is wrong with my installation? How do i make a token available for all the plugin that i am using. Hope to get a reply soon. Thank you

У відповідь на edem Koami

Re: Moodle Mobile

Aleksandra Markovic -

I have  error when i create service. I have in browser json when i test ,i have this msg on mobile devices "we lost connection, you need to reconnect. Your token is now invalid."

У відповідь на Aleksandra Markovic

Re: Moodle Mobile

Khyam Shahzad -

I am also getting the same error message with Moodle Mobile 1.4 custom web services. Moodle version is 2.6.3. 

У відповідь на Juan Leyva

Re: Moodle Mobile

Isaac Marco Blancas -
Фото Core developers

The same problem here when following the http://docs.moodle.org/dev/Moodle_Mobile_Developing_a_plugin_tutorial

Mi moodle versión is 2.6.2+ with the Moodle Mobile 1.4.2

The test with the client works OK (/local/custommm/client/client.php)

I can login the app, I open a course and I click "Grades". All the activities are loaded but when I click one I get the message:

we lost connection, you need to reconnect. Your token is now invalid.

and after two seconds it goes to a black page with a pop-up:

Uncaught TypeError: Cannot read property 'id' of null

File: http://192.168.1.38/moodlemobile/lib/mm.cache.js
Line: 50

У відповідь на Isaac Marco Blancas

shortname with null value in mdl_external_services table

Isaac Marco Blancas -
Фото Core developers

I was able to solve my "we lost connection, you need to reconnect. Your token is now invalid" problem. There was several questions...

  • I was not changing the wsservice paran in the config.json
  • I just added one function (local_custommm_get_grades) in the new "custommm" external service and is required to add all the functions Moodle include in the prebuilt "Moodle mobile web service" because we are not going to use this one.
  • Finally the column shortname is been inserted with a null value when I create a new Custom External Webservice. Moodle does not display this value and it is required to know it to update the "wssservice" (config.json) param. Now you can solve it updating the column on the database.
    update mdl_external_services set shortname='custommm' where name='custommm';
    I think the last problem is a bug but I don't find nothing related on the bug trucker. Can you reproduce it?
У відповідь на Isaac Marco Blancas

Re: shortname with null value in mdl_external_services table

Juan Leyva -
Фото Core developers Фото Moodle HQ Фото Plugin developers Фото Testers

Hi,

yes, this is all explained here:

http://docs.moodle.org/dev/Moodle_Mobile_Developing_a_plugin_tutorial

I will update the FAQs anyway to point to that problem

Regards

У відповідь на Juan Leyva

Re: shortname with null value in mdl_external_services table

Isaac Marco Blancas -
Фото Core developers

Hello Juan. If you wish I could make some modifications in this tutorial. It was the tutorial I followed and know it is fresh in my memory.

By other hand... Do you think it is a BUG the problem with the shortname when creating a new webservice? Should I open an issue?

У відповідь на Isaac Marco Blancas

Re: shortname with null value in mdl_external_services table

Juan Leyva -
Фото Core developers Фото Moodle HQ Фото Plugin developers Фото Testers