Posts Tagged ‘chamilo corporate’

Chamilo’s first steps in mobile learning

Last week we started our first baby steps in mobile learning, thanks to our long preparations, an edition of PHPArchitect, and the efforts of one of BeezNest’s employees (Christian), who wanted to try it out.

The very first result was something like this

Dokeos' users list appears on cell phone

Dokeos' users list appears on cell phone

Then I suugested he got a little deeper and got a list of courses-related events and we got this

Dokeos events on a cellphone

Dokeos events on a cellphone

This feature, along with a whole range of additional features, will probably make it into the corporate version first, and then move to the free version, once the costs of development have been covered by corporate customers.

All in all, this is a very exciting feature to have and, although it doesn’t get into the classic expectations of an m-learning system, it certainly opens the door very wide for it. Now the next steps are to

  • allow a student to send comments in the forum
  • allow a student to take simple tests
  • allow a student to reply to surveys
  • allow teachers to check the reports of their students’ progress

These little features, that could get Chamilo right into the m-learning market, will all make it to the corporate version first, then be applied to the free version.

Xapian: the tricky multi-term removal process

March 29, 2009 4 comments

Update 2012-01-17: this article is quite old now and it might be completely irrelevant. It is only provided as a hint which might help you out writing a procedure in PHP to manage indexing. As Olly Betts (main developer of Xapian) commented below, the error message doesn’t come directly from Xapian either, but it might be coming from some of the things built on top. No harm is meant to Xapian, it is a very light weight solution, fits very well in our needs to have an indexing component in our PHP application without adding complicated Java requirements and its been working for us for several years now. No critical use, but it’s never been down either.

Chamilo now implements the Xapian search engine in its professional version. The results are quite good, but to implement a very specific need for one customer, we had to make something a bit complicated: we associated terms in the Xapian database to a specific table of terms in Chamilo.

Not playing too much with transactions (as we should, really), we’ve been relying on the process of keeping the two codes databases in synch by having code that only does the two things together each time.

Of course, one of our team was taken aback by a client request and decided to “clean some terms directly from the Chamilo database”… Murphy’s law’s applications are always around…

Anyway, I had to implement a little (very ugly for now) interface to add/remove/edit terms from the Xapian database without affecting the Chamilo database. That’s when I realized that, when you remove terms from a XapianDocument object, you have to do the following process:

$list_of_terms_to_remove = array(‘term1′,’term2′,’term3’);

$xi = new XapianIndexer();

$doc = $xi->get_document((int)$doc_id);

foreach ($list_of_terms_to_remove as $rem_term) {


if ($doc instanceof XapianDocument) {
$xi->getDb()->replace_document((int)$doc_id, $doc);



Now… it doesn’t look like it, but the replace_document() method is actually quite important. If you don’t put that one *in* the loop, then Xapian will give you an evil error saying a term cannot be removed from an unexisting document! You want to avoid that? Use replace_document(); It’s that easy.

%d bloggers like this: