Firing a client to an external service in moodle

Firing a client to an external service in moodle

by Maram Meccawy -
Number of replies: 3
Hi,

I'm not sure if this is the right place to ask this question but couldn't think if any where else! I know it's more of a development problem than any thing else.

I have written three clients which I store in /moodle/) that makes a call to some external services and communicates with moodle's DB tables. (security & authentication is not an issue here)..

I need to activate those scripts (clients) in three places:

1- after a student takes a Quiz, so ideally in: mod /quiz/review.php
( the client needs the user's grade for this quiz, hence I didn't know where else should I place the callsmile

2- When the user picks a lesson: mod/Lesson/view.php

3- As the user logs-out: /login/logout.php

Now, only number 2 works fine, the rest result in either not making the call, or making the call but not redirecting me back to this page (that I called from), I'm presented with a white page. All I want is to fire this client at the background when a certain action is made without changing how the system normally works.

Any help?


Average of ratings: -
In reply to Maram Meccawy

Re: Firing a client to an external service in moodle

by Tim Hunt -
Wužiwarjo-wobraz wo Core developers Wužiwarjo-wobraz wo Documentation writers Wužiwarjo-wobraz wo Particularly helpful Moodlers Wužiwarjo-wobraz wo Peer reviewers Wužiwarjo-wobraz wo Plugin developers
A blank page is often the result of a fatal error. What do you get if you turn on the display of errors in Admin -> Server -> Debugging?
In reply to Tim Hunt

Re: Firing a client to an external service in moodle

by Maram Meccawy -
Thanks for mentioning this useful tool, I think I'm starting to get there! However, when I turned the developers option on, I could not see the " Attempt this Quiz" button any more! I had to set the debugging to minimal to see it again.
In reply to Maram Meccawy

Re: Firing a client to an external service in moodle

by Tim Hunt -
Wužiwarjo-wobraz wo Core developers Wužiwarjo-wobraz wo Documentation writers Wužiwarjo-wobraz wo Particularly helpful Moodlers Wužiwarjo-wobraz wo Peer reviewers Wužiwarjo-wobraz wo Plugin developers
In Moodle 1.8, setting debug to DEVELOPER meant that pages were served as XHMTL strict and application/xhtml+xml, which is very good for finding invalid HTML, but breaks some legacy javascript. In Moodle 1.9, debug level, and whether to serve as XHTML are separate settings.

Anyway, you should be able to use debug 'ALL' safely. (Or hack print_header to stop it setting the mime type to application/xhtml+xml in developer debug mode.)