May 14

I have a problem: I don’t have enough mp3’s in my laptop. I use to listen music while I’m programing and I’m getting bored of them. So during last 3 or 4 months I’ve been listening music from youtube or last.fm.

Less than a month was enough to me to realize that I was losing too much time every day choosing next song so I tried something longer, I listening conferences and speeches.

Last week I made a post about git which contains a video that I re-watched after some months (Julipedia’s recommendation)

This time I dedicate this post to David and Ferran (DFWiki creators) who are designing and developing the new Moodle API and Webservices.

Here is a YouTube video from a Google TechTalk about designing APIs. Joshua Bloch is the speaker, the Principal Engineer at Google. He also led the design of numerous Java platform features as Java Collections Framework, java.math package and the assert mechanism. This guy knows about what is talking about…..

Related Posts

Feb 10

This is a mini how-to oriented to new NWiki developers who usually use incorrect SQL queries to access to wiki pages.

wiki_pages table has one primary key: id. If you have it, you can invoke dmllib.php functions such get_record

	$page = get_record('wiki_pages', 'id', $pageid);

Several problems appear when you don’t have this id. Then you must use wiki API. There are great magic functions that recover wiki pages data from database.

If you are developing new features you must take into account that wiki_pages table has an enormous unique key:

  • pagename
  • version
  • dfwiki
  • groupid
  • userid
  • ownerid

In a normal situation you will have a pagename and a wiki id or a coursemodule id. Then, you must get coursemodule description using Moodle API.

  • get_coursemodule_from_id( $modulename, $cmid, $courseid);
  • get_coursemodule_from_instance($modulename, $instance, $courseid=0) ;

Using these functions you will be able to look up for the groupmode of this activity instance. At this point you will know the groupmode and stundentmode combination that is set up.

Calling get_record/s with the correct fields will return the desired wiki/s.

Related Posts